0

I'm facing a huge issue.

I'm doing a login for a customer, and I was doing this way:

function Saltar(pal){
if (pal=='10528'){window.open('http://www.google.es','_parent')}

Then, a button called to the action, and if the value is correct, it redirects to the URL.

The problem is the client gave me a list of 2572 values in Excel, and I don't really feel like writting all them down, one by one.

Is there anything I can do to automate/semiautomate this?

Thanks in advance.

  • See this thread on converting CSV/XLS to JSON. http://stackoverflow.com/questions/662859/converting-csv-xls-to-json – litel Apr 15 '16 at 00:07
  • If the values don't have any order/pattern (range, modulus, whatever) and have to be saved individually, I'd save as csv, json or plaintext in the spreadsheet program and convert the data to a JavaScript array using python, shell/bash or simple search and replace in an IDE. – jDo Apr 15 '16 at 00:11

1 Answers1

0

Convert the XML file to JSON. Then access the JSON object from Javascript.

Tomasito665
  • 1,188
  • 1
  • 12
  • 24