diff --git a/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json b/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json index d9198a6935..f7116fe364 100644 --- a/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json +++ b/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json @@ -447,7 +447,7 @@ "You will see a prompt to allow or block this site from knowing your current location. The challenge can be completed either way, as long as the code is correct.", "By selecting allow you will see the text on the output phone change to your latitude and longitude", "Here's some code that does this:", - "
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);
});
}
" + "
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);
});
}
" ], "challengeSeed": [ "fccss", @@ -463,7 +463,10 @@ "" ], "tests": [ - "assert(code.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'message: You should make use of the navigator.geolocation to access the users current location.');" + "assert(code.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'message: You should make use of navigator.geolocation to access the users current location.');", + "assert(code.match(/position\\.coords\\.latitude/gi), 'message: You should make use of position.coords.latitude to display the users' latitudinal location.');", + "assert(code.match(/position\\.coords\\.longitude/gi), 'message: You should make use of position.coords.longitude to display the users' longitudinal location.');", + "assert(code.match(/\\$\\(\\s*\"#data\"\\s*\\)\\s*\\.html\\([.\\w\\W]*?\\);/gi), 'message: You should display the users' position within the data div element');" ], "type": "waypoint", "challengeType": 0,