1

The jQuery load() function does not load to Chrome or Firefox, but it worked in Atom's HTML preview?

How can you set the --allow-from-local-files option in Google Chrome?

$(document).ready(function() {
  $(".test2").click(function() {
    $(".test1").load("data.html");
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="test2">click here</div>
<div class="test1">
  This will disappear after clicking on ....
</div>
Obsidian Age
  • 41,205
  • 10
  • 48
  • 71
YTM
  • 11
  • 1
  • I don't see any AJAX in there. `.load()` has nothing to do with AJAX. – Difster Jul 13 '17 at 22:44
  • @Difster yes it does; `load()` makes an AJAX request to retrieve text/html – Rory McCrossan Jul 13 '17 at 22:47
  • You're right. I never thought of it as an AJAX function. I guess I just saw it line an include file. – Difster Jul 13 '17 at 22:53
  • Possible duplicate of [How to launch html using Chrome at "--allow-file-access-from-files" mode?](https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-from-files-mode) – Dan Def Jul 14 '17 at 06:51

0 Answers0