Does jQuery work when you first load the page, and then it stops
working after any ajax postback within the update panel? If this is
the case there is a pretty simple fix:
instead of using $(document).ready(function() { ...});
use either:
function pageLoad() {
//code goes here
}
or
Well, it actually gets even shorter... you can combine the two
selectors into one
jQuery(#TreeviewTd, #MenuBarTd).toggle();
I have no experience with the UpdatePanel, but I encourage you to get
rid of all other AJAX libraries and stick to jQuery...
Can you tell me why
Nah, make it sexier, use parenteses (tip from the new John Resig's ebook):
( var $ = window.jQuery;
$(#CollapseExpandTd).click(
function() {
$(#TreeviewTd).toggle();
$(#MenuBarTd).toggle();
});
);
$ will be a local variable and unicorns will come to see the magic running
Maybe the asp.Net ajax is still working and changing elements when the DOM
is ready in the page.
I would encourage you to get rid of your asp.net ajax too. It's a nightmare
of issues.
2009/12/23 Šime Vidas sime.vi...@gmail.com
Well, it actually gets even shorter... you can combine the two
On Dec 23, 2:06 pm, Leonardo Balter leonardo.bal...@gmail.com wrote:
Nah, make it sexier, use parenteses (tip from the new John Resig's ebook):
( var $ = window.jQuery;
$(#CollapseExpandTd).click(
function() {
$(#TreeviewTd).toggle();
$(#MenuBarTd).toggle();
});
);
On Dec 23, 6:58 am, jqHunter tinu.punn...@gmail.com wrote:
Hi All,
I have the following js function used in an old web app. How can I
translate this to equivalent jQuery code? Appreciate your help!
function expandCollapse_onclick()
{
var treeCell =
Unicorns are a mythical creature, and so is that use of parentheses.
Could this be the syntax you were looking for?
(function() {
var $ = window.jQuery;
$(#CollapseExpandTd).click(
function() {
$(#TreeviewTd).toggle();
$(#MenuBarTd).toggle();
});
})();
That puts all the
Should be pretty easy:
$(#CollapseExpandTd).click(function() {
$(#TreeviewTd).toggle();
$(#MenuBarTd).toggle();
});
Thanks much Sime Vidas, it worked! Since mine is an aspx with an AJAX
UpdatePanel, jQuery(document).ready(function(){...}); did not work for
me. So I implented it in the pageLoad as below:
jQuery.noConflict();
function pageLoad() {
jQuery(#CollapseExpandTd).click(function() {
9 matches
Mail list logo