RwL wrote:
Can't figure out for the live of me why remove() is working on this
function in every browser but Safari:
http://www.lifford.org/exp/tmr.html
to summarize what's going on, this is my only function:
$(document).ready(function() {
$('a').not($("#nav [EMAIL PROTECTED]"))
.click(function() {
$('<span class="disabledLinkMsg">All
links in this demo are
disabled except those under "Nav". <u>close</u></
span>').appendTo(this).click(function() { $(this).remove(); });
return false;
});
});
So,
1) links (except in #nav) are selected
2) on click some HTML is appended to the link, and then given its own
onclick event to remove itself from the DOM
Seems to work as intended everywhere but Safari, version 2.0.4
(419.3), where the remove() fails. I have Safari's JS Console turned
on but not seeing anything there.
I've tried using a number of different selectors with the remove(),
but nothing I've tried makes Safari work.
As you're adding the span to the link itself, maybe both click events
somehow interfere in Safari... what about:
$('a').not($("#nav [EMAIL PROTECTED]")).click(function(e) {
if (e.target.nodeName.toLowerCase() != 'span') {
$('<span class="disabledLinkMsg">All links in this demo are
disabled except those under "Nav". <u>close</u></span>')
.appendTo(this)
.click(function() { $(this).remove(); });
}
return false;
});
Just guessing...
--Klaus