By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,946 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,946 IT Pros & Developers. It's quick & easy.

Problem with <script> tag using runat=server and src attributes

P: n/a
Hi,

I am having a problem executing server side javascript.

For some reason the script tag is ignored when the runat=server is combined
with the src attribute. The code is being used client side also, so
embedding it right into the page is not an option.

I have also tried the following code without success.
<script language=javascript runat=server>
<!-- #include file="T.js" -->
</script>

The problem is issolated in the following example.

Thanks in advance.,
John MacIntyre
VC++ / VB / ASP / Database Developer
http://www.johnmacintyre.ca
---------------------------
T.asp
---------------------------
<%@ Language=VBScript %>
<html>
<script language=javascript runat=server src="T.js"></script>
<script language=javascript runat=server>
function local_calcTotal( nA, nB)
{
return (nA + nB);
}
</script>
<body>
<%=now()%></P>
local calc : <%=local_calcTotal( 2, 2)%></P>
remote calc : <%=remote_calcTotal( 2, 2)%></P>
</body>
</html>

-----------------------
T.js
-----------------------
function remote_calcTotal( nA, nB)
{
return (nA + nB);
}
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"John MacIntyre" <Pl****@reply.to.group.thx> writes:
I am having a problem executing server side javascript.

For some reason the script tag is ignored when the runat=server is combined
with the src attribute. The code is being used client side also, so
embedding it right into the page is not an option.


I don't believe earlier ASP versions works with src attributes on its
script tags, but IIS 5.0 should accept it.

<URL:http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q224/9/63.ASP&NoWebContent=1>

/L 'No, I didn't know that, but Google did.'
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.