I have a simple html/css webpage: http://www.eveo.org
All my content is located in my “content” div, 400px tall, and 960px wide. How could I update my content into that div without actually refreshing the web-page?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Adding onto the jQuery aspect, here’s an example where I do that very thing.
I have on my page a link which opens a container which is absolutely positioned where you clicked with your mouse, in this container is the contents of the link you clicked on. There’s a lot more code than What I’m showing here which performs my specific task, but this should be abstracted enough for you to use.
Live Demo: http://wecodesign.com/demos/stackoverflow-7071545.htm
In case you’re not familiar with jQuery, I’ll explain a few things
updateContainer()function, I specify the container using jQuery selector syntax, then I put it into a jQuery tag$()so it becomes an object that I can then manipulate. I then use load to dynamically update it with the url that was passed to the function.$(document).ready(function() {} );is a pretty universally used thing in jQuery, it basically says, run what’s in the curly braces when the document is ready.a[rel="dynamicLoad"]does is finds all anchor tags with this rel tag attribute and modifies them with the code I specify.updateContainer()function, then I runevent.preventDefault()andevent.stopPropagation()to stop the link from doing what it normally does by default, which is to open the page, you’ll notice that I passed “event” into the function call.