javascript - Get A Script To Work Using hostname To Grab URL -
I'm trying to figure out how this script works and it's disappointing.
Here's the original:
& lt; Script Type = 'Text / Javascript: I'm trying to improve the script by holding the URL instead of entering the URL manually. '& Gt; MakeSlider ({url: "http://yourdomain.com/" // Add your blog URL}); & Lt; / Script & gt;
Here's what I've tried (and others like this):
& lt; Script type = 'text / javascript' & gt; Mascular ({url: "http /" + window.location.hostname + /}); & Lt; / Script & gt;
I also tried to use a variable:
& lt; Script type = 'text / javascript' & gt; Var getDomain = "http //" + window.location.hostname + /, Mass Slider ({url: getDomain}); & Lt; / Script & gt;
None of my efforts work out.
Try
var getDomain = "http: //" + Window.location.hostname + "/";
Comments
Post a Comment