如何在Javascript中启动Skype,而不被window.location重定向? [英] How to launch Skype without being redirected by window.location in Javascript?

查看:3472
本文介绍了如何在Javascript中启动Skype,而不被window.location重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否可能,或者我只是做错了方式。
我想做的是调用一个函数,它检查数据库以获取skype id(用户B),并验证用户A是否登录。如果用户A登录并且找到用户B的Skype ID,则启动Skype。如果没有,没有发生。听起来很简单....

I am not sure if this is possible or maybe I am just doing it the wrong way. What I want to do is to call a function which checks the database to get the skype id (user B) and verify if user A is login. If user A is login and a Skype ID for user B is found then start up Skype. If not, nothing happens. Sounds simple enough....

当用户(用户A)点击表单上的图片按钮时调用该函数。

A function is called when a user (user A) click on an image button on a form.

例如在start.html上

For example on start.html

<a href="#" onclick="skypeme('var1','var2'); return false"><img src="images/chat.png" ></a>

skypeme是一个javascript函数,如下所示:

skypeme is a javascript function like this:

<script>
function skypeme(a,b) {
    window.location = 'skypeme.cfm?a=' + a + '&b=' + b;
    }
</script>

调用skypeme.cfm执行所有数据库检查:

which calls skypeme.cfm to do all the database checking:

check the database and see if user A is login.... 
if user A is login, check if user B has skype ID
       if skype id is found for user B do this
           <script language="javascript">
           window.location = 'skype:#skype_id#?chat';
           </script>
       else do nothing 
else user A is not login
    <script language="javascript">
    signin('#a#','#b#');
    </script>

skypeme.cfm正在完成它的工作,并在所有东西都被检出时启动Skype。然而,问题是当用户点击start.html上的按钮,他被指向一个空白页skypeme.cfm(skypeme.cfm不显示任何东西,但检查)然后skype开始。

The skypeme.cfm is doing its job and start up Skype when everything is checked out fine. However, the problem is when user click on the button on start.html, he is directed to a blank page skypeme.cfm (skypeme.cfm doesn't display anything but checking) then the skype starts.

有什么办法做到这一点,当用户点击start.html上的聊天按钮,他会在start.html页面上REMAIN,而skype.cfm检查数据库和启动Skype与JavaScript代码?这可能是简单的,但我只是不能得到它这样做。任何帮助是赞赏。提前感谢。

Is there any way to do it so that when the user click on the chat button on start.html, he will REMAIN on the start.html page while skype.cfm check the database and kick up Skype with javascript code? This maybe something simple but I just can't get it to do that. Any help is appreciated. Thanks in advance.

推荐答案

使用重定向到链接

window.location = 'skype:' + phone + '?call';

这篇关于如何在Javascript中启动Skype,而不被window.location重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆