|
 |
asp_databases thread: Passing a number from ASP to JavaScript
Message #1 by jmuldoon@q... on Thu, 10 Jan 2002 23:56:43
|
|
Dallas Martin (are you out there, guy) gave me some excellent code that
allows me to automatically change a right hand frame to match the first
item in a list of paginated thumbnails.
Response.write "<br>sendesc: " & sendDesc
%>
<SCRIPT LANGAUGE="javascript">
<!-- Hide from browsers that do not understand Javascript
function NavHelp()
{
HelpWindow=window.open("../helpnav.asp", "SuNavHelp",
"toolbar=0, width=500, height=300, resizable=1,
scrollbars=1, screenx=10, screeny=10");
}
function ReloadRightFrame()
{
var url = window.location.href;
var prid=41;
var strHref;
{strHref="framedescription.asp?frPrid="+ prid;
parent.DescriptionFrame.document.location.href=strHref;
}
-------
Here's the problem. var prid=41 is up there just as a placeholder. It
should be var prid=sendDesc
sendDesc is a variable created in ASP. Now, I have done my JavaScript
homework, but I've forgotten it. Can anyone puuleeeaase assist with this?
thanks.
Joe
Message #2 by "Phil Sayers" <philipsayers@m...> on Thu, 10 Jan 2002 19:12:12 -0500
|
|
Put a hidden form element on the page and set it's value using the ASP
script. Then further down when you're in the javascript, point the
javascript to the form field. I think you'll have to have the form tags
too, so you are netscape compatible. I have trouble in NS if I use form
elements and no form tags.
-----Original Message-----
From: jmuldoon@q... [mailto:jmuldoon@q...]
Sent: Thursday, January 10, 2002 11:57 PM
To: ASP Databases
Subject: [asp_databases] Passing a number from ASP to JavaScript
Dallas Martin (are you out there, guy) gave me some excellent code that
allows me to automatically change a right hand frame to match the first
item in a list of paginated thumbnails.
Response.write "<br>sendesc: " & sendDesc
%>
<SCRIPT LANGAUGE="javascript">
<!-- Hide from browsers that do not understand Javascript
function NavHelp()
{
HelpWindow=window.open("../helpnav.asp", "SuNavHelp",
"toolbar=0, width=500, height=300, resizable=1,
scrollbars=1, screenx=10, screeny=10");
}
function ReloadRightFrame()
{
var url = window.location.href;
var prid=41;
var strHref;
{strHref="framedescription.asp?frPrid="+ prid;
parent.DescriptionFrame.document.location.href=strHref;
}
-------
Here's the problem. var prid=41 is up there just as a placeholder. It
should be var prid=sendDesc
sendDesc is a variable created in ASP. Now, I have done my JavaScript
homework, but I've forgotten it. Can anyone puuleeeaase assist with
this?
thanks.
Joe
$subst('Email.Unsub').
Message #3 by "Dallas Martin" <dmartin@z...> on Thu, 10 Jan 2002 20:03:03 -0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C19A11.CFDC3000
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Here's the correction to your code.
var prid =3D<%=3DsendDesc%>;
Assuing sendDesc =3D 99, then IIS/ASP will
generate this line:
var prid =3D 99;
Dallas
----- Original Message -----
From: jmuldoon@q...
To: ASP Databases
Sent: Thursday, January 10, 2002 11:56 PM
Subject: [asp_databases] Passing a number from ASP to JavaScript
Dallas Martin (are you out there, guy) gave me some excellent code
that
allows me to automatically change a right hand frame to match the
first
item in a list of paginated thumbnails.
Response.write "<br>sendesc: " & sendDesc
%>
<SCRIPT LANGAUGE=3D"javascript">
<!-- Hide from browsers that do not understand Javascript
function NavHelp()
{
HelpWindow=3Dwindow.open("../helpnav.asp", "SuNavHelp",
"toolbar=3D0, width=3D500, height=3D300, resizable=3D1,
scrollbars=3D1, screenx=3D10, screeny=3D10");
}
function ReloadRightFrame()
{
var url =3D window.location.href;
var prid=3D41;
var strHref;
{strHref=3D"framedescription.asp?frPrid=3D"+ prid;
parent.DescriptionFrame.document.location.href=3DstrHref;
}
-------
Here's the problem. var prid=3D41 is up there just as a placeholder.
It
should be var prid=3DsendDesc
sendDesc is a variable created in ASP. Now, I have done my JavaScript
homework, but I've forgotten it. Can anyone puuleeeaase assist with
this?
thanks.
Joe
$subst('Email.Unsub').
Message #4 by jmuldoon@q... on Fri, 11 Jan 2002 04:02:41
|
|
Well, just that simple! I forget that the Javascript is hard-coded on the
page and that a response.write will handle.
Dallas, it works like a charm. Thanks for all the help.
Joe M
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0007_01C19A11.CFDC3000
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
>
> Here's the correction to your code.
>
> var prid =3D<%=3DsendDesc%>;
>
> Assuing sendDesc =3D 99, then IIS/ASP will
> generate this line:
>
> var prid =3D 99;
>
> Dallas
>
> ----- Original Message -----
> From: jmuldoon@q...
> To: ASP Databases
> Sent: Thursday, January 10, 2002 11:56 PM
> Subject: [asp_databases] Passing a number from ASP to JavaScript
>
>
> Dallas Martin (are you out there, guy) gave me some excellent code
> that
> allows me to automatically change a right hand frame to match the
> first
> item in a list of paginated thumbnails.
>
> Response.write "<br>sendesc: " & sendDesc
>
>
> %>
>
> <SCRIPT LANGAUGE=3D"javascript">
> <!-- Hide from browsers that do not understand Javascript
> function NavHelp()
> {
> HelpWindow=3Dwindow.open("../helpnav.asp", "SuNavHelp",
> "toolbar=3D0, width=3D500, height=3D300, resizable=3D1,
> scrollbars=3D1, screenx=3D10, screeny=3D10");
> }
> function ReloadRightFrame()
> {
> var url =3D window.location.href;
> var prid=3D41;
> var strHref;
> {strHref=3D"framedescription.asp?frPrid=3D"+ prid;
>
> parent.DescriptionFrame.document.location.href=3DstrHref;
> }
>
> -------
>
> Here's the problem. var prid=3D41 is up there just as a placeholder.
> It
> should be var prid=3DsendDesc
>
> sendDesc is a variable created in ASP. Now, I have done my
JavaScript
> homework, but I've forgotten it. Can anyone puuleeeaase assist with
> this?
> thanks.
>
> Joe
>
> $subst('Email.Unsub').
>
>
> ------=_NextPart_000_0007_01C19A11.CFDC3000
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META content=3D"text/html; charset=3Diso-8859-1"
> http-equiv=3DContent-Type>
> <META content=3D"MSHTML 5.00.3315.2870" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT face=3DTahoma size=3D2></FONT> </DIV>
> <DIV><FONT face=3DTahoma size=3D2>Here's the correction to your
> code.</FONT></DIV>
> <DIV> </DIV>
> <DIV><FONT face=3DTahoma size=3D2>var prid
> =3D<%=3DsendDesc%>;<BR></FONT></DIV>
> <DIV><FONT face=3DTahoma size=3D2>Assuing sendDesc =3D 99, then
IIS/ASP
> will</FONT></DIV>
> <DIV><FONT face=3DTahoma size=3D2>generate this line:</FONT></DIV>
> <DIV> </DIV>
> <DIV><FONT face=3DTahoma size=3D2>var prid =3D 99;</FONT></DIV>
> <DIV> </DIV>
> <DIV><FONT face=3DTahoma size=3D2>Dallas</FONT></DIV>
> <DIV><FONT face=3DTahoma size=3D2> </DIV></FONT>
> <BLOCKQUOTE
> style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT:
> 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
> <DIV
> style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color:
> black"><B>From:</B>
> <A href=3D"mailto:jmuldoon@q..."
> title=3Djmuldoon@q...>jmuldoon@q...</A> </DIV>
> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A
> href=3D"mailto:asp_databases@p..."
> title=3Dasp_databases@p...>ASP
> Databases</A> </DIV>
> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, January 10,
> 2002 11:56
> PM</DIV>
> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [asp_databases]
> Passing a number
> from ASP to JavaScript</DIV>
> <DIV><BR></DIV>Dallas Martin (are you out there, guy) gave me some
> excellent
> code that <BR>allows me to automatically change a right hand frame to
> match
> the first <BR>item in a list of paginated
> thumbnails.<BR><BR>Response.write
> "<br>sendesc: " &
> sendDesc<BR><BR><BR>%><BR><BR><SCRIPT
> LANGAUGE=3D"javascript"><BR><!-- Hide from browsers that do not
> understand
> Javascript <BR>function
> NavHelp()<BR>{<BR>HelpWindow=3Dwindow.open("../helpnav.asp",
> "SuNavHelp",<BR>"toolbar=3D0, width=3D500, height=3D300,
> resizable=3D1,
> <BR>scrollbars=3D1, screenx=3D10, screeny=3D10");<BR>}<BR>function
> ReloadRightFrame()<BR>{<BR>var url =3D window.location.href;<BR>var
> prid=3D41;<BR>var
> strHref;<BR>{strHref=3D"framedescription.asp?frPrid=3D"+
>
>
prid;<BR><BR>parent.DescriptionFrame.document.location.href=3DstrHref;<BR
> >}<BR><BR>-------<BR><BR>Here's
> the problem. var prid=3D41 is up there just as a placeholder. It
> <BR>should be
> var prid=3DsendDesc<BR><BR>sendDesc is a variable created in ASP. Now,
> I have
> done my JavaScript <BR>homework, but I've forgotten it. Can anyone
> puuleeeaase
> assist with this? <BR>thanks.<BR><BR>Joe<BR><BR>---<BR>Change your
> mail
> options at <A
>
>
href=3D"http://p2p.wrox.com/manager.asp">http://p2p.wrox.com/manager.asp<
> /A> or
> <BR>to unsubscribe send a blank email to <A
>
> href=3D"mailto:$subst('Email.Unsub')">leave-asp_databas
> es-20631H@p...</A>.<BR></BLOCKQUOTE></BODY></HTML>
>
> ------=_NextPart_000_0007_01C19A11.CFDC3000--
>
Message #5 by Kyle Burns <kburns@c...> on Fri, 11 Jan 2002 12:35:04 -0500
|
|
You need to use inline code to include the value of your variable:
<SCRIPT LANGUAGE="javascript">
<!-- Hide from browsers that do not understand Javascript
function NavHelp()
{
HelpWindow=window.open("../helpnav.asp", "SuNavHelp",
"toolbar=0, width=500, height=300, resizable=1,
scrollbars=1, screenx=10, screeny=10");
}
function ReloadRightFrame()
{
var url = window.location.href;
var prid=<% =sendDesc %>;
var strHref;
{strHref="framedescription.asp?frPrid="+ prid;
parent.DescriptionFrame.document.location.href=strHref;
}
=================================
Kyle M. Burns, MCSD, MCT
ECommerce Technology Manager
Centra Credit Union
kburns@c...
>> -----Original Message-----
>> From: jmuldoon@q... [mailto:jmuldoon@q...]
>> Sent: Thursday, January 10, 2002 6:57 PM
>> To: ASP Databases
>> Subject: [asp_databases] Passing a number from ASP to JavaScript
>>
>>
>> Dallas Martin (are you out there, guy) gave me some
>> excellent code that
>> allows me to automatically change a right hand frame to
>> match the first
>> item in a list of paginated thumbnails.
>>
>> Response.write "<br>sendesc: " & sendDesc
>>
>>
>> %>
>>
>> <SCRIPT LANGAUGE="javascript">
>> <!-- Hide from browsers that do not understand Javascript
>> function NavHelp()
>> {
>> HelpWindow=window.open("../helpnav.asp", "SuNavHelp",
>> "toolbar=0, width=500, height=300, resizable=1,
>> scrollbars=1, screenx=10, screeny=10");
>> }
>> function ReloadRightFrame()
>> {
>> var url = window.location.href;
>> var prid=41;
>> var strHref;
>> {strHref="framedescription.asp?frPrid="+ prid;
>>
>> parent.DescriptionFrame.document.location.href=strHref;
>> }
>>
>> -------
>>
>> Here's the problem. var prid=41 is up there just as a
>> placeholder. It
>> should be var prid=sendDesc
>>
>> sendDesc is a variable created in ASP. Now, I have done my
>> JavaScript
>> homework, but I've forgotten it. Can anyone puuleeeaase
>> assist with this?
>> thanks.
>>
>> Joe
>>
>> $subst('Email.Unsub').
>>
|
|
 |