HELP .... javascript and ASP

Discussion in 'ASP General' started by Luc Dal, Feb 17, 2004.

  1. Luc Dal

    Luc Dal Guest

    Hello,

    I need your help : is it possible to call asp with javascript .If so, can
    you give me a sample ?
    And by the way, is it possible to call asp with javascript ?
    Thanks
    Luc Dal, Feb 17, 2004
    #1
    1. Advertising

  2. Luc Dal

    Roland Hall Guest

    "Luc Dal" wrote:
    : I need your help : is it possible to call asp with javascript .If so, can
    : you give me a sample ?
    : And by the way, is it possible to call asp with javascript ?

    You can write your code in javascript on the server side:
    <%@ LANGUAGE=Javascript %>

    You can use:
    <script language="javascript" runat="server">

    However, if you're referring to client-side javascript:
    <script type="text/javascript">

    ....then to call ASP, you will have to reload the current page or call
    another. If you want to pass variables, then you'll need to pass them
    through HTML forms with GET or POST or pass location.href with parameters on
    the URL, similar to GET.

    To call javascript from ASP, then embed the variables in the javascript code
    when you're writing your ASP code.

    Ex.

    <%
    dim a
    a = "a variable"
    %>
    <script type="text/javascript">
    alert('<%=a%>');
    </script>

    Or you can use Response.Write("<script type=""text/javascript"">" & vbCrLf)
    to write all of your client-side code to the page.

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 17, 2004
    #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. David Virgil Hobbs
    Replies:
    0
    Views:
    513
    David Virgil Hobbs
    Jan 6, 2004
  2. Replies:
    0
    Views:
    353
  3. francisco lopez
    Replies:
    2
    Views:
    264
    Hywel Jenkins
    Dec 30, 2004
  4. parez
    Replies:
    0
    Views:
    131
    parez
    Sep 11, 2007
  5. porter

    Javascript and IE? Javascript and C#?

    porter, Oct 5, 2007, in forum: Javascript
    Replies:
    6
    Views:
    284
    Thomas 'PointedEars' Lahn
    Oct 6, 2007
Loading...

Share This Page