Having an issue with my javascript code:
function updatePage() {
if (request.readyState == 4)
if (request.status == 200)
var data = JSON.parse(request.responseText);
update_select($('select[name=island_name]'), data);
else if (request.status == 404)
alert("Request url does not exist");
else
alert("Error: status code is " + request.status);
}
I'm consistently encountering an
Uncaught SyntaxError: Unexpected token if
error that stops the execution of my script. Any suggestions on how to resolve this?