Back to Demos List

GSW Browser: GSW Variables


This page displays the variables that are available to the GSW Broswer.





About This Demo

This demo is using the gswconnectbot plugin.


var GSW = GSW || {};
GSW.Tests = GSW.Tests || {};

GSW.Tests.onDeviceReady = function() {
	// Cordova is now initialized. Have fun!
	console.log('Now running cordova-' + cordova.platformId + '@' + cordova.version);
	GSW.Tests.getVariables = function() {
		var cont = document.getElementById('variables');
		var ul = document.createElement('ul');
		ul.setAttribute('style', 'padding: 0; margin: 0;');
		ul.setAttribute('id', 'theList');

		for (var prop in navigator.gswconnectbot.clientStrings) {
			if (navigator.gswconnectbot.clientStrings.hasOwnProperty(prop)) {
				var li = document.createElement('li');
				li.innerHTML = (prop + ' = ' + navigator.gswconnectbot.clientStrings[prop]);
				li.setAttribute('style', 'display: block;');
				ul.appendChild(li);
			}
		}
		cont.appendChild(ul);
	}
	document.getElementById("display").addEventListener("click", GSW.Tests.getVariables);
}
document.addEventListener('deviceready', GSW.Tests.onDeviceReady, false);