The Entreprexplorer's Journal

A journal of one (currently young) man's journey into entrepreneurism. Including entrepreneurial thoughts, ideas, tribulations, experiences, etc. See where it goes...


  Subscribe to this blog!

My Photo
Name:
Location: San Francisco, California, United States

I am an entrepreneur based in San Francisco, CA. My current entrepenurial project is CommunityWalk.com.

Wednesday, September 14, 2005

Technical Post: IE6 "Show Picture" Bug

Ok this is a technical post. I now have a huge headache because of one stupid IE6 bug. Turns out that if your application has a link with the value of javascipt:void(0) and it is used to load an image into the dom using innerHTML then the image will not display on IE6. Instead the href value of the link needs to be '#' instead of 'javascript:void(0)'. Of course this sticks the # into the url, which is why I avoided it in the first place, but it does get the picture to display...

Stupid IE. What an obscure little bug.

11 Comments:

Anonymous Anonymous said...

Thank you so much for posting about this bug!! I've literally been wrapping my brain around this for a week.

10:52 AM  
Anonymous Anonymous said...

Amen to the above post. Although I haven't been working on this problem for a week, I had lost all hope that IE could give me what I wanted. An obscure bug indeed. This is the fix I was looking for.

11:19 AM  
Anonymous Anonymous said...

< a href="javascript:void(0);" onclick="doSomething();return false;" >

Adding return false might do the trick. You need to tell ie that the anchor tag should not do it's default behevior (go to another page). Just to returning false on form submit when doing form validation.

9:45 AM  
Anonymous Anonymous said...

thanks a lot, i am working since 4 hours on this bug ! and you give me the solution !! THHAANNKKS !!

2:13 PM  
Blogger D. Pink said...

I cannot thank you enough for posting this. I've been searching for a solution to this bug for over a day; I had no idea it was something so simple!

Additionally, the "return false" method works just as well, and I am using that approach. This way, it really doesn't matter what I put in the href, as the other poster said.

7:13 AM  
Blogger Jen said...

Thank you sooooooooo much!!! I spent hours on this problem.

3:33 PM  
Anonymous Anonymous said...

Thanks a ton Jared. I was losing my sleep over this bug.. Thanksssss again...

3:26 AM  
Anonymous Anonymous said...

Thanks to Mr.Anonymous too for the solution.. :)

3:38 AM  
Blogger Ryan Spohn said...

Thank you!!! This was very helpful.

I was able to achieve the same result by just adding "return false;" to onclick

e.g. -

href="javascript:;" onClick="doSomething(); return false;"

4:02 PM  
Anonymous Anonymous said...

You da man

6:18 PM  
Anonymous Anonymous said...

The solution really helps me; thanks to everybody.
--Rishi

10:30 AM  

Post a Comment

<< Home