Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.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
Javascript Jquery加载方法上载多个页面_Javascript_Jquery_Html_Requirejs - Fatal编程技术网

Javascript Jquery加载方法上载多个页面

Javascript Jquery加载方法上载多个页面,javascript,jquery,html,requirejs,Javascript,Jquery,Html,Requirejs,我必须上传A&B html页面在C(家长)html页面。我正在使用jQuery加载方法。A&B页面还包含外部javascript()文件 问题: 1.加载方法将是最好的方法,或者有其他好方法吗 2.A&B html页面未在C页面中加载,是因为它们包含JS文件 HTML <div id="test1"></div> <div id="test2"></div> Javascript <script> $(document).read

我必须上传A&B html页面在C(家长)html页面。我正在使用jQuery加载方法。A&B页面还包含外部javascript()文件

问题:

1.加载方法将是最好的方法,或者有其他好方法吗

2.A&B html页面未在C页面中加载,是因为它们包含JS文件

HTML

<div id="test1"></div>
<div id="test2"></div>

Javascript

<script>
$(document).ready(function(){
$("#test1").load("t1.html");
$("#test2").load("t2.html");
});
</script>

$(文档).ready(函数(){
$(“#test1”).load(“t1.html”);
$(“#test2”).load(“t2.html”);
});
试试这种方法

$( "#result" ).load( "ajax/test.html", function() {
alert( "Load was performed." );
});

t1.html
t2.html
文档片段还是完整的
html
文档?请参阅完整的html,其中还包含外部JSTry,将
html
缩减为没有