Shaye Larsen
asked on
Loading content into a div via jQuery doesn't include external files?
I am loading content from an external file into a div via jQuery.
For some reason, like the other ajax content loading scripts, it does not pull in the javascripts, css files, etc. which are referenced in my external file, making the page, once loaded, in look like junk. My external file relies completely on the css file it references and also needs a js file too.
I know this can be done because I have used a jQuery lightbox popup that can load its contents via ajax from an external file and it loads including the necessary css and js files.
Does anyone know how to get this to work or knows of a good plugin that will do this?
The below javascript is what I am currently using:
For some reason, like the other ajax content loading scripts, it does not pull in the javascripts, css files, etc. which are referenced in my external file, making the page, once loaded, in look like junk. My external file relies completely on the css file it references and also needs a js file too.
I know this can be done because I have used a jQuery lightbox popup that can load its contents via ajax from an external file and it loads including the necessary css and js files.
Does anyone know how to get this to work or knows of a good plugin that will do this?
The below javascript is what I am currently using:
<script type="text/javascript">
$(document).ready(function() {
$("#loadAjaxSite").load("/sitecreator/site_templates/test-green/index.jsp");
});
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Right on that was enough to do the trick. Thank you very much!
ASKER
Thanks
ASKER
I tried it but I can't view it on the page... I only get the alert from the callback.
This is what I did with the script at the link you showed me:
Open in new window