HTML gotoURL问题

时间:2015-07-26 19:42:24

标签: html

function goToPage(url){
var initial = "http://www.blossompromotions.com/-p-";
var extension = ".html";
var link = document.getElementById('gotoURL');
link.innerHTML = url ? initial+url+extension : '' ;
link.href = initial+url+extension;
}
<FORM name="something" action="#">
Label 
<INPUT type="text" name="url" value="" onkeyup="goToPage(this.value)">
<INPUT type="submit" value="GO">
</FORM>
<a href="" id="gotoURL"></a>

我想为whatsapp创建一个分享按钮,它是: a href =“whatsapp:// send”data-text =“看一下这个很棒的网站: gotoURL的价值 ”data-href =“”分享

我无法找到办法做到这一点,任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

function goToPage(url){
var initial = "http://xxxx.com/aff_c?offer_id=36&aff_id=1088&source=";
var extension = "";
var link = document.getElementById('gotoURL');
var link1 = document.getElementById('gotoURL1');
link1.innerHTML = url ? initial+url+extension : '' ;
link1.href = initial+url+extension;
link.href = initial+url+extension;
}
   
    <body background="1.jpg">
        
<h1><font><b><i><font face="helvetica">Refer & Earn</font></h1>
        </b>
        </i>
<font><font face="helvetica">



<FORM name="something" action="#">

<fieldset>
<legend><b> Your Referral URL </b></legend>
<font><font color="yellow"><b><i> Enter your mobile number and then copy the link and share.</font>
        </b>
        </i>
        <br>
        <INPUT type="text" name="url" value="" onkeyup="goToPage(this.value)">
        </FORM>
        <br>
        <br>
        <br>
        <br>
        <fieldset><font><font color="white"><br> Your Unique Referral Link:  <a href="" id="gotoURL1"></a></font>
        </fieldset>
        <br>
        <br>
        <br>
        <br>
        <br>
<a href="whatsapp://send" data-text="Take a look at this awesome website:" id="gotoURL">Share</a>