Reputation: 85775
I been sort of using jquery livequery plugin and jquery live together. However now that I am using 1.4 it seems jquery livequery is not working 100%.
So I am not sure how to tackle this problem
I have this in livequery
$('#Description').livequery(function ()
{
$('#Description').htmlarea({
toolbar: [
["bold", "italic", "underline", "strikethrough", "|", "subscript", "superscript"],
["increasefontsize", "decreasefontsize"],
["orderedlist", "unorderedlist"],
["indent", "outdent"],
["link", "unlink"]
]
});
});
So everytime I loaded up my page. It would actually run that code in the livequery and display and if I went to another ajax tab and come back it would go into this again.
Now I am not sure how to change it to .live() jquery 1.4 since I just tried to do this
$('#Description').live(function ()
{
$('#Description').htmlarea({
toolbar: [
["bold", "italic", "underline", "strikethrough", "|", "subscript", "superscript"],
["increasefontsize", "decreasefontsize"],
["orderedlist", "unorderedlist"],
["indent", "outdent"],
["link", "unlink"]
]
});
});
and it does not seem to work. the plugin is not binded and the rich html editor is not displayed.
Upvotes: 0
Views: 268
Reputation: 630429
You should still use .livequery()
in this case...they operate in different ways, and .live()
isn't suited for running plugins as elements are created dynamically.
.livequery()
- Looks for new elements, executes when it finds them.
.live()
- Listens for events to bubble up the DOM and execute on them, it's made for handling events from new or old elements and not caring when they were added, but it's not all that useful for executing plugins on newly created elements.
What problems are you having with .livequery()
in 1.4.1? (1.4.2 is out by the way!)
Upvotes: 2