Some Things to know about IE 7

Posted Nov 17, 2006 @ 3:40 pm, Viewed by 767 Visitors, Read 769 Times.

When using javascript in IE 7, you don't need to use getElementById

Thus in IE 6 you would do:

Code:
<script>
var city = document.getElementById('city');
alert(city.innerHTML);
</script>



And in IE 7 you can do

Code:
<script>
alert(city.innerHTML);
</script>

city is automatically an object pointing to the HTML tag with the id of that name.

This also means that if you accidentally use a variable with the same name as an id of an element, you will get errors.

I'm sure this gives rise to some kind of security flaw.

  • Rate this Post!
  • Print

This Post Has No Comments.

REW Blogs User Stats
Currently Online Users: 0
Total Users: 2,522
Entries: 8,158
Unique Views: 7,952,138
Total Views: 8,387,849
Total Comments: 9,996
Total REW Points: 510
REW Steven

REW Steven I am a PHP / MySQL Programmer for Real Estate Webmasters. I program custom IDX solutions as well as many other custom features on our clients websites. Read More

This User's Stats
Blog Entries: 28
Average Blog Rating: 4
Unique Views: 16,494
Total Views: 17,471
Comments Posted: 15
Comments Received: 28
REW Points: 0