aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes getElementById()  Issue in IE10 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "getElementById()  Issue in IE10" Watch "getElementById()  Issue in IE10" New topic
Author

getElementById() Issue in IE10

rams srees
Greenhorn

Joined: Mar 18, 2013
Posts: 1
Legacy code has input object (drop down menu) whose 'id' was not specified but 'name' was configured. In the code, getElementById() was used by passing 'name' as the argument, IE8 used to return the object, however IE10 now returns 'null'. I am assuming, not configuring 'id' is not correct and the web standard doesn't suggest using 'name' as 'id' when 'id' is not given, give that, IE8 could very well have returned a 'null' in this case. This code is is present in over hundred views, now with IE10 out, it is anticipated that users will start upgrading to IE10. Is there a solution other than having to change the code in all the hundred+ views?
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
i would suggest, if you are using Netbeans IDE, this can be done a bit easily.
Step:1- select the main project folder->ctrl+H(Find & Replace).
Step:2- enter the name and its value (for ex: name="Hello") and Replace with name and id(ex: name="Hello" ID="Hello").
Step:3- Below you can see into how many places this replacement is going to be done and hit a replace all, it gets replaced.

This link gives you more Info


Hope this helps Happy Coding
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is no way that I know of in IE10 to hijack getElementById.

What you could do is a find in replace in the whole project to call a different function.



THIS IS A HACK! You really need to fix the real problem of poor coding practices.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

I agree with Eric. Fix the problem rather than hacking in a new problem that will make matters even worse.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getElementById() Issue in IE10