...

View Full Version : javascript:void(0) issues ie



xpdesigns
12-28-2011, 11:28 PM
I am having trouble with javascript:void(0) when using IE

The website URL is: http://gerritygroup.com.s136675.gridserver.com/properties/felicita-town-center.html

When you click on the map link it should open up the map on the same page but instead it shows an empty white box. For whatever reason it wont open the imbed map code when using javascript:void(0) in my a tag.

This site was built in MODX and seems to be working fine in all other browsers. Firefox, Safari and Chrome.

Please let me know if you have any other ideas that will get this map opening again in IE.

xelawho
12-28-2011, 11:57 PM
you can change the href to
a href="#"

but firebug says that the function ChangeLoc is not defined, but I could not find it anywhere... (and I suspect that IE is complaining about that, too).

I would try removing that onclick. The pictures link seems not to need it, so I suspect it is being assigned elsewhere

xpdesigns
12-29-2011, 02:08 AM
Thank you for your post,

Unfortunately if I use href="#" MODX will try to open it open in a completely new window when it refreshes the page. I used that javascript:void(0) script so that it wouldn't do that.

I took the onclick out but am still seeing the same issue in IE.

I'll also post this on the MODX forums and see if I can find a solution.. Thank you again for your help.

Old Pedant
12-29-2011, 02:17 AM
Instead of void(0), try just <a href="javascript: return false;">

void(0) should have worked, but then again this is MSIE.

xelawho
12-29-2011, 02:42 AM
[edit]: another silly idea. I'm giving up for the day :rolleyes:

Philip M
12-29-2011, 08:31 AM
Instead of void(0), try just <a href="javascript: return false;">

void(0) should have worked, but then again this is MSIE.

In my experience void(0) works fine in IE. I suspect there is some other problem which is exposed only in IE.

xpdesigns
12-29-2011, 05:55 PM
Thank you Everyone for your response,

This seems to have worked in IE9 so I am assuming it should work in IE7 and IE8

<a href="javascript: return false;">


I'll let you know what I come up with. Thanks again!!

hdewantara
12-29-2011, 06:11 PM
Hi xpdesigns,

My IE8 also shows an empty white box for the map. But when I have right-clicked and reload this white box just once, I could play click-clack with your "Pictures|Map" navigation.

I would think this as a bug in IE8, since that Google Map iframe should have been loaded the first time.

DanInMa
12-29-2011, 06:16 PM
well, since your using jQuery already, you could also change


function tab() {
$('.tab a').click(function() {
$(this).addClass('active').siblings('a').removeClass('active');
$(this).parent().siblings('.content').children('.item').eq($(this).index()).show().siblings().hide() ;
});
}

to this:


function tab() {
$('.tab a').click(function(e) {
e.preventDefault();
$(this).addClass('active').siblings('a').removeClass('active');
$(this).parent().siblings('.content').children('.item').eq($(this).index()).show().siblings().hide() ;
});
}

and simply use href="#"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum