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 function is called when a user (user A) click on an image button on a form.
For example on start.html
<a href="#" onclick="skypeme('var1','var2'); return false"><img src="images/chat.png" ></a>
skypeme is a javascript function like this:
<script>
function skypeme(a,b) {
window.location = 'skypeme.cfm?a=' + a + '&b=' + b;
}
</script>
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>
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.
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.