HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Search
-
how to get correct site url when using javascript
how to get correct url when using javascript? like you can get the url by using {link path="/"} on default.master.tpl. I want to change the background by using javascript. The background-image changed when the page is load, but after i go to another page , the background-image disappeared. I use this path to set the… -
Re: how to get correct site url when using javascript
You can retrieve the root-relative path of Vanilla with gdn.url('/');. This will work even if Vanilla is in a sub-directory. For your image, you can do: document.getElementById("Body").style.backgroundImage = "url(" + gdn.url('/themes/Elegant/design/images/nontransparent/1.png') + ")"; "gdn" is a global library that is…
2 results