Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix ill-defined reference to API_URL and GEOAPI_URL

  • Loading branch information...
commit c1e607678c300a535eb7acc58fa35fafaec60c9e 1 parent a614677
@JoeGermuska JoeGermuska authored
Showing with 12 additions and 14 deletions.
  1. +6 −6 censusweb/media/js/ire_census.js
  2. +6 −8 tools/js/ire_census.js
View
12 censusweb/media/js/ire_census.js
@@ -2,11 +2,11 @@
// jQuery
var ire_census = {};
(function() {
- this.API_URL = "http://censusdata.ire.org"
- this.GEOAPI_URL = "http://census.ire.org/geo/1.0"
+ this.API_URL = "http://censusdata.ire.org" // can be overridden
+ this.GEOAPI_URL = "http://census.ire.org/geo/1.0" // can be overridden
function apiRequest(path, callback, handler) {
- $.ajax(API_URL + path, {
+ $.ajax(ire_census.API_URL + path, {
dataType: "jsonp",
jsonpCallback: callback,
success: handler
@@ -51,7 +51,7 @@ var ire_census = {};
} else {
table = "";
}
- return this.API_URL + "/" + state + "/all_" + sumlev + "_in_"+state+table+"." + format;
+ return ire_census.API_URL + "/" + state + "/all_" + sumlev + "_in_"+state+table+"." + format;
}
this.build_shapefile_url = function(state,sumlev) {
@@ -114,7 +114,7 @@ var ire_census = {};
if (geoid.substr(0,'/boundary-set'.length) != '/boundary-set') {
geoid = '/boundary-set' + geoid;
}
- $.ajax(this.GEOAPI_URL + geoid, {
+ $.ajax(ire_census.GEOAPI_URL + geoid, {
dataType: "jsonp",
success: success_handler
});
@@ -136,7 +136,7 @@ var ire_census = {};
}
}
// 38.948337,-92.328032&sets=tracts,counties
- $.ajax(this.GEOAPI_URL + url, {
+ $.ajax(ire_census.GEOAPI_URL + url, {
dataType: "jsonp",
success: success_handler
});
View
14 tools/js/ire_census.js
@@ -2,13 +2,11 @@
// jQuery
var ire_census = {};
(function() {
- this.API_URL = "http://censusdata.ire.org"
- this.GEOAPI_URL = "http://census.ire.org/geo/1.0"
+ this.API_URL = "http://censusdata.ire.org" // can be overridden
+ this.GEOAPI_URL = "http://census.ire.org/geo/1.0" // can be overridden
function apiRequest(path, callback, handler) {
- var api_url = this.API_URL;
- console.log("apiRequest: " + api_url);
- $.ajax(api_url + path, {
+ $.ajax(ire_census.API_URL + path, {
dataType: "jsonp",
jsonpCallback: callback,
success: handler
@@ -53,7 +51,7 @@ var ire_census = {};
} else {
table = "";
}
- return this.API_URL + "/" + state + "/all_" + sumlev + "_in_"+state+table+"." + format;
+ return ire_census.API_URL + "/" + state + "/all_" + sumlev + "_in_"+state+table+"." + format;
}
this.build_shapefile_url = function(state,sumlev) {
@@ -116,7 +114,7 @@ var ire_census = {};
if (geoid.substr(0,'/boundary-set'.length) != '/boundary-set') {
geoid = '/boundary-set' + geoid;
}
- $.ajax(this.GEOAPI_URL + geoid, {
+ $.ajax(ire_census.GEOAPI_URL + geoid, {
dataType: "jsonp",
success: success_handler
});
@@ -138,7 +136,7 @@ var ire_census = {};
}
}
// 38.948337,-92.328032&sets=tracts,counties
- $.ajax(this.GEOAPI_URL + url, {
+ $.ajax(ire_census.GEOAPI_URL + url, {
dataType: "jsonp",
success: success_handler
});
Please sign in to comment.
Something went wrong with that request. Please try again.