or you can just move the scope up one level...
the two lines I changed start with a * and have a comment at the end
$(document).ready(function(){
* var somevar; // <-- declare the variable up here
$("#dialog").dialog({
autoOpen:false,
modal:true,
overlay: {backgroundColor: "#000",opacity: 0.5},
resizable:false,
buttons:{
"Delete": function() {window.location = "/home/" +
somevar ;},
"Cancel": function() {$(this).dialog("close");}
}
});
$(".button").click(function(){
$("#ui-dialog-title-dialog").text("Attention");
var message = "You are about to do something: ";
$(".ui-dialog-content").text(message + $(this).attr
("id"));
* somevar = $(this).attr("id"); // <-- removed the
"var" from this line
$("#dialog").dialog("open");
});
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---