There might be a duplicate of this (I’ve tried checking questions on creating dynamic links but they reference a static link – I want this link to be hidden from the user). On testing the following code on the ww3 site:
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
document.write("<a href="www.google.com">Google</a>");
</script>
</body>
</html>
I get:
http://www.w3schools.com/jsref/%22www.google.com%22
As the link address rather than http://www.google.com.
How do I correct this problem? And how do I make it so the link only appears after a set time? Note, this is a simplified version of the code for readability (the dynamic link will including two floating point variables assigned at the time the script is run).
You have 2 issues:
1) You need
http://before the URL so it’s: http://www.google.com2) You don’t need to use quotes in document.write, but if you want to you can do one of these 3: