会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133360个问题
Python 全系列/第三阶段:Python 网络与并发编程/网络通信 38611楼
JAVA 全系列/(旧的隐藏)第二十一阶段:百战商城项目(Spring Cloud最新架构)/百战商城项目 38613楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>window对象</title>
</head>
<body>
    <button>跨域传输</button>
    <script>
        // open('http://www.baidu.com');
        // close();
        // var but =document.querySelector('button');
        // but.onclick=function(){
        //     var iframe = document.createElement('iframe');
        //     iframe.src='name.html';
        //     iframe.style.display='none';
        //     document.body.appendChild(iframe);
        //     iframe.onload=function(eve){
        //         var iframeWindowName = eve.target.contentWindow.name;
        //         console.log(iframeWindowName);
        //     }
        // }
        var but= document.querySelector('button');
        but.onclick=function(){
       var iframe= document.createElement('iframe');
        iframe.src='name.html';//加载保存了信息的页面
        iframe.style.display='none';
        document.body.appendChild(iframe);
        //当iframe加载完毕,意味着window.name的内容已经被赋予完毕
        iframe.onload=function(eve){
            var iframeWindowName=eve.target.contentWindow.name;
           // console.log( iframeWindowName);
            eval(iframeWindowName);
            console.log(num);
        }
    }

    </script>
</body>
</html>

跟着老师的代码敲的,无奈报错,于是把老师的代码拿过来 仍然报错,如图

image.png

WEB前端全系列/第二阶段:JavaScript编程模块/面向对象编程 38614楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/变量、数据类型、运算符 38617楼

package com.itbaizhan;
//测试数组的三个类型的初始化
public class Test02 {
    public static void main(String[] args) {

        //静态初始化
        int[] s = {1, 2, 3, 4, 5, 6, 7, 8};// 静态初始化基本类型数组;
        //相当于 int[] = s; s = new int[8];
        System.out.println(s[1]);
        Man[] men = {new Man(1, 22), new Man(2, 33)};// 静态初始化引用类型数组;
        System.out.println(men[1].getAge());

        /**动态初始化*/
        //基本数据类型的动态初始化
        int[] a;
        a = new int[10];
        a[0] = 1;
        a[1] = 2;
        System.out.println(a[0]);
        System.out.println(a[1]);
        //引用数据类型的动态初始化
        Animal[] animal;
        animal = new Animal[10];
        Animal a1 = new Animal(1,1);
        Animal a2 = new Animal(1002,21);
        animal[0] = a1;
        System.out.println(animal[0]);
    }

    class Animal{

        private int id;
        private   int age;

        public Animal(int id,int age){
            super();
            this.id = id;
            this.age = age;
        }


        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }


    }
}

老师这是啥情况

JAVA 全系列/第一阶段:AI驱动的JAVA编程/数组和数据存储 38618楼
毕设项目/第一阶段:各种开发环境的使用/JDK的安装 38619楼

#encoding=utf-8

from tkinter import *
from tkinter.colorchooser import *
from tkinter.filedialog import *

class Application(Frame):
    def __init__(self, master = None):
        super().__init__(master)
        self.master = master
        self.pack()
        self.createWidget()
    def createWidget(self):
        # 创建主菜单栏
        menubar = Menu(root)

        # 创建子菜单
        menuFile = Menu(menubar)
        menuEdit = Menu(menubar)
        menuHelp = Menu(menubar)

        # 将子菜单加入到主菜单栏
        menubar.add_cascade(label='文件(F)', menu=menuFile)
        menubar.add_cascade(label='编辑(E)', menu=menuEdit)
        menubar.add_cascade(label='帮助(H)', menu=menuHelp)

        # 添加菜单项
        menuFile.add_command(label='新建', accelerator='ctrl + n', command=self.test)
        menuFile.add_command(label='打开', accelerator='ctrl + o', command=self.test)
        menuFile.add_command(label='保存', accelerator='ctrl + s', command=self.test)
        menuFile.add_separator()  # 添加分割线
        menuFile.add_command(label='退出', accelerator='ctrl + q', command=self.test)

        # 将主菜单栏加到跟窗口
        root['menu'] = menubar

        # 创建上下文菜单
        menubar2 = Menu(root)
        menubar2.add_command(label='颜色', command = self.openAskColor)

        menuedit = Menu(menubar2, tearoff = 0)
        menuedit.add_command(label='剪切')
        menuedit.add_command(label='复制')
        menuedit.add_command(label='粘贴')

        menubar2.add_cascade(label='编辑', menu=menuedit)

        # 编辑区
        w1 = Text(root, width=50, height=30)
        w1.pack()
        w1.bind('<Button-3>', text)
    def test(self):
        pass

    def openAskColor(self):
        s1 = askcolor(color='red', title='选择背景色')
        root.config(bg=s1[1])

    def test1(event):
        # 菜单在鼠标右键单击的坐标处显示
        menubar2.post(event.x_root, event.y_root)


if __name__ == "__main__":
    root = Tk()
    root.title('my window');root.geometry('450x300')
    app = Application(master = root)
    root.mainloop()

老师:问题很多,视频七分钟,百度两小时

  1. 如图,菜单栏虚线可以点击,并且点击后新弹出个窗口

image.png

2.这些地方是调用组件么。组件第一个字母不都是大写

image.png


3.我这里总是显示这样的,不知道为什么

image.png

Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 38620楼
JAVA 全系列/第八阶段:Linux入门到实战/Git 38621楼
Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 38622楼

老师我打印OK是怎么回事

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.6.0.min.js"></script>
</head>
<body>
    <script>
        //实现Ajax

        //1、创建XHR对象
        var xhr = new XMLHttpRequest();

        //2、open()方法准备要数据,send()方法准备发送请求
        //open("请求方式(post、get)","地址:服务器给数据的地址(端口)")
        xhr.open("get","http://iwenwiki.com/api/blueberrypai/getChengpinDetails.php");
        xhr.send();


        //3、准备接收服务器传回来的数据,监听前后端交互的状态
        xhr.onreadystatechange = function(){
            //4、接收数据,更新页面
            //0,1,2,3,4 一共五种状态,状态为4的时候表示后台已经准备好了
            if(xhr.readyState === 4){
                 //status目前分为两种状态:200(成功状态) !===200(失败状态)
                 if(status === 200){
                     console.log(xhr.responseText);
                 }else{
                     console.log(xhr.statusText);
                 }
            }        

        }

    </script>
</body>
</html>

image.png

WEB前端全系列/第五阶段:前后端交互/网络请求AJAX 38623楼

rbacDemo.rar

老师我的menu.jsp在引用dtree.js时路径始终不对 问下老师里面的路径哪里出错了

JAVA 全系列/第六阶段:项目管理与SSM框架/RBAC实战 38624楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637