Solved

JavaScript Content Grabbing

Posted on 2003-11-03
8
431 Views
Last Modified: 2008-03-10
Okay I need to pull in some content but I can only use JavaScript.  Is there away that I can grab content from an HTML page?

Help :)
0
Comment
Question by:codeSmoker03
8 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 63 total points
ID: 9676842
If it's on a different domain, then the answer is No.

It's a breeze with PHP, though, and I imagine the same thing is true for ASP or Perl.
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 62 total points
ID: 9677448
and if it is from your harddisk, you can rename the page with extension .hta and it will work too.
0
 

Expert Comment

by:shyam619
ID: 9677898
Use an invisible iFrame with the source for the iFrame set to the HTML page from where you want to grab the content. There is a workaround to get over the cross - domain issue too.
var frameElem = document.getElementsByTagName("IFRAME")[0];
var frameWnd = window.frames[0];
oHtml = frameElem.Document.body.outerHTML;

etc...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:Zontar
ID: 9678124
outerHTML is MSIE only.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 9678356
So is HTA

Only way to do cross domain scripting in Netscape/mozilla is with a signed script
0
 

Author Comment

by:codeSmoker03
ID: 9678376
Its on the same server, I'm pulling from what I believe is a perl script (havent been given all the information yet).

I have written two scripts one in ASP and one in PHP for snagging web content, but was told that the servers dont support either language, ASP i can understand, but PHP.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10346779
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: Zontar {http:#9676842} & mplungjan {http:#9677448}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Trying to convert the select box into input field 8 21
Animated .jpg? 13 55
Javascript to allow login/password authorization 4 27
is this a cms? 8 32
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now