SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot logitron's Avatar
    Join Date
    Feb 2006
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript item() Method in IE

    I am having a javascript error in IE from the following code:

    Code:
    	init_xhr('/ajax/pull_directory.php',null)
    	
    	var members = XMLResponse.getElementsByTagName('member')
    	tbody   = document.getElementById('tbody_members')
    	
    	while (tbody.childNodes[0])
    	{
    		tbody.removeChild(tbody.childNodes[0])
    	}
    	
    	for (i=0; i<members.length; i++)
    	{
    		member = members.item(i)
                    ...
            }
    The problem lies with [ member = members.item(i) ]. It works fine in FF, but IE gives me the error: Object doesn't support this property or method. I'm not too sure as to how to resolve this issue, so any help is much appreciated.
    Patrick Smith
    PHP Programmer

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    IE doesn't support item(i) use [i] instead.

    member = members[i]
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •