Jump to content

jQuery AJAX Page Loading


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...