browser에서 msn메신저로 연결하는 script - 전화카드 판매 사이트에서 보고 베낀것
<html>
<head>
<title> javascript for msn chat </title>
</head>
<object height='0' width='0' id='MsgrObj'></object>
<script>
function msn(person,screen) {
// check msn messenger
try {
MsgrObj.classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28";
} catch(e) {
if(!(e.number && 2148139390) == 2148139390) {
alert( "you don't have msn messenger" );
return;
}
}
// check login status
if( MsgrObj.MyStatus == 1 ) {
alert( "you have to login" );
return;
}
// check person in contant list
try {
var contact = MsgrObj.GetContact(person,"");
} catch(e) {
if((e.number && 2164261642) == 2164261642) { //MSGR_E_USER_NOT_FOUND
if( confirm( "do you want to add "+screen+" to your contact list?" ) ) {
MsgrObj.AddContact(0,person);
}
}
}
MsgrObj.InstantMessage(person);
}
</script>
<body>
<a href="javascript:msn('june8th@hotmail.com','june8th')">msn chat with june8th</a>
</body>
</html>