What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [RESOLVED] Using Ajax.open to get specific div

[RESOLVED] Using Ajax.open to get specific div
Author: Message:
macgyver08
Junior Member
**

Avatar
Hakuna matata!

Posts: 23
35 / Male / Flag
Joined: Feb 2007
O.P. RE: Using Ajax.open to get specific div
quote:
Originally posted by Adeptus
I think that you may be looking at this the wrong way.  Instead of parsing your site to extract the text from a specific <div> it may be much simpler to have your site provide the same text in a more handy format, such as a .txt file or a web service.  If it is "your" site, you should have the ability to set this up.

If it isn't your site, the functionality you are talking about is called "web scraping" and looking that up may yield some helpful information.
quote:
Originally posted by Spunky
A simple and crude method would just to be:

js code:
// txt is the xmlhttp responseText stored in a variable
txt = txt.split('<div id="1">')[1];
txt = txt.split('</div>')[0];
// txt will now be the div contents including the html
// if the content is bold for example, you will see:
// This is the <b>content</b> from the div

EDIT:
It may be possible to do this in one line:
js code:
txt = txt.split('<div id="1">')[1].split('</div>')[0];

I can't be sure of that one though without trying it, but most javascript seems to chain quite well
Thanks to both of you! I've got it figured out now :D
01-28-2010 10:46 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[RESOLVED] Using Ajax.open to get specific div - by macgyver08 on 01-27-2010 at 06:57 AM
RE: Using Ajax.open to get specific div - by Spunky on 01-27-2010 at 08:08 AM
RE: RE: Using Ajax.open to get specific div - by macgyver08 on 01-27-2010 at 09:57 AM
RE: Using Ajax.open to get specific div - by djdannyp on 01-27-2010 at 10:49 AM
RE: RE: Using Ajax.open to get specific div - by macgyver08 on 01-27-2010 at 11:05 AM
RE: Using Ajax.open to get specific div - by Adeptus on 01-28-2010 at 07:59 AM
RE: Using Ajax.open to get specific div - by Spunky on 01-28-2010 at 09:45 AM
RE: Using Ajax.open to get specific div - by macgyver08 on 01-28-2010 at 10:46 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On