After AJAX, my javascript doesn't work
I have this javascript code which toggles a module view/hide. When I run
the javascript, it works fine. However, after an ajax call from another
control the javascript won't work. What modifications should I make to the
code to make it work?
jQuery(document).ready(function ()
{
jQuery('#lnkShowModule').toggle
(
function ()
{
jQuery(this).html('Hide the Module');
jQuery('.hide-element').toggle();
},
function ()
{
jQuery(this).html('Show the Hidden Module');
jQuery('.hide-element').toggle();
}
);
});
Since I'm using DotNetNuke, I believe it uses the jQuery from the Host
settings. Therefore, its
https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js and
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js The
link I'm calling it from is:
<a id="lnkShowModule" href="#"> Show the module</a>
No comments:
Post a Comment