| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Ajax
- 자바스크립트
- COM+
- GTD
- .net
- GDI+
- jQuery
- XML
- 게으름
- 개발자
- Sliverlight
- 리팩토링
- hnd-7070
- Web 2.0
- C#
- 검색
- MS
- 백신
- ASP.NET
- WEb 2.0 Expo
- 구글
- 실버라이트2
- 해킹
- JavaScript
- 실버라이트
- 성공
- 전기차
- 형태소분석기
- 암호화
- silverlight
- Today
- Total
꿈으로 가는 작은 계단
자바스크립트를 이용한 MSN다루기 본문
// 자료실 SDK 참조하세요.
var obj;
var gChecker = "10331358";
// 1033 US
__ 1358체커게임
var gHex = "10331003";
// __ 1003 헥사게임
function
Button1_onclick() {
try {
obj = new
ActiveXObject("MSNMessenger.P4QuickLaunch");
}
catch (e)
{
alert(e); obj = null;
}
if(obj != null)
obj.LaunchApp(gChecker, ""); // 메신저 실행, 게임상대 select
}
다음음 예제입니다.
<script type="JavaScript">
<!--
var obj;
var
winModalWindow;
var AppID = "10331003";
var emailID = "";
//In the code
variable declarations above, the AppID variable is assigned the value of the
game Hexic (1003) for users
//within the US (1033). You should substitute the
correct value assigned to your application (by the Support team)
//for your
desired market.
function TryItNow(AppID)
{
// Test #1: Launch with
no email variable value causing the user to have to select another user to
interact with.
CheckMessenger();
LaunchApp(AppID,
"");
}
function LaunchApp(AppID, emailID)
{
if (obj !=
null)
{
obj.LaunchApp(AppID, emailID);
}
}
function
CheckMessenger()
{
eval ('try {obj = new
ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {obj = null;}');
var
strErrorPage = "http://" + [HOSTNAME] + "/Error.aspx"
if ([Browser is
not IE])
{
ShowWindow(strErrorPage, 410, 130);
}
else if (obj ==
null)
{
ShowWindow(strErrorPage, 410,
225);
}
}
function IgnoreEvents(e)
{
return
false
}
//Display error message if the MSN Messenger client 6.2 is not
installed or the browser is not Internet Explorer
function
ShowWindow(strError, width, height)
{
if (window.showModalDialog)
{
window.showModalDialog(strError,null,
"dialogWidth="+width+"px;dialogHeight="+height+"px;help=no;dialogLeft=160")
}
else
{
var ah = screen.availHeight;
var y =
(ah - height) / 2;
window.top.captureEvents
(Event.CLICK|Event.FOCUS)
window.top.onfocus=HandleFocus
winModalWindow = window.open (strError,"ModalChild",
"dependent=yes,width="+width+",height="+height+",top="+y+",left=160,screenX=160,screenY="+y)
winModalWindow.focus()
}
}
function HandleFocus()
{
if (winModalWindow)
{
if (!winModalWindow.closed)
{
winModalWindow.focus()
}
else
{
window.top.releaseEvents (Event.CLICK|Event.FOCUS)
}
}
return
false
}
</script>
출처 : http://hoons.kr/board.aspx?Name=asptip&BoardIdx=1687&Page=1&Mode=2
'소프트웨어 > JavaScript • Dhtml' 카테고리의 다른 글
| 웹브라우즈별 data URI scheme 테스트 (0) | 2009.08.06 |
|---|---|
| jQuery Selector 를 이해해 보자. (0) | 2009.08.06 |
| MySpace's Performance Tracker (0) | 2009.07.20 |
| jQuery Selectors - Collection (0) | 2009.07.16 |
| 리스트가 포함된 IE 페이지 로딩 속도 향상에 대해 (0) | 2009.07.15 |