• JAVA and ASP

    Author
    Topic
    #364471

    How do I use JAVA script on an ASP page. Looking in the book I think I have to use the tags tags.

    Looking at several books I am not exactly sure how to do it. The script behind what I have been working on is called navcond.js.

    Thank you. Fay

    Viewing 0 reply threads
    Author
    Replies
    • #559882

      You can use JavaScript in an ASP page, but not a JAVA applet, because the page is executed on the server, not in the browser. The ASP DLL expects pages to be written in VBScript by default. To incorporate JavaScript into the page, you have several options:

      (1) Change the default language to java script: in the first line of the .ASP file, put:

      (2) Put your server-side code in tags with the RUNAT attribute = Server:

      According to one page at MS, the JScript portions will be interpreted before the VBScript portions when you do this (“the code is executed in the following order: Script blocks in non-default languages are executed in order of appearance, then the inline code, and finally the script blocks in the default language”). Writing Procedures

      (3) Use a server-side include (I have never done this, but you can read up on it on ASP sites).

      But if you are trying to pass the code (or include) through to the page that the user loads, rather than executing it in advance, then you do not want (1) or (2). You want to use the same script include you would use in an HTML page; because it does not have the RUNAT=SERVER attribute, it will simply be coded into the page delivered to the user’s browser. Does this make sense?

    Viewing 0 reply threads
    Reply To: JAVA and ASP

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: