473,386 Members | 1,738 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,386 software developers and data experts.

Getting document's entire HTML

moishy
104 100+
I want to get the page's source code.
The best I came up with was: document.getElementsByTagName('html')[0]
Is there something shorter than that?
Dec 6 '07 #1
1 1006
acoder
16,027 Expert Mod 8TB
If you give the HTML tag an id, then you can use document.getElementById(id). Not much shorter, but there you go.
Dec 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Eshrath Ali Khan | last post by:
Hi, I have a requirement where I am transforming a XML into a html using an XSL. I need to create a object for the each and every occurrence of an element named "tgroup" in the xml. Also I need...
5
by: Kathryn | last post by:
Good morning! I am having a problem with a span. I have items, of which I only want to show the first X characters on the screen. If the user prints the page, I want the entire item to print....
4
by: Michael Hill | last post by:
If I had a span tag like: <span id='msg_2'> There is a bunch of text <a href="http://www.someurl.com"> here </a>. And some others <a href="http://www.otherurl.com">here</a>. Good luck! </span>...
5
by: s_m_b | last post by:
function saveState() { document.write (" | <a href = 'myhomepage.asp? view=mhp&amp;action=save&amp;pb="); >> document.write (document.phone.style.display.value); document.write ("'>save view</a>"); };...
2
by: Muscha | last post by:
Hi, Is there a way to get the current content of the web browser control? As in the browser is the "View Source" functionality? thanks. /m
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.