I'm trying to use the value of a JavaScript variable; however, for some reason, document.write
is not working.
Can you tell me what am I doing wrong and if there's another way to do this? Here is my JavaScript code:
<script type="text/javascript">
var url=${paramValue};
url = url.replace(/\s/g,"%20");
document.write("<a href='" + url + "'>" +
"<img src='/folder1/folder2/folder3/folder4/folder5/image.png'" +
" width='70' height='20'></a>");
</script>
The variable url=${paramValue};
is working, as I can check it with firebug.
The image is not appearing.