Solved

JavaScript Content Grabbing

Posted on 2003-11-03
8
435 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

821 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