"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