SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: ASP/jscript

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Egypt
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP/jscript

    Good morning everybody,

    I use a piece of jscript (asp codeded in jscript) that connects to database and retrieves some info from it and it has worked perefectly but a certain problem emerged and blocked me when I wanted to mix the jscript with the rest of My ASP application which is:

    "to write jscript, the @language must be set to javascript and since this line must be at the head of page and I call the script in all pages of my ASP application therefore this results in enforcing me to code the asp of the whole application in jscript which I can not do it".

    So I tried to play around it by using:
    <script language ='javascript' runat = server> and it worked but it is exceuted before any html tages and before any asp code written in <% %> which resulted in a unproperly layout.

    So I tried to put the jscript in an external js file and tried by different ways to call it in the asp page but the menu has not retrieved any items from the db, I tried the following:
    -------First trial:----------------------
    I tried to include it as a server side scripting file but it did not work
    <!--#include file ="pro.js"-->
    --------------------------------------------
    -------Second trial:------------------
    <!--#include file ="/pro.js"-->
    </script>
    -------------------------------------------
    -------Third trial:------------------
    </script>

    -------------------------------------------
    Result of all trials:
    The page does not display an error - sometimes says "Done but with errors" - and always the menu has not retrieved any items from the db

    I have tried all known ways to me, do you have any other way except the @language ='jscript' command line because it enforces the whole appllication to be written in _jscript and please notice that the "runat =server" solution is not appllicable too because it messes the layout.

    Please help

    Thanks to you

    Rasha zaki

    __________________________________________________

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why don't you mix the headers?

    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

    JScript coding

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    vb script coding

    Not sure whether it would work, but could be something to try.

    Gav


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •