SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Return False not working in IE

    Hi,
    Check out this page guys http://www.oxygen.com/DifferentWorld/

    The "View All Show Times" href should toggle a show/hide div. All of sudden, it's not working IE 6 (FireFox and IE 7 work fine). This never happened until today. Could an altered browser setting have caused this behavior as I didn't change the code? It looks like return false is not firing.

    Thanks,
    Hanan

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hananm View Post
    Hi,
    Check out this page guys http://www.oxygen.com/DifferentWorld/

    The "View All Show Times" href should toggle a show/hide div. All of sudden, it's not working IE 6 (FireFox and IE 7 work fine). This never happened until today. Could an altered browser setting have caused this behavior as I didn't change the code? It looks like return false is not firing.

    Thanks,
    Hanan
    Works for me in I.E.6. Do you get a console error?

    What does need fixing is this line and the branching upon which its result depends:
    Code:
    var is_ie=((agt.indexOf('msie')!=-1)&&(agt.indexOf('netscape')==-1));
    That does not mean that the browser is I.E. and consequently does not mean that the .addBehavior function is available.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but the line you're referring to is outside the function I'm calling. This is the function that's executed onclick.

    Code:
    function toggleDetailsView(anchorObj)
    {		
    	parentBlock = anchorObj.parentNode
    	divArray = parentBlock.getElementsByTagName("div");
    	for(var i=0; i <divArray.length; i++)
    	{
    		if(divArray[i].id == "showTimesBlock")
    		{
    			if(divArray[i].style.display == "none" || divArray[i].style.display == "")
    			{
    				divArray[i].style.display = "block";
    				anchorObj.style.backgroundImage = "url(/tvshows/images/show_times_visible_arrow.gif)";
    				anchorObj.innerHTML = "Hide All Show Times";
    			}
    			else
    			{
    				divArray[i].style.display = "none";
    				anchorObj.style.backgroundImage = "url(/tvshows/images/show_times_hidden_arrow.gif)";
    				anchorObj.innerHTML = "View All Show Times";
    			}
    			break;
    		}
    	}
    }

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hananm View Post
    but the line you're referring to is outside the function I'm calling.
    I didn't say that it applied to the problem you mentioned, just that it's going to cause errors in other browsers.

    You didn't say whether or not you get any console errors.

    Looking at the page's source, I would change href="" in the link in question, to href='#'.
    Tab-indentation is a crime against humanity.


Bookmarks

Posting Permissions

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