Silly question but I would like to create or set an image src that appends the current url after a string.
So I would like to write
<img src="//testURL.comaction?item={www.currenturl.com}" id="tabUrl" />
So {www.currenturl.com} will be replaced with the current URL
I know that I can get the current URL by using window.location.href; but how can I add this to a string?
Not sure if I should create a variable and apply it using document.getElementById
taboo = window.location.href;
Or do a document write similar to the example below
<script>document.write('<img src="'//testURL.comaction?item= +
window.location.href + '">')</script>
Any help is appreciated.