Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying the following code and k

Status
Not open for further replies.

gearheadgood

Programmer
Dec 12, 2003
8
US
I'm trying the following code and keep getting a syntax error in the first line:


var qstr = <%=crReportID%>;
locstr = &quot;LaunchReport.asp?ReportID=&quot; + qstr
windowprops = &quot;fullscreen=no,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes&quot;;
reportWindow=window.open(locstr,&quot;rptWindow&quot;,windowprops);

Any clues ?

tia,
GearHead
 
I would do an alert to make sure you are getting a value for crReportID.


alert('<%=crReportID%>');
 
Is qstr supposed to be a string? If so make sure you encapsulate it in quotes:
Code:
var qstr =
Code:
&quot;
Code:
<%=crReportID%>
Code:
&quot;
Code:
;


-kaht

banghead.gif
 
crReportID is a variable created in my ASP code. It is an integer derived from the query string.

I tried the quotes but it did not work !
 
Look at the &quot;view source&quot; after the page loads and see what exactly is being passed to that line. If all you're getting is a syntax error it shouldn't be that hard to debug. If you're still having problems post a copy of the function from the &quot;view source&quot; that the page generates.

-kaht

banghead.gif
 
Here is the function from the &quot;view source&quot;

function page_OnLoad()
{
var result;
var qstr = <%=crReportID%>;
locstr = &quot;LaunchReport.asp?ReportID=&quot; + qstr;
windowprops = &quot;fullscreen=no,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes&quot;;
reportWindow=window.open(locstr,&quot;rptWindow&quot;,windowprops);
return result;
}
 
That's not possible, if that was from the &quot;view source&quot; the asp reference to crReportID would have evaluated to whatever was in that variable instead of you seeing <%=crReportID%>

-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top