Question

I'm using blogger.com. I need to use data:blog.url variable on the javascript. But i don't know how to assign to any javascript variable.

How to get blogspot variables on the javascript?

Was it helpful?

Solution

if this doesn't works:

<script>
  var blogURL = '<data:blog.url/>';
</script>

then try this:

<div id="blogurl" style="display:none;"><data:blog.url/></div>
<script>
  var blogURL = document.getElementById('blogurl').innerHTML;
</script>

But if you want to get the page URL in javascript you can use window.location

disclaimer: i've never used blogger

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top