Javascript Escape Unescape kayan aiki yana taimaka muku tserewa da rashin jin daɗin kirtani na Javascript lokacin da kuke son fitar da Javascript kai tsaye ba fassara ta mai lilo ba.
Yadda Ake Gujewa/Javascript ba a Fadawa ba?
- Don Tserewa/Rarewa bayanan Javascript ƙara/ kwafi da liƙa bayanan Javascript cikin shigarwar.
- Hakanan zaka iya loda bayanan Javascript daga url ta danna maɓallin ko loda bayanan Javascript daga kwamfutar ta danna maɓallin.
- Danna maɓallin 'Escape' ko 'Unescape' don aiwatar da bayanan.
- Da zarar hira da aka yi za ka iya sauke fayil ta danna maballin.
Bayanan shigarwa
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);
}
}
Bayan Tserewa
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}