Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Using ASP in JavaScript ?


Message #1 by farsk@s... on Thu, 16 Jan 2003 15:02:14
>From: farsk@s...
>Reply-To: "javascript" <javascript@p...>
>To: "javascript" <javascript@p...>
>Subject: [javascript] Using ASP in JavaScript ?
>Date: Thu, 16 Jan 2003 15:02:14
>
>In 'x.asp' page , I want to add a new link, this link open a new window
>(called y.asp)
>I want to pass a variable from x.asp page to y.asp page, this variable
>called 'id'
>
>I used these code but it didn't work !!!
>
>* here is the code I use in x.asp page :
>-------
>
> >> the javascript code is :
><script language="JavaScript">
>function orderdetails ()
>{
>newwind = window.open("y.asp?id=ProdID","PrinterFriendly","left=20,
>top=20,    width=650, height=500, toolbar=1, status=1, scrollbars=1,
>resizable=1");
>}
></script>
>
> >> the html code is :
><a href="javascript:orderdetails();">open new window<a>
>------
>
>* here is the code I have in y.asp page :
>------
><%
>idis = Request("id")
>%>

JavaScript should be:
function orderdetails ()
{
newwind = window.open("y.asp?id=" + ProdID,"PrinterFriendly","left=20,
top=20,    width=650, height=500, toolbar=1, status=1, scrollbars=1,
resizable=1");
}
assuming ProdID is declared and initialised in JavaScript. If it is a 
server-side variable then script is:

function orderdetails ()
{
newwind = window.open("y.asp?id<% =ProdID %>","PrinterFriendly","left=20,
top=20,    width=650, height=500, toolbar=1, status=1, scrollbars=1,
resizable=1");
}


Joe

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


  Return to Index