[Mapserver-users] ASP Programming

Ed McNierney ed@topozone.com
Thu, 15 May 2003 14:44:36 -0400


Yvette -

It works just fine, but you need to understand what's happening where and when.  The VBScript code on your ASP page will be executed on the SERVER, as the output page is being generated.  The JavaScript will be written to the output page, where it's going to be executed inside the BROWSER at the client, after the server's all done and gone on to other things.

For example, the following code:

function go () {
<% for i = 1 to 5 %>
   alert ('The number is <% =i %>');
<% next %>
}

will execute the ASP code on the server, causing the following JavaScript to be written to the client:

function go () {
  alert ('The number is 1');
  alert ('The number is 2');
  alert ('The number is 3');
  alert ('The number is 4');
  alert ('The number is 5');
}

which, if and when that function is executed on the client, will cause five alerts to pop up.

Please do not think that the JavaScript, when executed, can then cause VBScript on the same page to be executed by the SERVER - that's not possible.  The server generates the page FIRST, then the client gets it and can interpret it anyway it likes.  The client cannot "interact" with the server on the same page - although the JavaScript code could open a new ASP page in the same or different window.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed@topozone.com
(978) 251-4242 
-----Original Message-----

From: Hurtubise, Yvette [mailto:Hurtubise@chilliwack.com]
Sent: Thursday, May 15, 2003 2:22 PM
To: mapserver-users@lists.gis.umn.edu
Subject: [Mapserver-users] ASP Programming


Has anyone had success using ASP script inside of JavaScript?

ex.
    function go(){
	<% FOR i = 1 to 2 %>
		...
	<%NEXT%>
   }

I have read that this is possible, but I have not been able to implement it successfully

Can anyone help with this?

Yvette

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users