javascript̹¿ËСÓÎÏ·
µÚÒ»²¿·Ö
JScript code:
<script type="text/javascript">
static_id=0;
XPrang=function(srcBox,targetBox){
var x=Math.abs(srcBox.left-targetBox.left);
var xDistance=srcBox.width/2+targetBox.width/2;
if(x<xDistance)
return true;
else
return false;
};
YPrang=function(srcBox,targetBox){
var y=Math.abs(srcBox.top-targetBox.top);
var yDistance=srcBox.height/2+targetBox.height/2;
if(y<yDistance)
return true;
else
return false;
};
IsPrang=function(srcBox){
for(var _i in Game.Boxs){
if(srcBox.id==Game.Boxs[_i].id)
continue;
else if(XPrang(srcBox,Game.Boxs[_i])&&YPrang(srcBox,Game.Boxs[_i])){
if(IsDestroy(srcBox,Game.Boxs[_i])=='destroy'){
srcBox.Destroy();
Game.Boxs[_i].Destroy();
return false;
}
else
return true;
}
}
return false;
};
IsDestroy=function(srcBox,targetBox){
var srcType=srcBox.id.split('_')[0];
var targetType=targetBox.id.split('_')[0];
var value=srcType+'X'+targetType;
var msg=null;
switch(value){
Ïà¹ØÎÊ´ð£º
ÓÃjavascript½«Êý¾Ýµ¼³öµ½Îı¾Îļþ(txt)ÖÐ..
Ê×ÏȼÙÉèÒѾÓÐÁËÐèҪдÈëµÄÎı¾ÄÚÈÝ var txtContent ="ÐèҪдÈëµÄÄÚÈÝ";
ÏÖÔÚÐèÒªÓÃjavascript½«ÄÚÈÝдÈëtxtÎļþ(Õâ¸ötxtÎļþ²»´æÔÚ,ÐèÒª´´½¨)ÖÐ,È»ºóдºÃÖ ......
ÒÔÏÂÊÇÒ»¶ÎJavsScript½Å±¾£¬µ«ÔËÐÐʱ×Ü»á²úÉú ¡°Microsoft JScript ÔËÐÐʱ´íÎó: 'null' Ϊ¿Õ»ò²»ÊǶÔÏó¡±Òì³££¬´ó¼Ò°ï¿´Ò»Ï¡£
<form id="form1" runat="server">
< ......
void CWEHelperDlg::OnOK(){
CString code;
//µ÷ÓÃVBSCRIPT£¬Äܵ¯³öÏûÏ¢¿ò,Ò²ÄÜÕýÈ··µ»Ø hello
code = "function main()\r\n\tMsgBox \"ok\"\r\n\tmain=\"hello\"\r\nend functio ......