473,473 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting HTML source from Firefox

Hi,

I have been trying to achieve this since yesterday night and am not
able to figure out any solution as yet.

There's an XML page with RDF information inside. I want to simply get
the source of this page and save it in a file.(basically i want to do a
'save as' without prompting the user.

I'll use the FSO for putting it into the file but to get the source of
the page in a variable :

I think document.body or document.html do not work in Firefox. Also
document.documentElement.getElementByTagName('xml' )[0].innerHTML is of
no good.

Any ideas ?

Thanks,
Anupam

Feb 20 '06 #1
3 3003
And I have also tried

var xmlDoc;
xmlDoc.load("my url");
alert('The XML in the page is :' + xmlDoc);

in Firefox. It says xmlDoc doesnt have any properties.

Feb 20 '06 #2
an********@gmail.com wrote:
And I have also tried

var xmlDoc;
xmlDoc.load("my url");
alert('The XML in the page is :' + xmlDoc);

in Firefox. It says xmlDoc doesnt have any properties.


Well, it does not. xmlDoc is declared, but not explicitly initialized. So
its value is `undefined'. And `undefined', the sole and primitive value of
the Undefined type, does not have a `load' property.
PointedEars
Feb 20 '06 #3
an********@gmail.com wrote:
There's an XML page with RDF information inside. I want to simply get
the source of this page and save it in a file.(basically i want to do
a 'save as' without prompting the user.

I'll use the FSO for putting it into the file
There is no FileSystemObject in the Gecko DOM, it is IE (DOM)-only.
You will have to use interfaces defined by the DOM Level 3 Load And
Save Specification or use the filesystem interfaces native to the
Gecko DOM. IIRC this has been asked and answered here before.
but to get the source of the page in a variable :

I think document.body or document.html do not work in Firefox.
document.body is a property defined in W3C DOM Level 2 _HTML_ as a shortcut
reference to the sole HTMLBodyElement object in the document tree of
(X)HTML documents. It is not available for non-(X)HTML document types,
of course.

There is no such property as `document.html' for any supported document type
in the Gecko DOM.
Also document.documentElement.getElementByTagName('xml' )[0].innerHTML is
of no good.
Because you are not dealing with an (X)HTML document. Furthermore, the
method identifier is `getElementsByTagName', not `getElementByTagName'.
Any ideas ?


var x = new XMLHttpRequest();
x.open('GET', 'http://example.com/blurb.rdf');
x.onreadystatechange = function()
{
if (x.readyState == 4 && /^[02]/.test(x.status))
{
window.alert(x.responseText);
}
};
x.send(null);
HTH

PointedEars
Feb 20 '06 #4

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

Similar topics

6
by: mike | last post by:
regards: what is the mechanism of "IE" and "Firefox 1.0" to parse HTML file and show the result on the screen?....@@. thank you may god be with you
12
by: Dominik Werder | last post by:
Hello! When walking the DOM I check for e.g. obj.nodeName=='DIV' or similar. But this throws a warning in firefox if obj is not a HTMLDivElement. How can you test for HTMLDivElement without...
2
by: cttseng | last post by:
Dear all, I have a problem that how to get the page's source code which is generated by javascript code? For example: http://grouper.com/video/south%2bpark Although I can see the result page...
8
by: Amit | last post by:
I have a master page and a content page but the stylesheet isnt getting applied like how it looks in visual studio design view. The master page is defined like this: <%@ Master Language="VB"...
12
by: mistral | last post by:
Can anybody tell me how to get source code of page in iframe? (popup window is clickable image). When I right click on this popup border to view source, i see just as follows <html> <head>...
16
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript...
3
by: paul.rusu | last post by:
Hi, I am having the html tidy in c# issue. I parse a lot of html pages with sports data. For this I need them converted in xml. I am using html tidy libraries: zetaHtmlTidy from codeproject,...
5
by: Locke | last post by:
Hi, What is the correct way to get the dimensions of the displayable window? I.e. I don't want the border or the toolbar to be included in the height or width. I want to request an image from...
29
by: Chris Riesbeck | last post by:
I have an image with a class and the class defines a clip rectangle. In Firefox 2 and 3, and Opera 9, I can access the rectangle with document.defaultView.getComputedStyle(). But that doesn't...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.