Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Ajax页面加载器在HTML对象中不工作_Jquery_Html_Ajax - Fatal编程技术网

Jquery Ajax页面加载器在HTML对象中不工作

Jquery Ajax页面加载器在HTML对象中不工作,jquery,html,ajax,Jquery,Html,Ajax,我尝试了下面的方法来显示Ajax加载程序图像,直到页面加载到HTML对象中。但这对我不起作用。下面的代码有什么问题?代码执行所有操作,但在运行时不显示Ajax加载程序映像 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/19

我尝试了下面的方法来显示Ajax加载程序图像,直到页面加载到HTML对象中。但这对我不起作用。下面的代码有什么问题?代码执行所有操作,但在运行时不显示Ajax加载程序映像

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>mouseover image position</title>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

    <style type="text/css">
    /*<![CDATA[*/
    body
    {
    background-color:#aaaaff;
    }
    #one
    {
    position:absolute;
    left:50%;
    top:50%;
    margin:-150px 0 0 -250px;
    }
    object
    {
    width:500px; 
    height:300px; 
    border:solid 1px #000000;
    }
    /*//]]>*/
    </style>

    <script type="text/javascript">
    //<![CDATA[
    // written by: Coothead
    function updateObjectIframe(which){
    document.getElementById('one').innerHTML = '<'+'object id="foo" name="foo" type="text/html" data="'+which.href+'"><\/object>';
    }

    //]]>
    </script>
<script type="text/javascript">
$.ajaxStart(function(){
    $("#Layer10").show();
});
$.ajaxComplete(function(){
    $("#Layer10").hide();
});
</script>

    </head>
    <body>
    <div id="one">
    <object id="foo" name="foo" type="text/html" data="http://www.w3schools.com/">
    <div id="Layer10">
    <img id="loading-image" src="im/ajax-loader.gif" alt="Loading..." />  
    </div>
    </object>
    </div>
    <div>
    <a href="http://www.google.com" onclick="updateObjectIframe(this); return false;">this is an object test not an iframe test</a>
    </div>
    </body>
    </html>

我认为这是因为浏览器不会将对象标记视为AJAX请求。我不知道是否有办法实现您的愿望。

这必须写在评论中,而不是回答中。对不起。仍然不太熟悉StackOverflow。我会记住的。