简体   繁体   中英

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. The trouble is when I try incorporating that into this layout here:

CSS-Only Responsive Layout

The links and buttons on the page "test.html" are no longer interactive in safari even though they still work in chrome.

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? or just locally?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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