Skip to content

Commit d9e9100

Browse files
save jhd
1 parent c1a7539 commit d9e9100

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

SJPv6/www/sjp.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ function getLagnaTable(AscData,date_time,longitude,latitude){
390390
}
391391

392392
// Function to download data to a file
393-
function download(data, filename, type) {
393+
function download_old(data, filename, type) {
394394
var file = new Blob([data], {type: type});
395395
if (window.navigator.msSaveOrOpenBlob) // IE10+
396396
window.navigator.msSaveOrOpenBlob(file, filename);
@@ -407,6 +407,17 @@ function download(data, filename, type) {
407407
}, 0);
408408
}
409409
}
410+
function download(data, filename, type) {
411+
var blob = new Blob([data], { type: 'application/octet-stream' });
412+
var link = document.createElement('a');
413+
link.href = window.URL.createObjectURL(blob);
414+
link.download = filename;
415+
416+
// Append to the body, click and remove
417+
document.body.appendChild(link);
418+
link.click();
419+
document.body.removeChild(link);
420+
}
410421
function deleteAllCookies() {
411422
const cookies = document.cookie.split(";");
412423

@@ -461,7 +472,7 @@ function getJHDStringEsc( parray){
461472
+"0\r\n"//Line18:1 (If 1 use temperature for calculations)
462473
;
463474
download(str,parray['chartname']+".jhd","text");
464-
return str;
475+
//return str;
465476
}
466477

467478

0 commit comments

Comments
 (0)