Jump to content

jQuery AJAX Page Loading


ColdEdge

Recommended Posts

Hey JustsomeguyOk here is the site I am working on http://otaku-plus.com/as you can see in the top navigation there are bunch of links what I want to do is when user clisk images the link point to http://otaku-plus.com/#!/images but since this will be an ajax call via jQuery the search filed will say what images you would like to search for? and it will have dif character/color. So basically when that is clicked jQuery loads index.php?o=images when u click web it loads index.php?o=web

Link to comment
Share on other sites

In general, you replace the innerHTML of the container element, or you build a new node structure. For example, you could send an ajax request for the new content, and when the content comes back use it to replace the innerHTML of the container with the response.

Link to comment
Share on other sites

This might be easier than he's (anime she's?) making it out to be though. You just need to understand the event model. When you make a web page, you just lay out a bunch of stuff that people can click on and it goes somewhere else. When you're using Javascript you're responding to specific events. An event is something like someone clicking on something, or the mouse going over a certain element, or the page resizing, certain actions which happen that you can respond to. Because he's using jQuery, the function posted in post 7 is only going to run when someone clicks on that one element. The only thing that piece of code does is respond when someone clicks on that one element, it doesn't respond when they click on anything else.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...