参照msdn的示例 “Creating an Assembly that Contains an Embedded JavaScript File”
完成所有内容后,浏览时IE总包脚本错误 “BorderAnimation” is undefined,还有另一个”;” is expected
哈
仔细检查UpdatePanelAnimation.js 发现
BorderAnimation = function(color) {
this._color = color;
}
BorderAnimation.prototype = {
animate: function(panelElement) {
var s = panelElement.style;
s.borderWidth = ‘2px’;
s.borderColor = this._color;
s.borderStyle = ’solid’;
window.setTimeout(
function() {{
s.borderWidth = 0;
}},
500);
}
}
应改为
BorderAnimation = function(color) {
this._color = color;
};
BorderAnimation.prototype = {
animate: function(panelElement) {
var s = panelElement.style;
s.borderWidth = ‘2px’;
s.borderColor = this._color;
s.borderStyle = ’solid’;
window.setTimeout(
function() {{
s.borderWidth = 0;
}},
500);
}
};
注意花括号后的两个分号~~
微软的大大们真是害人!
运行环境:
windows server 2003 sp1 en.
IE 6.0 .
IIS 6.0.
Visual Studio 2008 beta 2