<%@ Language="JAVASCRIPT" %> exists?

Discussion in 'ASP General' started by John Davis, Aug 26, 2003.

  1. John Davis

    John Davis Guest

    Just wonder if <%@ Language="JAVASCRIPT" %> exists??

    Since JavaScript is used in client-side scripting, but <% ... %> is used in
    server-side scripting. It sounds doesn't make sense. But I saw that in a ASP
    test question before.


    The question is like this:
    How can you script your ASP code in JavaScript?
    The answer is: <%@ Language="JAVASCRIPT" %>


    please advice. Thanks!
    John
     
    John Davis, Aug 26, 2003
    #1
    1. Advertising

  2. hi,

    you can use jscript (ms implementation of javascript) server side.
    just have to define it in the global asa as you did and in the site
    properties as default server side scripting language.
     
    Martin CLAVREUIL, Aug 26, 2003
    #2
    1. Advertising

  3. John Davis

    John Davis Guest

    Bob,

    In internet development, can i conclude....

    In client-side scripting, we can use JavaScript or VBScript, but JavaScript
    is a better choice.
    In server-side ASP scripting, we can use VBScript or JScript (server-side
    JavaScript??), but VBScript is a better choice

    John

    "Bob Barrows" <> wrote in message
    news:OD$...
    > John Davis wrote:
    > > Just wonder if <%@ Language="JAVASCRIPT" %> exists??
    > >

    > Of course it does!
    >
    >
    > > Since JavaScript is used in client-side scripting,

    >
    > VBScript and Javascript can BOTH be used in client-side scripting,

    provided
    > the browser being used supports them. IE will support both (actually, IE
    > supports JScript which is slightly different from JavaScript). Other
    > browsers may not support client-side vbscript, so for internet

    development,
    > client-side vbscript is usually avoided.
    >
    > > but <% ... %> is
    > > used in server-side scripting.

    >
    > Irrelevant
    >
    > > It sounds doesn't make sense. But I
    > > saw that in a ASP test question before.

    >
    >
    > ASP is not a language: it is more of a platform on which several scripting
    > languages can be used, including both vbscript and javascript.
    >
    > HTH,
    > Bob Barrows
    >
    >
     
    John Davis, Aug 26, 2003
    #3
  4. > In client-side scripting, we can use JavaScript or VBScript, but
    JavaScript
    > is a better choice.


    JavaScript is essentially the only choice, unless you want to limit your
    audience to Internet Explorer (no other mainstream browsers support
    client-side VBScript).

    > In server-side ASP scripting, we can use VBScript or JScript (server-side
    > JavaScript??), but VBScript is a better choice


    I don't believe there is a universally better choice. This is more like
    Pepsi vs. Coke. See http://www.aspfaq.com/2176
     
    Aaron Bertrand - MVP, Aug 26, 2003
    #4
  5. John Davis

    Ray at Guest

    I'm not Bob, but I will answer anyway.

    "John Davis" <> wrote in message
    news:...
    > Bob,
    >
    > In internet development, can i conclude....
    >
    > In client-side scripting, we can use JavaScript or VBScript, but

    JavaScript
    > is a better choice.


    Yes

    > In server-side ASP scripting, we can use VBScript or JScript (server-side
    > JavaScript??), but VBScript is a better choice


    This is personal preference. There are pros and cons to both VB Script and
    JScript.

    Ray at work
     
    Ray at, Aug 26, 2003
    #5
  6. John Davis

    Bob Barrows Guest

    John Davis wrote:
    > Bob,
    >
    > In internet development, can i conclude....
    >
    > In client-side scripting, we can use JavaScript or VBScript, but
    > JavaScript is a better choice.


    Essentially, yes. In my intranet apps, where the client is ALWAYS using IE,
    I use vbscript almost exclusively because I'm more familiar with it. If I
    was writing internet apps, I would take the trouble to familiarize myself
    with javascript.

    > In server-side ASP scripting, we can use VBScript or JScript
    > (server-side JavaScript??), but VBScript is a better choice
    >

    There is no "better choice". Both are "equally" supported. It's all in what
    you're familiar with. For example, the javascript array object has some very
    useful methods and properties that are not provided by vbscript arrays.
    However, vbscript has multi-dimensional arrays, which many of us use quite
    often, and which are not available in javascript. So there are trade-offs.
    It's up to you.

    Bob Barrows
     
    Bob Barrows, Aug 26, 2003
    #6
  7. John Davis

    Bob Barrows Guest

    Dave Anderson wrote:
    >
    > I have long felt that it is short-sighted to write for only one
    > browser. It certainly isn't difficult to write to commonly
    > implemented standards. This episode vindicated my persistence in
    > pressing team standards for browser compatibility in our web apps.
    > And yes, I have had to fight the "but we control the desktop"
    > argument all the way.
    >

    Thanks. Good food for thought.

    Bob
     
    Bob Barrows, Aug 27, 2003
    #7
    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. Replies:
    8
    Views:
    16,162
    catherine sea
    Oct 26, 2010
  2. Totan
    Replies:
    0
    Views:
    1,030
    Totan
    Apr 17, 2006
  3. Ulf Meinhardt
    Replies:
    8
    Views:
    6,211
  4. Daniel Borden
    Replies:
    3
    Views:
    126
    Warren Sarle
    Nov 10, 2003
  5. newcomer

    Check if file exists in Javascript

    newcomer, Mar 4, 2004, in forum: Javascript
    Replies:
    3
    Views:
    257
    Reply Via Newsgroup
    Mar 4, 2004
Loading...

Share This Page