简体   繁体   English

Ajax的新增功能,尝试在div中加载另一个页面,但Safari出现问题

[英]New to Ajax, trying to load another page in a div but having issues with Safari

To continue off the title I'm trying to load another page that will be on the same domain onto my index page using the following markup: 为了继续标题,我尝试使用以下标记将同一个域中的另一个页面加载到索引页面上:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
      $("#div1").load("test.html");
});
</script>

</head>
<body>

<div id="div1"></div>

</body>
</html>

Now that works completely fine on both chrome and safari. 现在,在chrome和safari上都可以正常使用。 The trouble is when I try incorporating that into this layout here: 问题是当我尝试将其合并到此布局中时:

CSS-Only Responsive Layout 仅CSS的响应式布局

The links and buttons on the page "test.html" are no longer interactive in safari even though they still work in chrome. “ test.html”页面上的链接和按钮即使在chrome浏览器中也无法在safari中交互。

The code should be correct and should work. 该代码应该正确并且可以正常工作。

but, in a local environment, javascript doesn't have the permissions to load files, did you try if this works on a server? 但是,在本地环境中,javascript没有加载文件的权限,如果在服务器上可行,您是否尝试过? or just locally? 或只是本地?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM