会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132490个问题
JAVA 全系列/第十八阶段:亿级高并发电商项目_架构/编码(旧)/电商:使用RabbitMQ实现大广告异步缓存 22666楼
Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 22668楼
JAVA 全系列/第五阶段:JavaWeb开发/Servlet技术详解(旧) 22675楼

<!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>轮播图的设计与实现</title>
    <link rel="stylesheet" href="reset.css">
    <style>
        .wrapper{
            width:600px;
            height:600px;
            position:relative; 
        }
        .content{
            width:300px;
            height:300px;
        }
        .items{position: relative;}
        .items img{
            width:300px;
            height:300px;
            position:absolute;
        }
        .circle li{
            width:10px;
            height:10px;
            border-radius:50%;
            background-color: chocolate;
            float:left;
            margin: 0 6px;
        }
        .circle{position:absolute;right:160px;
        bottom:320px;}
        .prev{
        position:absolute;
        left:180px;
        top:200px;
        width:40px;
        height:60px;
        background: url("image/6.png");
        background-size: 40px;
        background-repeat: no-repeat;
        
    }
     .next{
        position:absolute;
        right:180px;
        top:200px;
        width:40px;
        height:60px;
        background: url("image/7.png");
        background-size: 40px;
        background-repeat: no-repeat;
        
    }
    </style>
</head>
<body>
    <div class="wrapper">
       <div class="content">
       <div class="items"><img src="image/luo1.jpg" alt=""></div>
       <div class="items"><img src="image/luo6.jpg" alt=""></div>
       <div class="items"><img src="image/luo3.jpg" alt=""></div>
       <div class="items"> <img src="image/luo4.jpg" alt=""></div>
       <div class="items"><img src="image/luo5.jpg" alt=""></div>
       <div class="items"> <img src="image/luo3.jpg" alt=""></div>
       </div>
       <ul class="circle">
        <li id="pic1"></li>
        <li id="pic2"></li>
        <li id="pic3"></li>
        <li id="pic4"></li>
        <li id="pic5"></li>
        <li id="pic6"></li>
    </ul>
     <!-- 图片左右方来回滚动图片的左右箭头-->
     <a href=" " class=" prev"></a>
     <a href="#" class=" next"></a> 
    </div>  
</body>
</html>

老师,我这里content没有设置居中,图片应该在最左侧,这里怎么显示在这个位置?图片.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 22676楼

为什么最后一个子标签不是文本,</script>和</body>之间不是有空格吗

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div  class="div1">div1
    <div  id="div2">div2</div>
</div>
<span>这是span标签</span>
<script>
    var div1=document.querySelector('.div1');
    var div2=document.querySelector('#div2');
    var span=document.querySelector('span');
    /*
    1.textContent
    描述:返回当前节点和它的所有后代节点的文本内容。
     var result=document.getElementById('divA').textContent// This is some text
     console.log(result);
     2.nodeValue
     描述:nodeValue属性一般只用于Text节点
     console.log(span.firstChild.nodeValue);
     span.firstChild.nodeValue='新的span值';
     3.childNodes属性
     描述:childNodes属性返回一个节点集合(NodeList),节点集合中包括当前节点的所有子节点
     例子:
     var childList=div1.childNodes;
     console.log(childList);
     console.log(childList.length);
     console.log(childList instanceof  Array);
     console.log(childList[1]);
     4.firstChild/ lastChild
     描述:返回第一个\最后一个子节点,如果不存在返回null
     console.log(div1.firstChild);
     console.log(div1.lastChild);
     */
        console.log(document.body.firstChild);
        console.log(document.body.lastChild);
</script>
</body>
</html>

blob.png

WEB前端全系列/第二阶段:JavaScript编程模块/DOM模型 22677楼

老师,我这里不清楚为什么,原生AJAX时,前台打印了数据,后台还是报错。

1618196895(1).png

1618196925(1).png

用jquery 的ajax时,post 方法前台收不到数据,后台也接收不到数据,但是我看请求后台也有数据。而用get 方法不会出现这个问题。报错如下:

1618197006(1).png

1618197022(1).png

1618197040(1).png

<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>ajsx回顾</title>
    <script src="jquery-3.5.1.js"></script>
</head>
<style>
</style>
<body>
<div>
    <button class="btn1">原生ajax</button><br>
    <button class="btn2">jquery的ajax</button><br>
</div>
<script>
    //获取类
    var btnone=document.querySelector('.btn1');
    var btntwo=document.querySelector('.btn2');
    //原生ajax封装
    btnone.onclick=function () {
        //开始准备发送
        //创建一个xhr对象 准备发送ajax请求
        //考虑兼容性问题  目前用到的很少
        // if(window.XMLHttpRequest){
        //     var xhr=new XMLHttpRequest();
        // }else if(window.ActiveXObject){
        //     var xhr=new ActiveXObject();
        // }
        var xhr=new XMLHttpRequest();
        //目的:用onreadystatechange监听后台是否收到前台数据的回调函数
        xhr.onreadystatechange=function () {
            //判断前台向后台发送请求的状态 值为0 1 2 3 4
            if(xhr.readyState==4){
                //判断前端是否准备收到后台反馈得数
                if(xhr.status==200) {
                    //获取后台传送的数据
                    console.log(xhr.responseText)
                    //解析数据
                    // console.log(JSON.parse(xhr.responseText))
                }
            }
        }
        //请求超时 设置时间限制   封装可不加
        xhr.timeout=5000;//单位毫秒
        //超过5s 自动执行函数 xhr.onreadystatechange函数不会执行
        xhr.ontimeout=function () {
            console.log('连接超时,请刷新页面')
        }
        // post方法
        var data=new FormData();
        data.append('pass','mary')
        data.append('name','mary')
        //当准备好接收后台数据的回调函数后,着手准备发送ajax请求
        xhr.open('post','ajax.php',true);
        //设置后通过send方法发送到后台post
        xhr.send(data);
    }
    //--------------------
    //jquery 的ajax
    btntwo.onclick=function () {
        $.ajax({
            type:'post',
            url:'ajax.php',
            dataType:'json',
            data:{
                name:'bexi',
                pass:'12',
            },
            success:function (res) {
                console.log(res)
            }
        })
    }
</script>
</body>
</html>
<?php
print_r($_POST);
print_r($_POST['name']);
echo  json_encode($_POST);
  ?>


WEB前端全系列/第六阶段:Http服务与Ajax模块(旧)/Http服务与Ajax编程 22678楼

BinaryTreeSort.rar

老师,我的代码检查了几遍没发现没问题,但是最后遍历运行时,出现遍历不全的现象,望解答

JAVA 全系列/第二阶段:JAVA 基础深化和提高/数据结构 22679楼
JAVA 全系列/第五阶段:JavaWeb开发/Servlet技术详解(旧) 22680楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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