Forum Moderators: open

Message Too Old, No Replies

jquery - loading data from a page and display it in an an xml file

loading data from a page into xml

         

jacosta000

11:52 pm on Mar 1, 2009 (gmt 0)

10+ Year Member



Hello!

I'm sure this is possible, but every jquery ajax example I've seen involves either sending data to another page as a get or post request or it involves appending data into the html with data from another page. Please forgive me, I'm still new to the whole jquery thought process. ;-)

What I'd like to do is load data from another page into an xml file. Basically, I have an html page that has a list in tabular form.

To retrieve that information, I did something like this (this displays all of the information that matches the selectors onto the page):
$("#links").load("foo.html td.listitem table td");

This is cool and everything, but what I'd really like to do is take that information and place it into an xml file. This would essentially be used as an rss feed. So essentially what I want to do is scrape specific html from one page and list it in something of an rss feed.

It seems as though I won't be able to use the load function to do this. Can I use the ajax function? I've been trying to experiment with it, but I haven't had much success.

I've sort of hit a wall trying to figure this out, so if anyone can shed some light on the subject and point me in the right direction, I would be most grateful.

Thanks!

daveVk

3:19 am on Mar 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't understand the big picture here, should not all this be happening on the server ?
- server gets rss request
- server scrapes html from somewhere
- server re formats html as xml
- server sends xml as rss reply

jacosta000

3:50 am on Mar 2, 2009 (gmt 0)

10+ Year Member



well, as I was thinking about it, I see it definitely making more sense to do the scraping and formatting to xml server-side.

Just for my own jquery knowledge, If you display the contents of the load function on the page, is there a way to manipulate the contents of the data (like modifying contents of div tags or adding style)?

Thanks for the help!

daveVk

4:59 am on Mar 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am a jQuery newbe but understand this function loads content directly into the DOM. You should then be able to modify whatever you like, as if it where the original page content.