[jQuery] remove() method IE 7 ERROR
Hi, I have an ajax request which is returning an xml, but when I tray to remove an element from the xml response I'm receiving the following error message: This is happening only in IE7 (I didn't tray in IE6) Line: 1283 EROOR: Object doesn't support this property or method This is my code: var pDialog = $(data_responce).find('PDialog'); if(pDialog ){ pDialog .remove(); } This is what I find in 1283 when i debugged it : // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name !jQuery.cache[ id ] ) jQuery.cache[ id ] = {};
[jQuery] Re: remove() method IE 7 ERROR
I'm little confused. Why you think I want to remove a string? What I'm doing is with find('PDialog') to access the PDialog node and after that to remove it. On 18 Май, 13:01, ryan.j ryan.joyce...@googlemail.com wrote: remove() will remove an object from the DOM, but essentially you're just trying to remove part of a string aren't you? maybe try replace()? On May 18, 9:42 am, snakebit bozhidar...@gmail.com wrote: Hi, I have an ajax request which is returning an xml, but when I tray to remove an element from the xml response I'm receiving the following error message: This is happening only in IE7 (I didn't tray in IE6) Line: 1283 EROOR: Object doesn't support this property or method This is my code: var pDialog = $(data_responce).find('PDialog'); if(pDialog ){ pDialog .remove(); } This is what I find in 1283 when i debugged it : // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name !jQuery.cache[ id ] ) jQuery.cache[ id ] = {};
[jQuery] Re: remove() method IE 7 ERROR
I tray that, but find didn't finde PDialog node. On 18 Май, 13:20, Karthikraj karthik271...@gmail.com wrote: instead of $(data_responce).find('PDialog'); try this $('div'+data_responce+'/div').find('PDialog'); On May 18, 1:42 pm, snakebit bozhidar...@gmail.com wrote: Hi, I have an ajax request which is returning an xml, but when I tray to remove an element from the xml response I'm receiving the following error message: This is happening only in IE7 (I didn't tray in IE6) Line: 1283 EROOR: Object doesn't support this property or method This is my code: var pDialog = $(data_responce).find('PDialog'); if(pDialog ){ pDialog .remove(); } This is what I find in 1283 when i debugged it : // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name !jQuery.cache[ id ] ) jQuery.cache[ id ] = {};
[jQuery] Re: remove() method IE 7 ERROR
I know the feeling :) my temporary solution is almost the same as yours: var pDialog = data_responce.getElementsByTagName(PDialog); data_responce.documentElement.removeChild(pDialog[0]) On 18 Май, 17:13, ryan.j ryan.joyce...@googlemail.com wrote: monday morning mate, i completely misread what you wrote :| it's a bug i guess, have you tried to bypass the remove() method? eg. pDialog.parentNode.removeChild(pDialog); On May 18, 12:17 pm, snakebit bozhidar...@gmail.com wrote: I'm little confused. Why you think I want to remove a string? What I'm doing is with find('PDialog') to access the PDialog node and after that to remove it. On 18 Май, 13:01, ryan.j ryan.joyce...@googlemail.com wrote: remove() will remove an object from the DOM, but essentially you're just trying to remove part of a string aren't you? maybe try replace()? On May 18, 9:42 am, snakebit bozhidar...@gmail.com wrote: Hi, I have an ajax request which is returning an xml, but when I tray to remove an element from the xml response I'm receiving the following error message: This is happening only in IE7 (I didn't tray in IE6) Line: 1283 EROOR: Object doesn't support this property or method This is my code: var pDialog = $(data_responce).find('PDialog'); if(pDialog ){ pDialog .remove(); } This is what I find in 1283 when i debugged it : // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name !jQuery.cache[ id ] ) jQuery.cache[ id ] = {};
[jQuery] Traversing a XML document
/* * @param dom_obj xml data * @param ulObj unordered list element */ function buildTree(dom_obj, ulObj){ ulObj.append('li'+dom_obj[0].nodeName+'/li'); if(dom_obj[0].hasChildNodes()){ ulObj.append('liul/ul/li/'); dom_obj.children().each(function (i, obj){ buildTree($(this), ulObj.find('ul:last')); }) } } buildTree($(xml), $('#demo ul')) div id=demo ul/ul /div == XML RecentTutorials Tutorial author=The Reddest TitleSilverlight and the Netflix API/Title Categories CategoryTutorials/Category CategorySilverlight 2.0/Category /Categories Date1/13/2009/Date /Tutorial /RecentTutorials RESULT ul li#document/li li ul liRecentTutorials/li li ul liTutorial/li li ul liTitle/li liCategories/li li ul liCategory/li liCategory/li liDate/li /ul /li /ul /li /ul /li /ul /li /ul Hi, The problem is that Date have to be one level up. In general when I have 2 elements in a same level, and the second have children (which don't have children) and after I go through them the script didn't return in its last level, and is continue from the same level. How to make the script to go one level up?