调试了半天,全都是复制代码惹得祸!
上次由于一个'\t'让我郁闷了半天,本以为自己已经在debug的时候很小心了,没有想到今天又载了一会。错误非常之低级,而debug费力又还非常之大,真是让人哭笑不得。所以干脆在blog的随笔里专门开辟一个叫"Debug中的滑铁卢"的分类,专门记录Debug时一些stupid的小事。
其实Coding是挺枯燥的,这个我在说Whidbey的Snippets功能时就说过,而且特别是重复的Coding,更是让人烦躁。但是不管枯燥也好烦躁也罢,还是要写不。这时我们常常也会学学网站编辑,动用动用Ctrl+C & Ctrl+V大法。这不手艺欠佳,今天我就载在这个Ctrl+C、V上了,看来注定当不成网站编辑了(就这追求啊,浪费了我这么多时间看你这么些天瞎摆活了
!)。
今天这个问题其实超级的简单,真是too simple, too young ...,我在GetShowTab()方法前定义了两个方法,我写成这样的:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
这时发现这两个函数里面需要用 this.m_Panels[0].m_Element.style.display。好啊,Ctrl+C & Ctrl+V,搞定!
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
改拨改拨,ok了~~
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
运行起来完全没有效果,由于对DHTML中的element引用关系比较复杂,老是觉得可能是没有引用到正确的element,就在this.m_Panels[n].m_Element里查啊查啊,查到花儿都谢了,还是没有查到问题。最后都调试成这样了:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
才猛然发现,怎么赋值是"=="啊!!!。正确的应该是:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
可能算不上什么教训,但是还是可以注意几点。Coding的时候,因该:
多打些字;
查问题先查简单的;
实在不行了,散散步再回来做;
让team里的哥们给看一下...
posted on 2005-03-02 00:31 birdshome 阅读(1640) 评论(5) 编辑 收藏 举报