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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I execute a javascript in ASP. 1

Status
Not open for further replies.

ret

Programmer
Sep 28, 2000
6
US
I am trying to pass a error message from ASP than execute a javascript to display the error message.

Can I do this? [sig][/sig]
 
The practice is to write your ASP(or vbscript) to include the proper message in your javascript app.

The server then will in theory :

1: select the correct alert() message
2: compile creating the alert(message) statement in the proper formatting
3: All HTML and JavaScript is them passed to the users browser for processing and alert. [sig][/sig]
 
just like so:

<script>
alert(&quot;<%=errormess%>&quot;)
</script>

where errormess was calculated above...


jaredn
jared@aauser.com
 
I tried this small test and it does not seem to work.

<%
dim asptemp
asptemp = &quot;hello&quot;
%>

<script language=&quot;Javascript&quot;>
var jstemp;
jstemp = '<%=asptemp%>';
alert(jstemp);
</script> [sig][/sig]
 
Your example worked for me (it should work for you). Did you execute the .asp via a http call or simply try to double click on the asp file (that won't work)

Later, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
That's my problem.

Thanks very much Rob [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top