Archive for February 2010
I had a problem with getting a web application working on IE8 correctly. I have a workflow type application, and when I would pass two particular pages in the workflow, I would lose the ability to go back and forth in browser history. The buttons would just gray out. I tried a bunch of different things and searched the internet all to no avail. I did notice however that the 2 pages where it would get corrupted were very large, as I had many forms on them with a massive hidden variable that I just plugged into each form. So, I used jquery to copy the massive parameter to where I need it on submit, instead of in every form and now the page is MUCH smaller. This has solved my problem!
So, if you are losing your mind because IE is losing your browser navigation buttons, try reducing the size of your page and see if that won’t help you too.
Eric
I have been tracking down a nasty bug in my code over the last 6 hours. Here is the scenario. I have a section of nodes on my webpage that has fields and those fields handle events from the user. For example, I have a name field that when typed into there is an autocomplete box that pops up. The user has the ability to duplicate the entire section of nodes so that they can create more items. I am using my own node copy code which consists of taking the innerHTML from the first node and parsing out some things, incrementing ids and then plugging it back into the system by appending it after the original node. I am using jQuery for the event handling, but not for the node copy, since the node copy has some custom stuff that I have to do.
The bug occurs only on IE when I copy the nodes and then try to fire an event by typing in the field. What happens is that the event handler for the SUBSEQUENT input boxes can not be fired until I modify the field in the ORIGINAL node block. Then I get BOTH events!!! Nasty huh?
The solution actually lies in jQuery’s clone function. Here you see that when they do a clone they will eliminate the property that is embedded in the html called jQuery12341234=”2″ (those number are some internal jQuery identifier, probably for the event handler).
To fix the bug all I had to do was remove that attribute and definition and viola it works!
Here is jQuery’s replace from their clone function.
html.replace(/ jQuery\d+="(?:\d+|null)"/g, "")
My approach (before I found that jQuery was doing it also was this.
html.replace(/jQuery\d+=["']\d+["']/g, "")
Since jQuery programmers know more than me (i.e. when null might be in that field) I just ditched mine and used theirs.
Have a great day!
Eric

