OSDN Git Service

Version 0.6.221, Update the X.TextRange.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 03_XScript.js
index 753af82..f32a744 100644 (file)
@@ -62,6 +62,24 @@ if( X_Script_VBS_ENABLED ){
                        * */\r
                ].join( '\n' ) + '</script>' );\r
 \r
+       // http://space.geocities.jp/nequomame/others/excelvba/excelvba_01_03.html\r
+       // Document.ActiveElement に安全に触れるか?確認\r
+       // そういえば error は iframe 内で起きていた\r
+       // http://stackoverflow.com/questions/14378224/document-activeelement-in-iframe-shows-unspecified-error-in-ie-standards-mode\r
+       // document.activeElement in iframe shows unspecified error in IE standards mode\r
+       X_Script_gte15 || document.write( '<script type=text/vbscript>' +\r
+               [\r
+                       'Function vbs_testAE()',\r
+                               'On Error Resume Next',\r
+                               'Set ae = Document.ActiveElement',\r
+                               'If Err.Number Then',\r
+                                       'ae = 1',\r
+                               'End If',\r
+                               'Err.Clear',\r
+                               'vbs_testAE = ae',\r
+                       'End Function'\r
+               ].join( '\n' ) + '</script>' );\r
+\r
        // TODO Object のメンバを辿る vba\r
        // byte Array を扱う vba\r
 };\r
@@ -75,6 +93,8 @@ if( X_Script_VBS_ENABLED ){
 function X_Script_try( func, args ){\r
        if( !X_Script_gte15 ){\r
                //return func.apply( {}, args );\r
+               // window.onerror = return true を設定\r
+               // vbs 側から呼び出し?\r
                return;\r
        };\r
        return X_Script_gte15( func, args || [] );\r