1

I've tried to use:

$("#mydiv").load("myexternalfile.html");

And also the $get() method, but both of them won't load my target page properly, it loads the CSS fine, but something is happening that i won't load the JS includes from the target file.

I don't want to use iframes/frames, is there any other option to create the dynamic navigation, in a way that the target file includes will work fine?

  • Just use absolute paths in your `myexternalfile.html` includes and it will work. That is, use `http://yourdomain.com/path/to/file.ext` instead of just `path/to/file.etx`. – RaphaelDDL May 02 '13 at 17:44
  • Should I use absolute paths in every file that is related to my target file? Or just use the absolute path on the method load()? Because there's like hundreds of files related to the target file, that has relative paths –  May 02 '13 at 17:46
  • This answer might help you: http://stackoverflow.com/a/13812792/684932 It shows how use a regex to transform all relative paths into absolute ones before actually attaching the new code into the DOM, so you won't actually need to edit all files that can be included. But would be better to just put absolute. – RaphaelDDL May 02 '13 at 17:48
  • Awesome! Thanks! Should I delete my question? –  May 02 '13 at 17:59
  • 1
    Below the text description and tags, there might be some links, like: `share|edit|close|delete|flag`. You can close or delete. – RaphaelDDL May 02 '13 at 18:13

0 Answers0