0

I have a INDEX.html and some <DIV>'s that are populated with external HTML-files using jQuery LOAD()
Some of the external HTML's also contains Javascripts.
Seperately these external HTML's all perform well, when displayed in the DIV the script won't run.

There should be a solution to this but I cannot find it.....

This is the loading-function

>  <script type="text/javascript" > 
> $(document).ready(function() {
> $('a.linkje').click(function() {
>   var url = $(this).attr('href');
>   $('#master').load(url);
>   return false;
>   });
> });
> </script>

-----------------------------------------------------------------------------
Some tips on HOW TO will be highly appreciated!

2
Contributors
1
Reply
14
Views
4 Years
Discussion Span
Last Post by stbuchok
0

If you read the documentation for the load method, there is the ability to provide a callback function that can be called.

Have your javascript in an external file and then when you load the html page using jquery.load, call the javascript in the external file.

mypage
    reference to externalpage.js
    reference to mypage.js

externalpage


externalpage.js


    function externalPage_complete(response, status, xhr){
            //code goes here
        }



mypage.js


    $('div').load(url, {}, externalPage_complete);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.