The following simply loads a jquery-ui dialog from an external html file.
$('#showdialog').click(function(e) {
var div = $('<div>loading...</div>');
div.dialog({
modal: true,
open: function() { div.load('anotherpage.html'); }
});
e.preventDefault();
});
After the DOM loads from the external html file, I’d like to interrogate it with JQuery. For example, supposing anothorpage.html had a bunch of anchors on it, I’d like to wire up click handlers for them when it loads into the dialog.
Any ideas?
You can define more then one parameter of
jQuery.load(see http://api.jquery.com/load/) so after load is done you can do something:place code which you need instead of
alert.