473,394 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

HTML source code

Hi all.

I've a problem: I need to retrieve (in javascript) the soure HTML code
from a url without loading the page then put the HTML source code in a
string variable to manipulate it. From this variable I need to get all
the links to perform some operations.

Everyone have an idea?

Thanks.

Mar 22 '06 #1
4 1459
VK

Steve Slax wrote:
Hi all.

I've a problem: I need to retrieve (in javascript) the soure HTML code
from a url without loading the page then put the HTML source code in a
string variable to manipulate it. From this variable I need to get all
the links to perform some operations.

Everyone have an idea?


If both the requestor page (with your script) and the requested page
(with HTML to parse) are located under the same domain you can use
ajaxoids for this task. I would recommend <http://www.ajaxtoolbox.com>
library.

If they are located on different domains, you cannot do that
client-side. You need to install a content grabber on your server (it
is not my business but I presume that all copyrights considerations are
already taken).

Mar 22 '06 #2
Steve Slax wrote on 22 mrt 2006 in comp.lang.javascript:
I've a problem: I need to retrieve (in javascript) the soure HTML code
from a url without loading the page
What is the difference between retrieving and loading?
then put the HTML source code in a
string variable to manipulate it. From this variable I need to get all
the links to perform some operations.


You wil have to download it anyway.

In IE, or in cscript/wscript try:

function getUrl(url) {
var http = new ActiveXObject("microsoft.xmlhttp");
http.open("GET",url,false);
http.send();
return http.responseText;
}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 22 '06 #3
Thanks, now I'll try...

Mar 22 '06 #4
Steve Slax wrote on 22 mrt 2006 in comp.lang.javascript:
Thanks, now I'll try...


Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsreply/>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: asim | last post by:
Hi All i m transforming a simple XSL file on Server side using MSXML Parser ... and writting resultant HTML directly on browser .. is there any way to get this HTML in a variable ??? i seen the...
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
11
by: Patrick Van Esch | last post by:
Hello, I have the following problem of principle: in writing HTML pages containing ancient greek, there are two possibilities: one is to write the unicode characters directly (encoded as two...
10
by: Angel | last post by:
I want to concat a space in an HTML Control's innerText property. here is a sample code Dim celCreate As New HtmlControls.HtmlTableCell() celCreate.innerText = " TEST" When the page is...
17
by: chris.schwalm | last post by:
I would like to first state that I have searched through the archives and found a lot of related material, but am still new enough to javascript that I can't fit all the pieces together yet. So...
78
by: Robert Baer | last post by:
The homepage i have had up and seemingly working is: http://oil4lessllc.com/ However, the validator has so many complaints, and being so incompetent, i have no clue as to how to fix it all. Would...
2
by: ste-m | last post by:
Hi there, I was wanting to calculate how long my web pages take to load, and to insert this time into my HTML source code (not visible from the browser, but only in source view) as a HTML...
3
tpgames
by: tpgames | last post by:
When I renamed the class file to Audiodriver.class and changed the link to Audiodriver.class, the game wouldn't load. I got this error java.lang.NoClassDefFoundError: Audiodriver (wrong name:...
5
by: GuyBowden | last post by:
Hi I'm trying to figure out why a certain server is rendering out strange html Sometimes it renders out html code to the browser window. See here: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.