JSB Insurance

Better Coverage for less money = Hassle-Free Savings

Better Insurance. By The Numbers.

How much will you save?

Error:

Please enter a Zip Code.

“; var overlay_over = $(error); overlay_over.show(); overlay_over.appendTo(document.body); return false; return false; } else { if (temp[0].length != 5) { var overlay_error = $(”); overlay_error.show(); overlay_error.appendTo(document.body); $(‘.overlay_error’).css(‘visibility’, ‘visible’); $(‘.overlay_error’).css(‘opacity’, ‘1’); $(‘#popup’).hide(); var error = “X

Error:

Please enter a valid Zip Code.

Eg: 91411 or 91411-1927

“; var overlay_over = $(error); overlay_over.show(); overlay_over.appendTo(document.body); return false; return false; } get_code(zip); } } // count == 1 else if (count == 2) { if (temp[0] == “” || temp[1] == “” || temp[0].length != 5 || temp[1].length != 4) { var overlay_error = $(”); overlay_error.show(); overlay_error.appendTo(document.body); $(‘.overlay_error’).css(‘visibility’, ‘visible’); $(‘.overlay_error’).css(‘opacity’, ‘1’); $(‘#popup’).hide(); var error = “X

Error:

Please enter a valid Zip Code.

Eg: 91411 or 91411-1927

“;
var overlay_over = $(error);
overlay_over.show();
overlay_over.appendTo(document.body);
return false;
return false;
}
get_code(zip);
}
}
function get_code(zip) {
var URL = ‘https://maps.googleapis.com/maps/api/geocode/json?address=’ + zip + ‘&sensor=true&key=AIzaSyAwIKs6sVqcNyFR-hFYPqX4fZtavHsCKmQ’;
$.ajax({
url: URL,
type: ‘GET’,
success: function (resp) {
console.log(resp);
if (resp.status == “ZERO_RESULTS”) {
//alert(“Invalid Zip Code”);
var overlay_error = $(”); overlay_error.show(); overlay_error.appendTo(document.body); $(‘.overlay_error’).css(‘visibility’, ‘visible’); $(‘.overlay_error’).css(‘opacity’, ‘1’); $(‘#popup’).hide(); var error = “”; var overlay_over = $(error); overlay_over.show(); overlay_over.appendTo(document.body); return false; } else if (resp.status == “OK”) { console.log(‘workok’, zip); $(‘#secondfiled’).val(zip); resp.results[0].address_components.forEach(function (value) { if (value.types[0] == ‘administrative_area_level_1’) { $(‘#state’).val(value.long_name); } if (value.types[0] == ‘administrative_area_level_2’) { $(‘#city’).val(value.long_name); } }); var overlay = $(”); overlay.show(); overlay.appendTo(document.body); $(‘#popup’).show(); } else { // alert(“Invalid Zip Code”); var overlay = $(”); overlay.show(); $(‘#popup’).hide(); return false; } }, error: function (e) { alert(‘Error: ‘ + e); } }); }

Source

0 Replies to “JSB Insurance”