Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/430.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用带有个性化按钮的skype-uri.js?_Javascript_Skype - Fatal编程技术网

Javascript 如何使用带有个性化按钮的skype-uri.js?

Javascript 如何使用带有个性化按钮的skype-uri.js?,javascript,skype,Javascript,Skype,我想使用中的skype ui,但我不喜欢使用skype提供的“图像资产”。我已经创建了我的个性化Skype按钮,我想使用它。我该怎么做 我知道有这样一个代码: <a href="skype:echo123?call">Call</a> the Skype Echo / Sound Test Service Skype回声/声音测试服务 它可以很容易地作为任何类型的按钮使用,但是当在没有安装任何skype的计算机上使用它时,它不允许我在skype的下载页面中重定向。与使

我想使用中的skype ui,但我不喜欢使用skype提供的“图像资产”。我已经创建了我的个性化Skype按钮,我想使用它。我该怎么做

我知道有这样一个代码:

<a href="skype:echo123?call">Call</a> the Skype Echo / Sound Test Service
Skype回声/声音测试服务 它可以很容易地作为任何类型的按钮使用,但是当在没有安装任何skype的计算机上使用它时,它不允许我在skype的下载页面中重定向。与使用js脚本时不同:

<div id="call_32" style="width:20%;background-color:#0094ff">
<script type="text/javascript">
    Skype.ui({
        name: "call",
        element: "call_32",
        participants: ["echo123"],
        imageSize: 32,
        imageColor: "white"
    });
 </script>
</div>

Skype.ui({
名称:“呼叫”,
元素:“调用_32”,
与会者:[“echo123”],
图像大小:32,
图像颜色:“白色”
});
但它不允许我使用个性化按钮

请帮忙

谢谢


马克

我知道这个问题有点老了,但由于我刚刚面临同样的问题,我想我会分享我的解决方案

按照按钮前的指示包含skypeui.js包

<script type="text/javascript" src="http://cdn.dev.skype.com/uri/skype-uri.js"></script>

然后只需使用以下标记,将“myskypename”替换为您想要呼叫的skype名称或号码

<div id="MyDiv">
   <a onclick="Skype.tryAnalyzeSkypeUri('call', '0');" href="skype:myskypename?call">
      <img role="Button" src="/images/mybutton.gif">
   </a>
</div>

试试这个,这个很有效

<html>
<script type="text/javascript" src="http://www.skypeassets.com/i/scom/js/skype-uri.js"></script>
<div id="SkypeButton_Call_dhruv_1">
  <script type="text/javascript">
    Skype.ui({
      "name": "call",
      "element": "SkypeButton_Call_dhruv_1",
      "participants": ["dhruv"],
      "imageSize": 32
    });
  </script>
</div>
</html>

Skype.ui({
“名称”:“呼叫”,
“元素”:“SkypeButton\u Call\u dhruv\u 1”,
“参与者”:[“dhruv”],
“图像大小”:32
});
`
阅读更多有关skype按钮的信息

1)插入skype按钮,如下所述:

2) 隐藏skype按钮div

$('#SkypeButton_Call_your_skype_id_1').css('display', 'none');
3) 放置您自己的图像/链接

<a href="" onclick="skype_contact();">Call me</a>
基于

支持呼叫和聊天链接

将echo123替换为您的skype ID

脚本:

<script src="https://secure.skypeassets.com/i/scom/js/skype-uri.js"></script>

<script>
// code for adding and clicking hidden Skype buttons
var
SkypeButtons_ek = {},

// call when doc ready to setup the hidden button
// id = any unique id, user = your skype user id, type = call or chat
SkypeButton_ek_add = function(id, user, type){
  SkypeButtons_ek[id] = {user: user, type: type};
  jQuery("body").append('<div id="SkypeButton_ek_'+id+'"></div>');
  Skype.ui({
    "name": type,
    "element": "SkypeButton_ek_"+id,
    "participants": [user]
  });
  jQuery("#SkypeButton_ek_"+id+", #SkypeButton_ek_"+id+" > iframe").hide();
},

// call from your own link/button/event
// id is the same id you passed to SkypeButton_ek_add
SkypeButton_ek_click = function(id){
  if (SkypeButtons_ek[id].type == 'chat')
    SkypeWebControl.SDK.Chat.startChat({ConversationType: 'person', ConversationId: SkypeButtons_ek[id].user});
  else {
    Skype.tryAnalyzeSkypeUri(SkypeButtons_ek[id].type, '0');
    Skype.trySkypeUri_Generic('skype:'+SkypeButtons_ek[id].user+'?'+SkypeButtons_ek[id].type+'', jQuery('#SkypeButton_ek_'+id+' > iframe').attr('id'), '0');
  }
};

// add Skype buttons hidden
jQuery(document).ready(function($){
  SkypeButton_ek_add(1, 'echo123', 'chat'); 
  SkypeButton_ek_add(2, 'echo123', 'call'); 
});
</script>

//添加和单击隐藏Skype按钮的代码
变量
Skypeek={},
//当文档准备好设置隐藏按钮时调用
//id=任何唯一id,用户=您的skype用户id,类型=通话或聊天
SkypeButton_ek_add=功能(id、用户、类型){
skypeek_ek[id]={user:user,type:type};
jQuery(“正文”)。附加(“”);
Skype.ui({
“名称”:类型,
“元素”:“天空按钮”+id,
“参与者”:[用户]
});
jQuery(“#SkypeButton_ek_ek”+id+”,#SkypeButton_ek_ek”+id+“>iframe”).hide();
},
//从您自己的链接/按钮/事件呼叫
//id与您传递给SkypeButton_ek_add的id相同
SkypeButton_ek_click=功能(id){
如果(SkypeButtons_ek[id]。类型==“聊天室”)
SkypeWebControl.SDK.Chat.startChat({ConversationType:'person',ConversationId:SkypeButtons_ek[id].user});
否则{
Skype.tryAnalyzeSkypeUri(SkypeButtons_ek[id]。键入“0”);
Skype.trySkypeUri_Generic('Skype:'+SkypeButtons_ek[id]。用户+'?'+SkypeButtons_ek[id]。键入+'',jQuery('SkypeButton_ek_ek+id+'>iframe')。属性('id'),'0');
}
};
//添加隐藏的Skype按钮
jQuery(文档).ready(函数($){
SkypeButton_ek_添加(1,'echo123','chat');
SkypeButton_ek_add(2,'echo123','call');
});
标记

<a href="" onclick="SkypeButton_ek_click(1); return false;">Skype Chat</a>
<a href="" onclick="SkypeButton_ek_click(2); return false;">Skype Call</a>


当然,您可以向任何事件添加或绑定
SkypeButton\u ek\u click
调用

很好!对我有用。谢谢分享。这是最好的答案!谢谢?这是一个怎样的答案?
<script src="https://secure.skypeassets.com/i/scom/js/skype-uri.js"></script>

<script>
// code for adding and clicking hidden Skype buttons
var
SkypeButtons_ek = {},

// call when doc ready to setup the hidden button
// id = any unique id, user = your skype user id, type = call or chat
SkypeButton_ek_add = function(id, user, type){
  SkypeButtons_ek[id] = {user: user, type: type};
  jQuery("body").append('<div id="SkypeButton_ek_'+id+'"></div>');
  Skype.ui({
    "name": type,
    "element": "SkypeButton_ek_"+id,
    "participants": [user]
  });
  jQuery("#SkypeButton_ek_"+id+", #SkypeButton_ek_"+id+" > iframe").hide();
},

// call from your own link/button/event
// id is the same id you passed to SkypeButton_ek_add
SkypeButton_ek_click = function(id){
  if (SkypeButtons_ek[id].type == 'chat')
    SkypeWebControl.SDK.Chat.startChat({ConversationType: 'person', ConversationId: SkypeButtons_ek[id].user});
  else {
    Skype.tryAnalyzeSkypeUri(SkypeButtons_ek[id].type, '0');
    Skype.trySkypeUri_Generic('skype:'+SkypeButtons_ek[id].user+'?'+SkypeButtons_ek[id].type+'', jQuery('#SkypeButton_ek_'+id+' > iframe').attr('id'), '0');
  }
};

// add Skype buttons hidden
jQuery(document).ready(function($){
  SkypeButton_ek_add(1, 'echo123', 'chat'); 
  SkypeButton_ek_add(2, 'echo123', 'call'); 
});
</script>
<a href="" onclick="SkypeButton_ek_click(1); return false;">Skype Chat</a>
<a href="" onclick="SkypeButton_ek_click(2); return false;">Skype Call</a>