Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, 7th_zorro, Ayumi), 749 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Javascript and document.write #288178
09/04/09 15:59
09/04/09 15:59
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
I want to use a document.write command in javascript to write a line at the very beginning of the html file in which it is writing. I know how to use document.write(""); but I don't know how to tell the javascript to go to the very beginning of the html file. Can someone help me with this?


- aka Manslayer101
Re: Javascript and document.write [Re: mpdeveloper_B] #288182
09/04/09 16:04
09/04/09 16:04
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
body.innerHTML = "hi there" + body.innerHTML;

should do the trick


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Javascript and document.write [Re: Michael_Schwarz] #288185
09/04/09 16:21
09/04/09 16:21
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
I mean at the absolute beginning of the file, not the body. Before all the headers and everything. Line numero uno.


- aka Manslayer101
Re: Javascript and document.write [Re: mpdeveloper_B] #288187
09/04/09 16:37
09/04/09 16:37
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
I have to put this line at the beginning of the html file by using javascript, can it be done?

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">



Last edited by mpdeveloper_B; 09/04/09 16:38.

- aka Manslayer101
Re: Javascript and document.write [Re: mpdeveloper_B] #288189
09/04/09 16:53
09/04/09 16:53
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
html.innerHTML = "hi there" + html.innerHTML;

"should" work, but I'm not really sure.


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Javascript and document.write [Re: Michael_Schwarz] #288192
09/04/09 17:02
09/04/09 17:02
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
no dice. I'm curious about this...is there a way to change the doctype in javascript...


- aka Manslayer101
Re: Javascript and document.write [Re: mpdeveloper_B] #288194
09/04/09 17:06
09/04/09 17:06
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
no. but you can start a new document and write in everything plus the new doctype.

Re: Javascript and document.write [Re: Joey] #288195
09/04/09 17:11
09/04/09 17:11
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
well, I guess that solves that tongue

I'll have to change the doctype manually then. I was asking because the website software that we use for yahoo doesn't set doctypes, which can cause some problems, and if you change the files out of the program and open them back up it deletes any changes to the beginning of the file so all doctypes are removed...

Oh well, guess that means anytime we update I'll have to change the doctype. Hopefully we won't have to update alot.


- aka Manslayer101
Re: Javascript and document.write [Re: mpdeveloper_B] #288245
09/04/09 23:07
09/04/09 23:07
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
erm surely

<script>
document.write("");
</script>
<!doctype....

If that doesn't work and you need a solution i will be more than happy to create one for you


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Javascript and document.write [Re: Blade280891] #288359
09/05/09 14:58
09/05/09 14:58
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
and how is that supposed to work?

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1