打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Prototype An object-oriented Javascript library

README

Path:README
Last Update:Mon Apr 18 02:09:58 CDT 2005

Prototype

An object-oriented Javascript library

© 2005 Sam Stephenson (sam@conio.net)

Prototype is a Javascript library that aims to ease development of dynamic web applications. Its development is driven heavily by the Ruby on Rails framework, but it can be used in any environment.

Targeted platforms

Prototype currently targets the following platforms:

  • Microsoft Internet Explorer for Windows, version 6.0 and higher
  • Mozilla Firefox 1.0/Mozilla 1.7 and higher
  • Apple Safari 1.2 and higher

Using Prototype

To use Prototype in your application, download the latest release from the Prototype web site (prototype.conio.net/) and copy dist/prototype.js to a suitable location. Then include it in your HTML like so:

  <script type="text/javascript" src="/path/to/prototype.js"></script>

Building Prototype from source

prototype.js is a composite file generated from many source files in the src/ directory. To build Prototype, you’ll need:

From the root Prototype directory,

  • rake generate_dist_prototype will run script/make-dist.rb, which preprocesses the Prototype source and generates the single-file dist/prototype.js.
  • rake generate_dist_tarball will run the aforementioned task and create a distribution tarball of your current darcs repository with darcs dist. (rake dist, or just rake, can be used for this, too.)

Contributing to Prototype

You‘ll need the tools mentioned above. Modify the files in src/, add tests in test/ if possible, generate a new dist file, and record the changes with darcs record -al. Then email patches to sam@conio.net using darcs send.

Documentation

Prototype is embarrassingly lacking in documentation. (The source code should be fairly easy to comprehend; I’m committed to using a clean style with meaningful identifiers. But I know that only goes so far.)

Much of the problem is that there is no easy way to document it from within the source code itself. I’ve tried JSDoc and a Perl script included with JsUnit; neither groks Prototype’s hash-style class definitions or inheritance scheme. Making them work would require major changes, and I don’t have the time for that right now.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Ajax JavaScript resources at Savage Vines
Object-Oriented Programming with JavaScript, Part I: Inheritance
XMPP的开发知识汇总
JavaScript实现抽象类-yaosansi's Blog
浅谈JavaScript类的继承
Two Methods of Creating JavaScript Objects: Prototype Inheritance and the Xerox Method
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服