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

J

John MacIntyre

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>
 
L

Lasse Reichstein Nielsen

John MacIntyre said:
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/defaul...port/kb/articles/Q224/9/63.ASP&NoWebContent=1>

/L 'No, I didn't know that, but Google did.'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top