Reputation: 863
I know to open skype using its special commands in html to chat, for example:
<a href="skype:some_skype_user?chat">Chat</a>
One can click on "Chat" and it will launch Skype if it is installed.
However, I want to check if a customer is login to OUR SITE before he is able to chat. Once the person is login, I would like to launch Skype with a Javascript function so that he does not have to click on the "Chat" link to start Skype. So basically launching skype:some_skype_user?chat automatically. It must be something simple, but I can't seem to find any answer. Thanks in advance.
Upvotes: 2
Views: 5439
Reputation: 1972
Try 'redirecting' to the 'link':
window.location = 'skype:some_skype_user?chat';
Edit: To use a variable in place of some_skype_user
you need to concatenate it:
var skypename = 'skypeuser01';
window.location = 'skype:' + skypename + '?chat';
Upvotes: 4