Cross browser compatibility issue - JavaScript Array / ASP JS

Discussion in 'Javascript' started by dwair, Nov 30, 2006.

  1. dwair

    dwair Guest

    Hi, I have been having browser compatibility issues and was wondering
    if anyone could help.
    I have been using a JavaScript array to populate marker data using ASP
    JS in a google Maps project. For some reason the code works fine in
    FireFox but not in Internet
    Explorer (Run time error - expected ']' and 'markers' is undefined)
    Any help would be gratefully received

    --------------------------------------------------
    <script type="text/javascript">
    // get data from the db and plot the makers
    var markers = [
    <%while (!rstPropPoints.EOF){%>
    {
    'latitude':
    <%=rstPropPoints.Fields.Item("lat").Value%>,
    'longitude':
    <%=rstPropPoints.Fields.Item("long").Value%>,
    'propname':
    '<%=rstPropPoints.Fields.Item('propname').Value%>',
    'text': '<%=rstPropPoints.Fields.Item('text').Value%>',
    'image':
    '<%=rstPropPoints.Fields.Item('image').Value%>',
    'type':
    '<%=rstPropPoints.Fields.Item('sleeps').Value%>',
    },
    <%rstPropPoints.MoveNext();}rstPropPoints.Close();%>
    ];
    </script>
    ----------------------------------------------------

    thanks - Hugh
     
    dwair, Nov 30, 2006
    #1
    1. Advertising

  2. dwair wrote:
    > Hi, I have been having browser compatibility issues and was wondering
    > if anyone could help.
    > I have been using a JavaScript array to populate marker data using ASP
    > JS in a google Maps project. For some reason the code works fine in
    > FireFox but not in Internet
    > Explorer (Run time error - expected ']' and 'markers' is undefined)


    Have you checked the code that arrives at IE? Is that syntatically
    correct? Showing us the ASP code makes it hard for us to find the syntax
    error.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Nov 30, 2006
    #2
    1. Advertising

  3. dwair

    Lee Guest

    dwair said:
    >
    >Hi, I have been having browser compatibility issues and was wondering
    >if anyone could help.
    >I have been using a JavaScript array to populate marker data using ASP
    >JS in a google Maps project. For some reason the code works fine in
    >FireFox but not in Internet
    >Explorer (Run time error - expected ']' and 'markers' is undefined)
    >Any help would be gratefully received
    >
    >--------------------------------------------------
    ><script type="text/javascript">
    >// get data from the db and plot the makers
    >var markers = [
    ><%while (!rstPropPoints.EOF){%>
    > {
    > 'latitude':
    ><%=rstPropPoints.Fields.Item("lat").Value%>,
    > 'longitude':
    ><%=rstPropPoints.Fields.Item("long").Value%>,
    > 'propname':
    >'<%=rstPropPoints.Fields.Item('propname').Value%>',
    > 'text': '<%=rstPropPoints.Fields.Item('text').Value%>',
    > 'image':
    >'<%=rstPropPoints.Fields.Item('image').Value%>',
    > 'type':
    >'<%=rstPropPoints.Fields.Item('sleeps').Value%>',
    > },
    ><%rstPropPoints.MoveNext();}rstPropPoints.Close();%>
    > ];
    ></script>
    >----------------------------------------------------


    It's going to be easier to spot the problem looking at the actual
    generated code, rather than the ASP. Since there's probably too
    much to look at easily, see if generating only the first half
    reproduces the error, and so on until you've identified the
    smallest amount of generated code that reproduces it and take a
    look at that, and/or post it or a link to it.


    --
     
    Lee, Nov 30, 2006
    #3
    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. Replies:
    7
    Views:
    11,958
    Juan T. Llibre
    Mar 15, 2006
  2. =?Utf-8?B?cHJvZl9tYXJ0aW4=?=

    Cross-browser compatibility of Asp.net v.1.1 & 2.0

    =?Utf-8?B?cHJvZl9tYXJ0aW4=?=, Apr 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,639
    Juan T. Llibre
    Apr 25, 2006
  3. jb
    Replies:
    16
    Views:
    722
    Toby A Inkster
    Dec 8, 2003
  4. Sally Thompson
    Replies:
    8
    Views:
    579
    Sally Thompson
    Jun 19, 2004
  5. tom
    Replies:
    46
    Views:
    1,313
Loading...

Share This Page