I have the next script on my page
Parent
function triggerModal(b,a)
{
// if the url contains mysite - open it in showModalDialog
if (a.toLowerCase().search("person.aspx")>0 || a.toLowerCase().search("organizationview.aspx")>0)
{
ExecuteOrDelayUntilScriptLoaded(function () {
var options = {
url: a,
tite: 'Mi Ficha',
autoSize: true,
allowMaximize: false,
showClose: true,
dialogReturnValueCallback: myDialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}, 'sp.js');
}else{
a:;STSNavigate(a)
}
}
//THIS IS EXECUTED ONLY WHEN I CLOSE THE MODAL, NEVER WHEN I SEND THE OK
function myDialogCallback(target, strReturnValue)
{
if (target == SP.UI.DialogResult.OK) // Perform action on Ok.
{
triggerModal(null, "http://"+strReturnValue);
}
}
Child
$(function() {
$("div.s4-sn div.menu-horizontal ul li a").click(function(event) {
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, "www.google.cl");
return;
});
});
This works perfectly on IE, but doesnt not work on Chrome. The script execute on Chrome but does not trigger the commonModalDialogClose.
Can somebody tell my what I'm doing wrong?