Loading external HTML pages using .load() and internal JQuery is not working
I have a master.html where i have navigationDIV and bodyDIV, and on every click of nav tabs i am loading external html page into bodyDiv using following .load() function.
- $('#bodyDiv').load('home.html')
Now I have some basic JQuery functions in external JS file which i have linked in master page where i am using toggleSlide(), hide(), addClass() so and so forth, first time when page is getting load all these functions are working alright but the moment i am loading another tab page all functions stop working even on first tab also.
Tab onClick script from where .load() function is getting fired:
- <li id="one"><a href="#first" onclick="javascript:$('#bodyDiv').load('home.html')" >Home</a></li>
<li id="two"><a href="#second" onclick="javascript:$('#bodyDiv').load('trade.html')" >Trading</a></li>
Note FYI: I have used Jquery Tab UI on this page, the scrip is as below:
- $(document).ready(function() {
$(function () {
var tabContainers = $('div.tabs > div');
tabContainers.hide().filter(':first').show();
$('div.tabs ul.tabNavigation a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('div.tabs ul.tabNavigation a').removeClass('selected');
$(this).addClass('selected');
return false;
}).filter(':first').click();
});
Please help me I am stuck. Thank you very much in advance.