PDA

View Full Version : java help


rayman
11-12-2002, 12:31 PM
can someone please help me this is the coding im trying to sort out can somebody please tell me where i am going wrong what it does is puts a link on a blue background in a table with other links right next to it and when you click on it; it opens a pop up window with some coding in it but why cant i make it change the contents for it different link (it just uses the first link only)
<script>
function openpopup(){
var popurl="airwolf.HTML"
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="javascript:openpopup()">Airwolf.</B></FONT></A></TD>

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

</script>


<TD><FONT SIZE=2 COLOR="#ffffff" FACE="Arial, Helvetica"><B><a href="javascript:openpopup()">Axle.f.</B></FONT></A></TD>


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

joh6nn
11-12-2002, 01:33 PM
<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="javascript:openpopup('airwolf.HTML' )">Airwolf.</B></FONT></A></TD>

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


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


you named both functions the same thing. that's like trying to hold two different values in the same variable:

var the_One_True_Variable = some_Arbitrary_Value;
var the_One_True_Variable = now_For_Something_Completely_Diffferent;

alert( the_One_True_Variable ); //guess what it's gonna say.

you can fix this, by just having one function, that will take a variable, and do something with it. like open a new window with it. that's what i did with the code above.

also, if your first language is english, follow this link (http://www.penny-arcade.com/view.php3?date=2002-10-11&res=l). if you're not fluent in english, don't worry about it.

rayman
11-12-2002, 04:02 PM
cheers to jo6nn.
thankyou for to taking the time to work it for me
it works a treat
rayman