Skip to content

Commit 3089970

Browse files
committed
Merge pull request blueimp#2652 from bmwyant/master
Allow configuration of iframe src attribute
2 parents 2a56f70 + c0d3e29 commit 3089970

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

js/jquery.iframe-transport.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939
if (options.async) {
4040
var form,
4141
iframe,
42-
addParamChar;
42+
addParamChar,
43+
// javascript:false as initial iframe src
44+
// prevents warning popups on HTTPS in IE6.
45+
iframeSrc = 'javascript:false;';
46+
47+
if (options.iframeSrc) {
48+
iframeSrc = options.iframeSrc;
49+
}
50+
4351
return {
4452
send: function (_, completeCallback) {
4553
form = $('<form style="display:none;"></form>');
@@ -56,14 +64,12 @@
5664
options.url = options.url + addParamChar + '_method=PATCH';
5765
options.type = 'POST';
5866
}
59-
// javascript:false as initial iframe src
60-
// prevents warning popups on HTTPS in IE6.
6167
// IE versions below IE8 cannot set the name property of
6268
// elements that have already been added to the DOM,
6369
// so we set the name along with the iframe HTML markup:
6470
counter += 1;
6571
iframe = $(
66-
'<iframe src="javascript:false;" name="iframe-transport-' +
72+
'<iframe src="' + iframeSrc + '" name="iframe-transport-' +
6773
counter + '"></iframe>'
6874
).bind('load', function () {
6975
var fileInputClones,
@@ -95,7 +101,7 @@
95101
);
96102
// Fix for IE endless progress bar activity bug
97103
// (happens on form submits to iframe targets):
98-
$('<iframe src="javascript:false;"></iframe>')
104+
$('<iframe src="' + iframeSrc + '"></iframe>')
99105
.appendTo(form);
100106
window.setTimeout(function () {
101107
// Removing the form in a setTimeout call
@@ -159,7 +165,7 @@
159165
// concat is used to avoid the "Script URL" JSLint error:
160166
iframe
161167
.unbind('load')
162-
.prop('src', 'javascript'.concat(':false;'));
168+
.prop('src', iframeSrc);
163169
}
164170
if (form) {
165171
form.remove();

0 commit comments

Comments
 (0)