Change selected XML file with jQuery

eastavenger

New Member
I'm using the following piece of code to select and parse an XML file. Works great, but because I have 3 different XML files, I also have 3 different pages. It would make the application I'm building a lot faster if I could just replace the url to the XML file, instead of loading a completely new page.\[code\]$(document).ready(function(){ $.ajax({ type: "GET", url: "rss/page1", dataType: "xml", success: function(xml) {\[/code\]So, what I'm wondering is: Is it possible to change the url at \[code\]url:\[/code\] with a simple jQuery event? In pseudo code it would be something like this:\[code\]<a id="index" href="http://stackoverflow.com/questions/10981496/#">Index</a><a id="page1" href="http://stackoverflow.com/questions/10981496/#">Page 1</a><a id="page2" href="http://stackoverflow.com/questions/10981496/#">Page 2</a>\[/code\]If clicked on the \[code\]<a>\[/code\] tag with \[code\]id="index"\[/code\], change \[code\]url: "rss/what_ever_it_is_now"\[/code\] to \[code\]url: "rss/index"\[/code\]Thank you so much!
 
Back
Top