Help with events stop working after an AJAX request
First, I'm very new to coding
.
Second, I've read
Sticky: Why do my events stop working after an AJAX request?. Despite my best efforts to try to implement the suggestions my jQuery code is not working.
Here's what my code looks like:
ASP.Net (VB)
-
<a id="calendartoday_customize" title="click to open" href="#">customize</a>
<div id="calendartoday_options" class="calendartoday_options">
<asp:ImageButton ID="imgbtn_red" OnClick="setBackgroundImage" ImageUrl="~/Media/dot_red.png" runat="server" />
</div>
jQuery
-
$('#calendartoday_customize').toggle(
function(event) {
$('#calendartoday_options').slideToggle('slow');
$(this).attr('title','click to close')
.text('close');
},
function(event) {
$('#calendartoday_options').slideToggle('normal');
$(this).attr('title','click to open')
.text('customize');
}
);
The imagebutton ('imgbtn_red') within the div causes an AJAX request. Once the AJAX request takes place my jQuery code no longer functions. I'd very much appreciate any assistance. If you respond, please remember that I'm very new to coding. Thank you in advance for your assistance.