Wednesday, October 13, 2010

refresh div html with js

With a small mod for my particular project the code from this site was perfect: http://designgala.com/how-to-refresh-div-using-jquery/

In my case I wanted to refresh when something else happened and this was the simplest for me to implement. heres the code:

this on top of the page (script)src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js">
( script)

This in the ajax.js
function navrefresh(){
setTimeout($('#navigation').fadeOut('fast').load('containers/nav.php').fadeIn("fast"),1000);
}

of course i liked things fast (they had it slow on that site above) and the correct div ID as well as the php page to load the right things..... now just call this function where needed and your all done!


ps. i still didn't figure out how to use the html tags without blogger thinking it's html?
update: found it in the > post options, compose settings "show html literally"

No comments: