where to put javascript?

Discussion in 'ASP .Net Web Controls' started by rockdale.green@gmail.com, Jun 21, 2006.

  1. Guest

    I have an aspx file and a placeholder to dynamic load user defined
    webcontrols (ascx)

    in one one my user defined webcontrols, I need to call functions in my
    js file.
    I put the following line in my ascx but I kept getting error.

    <Script type='text/javascript' src='include/myjavascript.js'></Script>

    I do not want to put in the html header of my aspx file because other
    controls do not need those javascript functions.
    Is html header the only place that I can put javascript?
    What about <!--#include file=include\olap.js -->?
    Or any other approach to include this js file so that I can call its
    functions in my ascx?

    Thanks a lot
    -Rockdale
     
    , Jun 21, 2006
    #1
    1. Advertising

  2. Guest

    Never mind, the error is not caused by where the javascript put.

    wrote:
    > I have an aspx file and a placeholder to dynamic load user defined
    > webcontrols (ascx)
    >
    > in one one my user defined webcontrols, I need to call functions in my
    > js file.
    > I put the following line in my ascx but I kept getting error.
    >
    > <Script type='text/javascript' src='include/myjavascript.js'></Script>
    >
    > I do not want to put in the html header of my aspx file because other
    > controls do not need those javascript functions.
    > Is html header the only place that I can put javascript?
    > What about <!--#include file=include\olap.js -->?
    > Or any other approach to include this js file so that I can call its
    > functions in my ascx?
    >
    > Thanks a lot
    > -Rockdale
     
    , Jun 21, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eph0nk
    Replies:
    2
    Views:
    39,004
    Eph0nk
    Aug 6, 2003
  2. Jim Corey

    Where to put some javascript?

    Jim Corey, Jul 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    273
    Kevin Spencer
    Jul 2, 2004
  3. Jan Faerber
    Replies:
    6
    Views:
    360
    Jan Faerber
    Oct 11, 2004
  4. Ken Adams
    Replies:
    4
    Views:
    21,249
    David Dorward
    Mar 20, 2005
  5. Gabriel Rossetti
    Replies:
    3
    Views:
    577
    Jerry Hill
    Apr 25, 2008
Loading...

Share This Page