This sort of thing can be complicated, even for someone like me who is experienced in such matters. Initially you gave no indication of your level of expertise, so I responded optimistically, hoping you only needed a few clues to get at the heart of the matter.
Now, if someone were familiar with the yshout.js script, they may be able to be of more help. If there is a forum for that script, you can try posting there.
The basic problem is that many scripts, yshout.js apparently included, initialize the page content. There is no initialization when content is imported via AJAX, scripts on the imported page are not run.
A cursory inspection of the scripts associated with the working page:
chat.php
makes it look as though you might be able to get away with this (still with all of the scripts placed on the 'top' page, not the imported page*):
Code:
loadpage:function(page_request, divId){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(divId).innerHTML=page_request.responseText
setTimeout(function(){new YShout({
yPath: 'http://www.bulletdrive.com/yshout/',
log: 1
});}, 100)
}
},
But only if you are loading no other content via AJAX other than the chat.php page. If this is not the case, we would need to be able to determine when the chat.php page was being loaded, and only execute the added code at that point.
To test if any of this is even workable. Insert the code as indicated, and try loading the chat.php page. If that much works, we are on to something.
* do not include:
Code:
<script type="text/javascript">
new YShout({
yPath: 'http://www.bulletdrive.com/yshout/',
log: 1
});
</script>
anywhere. We are attempting to integrate it into the AJAX call.
Bookmarks