Facebook is all in ajax and gmail also...I know how to make website that loads ajax etc. But if I开发者_运维技巧 have a lot of pages in that menu I shouldn't load all of the jquery scripts, because I don't need it. Like if you are on facebook and click on profile http://www.facebook.com/profile.php?id=0000998 you get that profile.php, but chat don't change. So I think javascript load profile.php without refreshing the whole page and with that load it loads javascript that is needed for profile.php
Hier is example what should I like to build: I have main.php and profile.php main.php have main.js and profile.php has profile.js and there is chat.js that's always there but profile.js is not needed at main.php
So how they are doing this is there jquery plugin for this kind of system? Or example tutorial? tnx.
Your question makes little sense. If you want to be able to see what resources a page loads I suggest using Firebug. Using it's 'net' tab you can see which resources, (JavaScript, images etc) get loaded, and when. Reading the source (HTML and JavaScript) of the page will also tell you what's going on.
In general that's easy.
Store the state of the chat feature in a cookie. Each page checks the state of this cookie. If the cookie says that the chat has been activated, it also activates the chat feature.
But as always there are a lot of nasty details, you do not want ten pages in the background polling continuously the chat message stream. And there's a lot more smartness behind the scenes of GMail and Facebook. ;-)
BTW, Google is your friend.
If you prefer the copy-and-paste approach, you will find some plugins on the web.
If you like coding web applications just ask more detailed questions and start digging into it yourself. As Marto suggested use FireBug, WebScarab or Fiddler as a starting point.
精彩评论