For security reasons, you cannot initiate a dialogue unless it is a response to some kind of user-initiated event. For example, you can call up a dialog by clicking on another element:
$(function () {
$(".someElement").click(function () {
$('#f').click();
});
});
Working example .