Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

313
Views
¿Cómo puedo recibir todo el contenido de texto después de descargar el archivo xml con createObjectURL (blob)?
<a download="hello.xml" href='#' id="link">Загрузить</a> <script> var text = "<OPTP5101>Them-on-us Sale POS</OPTP5101><OPTP5102>Them-on-us Refund POS </OPTP5102>"; let blob = new Blob([text], {type: 'text/plain'}); link.href = URL.createObjectURL(blob); </script>

después de descargar el archivo y abrirlo, solo tengo lo siguiente

 Them-on-us Sale POS

Necesito todo el texto en el archivo xml después de descargarlo así.

 <OPTP5101>Them-on-us Sale POS</OPTP5101> <OPTP5102>Them-on-us Refund POS </OPTP5102>

¿Alguien sabe que me ayude por favor!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Encontré la solución cuando agregué al principio y al final del texto como este, todo se muestra cuando se abre con un navegador

 begining var text="<xml_cfg><global_params><param><name>OPTP</name><value>"; end text = text + "</value></param></global_params></xml_cfg>"

Y el código completo se parece a lo siguiente

 <a download="hello.xml" href="#" id="link">download xml</a> <script language="JavaScript"> var text="<xml_cfg><global_params><param><name>OPTP</name><value>"; $.ajax({ url: "rep.svxp_xml_download.download_xml_for_svxp", type: "POST", dataType: "json", data:{}, error: function(XMLHttpRequest, textStatus, errorThrown) { toastr.error("Произошла ошибка "+textStatus,"Информация", {"closeButton": true}); return; }, success: function(data){ for(let i=0; i<data.length; i++){ text = text + "<" + data[i].optp + ">" + data[i].description + "</" + data[i].optp + ">"; } text = text + "</value></param></global_params></xml_cfg>" let blob = new Blob([text], {type: "text/plain"}); link.href = URL.createObjectURL(blob); } }); </script
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!