zerozone 发表于 2013-1-29 13:10:15

How to implement a syntax hiliter in JavaScript?

Recently, I'd participated in an AJAX/RIA project. Our team included about 5 members: one lead, two programmers and two QAs. The main goal of this project is to provide a prototype for asset management by using <st1:city w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:city> technologies. As you know, <st1:city w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:city> application can provide rich and good experience to the user. For example, the application used <st1:city w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:city> is almost composed of several pages and other resources like CSS and images. Therefore, the transfer amount between client and server could be down and at the same time the user's operation interruption are to avoided.

For some reasons, we chose a commercial framework SmartClient as our toolkit for developing <st1:city w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:city>. SmartClient is without question the one of bested AJAX GUI system or frameworks. We expressed deeply by its functionalities and effects. It provided various client components, plentiful documents and examples. You can easily find the answer we want. But, the biggest limitation of SmartClient is that it is commercial software, so we could not see more detailed of it. As a result, the development was difficulty when you desire to extend some components. Anyway, SmartClient is good <st1:city w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:city> library except for high price and development efficiency.

We spent about two months to archive this prototype. Finally, this prototype gave our teammates and the customer good impression finally.

The source code from SmartClient is high quality code; easy understanding, simple and clean. JavaScript is an object based programming language. We used to thinking in OO because we are Object-Oriented programmer. Maybe some book mentioned the techniques for writing Object-Oriented programs in JavaScript. Standing the shoulders of giants, you can get through the mountaintop more quickly and safely. Reading high quality source code could be a short cut to become a software craftsman. <div class="code_title">js 代码
页: [1]
查看完整版本: How to implement a syntax hiliter in JavaScript?