473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Cross browser compatibility issue - JavaScript Array / ASP JS

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

Nov 30 '06 #1
2 2112
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/
Nov 30 '06 #2
Lee
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.
--

Nov 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Simba | last post by:
In some pages of my website I use a code like the following: for (var n = 0; n < getTagsArray("SPAN").length; n++){ //SPAN is just an example. I also use other tags tag =...
27
by: Alan Little | last post by:
If I load a JS file from a different domain, the browser requests it via HTTP, so I assume it sends any relevant cookie headers for that domain; why then can I not access them? E.g. suppose I have...
7
by: |{evin | last post by:
I'm currently working on what has turned in to something much larger that I wanted it to be. The upside is that I'm getting $$ to do it... but anywho. I currently have textboxes set up to...
17
by: Mark Rae | last post by:
Hi, I'm interested in your opinion concerning how far you would consider it necessary to code for cross-browser compatibility these days, especially for public-facing Internet sites... ...
150
by: tony | last post by:
If you have any PHP scripts which will not work in the current releases due to breaks in backwards compatibility then take a look at http://www.tonymarston.net/php-mysql/bc-is-everything.html and...
2
by: Lüpher Cypher | last post by:
Does anyone know of good links about cross-browser compatibility (html attributes/css2/javascript)? -- - lüpher --------------------------------------------- "Man sieht nur das, was man...
7
by: dejavue82 | last post by:
Dear Asp.net users, I have seen some people comment that their asp.net websites render differently with various web browsers. Are they doing somthing wrong? In particilar, 1) I am wondering...
15
by: CMM | last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My superiors have decided that it would be nice if we ensured the site worked on all the major platforms (as they see it: IE,...
27
by: David Golightly | last post by:
This is just a quick poll for all you web devs out there: What browsers do you test on/are concerned about compatibility with? Obviously, you're going to test on current-generation browsers such...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.