Page 1 has a Menu with id (#navigation), with a link called Page2 and DIV with id (global_content) that shows contents when the link Page2 is clicked. In the same page (Page 1) I wrote a jquery load function, so that when I click the link it should display the content without page reload. The load event works fine, the content is shown, but without the script tags that the Page 2 has.
This is the code in Page 1
<script>
jQuery(document).ready(function() {
//jQuery('#navigation li a').click(function(){
jQuery('#navigation li').on('click', 'a', function(){
var toLoad = jQuery(this).attr('href')+' #global_content';
jQuery('#global_content').fadeOut('fast',loadContent);
jQuery('#load').remove();
jQuery('#wrapper').append('<span id="load">LOADING...</span>');
jQuery('#load').fadeIn('normal');
function loadContent() {
jQuery('#global_content').load(toLoad, function() {
jQuery('#global_content').fadeIn('fast', hideLoader());
});
}
function showNewContent() {
jQuery('#global_content').show('normal',hideLoader());
}
function hideLoader() {
jQuery('#load').fadeOut('normal');
}
return false;
});
}); </script>
This is the code in Page 2
<div id="wall-feed-scripts">
<script type="text/javascript">
Wall.runonce.add(function () {
var feed = new Wall.Feed({
feed_uid: 'wall_91007',
enableComposer: 1,
url_wall: '/widget/index/name/wall.feed',
last_id: 38,
subject_guid: '',
fbpage_id: 0 });
feed.params = {"mode":"recent","list_id":0,"type":""};
feed.watcher = new Wall.UpdateHandler({
baseUrl: en4.core.baseUrl,
basePath: en4.core.basePath,
identity: 4,
delay: 30000,
last_id: 38,
subject_guid: '',
feed_uid: 'wall_91007'
});
try {
setTimeout(function () {
feed.watcher.start();
}, 1250);
} catch (e) {
}
});
</script>
</div>
<div class="wallFeed">
some content
</div>
But the output i get is
<div id="wall-feed-scripts"></div>
<div class="wallFeed">
some content
</div>
Can you help please?
<scripts>are not loaded/executed.$.getScript()