I have a function to open a page in a dialog box instead of the main window. The slightly cleared code is as follows:
var baseurl = window.location.origin + '/static/docs/'
function onClickLink(event) {
event.preventDefault();
if ($("#dialog").length == 0) {
setUpDialog()
}
var href = event.target.href;
href = baseurl + href.substring(1 + href.lastIndexOf('/'));
$("#dialog").load(href + ' .body', function(response, status, xhr) {
if (status == "error") {
window.location = event.target.href;
} else {
changeImageSrc();
reStructure();
}
});
$("#dialog").dialog({
modal: true,
title: event.target.text,
width: 960,
position: ['center', 100]
});
}
This code works fine in Chrome, but (status == "error") runs under Firefox. It looks like there is a 404 error in Firefox, it could be an image of a loaded page or something like that.
Any ideas how to get Chrome behavior under Firefox too? (You can find a working example here )
source
share