I need to change a part of my web page content dynamically without refreshing the entire page. Like myspace or facebook users gallery. Anybody knows for a good quality link of a tutorial or any useful scripts with working back button and changing address URL accordingly? Thanks for any suggestion.
Cool tutorial but I need something more complex... If you observe myspace it handles: -Back/Forward Button -Bookmarking/Creating shortcut -Full URL in the address bar -Full URL link in the left botom of the status bar There are a lot of tutorials about, but all for begginers or just partial solutions. I need a professional complete scene. However, Thank You.
If it is a simple update I'd user jQuery to periodially poll something in the background and update the page accordingly. http://docs.jquery.com/Ajax setTimeout(poll, 10000); // every 10 seconds function poll(){ $.get('my_url_returns_a_chunk_of_html', myCallback); } function myCallback(data, textStatus){ $('#somediv').html(data); // just replace a chunk of text with the new text setTimeout(poll, 10000); } This could be a lot better and handle when the text hasn't changed and error handling etc but is a start. If you need it to be instant your looking at Comet but in general it adds a lot of complexity so I'd stay away out of simplicity. http://en.wikipedia.org/wiki/Comet_%28programming%29
er, if you also observe their usability data, people are leaving myspace like its the titanic 2... it's true, you can build a site that does not change url and uses ajax only to fetch data and update parts as needed. but this is really crap with regards to usability. first off - you can't easily bookmark it. pressing back / forward on the browser WILL have unexpected results. the url management is doable as anchors to a degree so you can restore the view based upon a url - but it's just silly. don't get me wrong, i am all for dyanmic updates of dom elements through ajax or otherwise - just don't think it has to take over and modify the browser and user behaviours. also, consider the SEO - you'd only ever broadcast 1 page which then goes and fetches NN smaller 'content' ones as barebones data - you need to be careful how you structure it, I have seen some piss poor attempts at doing this. as a whole, it is achievable - but it's hard to get it right. which - i imagine - is why you are struggling to find an out of the box solution for this or a tutorial... if you want a second opinion, I suggest you go to www.stackoverflow.com and post your question there - you will get the best advice as voted by your coding peers and be able to take it from there. good luck and be sure to post resulting work here - just curious
I just checked out stackoverflow.com. Is this a fairly popular site in the developer community right now?
yes, it's the top place for coding advice as far as i can tell... depends on the subject though, some tags are more popular than others.