[thelist] how to gen included client-side javascript from ASP?

James Aylard evolt at pixelwright.com
Wed Jan 7 17:22:14 CST 2004

Glenn Carr wrote:

> I want to
> be able to generated the client-side script from server script.  This
> only displays output from the first two script tags, nothing is
> produced from the third.  What am I missing?
> <script language="JavaScript" type="text/javascript"
> src="test_client_script.asp"></script>
> test_client_script.asp:
> ---
> <%
> Response.Write( "document.write( '<b>from generated script</b>' );" )
> %>

    This should work, and did in a simple test that I created. Technically,
you should add Response.ContentType = "text/javascript" at the beginning of
your asp file, although IE doesn't get tripped up by its absence. What
browser are you using to test this? Also, I assume that your server is
capable of parsing asp, correct?

James Aylard

More information about the thelist mailing list