Damn IE - can anyone see why this won't work?

78 views
Skip to first unread message

Andy Newby

unread,
Oct 5, 2011, 1:01:46 PM10/5/11
to google-map...@googlegroups.com
Hi guys,

Sorry, I've just about had it with IE :(

http://www.chambresdhotes.org/cgi-bin/links/page.cgi?g=Google_Maps&t=espanol&q=Paris&radiusSelect=30

Works fine in FF, Chrome, Safari, IE 9 and IE 10 - yet won't work in IE 7 or 8! I get an error, but cos I'm testing it in a program called "IETester", I don't actually have a proper way to view the javascript its moaning at.

Does anyone have a copy of IE 7 or IE 8, which they can run that page on, and tell me the errors they see?

BTW: Its not the google maps bug, which I'm assuming someone is aware about already:

http://gossamerlinks.com/maps_error.png

The error I'm refering to is when you click on "Contact Propertie"

http://gossamerlinks.com/proper_error.png

It drives me NUTS how crappy IE's debugging tools are for Javascript and what-not. At least IE 9 and 10 are better - but we still have to code for those using older versions :(

TIA to anyone who can take a peek

Andy

Joseph Elfelt

unread,
Oct 5, 2011, 2:32:12 PM10/5/11
to Google Maps JavaScript API v3
IE8:
Unknown runtime error page.cgi?
g=Google_Maps&t=espanol&q=Paris&radiusSelect=30, line 254 character 2

HTH

Rossko

unread,
Oct 5, 2011, 3:10:42 PM10/5/11
to Google Maps JavaScript API v3
> Sorry, I've just about had it with IE :(
>
> http://www.chambresdhotes.org/cgi-bin/links/page.cgi?g=Google_Maps&t=...

Browsers react differently to invalid HTML
Try your page at http://validator.w3.org/

There's a problem with the doctype

There is a serious problem with the structure - two <head> tags

Most of the other error reports are follow-ons from the failed
doctype, fix that and see what's left.

Andy Newby

unread,
Oct 6, 2011, 3:21:51 AM10/6/11
to google-map...@googlegroups.com
Hi,

Thanks. Whats wrong with the doctype?

Cheers

Andy


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
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.




--
Andy Newby
an...@ultranerds.co.uk

Andy Newby

unread,
Oct 6, 2011, 3:57:02 AM10/6/11
to google-map...@googlegroups.com
Hi,

Mmm ok, well I've "cleaned" up the template now (its a re-design of the existing site, but using CSS instead of horrible tables ;)). However, that still doesn't seem to have fixed the issue : ( I'm still getting an error about line 231 , which is a bit of a sod :(

Cheers

Andy
--
Andy Newby
an...@ultranerds.co.uk

Andy Newby

unread,
Oct 6, 2011, 4:47:42 AM10/6/11
to google-map...@googlegroups.com
Man, this is screwed up :(

The code that shows the "AJAX loading" image, is this:

    function getData2(dataSource, divID, ID) {
        alert("HERE NEW 1");
        go2ByScroll("anch" + ID);
        jQuery('#' +divID).html("<img src='/links/static/ajax-loader.gif'>");
        var the_url = dataSource + ";divID=" + divID;
        jQuery.ajax({
          url: the_url,
          success: function(data){
            document.getElementById(divID).innerHTML = data;
          }
        });   
    }         

When you click the "Contact Propertie" button, it must be calling that function - as the image gets shown, using:

        jQuery('#' +divID).html("<img src='/links/static/ajax-loader.gif'>");

I've verified that its indeed using this, by changing it to:

        jQuery('#' +divID).html("TEST <img src='/links/static/ajax-loader.gif'>");

..and sure enough, when I click the Contact button, it comes up with "TEST" and then the "ajax loading" image.

But what I don't get, is why oh why its neglecting to run other parts of the code. If I change that function to just:

    function getData2(dataSource, divID, ID) {
        alert("HERE NEW 1");
        jQuery('#' +divID).html("<img src='/links/static/ajax-loader.gif'>");
    }

..again, the image is shown - but no "alert" comes up. I'm really pulling my hair out on this one :( Any suggestions are much appreciated!

Cheers

Andy
--
Andy Newby
an...@ultranerds.co.uk

Rossko

unread,
Oct 6, 2011, 4:51:49 AM10/6/11
to Google Maps JavaScript API v3
> Thanks. Whats wrong with the doctype?

It doesn't have one at all now. Google do recommend one
http://code.google.com/apis/maps/documentation/javascript/tutorial.html#HTML5
it does help to get consistent layout across browsers.

Andy Newby

unread,
Oct 6, 2011, 4:57:05 AM10/6/11
to google-map...@googlegroups.com
Hi,

Thanks. I've tried changing to just:

<!DOCTYPE html>

...but I still get an error about main.js: (and the "contact propertie" button still doesn't work)

Line: 27
Char: 56
Error:
Code: 0
URL: http://maps.gstatic.com/intl_en_gb/mapfiles/api-3/5/16/main.js

As always, IE is very helpful with providing a useful error message :*(

Cheers

Andy

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
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.




--
Andy Newby
an...@ultranerds.co.uk

davie strachan

unread,
Oct 6, 2011, 6:03:25 AM10/6/11
to Google Maps JavaScript API v3
Hi
Know DA about jQuery
But normally errors show up not on the line indicated but earlier on


22 jQuery(document).ready(function() {
23 jQuery('#toggleButton').click(function() {
24 if (jQuery('#toggleSection').is(":hidden"))
25 {
26 jQuery('#toggleSection').slideDown("slow");
27 } else {
28 jQuery('#toggleSection').slideUp("slow");
29 }
30 });
31 });


On Oct 6, 9:57 am, Andy Newby <andy.ne...@gmail.com> wrote:
> Hi,
>
> Thanks. I've tried changing to just:
>
> <!DOCTYPE html>
>
> ...but I still get an error about main.js: (and the "contact propertie"
> button still doesn't work)
>
> Line: 27
> Char: 56
> Error:
> Code: 0
> URL:http://maps.gstatic.com/intl_en_gb/mapfiles/api-3/5/16/main.js
>
> As always, IE is very helpful with providing a useful error message :*(
>
> Cheers
>
> Andy
>
>
>
>
>
>
>
>
>
> On Thu, Oct 6, 2011 at 9:51 AM, Rossko <ros...@culzean.clara.co.uk> wrote:
> > > Thanks. Whats wrong with the doctype?
>
> > It doesn't have one at all now.  Google do recommend one
>
> >http://code.google.com/apis/maps/documentation/javascript/tutorial.ht...
> > it does help to get consistent layout across browsers.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > 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.
>
> --
> Andy Newby
> a...@ultranerds.co.uk

davie strachan

unread,
Oct 6, 2011, 6:12:17 AM10/6/11
to Google Maps JavaScript API v3
Sorry about that
As I was saying the line showing the error is normally a line earlier
in the programme.
Looking at your code I see line 24 shows ":hidden" whereas lines 26
and 27 show "slow"
As I said I know DA about jQuery but is the : required

Must look into jQuery at come time but I am still struggling with ASP
vaguaries
Regards Davie

Andy Newby

unread,
Oct 6, 2011, 6:35:21 AM10/6/11
to google-map...@googlegroups.com
Hi,

Thanks for the reply. Unfortunatly, thats not it:

http://api.jquery.com/slideDown/

As you can see, the format we have is correct:

$('#clickme').click(function() {
   $('#book').slideDown('slow', function() {
     // Animation complete.
   });
});

..or the simpler version:

$('#clickme').click(function() {
    $('#book').slideDown('slow');
});

...really baffled as to whats going on here :(

Andy
an...@ultranerds.co.uk

davie strachan

unread,
Oct 6, 2011, 10:01:25 AM10/6/11
to Google Maps JavaScript API v3
Hi
Have you seen Additional Notes: in http://api.jquery.com/hidden-selector/
As I said earlier over the past 30 years I have been programming most
of the error messages give a line further on from the actual error.
This is because javascript is an interpreted language and the
interpreter may not fail on the actual line. As the different browsers
use different interpreters some may not show errors at all.
The actual error may be several lines prior to the interpreter failing
in IE
Regards Davie


On Oct 6, 11:35 am, Andy Newby <andy.ne...@gmail.com> wrote:
> Hi,
>
> Thanks for the reply. Unfortunatly, thats not it:
>
> http://api.jquery.com/slideDown/
>
> As you can see, the format we have is correct:
>
> $('#clickme').click(function() {
>    $('#book').slideDown('slow', function() {
>      // Animation complete.
>    });
>
> });
>
> ..or the simpler version:
>
> $('#clickme').click(function() {
>     $('#book').slideDown('slow');
>
> });
>
> ...really baffled as to whats going on here :(
>
> Andy
>
> a...@ultranerds.co.uk

Andy Newby

unread,
Oct 6, 2011, 10:04:59 AM10/6/11
to google-map...@googlegroups.com
Hi,

I'm kinda getting there. It turns out that GMaps doesn't like the jQuery function of css() . I changed that to use height() instead (to set the div height), and that works. Still getting a weird one though (I've posted this on the jQuery forum too);

http://forum.jquery.com/topic/weird-issue-in-ie-8-with-html

Seems like it doesn't wanna work with certain charachters/strings. I've tested it using innerHTML, as well as the html() function in jQuery... both fail the same way in IE 8

I will LOVE the day when browsers are cross compatible... although I doubt I will see it in my lifetime ;)

Cheers

Andy
an...@ultranerds.co.uk

Andy Newby

unread,
Oct 6, 2011, 1:43:55 PM10/6/11
to google-map...@googlegroups.com
Wow, that was a sod to catch. It turns out the AJAX content being returned had an extra </div> in it... which was causing it for some reason to not work with the html() and innerHTML functions of Javascript.

Just in case anyone else comes across the problem in the future ;)

Thanks for the replies though guys

Andy
--
Andy Newby
an...@ultranerds.co.uk
Reply all
Reply to author
Forward
0 new messages