document.GetElementById, cross browser support, and id / name tags
First off, I have a mess.
I developed an entire infrastructure (fixed on an IE environment, so all good, right?) that people are now complaining it is not working on iPad. Well, it basically doesn't work on anything above IE9, and any other browser. So, IE9 and below flawless, anthing else, no go. I'm guessing this is when HTML5 was introduced to IE, but not sure.
Anyway, as a general issue, what is happening in IE 9 (working), when I call document.getElementById, it actually looks at teh ID AND/OR the name of the form element. I used this in many differen scenarios, and incorrectly....this I know.
So, I'll have an example of something like this:
<input type="test" id="[test]" name="test" value="12345">
Then, I'd call it like this:
var test1 = document.getElementById("[test]").value;
var test2 = document.getElementById("test").value;
The alerts woudl both read 12345
Now, when I go to run the same style of code on another browser, I get an error on var test2 = document.getElementById("test").value; because it doesn't exist
Problem is my .js page has over 2500 lines of code, and making a change on it affects our entire application, so I can't just fix it for one page at a time, it has to be one big global change.
In the meantime, I am staying on IE9 for work environment, but eventually it will have to be fixed, especially since they want to use these pages on iPad, or any other browser.
So, I'm looking for an alternative to document.getElementById(), or a way to force my .js page to render in the old HTML, or a way to make other browsers work identical to IE9.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)