jQuery (". custom-filter-options .sbHolder ul li a"). each (function () {var myStr = jQuery (this) .text (); var myArr = myStr.split ("( "), url = 'ваш url'; // New Code data = myArr [0]; try {jQuery.ajax ({url: url, context: this, type: 'post', data: data, success: function ( data) {if (data) {jQuery (this) .html (data);} else {jQuery (this) .html (myArr [0]);}}};} catch (e) {}}); [ ! d0]
Вы можете запустить хром-браузер с флагом --allow-file-access-from-files
, использовать fetch()
из XMLHttpRequest()
для запроса файла из локальной файловой системы.
fetch("file:///path/to/file")
.then(response => response.arrayBuffer())
.then(ab => {
// do stuff with `ArrayBuffer` representation of file
})
.catch(err => console.log(err));
См. также Чтение локального XML с JS