如果在CHtmlDialog中调用Javascript函数
// 调用页面的刷新方法
IHTMLWindow2* pWindow;
IHTMLDocument2* pDocument;
HRESULT hr = GetDHtmlDocument(&pDocument);
hr = pDocument->get_parentWindow(&pWindow);
if( pWindow)
{
VARIANT ret;
ret.vt = VT_EMPTY;
CString sFunc = _T("RefreshFileForClient()");
CString sLang = _T("javascript");
hr = pWindow->execScript(sFunc.AllocSysString(), sLang.AllocSysString(), &ret);
}
相关文档:
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
......
javascript内存泄露的问题一直以来都不受到大家的重视,原因是对用户的影响没有太实际的表现,或许近几年内存发展迅速。脚本内存再泄露也不会有太大影响。
当然作为前端开发的同学们,就不能有这样的侥幸心理。出现memory leaks很大程度上是因为程序的不成熟和编码不太规范造成的。不过,这里就不说如何出现问题的,对问 ......
Primitive types
1. undefined, null, boolean, number, string; undefined is derived from null.
e.g. var tmp; typeof tmp == undefined.
e.g. void(javascript:aler(‘x’)) == undefined.
e.g. undefined==null
2. NaN!=NaN isNaN(“123”)==false isNaN(“blue”)==true ......
1.在HTML中使用<script>元素引入JavaScript。
该元素有两个属性,language声明要使用的脚本语言,src属性是可选的,用于引用外部JavaScript文件。
NB
:现在大多使用type属性(type=“text/javascript”)替代language属性,以便更好地支持XHTML(可扩展HTML)。
2.一般认为 ......
ZT:http://www.ruanyifeng.com/blog/2010/05/object-oriented_javascript_inheritance.html
上一次的文章,主要介绍了如何"封装"数据和方法,从原型对象生成实例。
今天要介绍的是,多个原型对象之间如何"继承"。
比如,现在有一个"动物"对象,
function Animal(){
this.species = "动物";
}
还有 ......