PDA

View Full Version : window open in javascript???


twocool
04-17-2003, 04:27 AM
how to link when a new window pop ups....

<a href="javascript:WinOpen('display_form.asp?ReqNo=<%=rs("ReqNo")%>')" target="_self", width=500,height=400><%=rs("ReqNo")%></a>

i linked it like this its not working.... pls advise.. thanks

miranda
04-17-2003, 05:40 AM
First off, you have your Javascript incorrect. You are trying to combine HTML and javascript. 2nd Is this like a popup advertisement?? If so make the javascript a function then use the onLoad event in the body tag. like so


<script language="javascript" type="text/javascript">
function openAd(url,windowname){
win1=window.open ('display_form.asp?ReqNo=<%=rs("ReqNo")%>','win1','width=500,height=400')
}
</script>
<body onLoad="openAd();">


If it is supposed to open when the user clicks the link then just change the code to look like this


<a href="javascript:window.open ('display_form.asp?ReqNo=<%=rs("ReqNo")%>','win1','width=500,height=400')"><%=rs("ReqNo")%></a>