-5

In this below codes, i want a script that will display the full url of a page inside where there is FULL URL! Please help me! Note, my site is just an xhtml site(Wapka.Mobi)

var disqus_url = 'FULL URL';
(function () {
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript';
    dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
Huangism
  • 16,278
  • 7
  • 48
  • 74
  • 1
    This question is lacking in the research department https://www.google.ca/search?q=how+to+get+full+url+of+page&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gfe_rd=cr&ei=NLtzU9qVGIKN8QeF1oDQDg#channel=fflb&q=get+page+url+with+javascript&rls=org.mozilla:en-US:official&safe=off – Huangism May 14 '14 at 18:51
  • You can use `document.documentURI` or `document.URL` to get the full document location. The only main difference between them is that `document.documentURI` will be available on **every types** of documents (e.g. xml) while `document.URL` will works on **HTML** documents only. Moreover, it has been introduced from the DOM4 specification (See the MDN for more informations about it : https://developer.mozilla.org/en-US/docs/Web/API/document.documentURI). In case of doubt, you might prefer using `document.documentURI`. – jmpp May 14 '14 at 19:05

2 Answers2

0

The solution will be:

var disqus_url = window.location;
Mark Rijsmus
  • 627
  • 5
  • 16
0
var disqus_url = document.location.href;
petey
  • 16,914
  • 6
  • 65
  • 97