Javascript – Objects

Javascript – Objects

In Javascript, objects are arrays where indexes are the property names. You can declare an object: var person = {}; The properties are separated with ‘,’ and the key/value for its property is separated with ‘:’. The property name can have single quotes, double quotes or nothing. name:”Kronos” ‘name’:”Kronos” “name”: “Kronos” You can access a property using ‘.’. If the property name starts with a number or is a reserved word then you have to use ‘[]’ and quotes: person.name = “Kronos”; person[‘1name’] = “Kronos”; An object can contain another…

Javascript – Objects Read More

Javascript – Geolocation API

Javascript – Geolocation API

With Geolocation API, the user can provide their location to web sites. You can access it with the navigation.geolocation object. Check if the browser supports the API: To get the current position: If you want to follow the location in case it changes then you can use the watchPosition() method. It also returns a unique id which you can use to identify the requested position. Javascript – Geolocation API

Javascript – Geolocation API Read More

Javascript – Audio, Video & WebCam API

Javascript – Audio, Video & WebCam API

HTML Audio and Video elements have methods, properties and events that can be changed/called from Javascript. Properties currentSrc currentTime videoWidth videoHeight error muted seeking volume height width controls Read-only propertied played startTime duration ended paused seekable Methods play pause load canPlayType Events play pause progress error timeupdate ended abort empty emptied waiting loadedmetadata If you want to access the WebCam you need to use the getUserMedia API Javascript – Audio, Video & WebCam API

Javascript – Audio, Video & WebCam API Read More