PDA

View Full Version : java script muddle


rayman
11-14-2002, 07:12 PM
can anybody help with this piece of java what is meant to happen is when you click on airwolf button it should goto airwolf.html
and when you click on axfle.f it goes to axle.f.html in a new non resizable pop up but this is not happening as it is not bringing up new pop up with the contents of the various html files
thanks in advanced for your help.
the java is below.


<script>
function openpopup(popurl){
winpops=window.open(popurl,"","width=400,height=338,scrollbars,")
}

</script>

<CENTER><H1><TABLE BORDER="5" CELLPADDING="3" CELLSPACING="1" WIDTH="100"><TR BGCOLOR="#1e3fcd" ALIGN="CENTER">
<TD><FONT SIZE=2 COLOR="#ffffff" FACE="Arial, Helvetica"><B><a href="java script:openpopup('airwolf.HTML' )">Airwolf.</B></FONT></A></TD>

<TD><FONT SIZE=2 COLOR="#ffffff" FACE="Arial, Helvetica"><B><a href="java script:openpopup"axle.f.HTML">Axle.f.</B></FONT></A></TD>


</tr>
</table>
</h1></centre>

rayman
11-14-2002, 07:32 PM
sorry i changed abit and forgot to put it back before posting
<script>
function openpopup(popurl){
winpops=window.open(popurl,"","width=400,height=338,scrollbars,")
}

</script>

<CENTER><H1><TABLE BORDER="5" CELLPADDING="3" CELLSPACING="1" WIDTH="100"><TR

BGCOLOR="#1e3fcd" ALIGN="CENTER">
<TD><FONT SIZE=2 COLOR="#ffffff" FACE="Arial, Helvetica"><B><a href="java script:openpopup('airwolf.HTML'

)">Airwolf.</B></FONT></A></TD>

<TD><FONT SIZE=2 COLOR="#ffffff" FACE="Arial, Helvetica"><B><a href="java

script:openpopup('axle.f.HTML')">Axle.f.</B></FONT></A></TD>


</tr>
</table>
</h1></centre>

PauletteB
11-15-2002, 12:18 AM
In brief

<script>
function openpopup(){
window.open('', 'winpops', 'scrollbars,width=400,height=338')
}
</script>

<a href="airwolf.HTML" target="winpops" onClick="openpopup()">Airwolf</a>

<a href="axle.f.HTML" target="winpops" onClick="openpopup()">Axle</a>

whammy
11-15-2002, 12:35 AM
Actually if the problem is the fact that it's not opening up in a "new" window (which I'm not clear on), you need to also use "_blank" as the window name in your function instead of "winpops" (or pass a new window name into the function, along with the URL, separated by a comma).

I'm not sure if the former method is XHTML compatible though. I will perhaps test that out and post here again.

:)

Adam20002
11-15-2002, 05:44 PM
The first link


<a href="javascript:openpopup('airwolf.HTML')">Airwolf</a>


should work provided airwolf.html is an actual page

the second link has

axle.f.html

which seems strange are you sure thats not a typo ?

jonathan
11-18-2002, 03:33 PM
Well you did say that you wanted to do it in java, and I'm not at al familiar with it. But from the looks of it, it looks alot like javascript. I was just wondering if you should put href="javascript:openpopup('asdofjd');" instead of href="java script:openpopup('adoijdkjf');". Other than that, I can't see anything that catches my eye.