views:

97

answers:

2

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?

+1  A: 

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

Pedro Ladaria
Thank you. That is helpful. If you know about blogger language book or syntax language (b:if ...), tell me please
ebattulga
Pedro Ladaria
Very thanks for you
ebattulga
A: 

@ebattulga Have you got the solution. I have come across with the same problem. I want to access "data:blog.url" within a Java Script (for share this scriptlet)

Sumit Pranav