You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello guys, i've been struggling for few hours truing to find out why "onBeforeLoad" is executed first.
here is a sample of my code: the first time before the overlay loads, alert(1) is displayed first. but then it's the seconde alert with old "post" value which is displayed first...
Thank you so much for your help
var $ol;
$("#forums .edit, #forums .disapprove").live("click", function() {
var post = $("#post-10001").find(".post").text();
$ol = $(this);
alert(1);
$(this).overlay({
target: "#overlay",
load: true,
onBeforeLoad: function() {
alert(2 + post);
this.getOverlay().find("#new-reply").val(post);
}
});
});
$("form.alter-post").validator().submit(function(e) {
$ol.overlay().close(); // close the overlay
$.ajax({
...
});
return e.preventDefault(); // prevent form submission
});
The text was updated successfully, but these errors were encountered:
I think it would help if you could please try to get this into a JSFiddle (www.jsfiddle.net), so we can see this in action? From what I am seeing, I suspect an issue with how you've used $(this), and it's context - I think it would be really good to see this in action first though!
Hi Alex,
I didn't receive any notification, I just by chance checked the post :)
it's very complicated to put it in JSFiddle, but i ended up using ajax calls to retrieve the value of a variable.it's more reliable. but it remains a mystery! maybe it's a problem of $(this)!!
by the way, do you have any idea for the issue I have submitted regarding the validator??? :D
thanks
Hello guys, i've been struggling for few hours truing to find out why "onBeforeLoad" is executed first.
here is a sample of my code: the first time before the overlay loads, alert(1) is displayed first. but then it's the seconde alert with old "post" value which is displayed first...
Thank you so much for your help
The text was updated successfully, but these errors were encountered: