Hello! I need help on how to create a var array for a list of about 500 cities. I am going to use this list in a geoIP variable to hide some text. I need the code to tell the if statement to look in the file 'cities.js', and if the city returned by the geoIP if statement equals a city in the list, then I need it to perform the function I have assigned. Here is the code snippet, I need the list of cities to replace the 'stockton', without just typing them all out in the html file: Here is my array: Anyone's help would be much appreciated!!!
try to check it in loop: for (var i=0; i < cityArray.length; i++) { if (geoip_city() == cityArray[i]){ HideText(); } } Code (markup):
Well, after inputing the code, the if and function statements did not work. I have the array in a seperate file on my server. I even pasted the entire array code into the .htm file, and it still did not respond. Here is the code snippet with external file: Not sure if there is still something wrong. Suggestions?
Actually, I found out what was wrong, I had an extra "}" and it was throwing the code out, and excluding the function code. Thanks for your help!!