JavascriptºÍASÏ໥½»»¥µ÷ÓÃ
Re
Ò»¸ö¹«ÓÃÀࣺflash.external.ExternalInterface£»
¸ÃÀàÓÐÁ½¸öÏà¹Ø·½·¨£º
1¡¢µ÷ÓÃjavascriptº¯Êý£»
ExternalInterface.call(´jsº¯ÊýÃû´[,ÒÔ¶ººÅ¸ô¿ªµÄ¶à¸ö²ÎÊý]);
ÆäÖÐjsº¯ÊýÃûΪÔÚjavascriptÖÐÉêÃ÷µÄº¯ÊýÃû³Æ£¬
´«µÝµÄ²ÎÊý¿ÉÒÔÊÇasÖÐÈκÎÀàÐ͵ÄÊý¾Ý£¬ÕâЩ²ÎÊý½«±»×Ô¶¯×ª»»³Éjs±äÁ¿£»
2¡¢×¢²ájsÖпÉÓõĻص÷º¯Êý£»
ExternalInterface.addCallback(´jsÖе÷Óõĺ¯ÊýÃû´,asÖеĻص÷º¯Êý);
ÆäÖÐjsÖе÷Óõĺ¯ÊýÃûΪָ¶¨flashʵÀýµÄ´Ë»Øµ÷º¯ÊýÔÚjsÖе÷ÓÃʱµÄÊôÐÔÃû£¬
È磺flash.test£¬ÔÚÉÏÊöaddCallback·½·¨µÄµÚÒ»¸ö²ÎÊýÔòÓ¦ÉèÖ㺓test”£»
ÔÚASÎļþµ±Öе÷ÓÃÁËÉÏÊöµÄÁ½¸ö·½·¨£¬²¢ÔÚjavascriptÖÐÉêÃ÷ºÃ¼´½«±»asµ÷Óõĺ¯ÊýÖ®ºó£¬
¼´ÎªASµ÷ÓÃjsºÍjsµ÷ÓÃASÖк¯Êý×öºÃÁË×¼±¸£¬
±àÒëºÃswfÎļþ£¬
È»ºó·¢²¼flashÏîÄ¿£¬
Ôò¿ÉÔÚ×Ô¶¯Éú³ÉµÄhtmlÎļþÖвâÊÔËù×öºÃµÄ²âÊÔ¹¦ÄÜ¡£
×¢Ò⣺
Éú³ÉµÄhtmlÒ³ÃæÐèÒªÔÚweb·þÎñÆ÷ÏÂä¯ÀÀ£¬
flashÎļþ²ÅÄÜÕý³£µØÓëjs½»»¥£¨Ó¦¸ÃÊÇflashµÄ°²È«É³ÏäÏÞ¶¨Á˱¾µØ²»ÄÜÓëjs½»»¥£©¡£
Ïà¹ØÎĵµ£º
Javascript´úÂë
<script>
var idTmr = "";
function copy(tabid){
var oControlRange = document.body.createControlRange();
oControlRange.add(tabid,0);
oControlR ......
±¾ÎÄת×Ô£ºhttp://www.felixwoo.com/archives/247
×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
Ò»¡¢Ê²Ã´ÊDZհü£¿
“¹Ù·½”µÄ½âÊÍÊÇ£º±Õ°üÊ ......
CDATA ÄÚ²¿µÄËùÓж«Î÷¶¼»á±»½âÎöÆ÷ºöÂÔ¡£
¼ÙÈçÎı¾Öаüº¬ÁË´óÁ¿µÄ "<" ºÍ "&" ×Ö·û - ¾ÍÏñ±à³Ì´úÂëÖо³£³öÏÖµÄÇé¿öÒ»Ñù - ÄÇôÕâ¸ö XML ÔªËؾͿÉÒÔ±»¶¨ÒåΪһ¸ö CDATA ²¿·Ö¡£
CDATA Çø¶Î¿ªÊ¼ÓÚ "<![CDATA["£¬½áÊøÓÚ "]]>"£º
<script type="text/javascript">
<![CDATA[
function compare(a,b ......
ÎÊ:
Hi,
I have this C#/ASP.NET/.aspx page with a string variable named myString with the value "Mario Gamito".
How can I access "Mario Gamito" from within a JavaScript function, i. e., the variable's value ?
Already tried '" + mystring + "' but it doesn't works.
Any help would be appreciated.
......