Development Blog by Professionals
Ajax – dynamic content with link history
Use this script to update content dynamicaly. Original source from
http://www.unfocus.com/projects/historykeeper/
<script type="text/javascript" src="Scripts/history.js"></script>
<script type="text/javascript">
function PromptMe() {
this.historyListener = function(historyHash) {
stateVar = historyHash;
document.title = Title";if (historyHash!= "" ){
new Ajax.Updater('id','url',
{method:'get', parameters:{variable:historyHash},
onCreate: function(){$('preloader').setStyle({display: 'BLOCK'});},//preloader=an image being displayed
onSuccess: function(){$('preloader').setStyle({display: 'NONE'});}//or not
}); //end of ajax updater}; //function(historyHash)
}//end of if historyHash
unFocus.History.addEventListener('historyChange', this.historyListener);
this.historyListener(unFocus.History.getCurrent());
}; //function PromptMe()
</script>
<body onLoad="demoApp = new PromptMe();">
</body>
| Print article | This entry was posted by kostas on November 23, 2009 at 12:02, and is filed under JavaScript, PHP, ajax. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |


