patrickd123
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 6/18/2008
-
Status: offline
|
Passing array btween VBScript and javascript
Wednesday, June 18, 2008 12:39 AM
( permalink)
Hi, I have an ASP page that should display placemarks stored in my sql database as a set of (latitude,longitude) Is it possible to pass an array between VBScript and javascript, because I only know how to invoke google map API from javascript. I then need to pass my set of points as a parameters to a javacript function that I would call from vbscript. Something like: <%@ Page Language="VB"%> <script runat="server"> ' Select placement from database to an array showplacemark(???????) </script> <html> <head> <script language="javascript" runat="server"> function showplacemark(???????) { for (???????) { var point = new GLatLng(?,?); map.addOverlay(new GMarker(point)); } } </script> </head> <body> </body> </html> Thanks!
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Passing array btween VBScript and javascript
Wednesday, June 18, 2008 1:37 AM
( permalink)
VBS:
Function CreateVBArray()
Dim i, j, k
Dim a(2, 2)
k = 1
For i = 0 To 2
For j = 0 To 2
a(j, i) = k
document.writeln(k)
k = k + 1
Next
document.writeln("<BR>")
Next
CreateVBArray = a
End Function
JS:
function VBArrayTest(vbarray)
{
var a = new VBArray(vbarray);
var b = a.toArray();
var i;
for (i = 0; i < 9; i++)
{
document.writeln(b[i]);
}
} Then just call: VBArrayTest(CreateVBArray());
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|