IE8 bug: An Unspecified error in main.js

3,071 views
Skip to first unread message

Nghi Nguyen

unread,
Jun 9, 2011, 4:29:33 AM6/9/11
to google-map...@googlegroups.com
Dear all,

Our application use https to request api:
 <script src="https://maps-api-ssl.google.com/maps/api/js?v=3.4&sensor=false&language=en" type="text/javascript"></script>

Error show on IE 8:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Thu, 9 Jun 2011 08:21:50 UTC


Message: Unspecified error.
Line: 27
Char: 56
Code: 0
URI: https://maps-api-ssl.google.com/intl/en_ALL/mapfiles/api-3/4/14/main.js


Its not easy to reproduce this bug. Some time it occur and sometime its not.

It also does not occur on Firefox or IE9.

I tested with version 3.3, 3.4.

Please help investigate it.


Thanks,
Andy Nghi

Rossko

unread,
Jun 9, 2011, 4:51:10 AM6/9/11
to Google Maps JavaScript API v3
> Please help investigate it.

How? We cannot see what you are doing. Sounds like a timing race
condition.

Nghi Nguyen

unread,
Jun 9, 2011, 4:53:27 AM6/9/11
to google-map...@googlegroups.com
I forgot add a note that this error cause map does not display controls (navigation bar, Map Type).

Cheers,
Andy Nghi

Chris Broadfoot

unread,
Jun 9, 2011, 6:30:53 AM6/9/11
to google-map...@googlegroups.com
Where?


Andy Nghi

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/ajnEJAQ53tYJ.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



--
http://twitter.com/broady

Dimitris Minas

unread,
Jul 6, 2011, 6:23:29 AM7/6/11
to Google Maps JavaScript API v3
I have the same problem.
I can run the application on Firefox, but NOT on IE 8.

Any solutuion????

On Jun 9, 9:29 am, Nghi Nguyen <andyn...@gmail.com> wrote:
> Dear all,
>
> Our application use https to request api:
>  <script src=
> "https://maps-api-ssl.google.com/maps/api/js?v=3.4&sensor=false&langua..."

Luke Mahé

unread,
Jul 6, 2011, 9:09:06 AM7/6/11
to google-map...@googlegroups.com
Can you supply a link?

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.

Dimitris Minas

unread,
Jul 6, 2011, 9:58:14 AM7/6/11
to Google Maps JavaScript API v3
Here is the code:



<!DOCTYPE html>
<html>
<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /
>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/
>
<title>Google Maps JavaScript API v3 Example: Fusion Tables Layer
Styling</title>
<link href="http://code.google.com/apis/maps/documentation/
javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/
js?sensor=false"></script>

<script type="text/javascript">

function initialize() {


var map_center = new google.maps.LatLng(39.876019,
-7.514648);


map = new
google.maps.Map(document.getElementById('map_canvas'), {
center: map_center,
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP

});

}

</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="height: 450px; width: 400px; margin:
15px"></div>

</body>
</html>



The problem is that when I use the name of the server (insted of
"localhost"), it doesnt display the map layer and navigation buttons.
But Only on IE8. On Firefox runs perfect.
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -
>
> - Show quoted text -

Rossko

unread,
Jul 6, 2011, 2:30:07 PM7/6/11
to Google Maps JavaScript API v3
> I have the same problem.

No you don't. You're not using HTTPS, you're not reporting an
'unspecified error' message, etc etc.
It's generally more helpful to start your own thread for your own new
problem rather than hijack other peoples threads.

> Here is the code:

It's not a link. It is very difficult to debug a code dump ; if you
make it easier for people to help you, you get the results you want.

> The problem is that when I use the name of the server (insted of
> "localhost"), it doesnt display

Even more reason to show us what you see directly.

Dimitris Minas

unread,
Jul 7, 2011, 10:25:18 AM7/7/11
to Google Maps JavaScript API v3
Yes, I am reporting an 'unspecified error' message!!!
On the 'main.js'.
I cannot provide the link because it is not on the internet, but on
the local network and is accesible only localy.
But I followed all that steps here (in the last reply) and seems to be
solved somehow:
http://answers.microsoft.com/en-us/ie/forum/ie8-windows_xp/domain-masking-fails-on-ie-8/4cabddf4-9cc4-4aca-b5f3-0735da822321

But now a new problem came out.

Message: Identifier, string or number expected
Line: 374

AND

Message: Object expected
Line: 528

And the worst is that there is not such number of lines. The last line
is 176!!!!

Rossko

unread,
Jul 7, 2011, 11:23:54 AM7/7/11
to Google Maps JavaScript API v3
> But now a new problem came out.

Then there us something else wrong. You won't show us the patient, so
it is still difficult to diagnose.

Dianne van Dulken

unread,
Jul 7, 2011, 11:57:27 AM7/7/11
to google-map...@googlegroups.com
I had something very similar with IE8.

I think it was the order that the dom was reading things.

Try, as a temp measure, copying main.js and including it in your local js file that you are using to call the map.

Pil

unread,
Jul 7, 2011, 1:28:23 PM7/7/11
to Google Maps JavaScript API v3


On Jul 7, 5:57 pm, Dianne van Dulken <dog...@gmail.com> wrote:

> Try, as a temp measure, copying main.js and including it in your local js
> file that you are using to call the map.

Thats no good idea because there are good reasons to load the API like
it's been developed to load: via bootstrap.

Try to fix HTML errors. Try to use the Error Console in Firefox, try
to debug your script in a normal browser.
After you think the whole thing is free of errors you can try an
'abnormal' browser.

If nothing helps try to upload your patient to an accessible host and
provide a link.

Sam Doyle

unread,
Jul 7, 2011, 1:43:28 PM7/7/11
to google-map...@googlegroups.com
Surely that'll essentially mean two loads of main.js causing errors

______________
Sam Doyle
@sam_doyle
--

Luke Mahé

unread,
Jul 7, 2011, 8:40:46 PM7/7/11
to google-map...@googlegroups.com
If you guys don't include a link then we can't help you.

And I wouldn't recommend taking a copy of main.js as you will most probably run into more problems.

-- Luke

Angile

unread,
Jul 13, 2011, 6:55:29 PM7/13/11
to Google Maps JavaScript API v3
I have the same issue using Polyline. Markers do appear but Polyline
don't. After a refresh (F5) the error is gone.

The issue appear on first load of the page and disapear after a page
refresh. (Unexpected error, line 34 carr 595 in main.js)

I also have this issue on other type of maps. Is it IE8 or API V3?

link:
http://angile.ca/test_sql.php
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

Luke Mahé

unread,
Jul 13, 2011, 7:42:57 PM7/13/11
to google-map...@googlegroups.com
I'm surprised a browser can even load that page. Try running it through a validator first to fix up your html - http://validator.w3.org/check?uri=http%3A%2F%2Fangile.ca%2Ftest_sql.php&charset=%28detect+automatically%29&doctype=Inline&group=0

But the main problem is that you're not waiting for the page to finish loading which can cause errors in IE8 because of the VML namespace which is used to draw Polylines.

You need to add an event listener to the window 'load' event or by adding a function to the body onload attribute. If you look at the source of http://code.google.com/apis/maps/documentation/javascript/examples/map-simple.html you can see a simple example that adds a function to the body onload.

Hope this helps.

-- Luke

Angile

unread,
Jul 25, 2011, 8:38:12 PM7/25/11
to Google Maps JavaScript API v3
Google map API V3, IE8, main.js unexpected error

I had this issue once; I have been searching to resolve this problem
for weeks.
I HAVE FUND THE SOLUTION!

Insert this code after:

<script language="javascript" src="http://maps.google.com/maps/api/js?
sensor=false"></script>
and before </head>

<script type="text/javascript">
function handleErr(msg, url, line_no)
{
errorMsg = "Error: " + msg + "\n";
errorMsg += "URL: " + url + "\n";
errorMsg += "Line: " + line_no + "\n\n";
alert(errorMsg);
return true;
}

onerror = handleErr;
function message(){ }
message();
</script>';

// This will "Suppress the Error" and pass thrue the bug

Ref: http://www.satya-weblog.com/2007/03/javascript-error-handling.html

On 9 juin, 04:29, Nghi Nguyen <andyn...@gmail.com> wrote:
> Dear all,
>
> Our application use https to request api:
>  <script src=
> "https://maps-api-ssl.google.com/maps/api/js?v=3.4&sensor=false&langua..."

Angile

unread,
Jul 26, 2011, 10:40:05 AM7/26/11
to Google Maps JavaScript API v3
I have forgotten to mention,

REPLACE alert(errorMsg);

FOR location.replace("your page.html"); // this will reload
your page until no error occur

Angile

unread,
Jul 26, 2011, 11:06:20 AM7/26/11
to Google Maps JavaScript API v3
Better: (for those who's pages have to be reloaded (F5) to repair the
main.js unexpected error

<script type="text/javascript">
function handleErr(msg, url, line_no){
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf("/") + 1);
errorMsg = "Error: " + msg + "\n";
errorMsg += "URL: " + url + "\n";
errorMsg += "Line: " + line_no + "\n\n";
//alert(errorMsg); // This will confirm the JS error
location.replace(sPage); // This will reload your page
return true;}
onerror = handleErr;
</script>

Rossko

unread,
Jul 26, 2011, 2:21:14 PM7/26/11
to Google Maps JavaScript API v3
> Better: (for those who's pages have to be reloaded (F5) to repair the
> main.js unexpected error

Better still, fix the error instead of trying to hide it. Can't
advise further, your page is no longer available.
Reply all
Reply to author
Forward
0 new messages