I am trying to implement a confirmation dialog, which I have done and works fine until the page is loaded from another jquery page, then the event (code) is not executed.
If I load the page by entering the url in a browser manually, everything is fine. If I load it by clicking on another jQuery page, because of the way the url is formed - it stops the code from executing.
After clicking on a button, instead of getting..
"http://www.somedomain.com/somedir/patient_records.php"
You get..
"http://www.somedomain.com/somedir/home.php#patient_records.php"
On the target page, I have the following code..
$(document).ready(function(e) {
$(document).delegate('#delpatient' , 'click', function() {
$(this).simpledialog({
'mode' : 'bool',
'prompt' : 'Delete Patient?',
'useModal': true,
'buttons' : {
'Yes': {
click: function () {
$('#dialogoutput').text('OK');// set variable here to already set vairable (crated dynamically) then..
//header($del_loc);
window.location.href='http://www.somedomain.com/somedir/del.php?pid=$id';
}
},
'No': {
click: function () {
$('#dialogoutput').text('Cancelled');
},
icon: "delete",
theme: "c"
}
}
})
})
});
This works fine when the url is entered manually in the browser, but not when being called from another jQuery button on another page. I gather this is something to do with the way the url is constructed (with hash values.)
I can get it to work by adding.. rel="external" to the calling link. The problem is that I loose all the nice animation and transition effects.
Can anyone suggest an alternate approach or a fix for this problem ?
Many thanks..

New Topic/Question
Reply


MultiQuote


|