Solved

JavaScript Content Grabbing

Posted on 2003-11-03
8
428 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…
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…

757 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

19 Experts available now in Live!

Get 1:1 Help Now