joseph/Monocle — Issue #75: Firefox - Two requests are made "undefined"
Author: expouic
Created: 2011-11-30 11:00:35+00:00
State: open

When testing on firefox two requests are made "undefined"

The problem was solved when include the validation in function loadTestFrame.

#####################################################
BEFORE
#####################################################
function loadTestFrame(cb, src) {
if (!testFrame) { testFrame = createTestFrame(); }
frameLoadCallback = cb;

if (typeof src == "undefined") {
if (testFrameLoadedWithStandard) {
frameLoadCallback(testFrame);
} else {
testFrameLoadedWithStandard = true;
src = 4;
}
}

if (typeof src == "number") {
var pgs = [];
for (var i = 1, ii = src; i <= ii; ++i) {
pgs.push("

Page "+i+"

");
}
var divStyle = [
"display:inline-block",
"line-height:"+testFrameSize+"px",
"width:"+testFrameSize+"px"
].join(";");
src = "javascript:'"+
'

'+
'

'+
'

'+pgs.join("")+'

'+
"'";
}

testFrame.src = src;
}

#####################################################
AFTER
#####################################################

function loadTestFrame (cb, src) {
if (!testFrame) { testFrame = createTestFrame(); }
frameLoadCallback = cb;

if (typeof src == "undefined") {
if (testFrameLoadedWithStandard) {
frameLoadCallback(testFrame);
} else {
testFrameLoadedWithStandard = true;
src = 4;
}
}

if (typeof src == "number") {
var pgs = [];
for (var i = 1, ii = src; i <= ii; ++i) {
pgs.push("

Page "+i+"

");
}
var divStyle = [
"display:inline-block",
"line-height:"+testFrameSize+"px",
"width:"+testFrameSize+"px"
].join(";");
src = "javascript:'"+
'

'+
'

'+
'

'+pgs.join("")+'

'+
"'";
}

if (src != undefined) testFrame.src = src;
}