Online Javascript Escape Unescape

Input data
bfotool loadding
Output data
bfotool loadding

Javascript Escape Unescape tool helps you to escape and Unescape Javascript string when you want to output the Javascript directly not interpreted by browser.

How to Escape/ Unescape Javascript?

  • To Escape/ Unescape your Javascript data add/ copy and paste the Javascript data into the input.
  • You can also load the Javascript data from the url by clicking the  button or load the Javascript data from the computer by clicking the  button.
  • Click the 'Escape' or 'Unescape' button to process the data.
  • Once conversion is done you can download the file by clicking the  button.

Input Data

function download(content, fileName, mimeType) {
    var a = document.createElement('a');
    mimeType = mimeType || 'application/octet-stream';

    if (navigator.msSaveBlob) { // IE10
        navigator.msSaveBlob(new Blob([content], {
        type: mimeType
        }), fileName);
    } else {
        location.href = 'data:application/octet-stream,' + encodeURIComponent(content);
    }
}

After Escape

function download(content, fileName, mimeType) {\r\n    var a = document.createElement(\'a\');\r\n    mimeType = mimeType || \'application/octet-stream\';\r\n\r\n    if (navigator.msSaveBlob) { // IE10\r\n        navigator.msSaveBlob(new Blob([content], {\r\n        type: mimeType\r\n        }), fileName);\r\n    } else {\r\n        location.href = \'data:application/octet-stream,\' + encodeURIComponent(content);\r\n    }\r\n}