我正在处理基于此的脚本:http://api.jquery.com/load/
这是我的代码:
<html lang="en">
<head>
<meta charset="utf-8">
<title>load demo</title>
<style>
body {
font-size: 12px;
font-family: Arial;
}
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<b>Load the result:</b>
<div id="new-projects"></div>
<script>
$( "#new-projects" ).load( "http://beta.sportsdirect.bg/ #page-header-container" );
</script>
</body>
</html>
该元素位于同一网站但未加载。 您可以在此处查看结果:http://beta.sportsdirect.com/test/
我不明白为什么,有人可以帮我解决这个问题吗?
提前致谢!
答案 0 :(得分:-1)
&#34; page-header-container&#34;没有元素。您要加载内容的页面中的ID。这需要是一个id,而不是一个类。