Skip to content

Commit

Permalink
Merge pull request #88 from bregnholm/patch-1
Browse files Browse the repository at this point in the history
check if cookieValue is string
  • Loading branch information
johnculviner committed Mar 17, 2015
2 parents b9ad024 + 82685fd commit 0cbe641
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Scripts/jquery.fileDownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ $.extend({
//remove the perparing message if it was specified
if ($preparingDialog) {
$preparingDialog.dialog('close');
};
}

settings.successCallback(url);

Expand All @@ -208,7 +208,7 @@ $.extend({
//remove the perparing message if it was specified
if ($preparingDialog) {
$preparingDialog.dialog('close');
};
}

//wire up a jquery dialog to display the fail message if specified
if (settings.failMessageHtml) {
Expand Down Expand Up @@ -329,7 +329,13 @@ $.extend({

function checkFileDownloadComplete() {
//has the cookie been written due to a file download occuring?
var lowerCaseCookie = settings.cookieName.toLowerCase() + "=" + settings.cookieValue.toLowerCase();

var cookieValue = settings.cookieValue;
if(typeof cookieValue == 'string') {
cookieValue = cookieValue.toLowerCase();
}

var lowerCaseCookie = settings.cookieName.toLowerCase() + "=" + cookieValue;

if (document.cookie.toLowerCase().indexOf(lowerCaseCookie) > -1) {

Expand All @@ -356,7 +362,7 @@ $.extend({

var formDoc = downloadWindow ? downloadWindow.document : getiframeDocument($iframe);

if (formDoc && formDoc.body != null && formDoc.body.innerHTML.length) {
if (formDoc && formDoc.body !== null && formDoc.body.innerHTML.length) {

var isFailure = true;

Expand Down

0 comments on commit 0cbe641

Please sign in to comment.