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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John MacIntyre

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

    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=javasc ript 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



    ---------------------------
    T.asp
    ---------------------------
    <%@ Language=VBScri pt %>
    <html>
    <script language=javasc ript runat=server src="T.js"></script>
    <script language=javasc ript runat=server>
    function local_calcTotal ( nA, nB)
    {
    return (nA + nB);
    }
    </script>
    <body>
    <%=now()%></P>
    local calc : <%=local_calcTo tal( 2, 2)%></P>
    remote calc : <%=remote_calcT otal( 2, 2)%></P>
    </body>
    </html>

    -----------------------
    T.js
    -----------------------
    function remote_calcTota l( nA, nB)
    {
    return (nA + nB);
    }


  • Lasse Reichstein Nielsen

    #2
    Re: Problem with &lt;script&g t; tag using runat=server and src attributes

    "John MacIntyre" <Please@reply.t o.group.thx> writes:
    [color=blue]
    > 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.[/color]

    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.microso ft.com/default.aspx?sc id=http://support.microso ft.com:80/support/kb/articles/Q224/9/63.ASP&NoWebCon tent=1>

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

    Comment

    Working...