javascript - Grab File From Address Using hostname -
How do I ask this question properly, it is not at all obvious.
I am trying to customize an existing script and it so that people do not manually enter the URL to use the domain: window.location.hostname
.
Original code:
& lt; Script type = "text / javascript" src = "http://enter-your-domain.com/feeds/comments/default?alt=json&max-results=5" & gt; & Lt; / Script & gt;
This is what I tried:
I do not understand how it works properly.
You are twice the nest of the Sprague Tag, just use:
< Pre> & lt; Script type = "text / javascript" & gt; Var getDomain = "http //" + window.location.hostname + '/ feeds / comments / default? Alt = Jason and max-result = 5 'Return Guest Domain & lt; / Script & gt;
Comments
Post a Comment