Brilliant! Thanks very much. :D
IE doesn't handle custom elements well, make them all s or
s and it should be fine. Or if you need to keep it that way, try
putting this before all scripts:
if( $.browser.msie ){
$.each('Name,Role,Interests,Words'.split(','), function(){
document.createElement(this);
});
};
creating an
wrote:
>
> > @ProfCrazyHorse:
> > Your solution seems simple.. why to change something that is working fine?
>
> > - Original Message -----
> > From: Charlie
> > To: jquery-en@googlegroups.com
> > Sent: Wednesday, August 05, 2009 6:38 AM
>
ng that is working fine?
>
>
>
> - Original Message -
> From: Charlie
> To: jquery-en@googlegroups.com
> Sent: Wednesday, August 05, 2009 6:38 AM
> Subject: [jQuery] Re: replaceWith()
>
> there are lots of ways in jQuery to create relationships be
@ProfCrazyHorse:
Your solution seems simple.. why to change something that is working fine?
- Original Message -
From: Charlie
To: jquery-en@googlegroups.com
Sent: Wednesday, August 05, 2009 6:38 AM
Subject: [jQuery] Re: replaceWith()
there are lots of ways in jQuery to
there are lots of ways in jQuery to create relationships between
selectors depending on your markup. Without seeing any markup it's hard
for anyone else to help you create those connections
ProfCrazyHorse wrote:
I want to replace one element with another, and keep the element
contents
Richard,
Thanks for your reply.
It is neat but it leaks memory on IE.
While the following not:
$.fn.replaceWithAndReturnNew = function(html){
var div = document.createElement('div');
var replaced = this[0];
replaced.parentNode.replaceChild(d
This one is slightly better altough not in jQuery style:
$.fn.replaceWithAndReturnNew = function(html){
var elm = $(this)[0].cloneNode(false);
$(this).after(elm).remove();
elm.innerHTML = html;
return $(elm);};
On Sep 20, 9:31 am, tchvil <[EMAIL PROTECTED]> wrote
$.fn.replaceWithAndReturnNew = function(htmls){
var replacer = $(htmls);
$(this).replaceWith(replacer);
return replacer;
};
- Richard
On Sat, Sep 20, 2008 at 3:31 AM, tchvil <[EMAIL PROTECTED]> wrote:
>
> Thanks a lot for your replies.
> Ok, I guess there are good reasons to return the rep
Thanks a lot for your replies.
Ok, I guess there are good reasons to return the replaced object.
Now my question becomes... is there a better jQuery way of doing this
quite ugly thing:
$.fn.replaceWithAndReturnNew = function(htmls){
var replaced = $(this)[0];
var div = document.c
On Wed, Sep 17, 2008 at 4:58 PM, Karl Rudd <[EMAIL PROTECTED]> wrote:
>
> Err remove() is chainable. It doesn't "return a DOM element", it
> "keeps hold" of the elements that it was called to remove from the
> DOM. So it acts just like replaceWith().
>
> There was a debate in the early stages of j
Sorry, I missunderstood the initial (and subsequential) posts.
The present behavior (return the initially matched element) is the
correct one. That's what I'd expect and it matches the behavior of
remove(), append(), etc.
Don't file any bug report :)
Thanks Richard for pinging me about this.
--
I think this is a bug, I'd expect replaceWith to return the old set,
just like append/etc.
Can you (tchvil) file a bug with a test case ? put it under core,
assigned to me.
Thanks
--
Ariel Flesler
http://flesler.blogspot.com/
On Sep 17, 8:04 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> O
Err remove() is chainable. It doesn't "return a DOM element", it
"keeps hold" of the elements that it was called to remove from the
DOM. So it acts just like replaceWith().
There was a debate in the early stages of jQuery about whether or not
methods (not including the base $/jQuery function) tha
On Wed, Sep 17, 2008 at 6:58 AM, Karl Rudd <[EMAIL PROTECTED]> wrote:
>
> Nah, it's not a bug.
>
> replaceWith( content ) Returns: jQuery
> Replaces all matched elements with the specified HTML or DOM elements.
> This returns the JQuery element that was just replaced, which has been
> removed fro
Nah, it's not a bug.
replaceWith( content ) Returns: jQuery
Replaces all matched elements with the specified HTML or DOM elements.
This returns the JQuery element that was just replaced, which has been
removed from the DOM
( http://docs.jquery.com/Manipulation )
It's like doing a remove(), fol
This sounds like a bug to me. Better raise it on the jQuery Dev list:
http://groups.google.com/group/jquery-dev/
- Richard
On Tue, Sep 16, 2008 at 4:58 AM, tchvil <[EMAIL PROTECTED]> wrote:
>
> Hi,
> replaceWith returns the JQuery element that was just replaced.
>
> In the example below:
> $( '
Thanks Karl,
Perfect. Worked like charm.
Christopher
On Jan 25, 2:03 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> I can't build the whole thing for you because I don't know what is
> being clicked and which element's class you want changed, but in
> general you can manipulate classes wit
I can't build the whole thing for you because I don't know what is
being clicked and which element's class you want changed, but in
general you can manipulate classes with .addClass('some-class')
and .removeClass('optional-class-name') and .toggleClass('some-class').
You'll find these met
John,
Well figures .. it is my code. .html() certainly does the trick. I
wasn't aware that replaceWith removes stuff from the DOM indefinitely.
A, thanks for saving me from hours of troubleshooting. I really
really appreciate it.
- sf
On 9/24/07, John Resig <[EMAIL PROTECTED]> wrote:
>
> A
Are you meaning to do .html(..) instead of replaceWith? replaceWith
completely removes the element (which means that when it's called the
second time, nothing happens, since the element no longer exists).
Whereas .html() simply replaces the contents of the element.
--John
On 9/24/07, Steve Fin
This is actually happening in IE7 also. Is it possible that something
is hosed with my code? I'm more confident it's that than a broken
replaceWith() but I'd really like to know why it only works once, and
then I need a page refresh for that "ajax" effect.
- sf
On 9/24/07, Steve Finkelstein <[EM
22 matches
Mail list logo