The place where everyone hangs out, chats, gossips, and argues
User avatar
By Stephen.
#63549
I have this java script for a confirmation of entry to a particular page on my site...

<script>
var stay=confirm("YOUR MESSAGE HERE")
if (!stay)
window.location="WEBSITE LOCATION"
</script>


Now, does anyone know where this goes in HTML (head, body :?:) and is that right because I can't get it to work!?
By timb
#63551
that doesn't look right to me. is that all the code showing up? if not put it in a [code][/code]
User avatar
By Sidders
#63552
I put it in the <head> and it works fine. What use is it?
By timb
#63555
that works? 8O

you can put the script anywhere on the page really. i would tend to put scripts at the very top of the code just so its loaded first.

it's meant to be javascript right? you should really specify the script language etc in the script tag. if its meant to be vb script throw it away it's useless. javascript lines should end with ;
User avatar
By Sidders
#63557
Well I put it on my 'Top Ten' page here and all it does is pop-up a message before the page opens.
User avatar
By Adam
#63558
Christina Aguilera - anybody see that picture of her undercarriage? its in heat btw.

Junior Senior - class.
User avatar
By Sidders
#63559
timb wrote:it's meant to be javascript right? you should really specify the script language etc in the script tag. if its meant to be vb script throw it away it's useless. javascript lines should end with ;
I was going to say that too. Doesn't technically matter these days because browsers can generally interpret the language for themselves, but it's good practice to put the language in.
User avatar
By Sidders
#63560
Adam wrote:Junior Senior - class.

That's why it's my number 1.
User avatar
By Stephen.
#63561
Well that's the way I intended it but it won't work for me. I use Frontpage but you can edit the HTML in that so I put it in there but still not working.
(I didn't write it btw, I got it from an HTML help site)
By Lew
#63562
you had justin timberlake at no. 2??? well, its your website
User avatar
By Sidders
#63563
Weeman wrote:Well that's the way I intended it but it won't work for me. I use Frontpage but you can edit the HTML in that so I put it in there but still not working.
(I didn't write it btw, I got it from an HTML help site)

My advise - don't use Fronpage, it's evil :evil:
User avatar
By Sidders
#63565
Lewis wrote:you had justin timberlake at no. 2??? well, its your website
It was best of a bad bunch last week.
By Lew
#63570
i cant either, but i still made an absolutely wonderful website........
User avatar
By Sidders
#63574
If you put it within <head> I really can't see why it won't work. Try putting it directly below the <title>blah, blah</title> bit.

You can go View-->View Source on my page if that helps.
By timb
#63575
well it works in mozilla so i guess it's ok, but it might not in some others so i would prefer to fix it.

look at your html source code when you view the actual page and see if its the same as you have there or if frontpage has altered it for you
By Lew
#63578
my website looks really weird and different in opera

i'm never using front page again, i've got this cool page thing. is it any good? its a WYSIWYG so i should be ok
User avatar
By Sidders
#63579
timb wrote:well it works in mozilla so i guess it's ok, but it might not in some others so i would prefer to fix it.

look at your html source code when you view the actual page and see if its the same as you have there or if frontpage has altered it for you

Seems very likely. Microsoft thinking it knows best as usual....
User avatar
By Sidders
#63583
Weeman wrote:Well nothing else gets altered and I have quite a bit of java on my site...
Should work anyway, try putting it just after the <head> tag.
User avatar
By Sidders
#63587
Is the page online?

Sorry, too slow writing this!

Good to know, thanks!

Disappointing that they haven’t replaced Pippa in […]