UNPKG

generator-ios-suite

Version:
98 lines (90 loc) 3.75 kB
<html> <head> <title> WindVane test H5 page. </title> <script src="https://g.alicdn.com/mtb/lib-windvane/3.0.0/windvane.js"></script> </head> <style type="text/css"> .btn { width: 600px; height: 150px; font-size: 50px; } </style> <body> <div> <button class="btn" type="button" onclick="checkWindVaneVersion()">WindVane Version</button> <button class="btn" type="button" onclick="firstCall()">firstAPI</button> <button class="btn" type="button" onclick="secondCall()">SecondAPI</button> <button class="btn" type="button" onclick="globalCall()">GlobalJSBridge</button> <button class="btn" type="button" onclick="globalAliasCall()">GlobalAliasJSBridge</button> <button class="btn" type="button" onclick="webViewCall()">WebViewJSBridge</button> <button class="btn" type="button" onclick="webViewControllerCall()">WebViewVCJSBridge</button> <button class="btn" type="button" onclick="nativeJSBridgeCall()">NativeJSBridgeCall</button> </div> <script>l; function checkWindVaneVersion() { var params = { v: '1.0.0' }; window.WindVane.call('Base', 'checkWindVaneSDK', params, function(e){ alert('success: ' + JSON.stringify(e)); }, function(e) { alert('failure: ' + JSON.stringify(e)); }) }; function firstCall() { window.WindVane.call('MyJSBridge', 'firstAPI', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function secondCall() { window.WindVane.call('MyJSBridge', 'secondAPI', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function globalCall() { window.WindVane.call('StaticJSBridge', 'handler1', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function globalAliasCall() { window.WindVane.call('StaticJSBridge', 'handler4', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function webViewCall() { window.WindVane.call('StaticJSBridge', 'handler2', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function webViewControllerCall() { window.WindVane.call('StaticJSBridge', 'handler3', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; function nativeJSBridgeCall() { window.WindVane.call('MyJSBridge', 'nativeCallJSBridge', null, function(e) { alert('call success'); }, function(e) { alert('call failed'); }); }; </script> </body> </html>