I m trying to match subdirectory and populate the variable according to it. This is what I have done so far.
For example i have a domain (www.mydomain.com/city/).
<script type="text/javascript">
var lnk = "";
if (window.location.href.match("city")) {
lnk = "aqer123";
} else if (window.location.href.match("country")) {
lnk = "aber321";
}
Then this "lnk" variable should becomes the value of disqus_shortname
var disqus_shortname = 'lnk'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
It is not working. Is there an alternative way of populating variable according to subdomain? Any help would be great.