[英]HTML + Load one html partial inside another html page using Jquery Load Function
I have 2 HTML files 我有2个HTML文件
File 1. index.html
File 2. nav_bar.html
Here I am trying to load static page nav_bar.html
into index.html
在这里,我尝试将静态页面nav_bar.html
加载到index.html
I tried one of the jquery load
method - sample code of index.html. 我尝试了一种jquery load
方法-index.html的示例代码。 ie. 即。
<script type="text/javascript">
$(function() {
$("#nav_bar").load("nav_bar.html");
});
</script>
Working fine with Firefox but Chrome does not response to load this file. 在Firefox上可以正常使用,但Chrome无法响应以加载此文件。 I am not getting the way to resolve it. 我没有办法解决它。 Note: Please avoid the use of iframe. 注意:请避免使用iframe。
Thanks in advance. 提前致谢。
要为Chrome禁用同一来源策略:请使用Stackoverflow Post或此
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.