代码添加按钮SMS Whatsapp和电子邮件

时间:2016-01-24 00:38:37

标签: button share

我几周试图在WP主题中添加按钮SMS Whatsapp和电子邮件,但我有错误。

window.open(link, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width='+winWidth+',height='+winHeight);
}

function eh_get_fburl(title, descr, url){
  return 'http://www.facebook.com/share.php?u=' +encodeURIComponent(url)+ '&title=' + encodeURIComponent(title);
}

function eh_get_twurl(title, url){
  return 'http://twitter.com/home?status=' + encodeURIComponent(title) + '+' + encodeURIComponent(url);
}

function eh_get_gpurl(url){
  return 'https://plus.google.com/share?url=' + encodeURIComponent(url);
}

function eh_get_lnurl(title, url){
  return 'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title);
}

function eh_get_waurl(title, url){
  return 'whatsapp CODE' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title);
}

function eh_get_txurl(title, url){
  return 'SMS CODE' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title);
}

function eh_get_emurl(title, url){
  return 'Email CODE" + title + "&body=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title);
}

1 个答案:

答案 0 :(得分:0)

对于whatsapp:

.
|-- foobar
|   `-- test
|       `-- com
|           |-- FooBarRemoteService.class
|           |-- GetBar.class
|           |-- GetBarResponse.class
|           |-- GetFoo.class
|           |-- GetFooResponse.class
|           |-- InterfaceFooBar.class
|           |-- ObjectFactory.class
|           `-- package-info.class
`-- subpackage
    |-- bar
    |   |-- Bar.class
    |   |-- ObjectFactory.class
    |   `-- package-info.class
    `-- foo
        |-- Foo.class
        |-- ObjectFactory.class
        `-- package-info.class

对于短信:

return "whatsapp://send?text="+encodeURIComponent(url)+" "+encodeURIComponent(title)

发送电子邮件:

return "sms:my_phone_number?body="+encodeURIComponent(url)+" "+encodeURIComponent(title)