jQuery加载不显示任何内容吗?

我有一个带有div容器的index.html文件:

<div class="Widget"></div>

在index.html中还有一个jquery代码,该代码应加载另一个html文件的内容并将其作为内容放入小部件中:

            $( ".Widget" ).load( "loadTest.html",function( response,status,xhr ) {
            if ( status == "error" ) {
                alert("error: " + xhr.status + " " + xhr.statusText );
            } else {    
                alert("Success"); 
            } 
        });

我收到警报“成功”,但我的“窗口小部件” div中没有​​内容。 loadTest.html看起来像这样:

<html lang="de">
<head>
    <meta charset="UTF-8"/>
</head>

<body>
    My content 
</body>
</html>
cad1234 回答:jQuery加载不显示任何内容吗?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167998.html

大家都在问