PDA

View Full Version : init parameter to html


Xeef
11-16-2004, 08:53 PM
hi again

i realy was mising this
to have no idea and ask stupid questions :)

here one more :

can i give a html page an init parameter
somthing like

www.side.com/start.html?Var=100

and in side the html :
alert(Var)

so i get an alert whit 100 in it

or instantly call a cunction

www.side.com/start.html?MyFunction()

in html

function MyFunction(){alert(100)}

THX in front for any help

Xeef
11-16-2004, 11:39 PM
why i need this :

i wana have ONE html which you call whit the browser this window MUSS have the menubar (or is there a way to prevent it ?)
so next step this html opens it self whit windows.open (whit out menubar) and close it self sofare anything fine
but this will loop for ever so the html which i opens whit window.open needs to now that it's opened by it self so it hase no menubar
and not need to load it self and close it self :p

petefs
11-17-2004, 09:27 AM
you can parse the URL in JavaScript and use it as a conditional

i.e.

start.html#1

and then in javascript

if (document.href.split("#")[1] == 1) // your code here


should work...I'm not too snappy with my JavaScript at the moment so it's untested, but I'm sure that will put you in the right place to work ^_^

Xeef
11-17-2004, 02:48 PM
AHa this sound EXACTLY what i need

will test it sone

THX a lot petefs

Xeef
11-17-2004, 06:54 PM
Hmm

on the way ! :)

--> window.location