[jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Hi, I'm fetching a url using $.get(): $.get(url, function(xml) { alert($(tag, xml).get(0).text); }); xml is a simple xml tag: tagbody/tag IE works fine and alerts body, but FF alerts undefined. ___ jQuery mailing list discuss@jquery.com

Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Realazy XA Chen
may add a prolog to xml file will help:?xml version=1.0 encoding=UTF-8 ?2006/8/9, Mohsen Saboorian [EMAIL PROTECTED]:Hi,I'm fetching a url using $.get():$.get(url, function(xml) { alert($(tag, xml).get(0).text);});xml is a simple xml tag:tagbody/tagIE works fine and alerts body, but FF alerts

Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Thank you Klaus. Yes, my MIME was set text/xml. 1. alert($(tag, xml).get(0).text); 2. alert($(tag, xml).text()); IE: 1, 2 works FF: only 2 works just putting a prolog on top will not make it xml. please check if you have set the correct mime type for your ajax response. with the extremely

Re: [jQuery] $.get Firefox problem

2006-08-09 Thread Mohsen Saboorian
Also this works fine for both IE and FF: alert($(tag, xml).get(0).firstChild.data); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] $.get Firefox problem

2006-08-09 Thread John Resig
Also this works fine for both IE and FF: alert($(tag, xml).get(0).firstChild.data); When accessing the text value of XML elements you should always use .nodeValue - that works the most reliably from browser to browser. This is why doing the jQuery .text() works in both browsers. --John