[jQuery] Re: outerHTML and Firefox does not work

2007-04-11 Thread Christof Donat
Hi, > Is there a way to get the equivalent of outerHTML's result of a node > using jQuery ? (Y/n) To get something that is similar to outerHTML in Firefox, this might help: http://developer.mozilla.org/en/docs/XMLSerializer > $("#test").jquerymagic() jQuery.fn.jquerymagic = function() {

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread Ariel Jakobovits
ery-en@googlegroups.com Sent: Tuesday, April 10, 2007 6:15:50 AM Subject: [jQuery] Re: outerHTML and Firefox does not work You could try this, it's a bit sloppy but what the heck... $.fn.outerHtml = function() { $this = $(this); var h = $this.html();

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread Christian Bach
You could try this, it's a bit sloppy but what the heck... $.fn.outerHtml = function() { $this = $(this); var h = $this.html(); var s = $this.wrap("").parent().html(); $this.empty().html(h); return s; }; hello hello

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread Fabien Meghazi
Correct. Only Internet Explorer supports "outerHTML". Even "innerHTML" started off as a Microsoft only thing, but because it was used so widely other browsers have adopted it as a defacto standard. What are you trying to do that you need to use outerHTML? Hi everyone in this thead, I was abou

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread Karl Rudd
Yes you're both correct. I wrote things out too quickly. Karl Rudd On 4/10/07, David Duymelinck <[EMAIL PROTECTED]> wrote: David Duymelinck schreef: > > Klaus Hartl schreef: >> No, that will throw an error, because at this point: $("#k >> img").get(i) you already have a reference to the DOM e

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread David Duymelinck
David Duymelinck schreef: Klaus Hartl schreef: No, that will throw an error, because at this point: $("#k img").get(i) you already have a reference to the DOM element itself. Thus the following will work: $("#k img").get(i).src or stick to jQuery: $("#k img").attr('src') it's it $("#k i

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread David Duymelinck
Klaus Hartl schreef: No, that will throw an error, because at this point: $("#k img").get(i) you already have a reference to the DOM element itself. Thus the following will work: $("#k img").get(i).src or stick to jQuery: $("#k img").attr('src') it's it $("#k img").eq(i).attr('src'). --

[jQuery] Re: outerHTML and Firefox does not work

2007-04-10 Thread Klaus Hartl
Karl Rudd schrieb: What do you mean by "required tag"? Do you mean the attributes in the tag/element, like src="pic1"? If you want the "src" attribute of the element you have selected you could do this: alert( $("#k img").get(i).attr('src') ); No, that will throw an error, because at this

[jQuery] Re: outerHTML and Firefox does not work

2007-04-09 Thread Karl Rudd
What do you mean by "required tag"? Do you mean the attributes in the tag/element, like src="pic1"? If you want the "src" attribute of the element you have selected you could do this: alert( $("#k img").get(i).attr('src') ); Or if you have more than one 'img' inside the '#k' div you could loo

[jQuery] Re: outerHTML and Firefox does not work

2007-04-09 Thread bjb
thanks a lot as a jquery beginner I wonder if there is no jquery way to get the required tag? best regards Bernd -- View this message in context: http://www.nabble.com/outerHTML-and-Firefox-does-not-work-tf3549488s15494.html#a9910093 Sent from the JQuery mailing list archive at Nabble.com.

[jQuery] Re: outerHTML and Firefox does not work

2007-04-09 Thread Karl Rudd
Correct. Only Internet Explorer supports "outerHTML". Even "innerHTML" started off as a Microsoft only thing, but because it was used so widely other browsers have adopted it as a defacto standard. What are you trying to do that you need to use outerHTML? Karl Rudd On 4/10/07, bjb <[EMAIL PROT

[jQuery] Re: outerHTML and Firefox does not work

2007-04-09 Thread Blair Mitchelmore
outerHTML is an IE only property that only a few other browsers support. However, Mozilla's JavaScript implementation rocks so try this code I found on : var _emptyTags = { "IMG": true, "BR":true, "INPUT": true, "META": true, "