I'm still new to jquery and all that, and right now I'm having a little problem that might just border on the lack of basic knowledge. So I just wanna say sry and thanks in advance for reading:
I have 2 html files ("main.html" and "content.html"). Both uses some jquery, which i have within one .js file ("script.js"). The jquery are some basic clicks on div-elements etc.
Now, the "main.html" is my base, so having header info, js-links, css-links, body etc. The "content.html" file has just some divs. Now I load the "content.html" within the "main.html" file via:
$.get('content.html', function(data) { $('body').append(data);});
well that works perfect, so far so good. Problem is, that the click functions that refer to divs within the "content.html" just don't work now. They only work when I declare/load the "script.js" within the "content.html" aswell. But now the js-file is loaded twice, triggering click functions for divs in the "main.html" file twice.
How can I fix that? Can I just reinitialize the js-file instead of loading it a new or something?
Thanks again, ANB_Seth