I am setting up a link to Adobe's Aviary web app, which requires input in the following format:
<a href="#" onclick="return launchEditor('editableimage1',
'http://www.mywebsite.com/IMAGE.jpg');">Edit!</a>
I need to substitute a variable name for the IMAGE.jpg part of this, and I have tried to do this using the following code. Since the visual cues tell me that the variable name isn't being interpreted I already know this will fail, but I can't see how to express it properly. Sorry, very new to Javascript so hope someone can kindly help. Here's my code:
<script>
var imgNamePassed = sessionStorage.getItem('imgName');
console.log("imgName", imgNamePassed);
</script>
<a href='#' onclick="return launchEditor('editableimage1','http://www.mywebsite.com/ + imgNamePassed + "');" />"LINK TEXT</a>
Fix it to:
Example: JSFiddle