在CDHTMLDialog中用JavaScript调用C++函数
在类的构造函数中添加
EnableAutomation();
在OnInitDialog中添加
SetExternalDispatch(GetIDispatch(TRUE));
在类的声明中添加宏
DECLARE_DISPATCH_MAP()
在类的实现文件中添加组宏
BEGIN_DISPATCH_MAP(当前类, 基类)
END_DISPATCH_MAP()
然后就可以用 DISP_FUNCTION宏来映射导出函数了
在Javascript中用
external.函数名()
来调用
相关文档:
Javascript函数包含一个伪数组(pseudo-array),该数组包含所有传入参数,我们不能修改它,但可以访问其中的成员,该数组也具有length属性。
函数重载依赖于判断传入参数个数和类型的能力。
函数重载的例子:
<html>
<head>
<mce:script type="text/javascript"><!--
function sendMessage(msg ......
1 Add the following code to .aspx
<script>
function fresh() {
{
window.opener.document.getElementById("ControlId").click(); //ControlId -- ......
C/C++关键字static,const,inline,define,typedef
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
......
事件源对象
event.srcElement.tagName
event.srcElement.type
捕获释放
event.srcElement.setCapture();
event.srcElement.releaseCapture();
事件按键
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
事件返回值
event.returnValue
鼠标位置
event.x
event.y
窗 ......