Is it possible to create a xsl variable using
<xsl:variable name="x"><xsl:value-of select="country" /></xsl:variable>
using a javascript variable?
The variable "country" is created in another javascript file, that is not embedded within the xslt. I am trying to get the country of user's location using ajax.
--------------Javascript File--------------
$(document).ready(function()
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$.getJSON('http://ws.geonames.org/countryCode', {
lat: position.coords.latitude,
lng: position.coords.longitude,
type: 'JSON'
}, function(result) {
country = result.countryCode;
});
});
};
If there is a better way, please do reply. Thanks in advance.