Passing array btween VBScript and javascript

Author Message
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)
0
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!
 
#1
    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)
    0
    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
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9