javascript - Cant get the syntax correct for a practice template -


i hope isn't code through correct think may few syntax errors. getting lots of different types of errors have gone through , tried code compile recent "critical error detected @ line 33, column 5 in ms-appx://io.cordova.myapp7523d86d4f8a4241bd8c3bad3d5fe0a3/www/scripts/index.js. script1006: expected ')", "setplaceholderimage()" line.

this practice template app can found @ https://msdn.microsoft.com/en-us/magazine/dn879349.aspx titled:cross-platform : write cross-platform hybrid apps in visual studio apache cordova.

(function () {     "use strict";     document.addeventlistener('deviceready', ondeviceready.bind(this),         false);      function ondeviceready() {          // perform other initialization here.     };     locate();     document.getelementbyid("btnlocate").addeventlistener("click", locate);      (function locate() {         navigator.geolocation.getcurrentposition(function (position) {             app.lastposition = {                 latitude: position.coords.latitude,                  longitude: position.coords.longitude,                 address: "(  position.coords.latitude  )" + "(  position.coords.longitude  )" };              // go translate coordinates address using bing map web api.             updateposition();         }, function (error) {             winjs.log && winjs.log("unable location: "              + error.message, "app");         }, {             maximumage: 3000, timeout: 10000, enablehighaccuracy: true         });     }      setplaceholderimage(){ document.getelementbyid("photo").addeventlistener("click",   capturephoto.bind(photo)); } function capturephoto() {     var photodiv = this;     // capture camera image file.     navigator.camera.getpicture(camerasuccess, cameraerror) {         quality: 50,         destinationtype: camera.destinationtype.file_url,         encodingtype: camera.encodingtype.jpeg,         mediatype: camera.mediatype.picture,         allotedits: true         correctorientation: true     });     function camerasuccess(imagefile) {         // save share , enable share button.         app.lastcapture = imagefile;         document.getelementbyid("btnshare").disabled = false;         // letterboxing , assign img.src.         scaleimagetofit(photodiv.queryselector("img"),            photodiv, app.lastcapture);     };     function cameraerror(error) {         winjs.log && winjs.log("unable obtain picture: " + error, "app");     }; }  document.getelementbyid("btnshare").addeventlistener("click", app.share); function share() {     var txtlocation = document.getelementbyid("txtlocation").value;     plugins.socialsharing.share("at " + txtlocation, "here am!",       app.lastcapture); }  } )(); 


Comments