Click to See Complete Forum and Search --> : add string


superDOS
08-18-2003, 12:21 PM
i need help to create a script that adds a piece of string to the beginning of the hmtl document so it comes before the <html> tag.
is this possible? :confused:

Khalid Ali
08-18-2003, 12:36 PM
may be..use DOM methods

document.getElementsByTagName("html")[0].insertBefore()

superDOS
08-18-2003, 01:08 PM
sorry i'm completly green with javascripts.
could you tell me the whole code?

more specific i want to add a <noscript> tag before all code in the html document.

Khalid Ali
08-18-2003, 01:26 PM
hunm..for that I think appropriate optionis server side language..because you want to it before browser reads any other part of the page..

superDOS
08-18-2003, 01:32 PM
yeah exactly. is it hard to do?
i have no experice in ssl.

could you help me out if so? :rolleyes:

thanks

pyro
08-18-2003, 01:34 PM
What serverside languages does your server support? PHP? Perl? JSP?

superDOS
08-18-2003, 01:46 PM
php and mySQL

pyro
08-18-2003, 01:48 PM
Cool... Not sure exactly what you are doing, or why you would want to display text before the <html> but...

<?PHP
echo "some text here...";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
...

Khalid Ali
08-18-2003, 01:54 PM
I am just wondering ..how come you are not able to add noscript tag in thyepages manually..just curious..

superDOS
08-18-2003, 02:14 PM
okey this is the problem:
the server i have adds a javascript to the html document when you load the page and it adds to the top of the document so i need it to add a noscript tag before the javascript