Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    javascript:void(0) issues ie

    I am having trouble with javascript:void(0) when using IE

    The website URL is: http://gerritygroup.com.s136675.grid...wn-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.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,969
    Thanks
    56
    Thanked 557 Times in 554 Posts
    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

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,537
    Thanks
    77
    Thanked 4,381 Times in 4,346 Posts
    Instead of void(0), try just <a href="javascript: return false;">

    void(0) should have worked, but then again this is MSIE.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    xpdesigns (12-29-2011)

  • #5
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,969
    Thanks
    56
    Thanked 557 Times in 554 Posts
    [edit]: another silly idea. I'm giving up for the day
    Last edited by xelawho; 12-29-2011 at 01:44 AM. Reason: silliness

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by Old Pedant View Post
    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.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #7
    New Coder
    Join Date
    May 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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!!

  • #8
    Regular Coder hdewantara's Avatar
    Join Date
    Aug 2009
    Location
    Jakarta, Indonesia.
    Posts
    354
    Thanks
    9
    Thanked 52 Times in 51 Posts
    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.

  • #9
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    well, since your using jQuery already, you could also change

    Code:
    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:

    Code:
    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="#"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •