还是代码没反应的问题

来源:1-1 使用load()方法异步请求数据

石榴笑了

2018-09-27 18:10

<!DOCTYPE html >

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>

        <title>使用load()方法异步请求数据</title>

        <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>

        <link href="style.css" rel="stylesheet" type="text/css" />

    </head>

    

    <body>

        <div id="divtest">

            <div class="title">

                <span class="fl">我最爱吃的水果</span> 

                <span class="fr">

                    <input id="btnShow" type="button" value="加载" />

                </span>

            </div>

            <ul></ul> 

        </div>

        

        <script type="text/javascript">

            $(function(){

                $("#btnShow").bind("click", function () {

                    var $this=$(this);

                    $("ul")

                    .html("<img src='Images/Loading.gif' alt=''/>")

                    .load("http://www.imooc.com/data/fruit_part.html",function(){

                        $this.attr("disabled","true");

                   });

                })

            });

        </script>

    </body>

</html>

看了很多提问都是跟这个有关,但是没看懂?

写回答 关注

2回答

  • 谢小婷
    2018-09-28 17:52:15
    已采纳

    <script src="https://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>   http加一个s

  • L__L
    2018-10-12 14:49:20

    <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> 这个http改成https

    "http://www.imooc.com/data/fruit_part.html"    这个http也改成https  就有用了

    石榴笑了

    感谢~为了不被跨域的问题困扰,已经把链接的网页保存到本地了嘻嘻

    2018-10-17 22:53:24

    共 1 条回复 >

jQuery基础(五)一Ajax应用与常用插件

如何用jquery实现ajax应用,加入学习,有效提高前端开发速度

69094 学习 · 400 问题

查看课程

相似问题