Reputation: 63
<script>
var1 = "http://ofuran.com";
var2 = "?ref=Df34hfgT"; var newlink = var1.concat(var2);
</script>
How I use this newlink variable in the following line? please help me by doing.
<?php echo '<script>window.open("http://www.ofuran.com", "_blank"); </script>'; ?>
Upvotes: 1
Views: 185
Reputation: 451
use the code:
<script>
var1 = "http://ofuran.com";
var2 = "?ref=Df34hfgT";
var newlink = var1.concat(var2);
</script>
<?php echo '<script>window.open(newlink, "_blank"); </script>'; ?>
Upvotes: 1
Reputation: 38502
You can try like this way,
var var1 = "http://ofuran.com";
var var2 = "?ref=Df34hfgT";
var newlink = var1.concat(var2);
window.open(newlink, "_blank");
Upvotes: 1