Hello I am looking for a certain javascript source that can get a pages source code?
Thanks to any help in advance.
1
2
ID:275907
Feb 4 2005, 11:43 am
|
|
In response to Elation
|
|
most browsers have a 'view source' option, either via a right click on the page, or a menu choice. no javascript required! :)
|
If your looking to get the source code for pretty much anything other than a basic HTML document, you won't be able to. Other than that, View->Source works.
|
In response to digitalmouse
|
|
digitalmouse wrote:
most browsers have a 'view source' option, either via a right click on the page, or a menu choice. no javascript required! :) Yea well I was going to do it for a webpage. I wanted to get the whole source code of my own webpage and do somthing with it in javascript code. So Im getting the source code when the website is first displayed. Not by the other means of getting it. Like through the browser. I could just do it through php, but the server doesnt run PHP. And no I cant just move to another host cause I all ready have one that host php scripts. I just want to do it on javascript. Or at least see if its possible. I've been looking on google but the code that I did find didn't work. Im not to sure why. Thanks for a.. :) telling me though. [EDIT] 12/5/01 - digitalmouse 2/8/01 - Green Lime digitalmouse is your key creation date wrong? :) I know mine is |
In response to Green Lime
|
|
nope- my first posts were less than a month later.
|
I got the following code on the page.
<SCRIPT>var htmlsource = new File("file://bwicki.byond.com/ByondBwicki.dmb?DragonBlazeGames"); htmlsource.open(); var htmltext = htmlsource.read(htmlsource.length); htmlsource.close();</SCRIPT> But it doesnt seem to be working. I got the File() Object information from the bellow site. http://www.mozilla.org/js/js-file-object.html Hope you can help me out maybe tell me whats wrong with the code. |
In response to Green Lime
|
|
Is it JavaScript?
Then the first tag should be: <script language = JavaScript> Learn to program in JavaScript before copying and pasting code. You wouldn't do it with DM, eh? |
In response to Elation
|
|
Elation wrote:
Is it JavaScript? <code> <script language="JavaScript"></script> </code> Learn to program to the most basic of standards before correcting other people. |
In response to Nick231
|
|
Nick231 wrote:
Elation wrote: Ohh I was un aware that the language propertie was required? I thought <script language="JavaScript"> and <script> were the same? If not what is the difference O.o? |
In response to Green Lime
|
|
for the more lazy browsers like IE, you can get away with just using <script>, but the proper way to use client-side scripting languages is with the full line: <script language="javascript">. some people even say to use the version of javascript too ("javascript 1.3"), but i do not believe that to be standardized, or put into regular use.
|
In response to Nick231
|
|
Nick231 wrote:
<code> > <script language="JavaScript"></script> > </code> Oooh, BURN! It still works though...I wasn't aware of any standards. <html> <head> <script=JavaScript> alert('OHHH BURN!') </script> </head> </html> |
In response to Elation
|
|
It works, yes, but you're supposed to surround attribute values with quotes. It's better. Plus it means your page is one step closer to being XHTML-compatible. =)
|
In response to Crispy
|
|
Bah, I suppose I'll just stick with my actionscript then. :/
So what's so great about being XHTML compatible? (straight question, not being unruly) |
In response to Elation
|
|
Elation wrote:
Bah, I suppose I'll just stick with my actionscript then. :/ Wasn't even aware of there being a XHTML O.o, Ive heard of DHTML but not XHTML... what is it? |
In response to digitalmouse
|
|
Well it might not work for a few reasons, you might have the wrong version of windows,linux,or what ever out there. Or the file was corrupt.
|
In response to Green Lime
|
|
Green Lime wrote:
Wasn't even aware of there being a XHTML O.o, Ive heard of DHTML but not XHTML... what is it? The bastard child of XML and HTML. ;-) In other words... they (the W3C) took HTML, with all its messy and "forgiving" parsing rules, and applied XML's strict parsing rules. In HTML, this is incorrect (tags should be closed in the reverse order that they're opened) but will be accepted by most browsers: <b><i>Bold and italic text</b></i> If a page is designated as XHTML and contains an error like the above (or any other tag structure that's invalid in XML), an XHTML-compliant browser will actually REFUSE to render it*. * At least, that's what I assume it'll do. I haven't actually read the XHTML spec, but XML parsers are supposed to chuck a wobbly if you give them incorrect data, so I assume that XHTML is the same. |
In response to Meta Gaara
|
|
<font color="#0000FF">Meta Gaara babbled:
...you might have the wrong version of windows,linux,or what ever out there...</font> eh? what does having the wrong version of an operating system have anything to do with the key creation date on BYOND? me thinks someone forgot to take their medication today. :p |
In response to digitalmouse
|
|
Well some programs only operate on a certain system,version or what ever.
|
In response to Meta Gaara
|
|
<font color="#666666">Meta Gaara mumbles:
Well some programs only operate on a certain system,version or what ever.</font> what programs??? we are talking about a website which has been running on a server for ages! even if you change your browser on your local machine (regardless of OS), that won't affect the server you are accessing. |
1
2
That's where the Javascript is...