PDA

View Full Version : question on Java Scripts


CarpeNoctem
08-03-2003, 10:04 PM
OK, i know that you all must be sick of me, but i think that we are all here to learn right?

i have another question
i have a script and execution code on my page that reads as follows:

<script>

function openpopup(){
var popurl="../rec.html"
winpops=window.open(popurl,"","width=390,height=374,left=50,top= 50")
}

</script>
<p align="center"><br>&nbsp;<a href="javascript:openpopup()"><img src="../img/rec.jpg" width="88" height="31" border="0"></a></p>


what i did was put what is in between the <script> and </script> into a js file located at www.carpenoctem.tv/java/popup.js

i know that the problem that i have lies in the <a href="javascript:openpopup()"> but i dont know what it should read...... i tried it without the open popup.



if you take a look at www.carpenoctem.tv/test/berkowitz.html you will see what i am attempting there.... it is that little recommend this site button...

what should it read in order to work properly?

Thanks

mark

n8thegreat
08-03-2003, 10:18 PM
according to your source its just href="openpopup()" no href="javascript:openpopup()" :P

CarpeNoctem
08-04-2003, 01:22 AM
what should i make the link read?

n8thegreat
08-04-2003, 01:25 AM
javascript:openpopup()

you only had openpopup(), so it was trying to find a dir or file with that name, you have to put the javascript: before it

CarpeNoctem
08-04-2003, 01:39 AM
should it be <a href="javascript:openpopup">

CarpeNoctem
08-04-2003, 01:41 AM
i tried doing it where it was <a href......


and it does not work properly.....

if you look at www.carpenoctem.tv/killers/berkowitz.html and click on the link, you will see what it is supposed to do.....

but here it doesnt give the popup window

CarpeNoctem
08-04-2003, 01:43 AM
maybe i have the text wrong into the js?

here is what it says




function openpopup(){
var popurl="../rec.html"
winpops=window.open(popurl,"","width=390,height=374,left=50,top= 50")
}

n8thegreat
08-04-2003, 10:05 AM
i looked at the source before, where you said to look, at the reccomend this page button. and you had <a href="openpopup()"><img etc..., while it should have been <a href="javascript:openpopup()"><img etc... there is nothing wrong with your openpopup() function

CarpeNoctem
08-04-2003, 01:24 PM
awesome.....

Thanks!