English 中文(简体)
有什么理由不写自己的HTML吗?
原标题:Any reason not to write my own HTML?
  • 时间:2012-05-24 15:29:10
  •  标签:
  • html
  • seaside

在海滨,在所有这些 rendercontent on: 方法中,我可以使用 HTML 画布对象组装我的DOM树。

我正在为我的组件写一堆助手, 因为我用Twitter布设来打字, 不想一直写所有的锅炉代码(lt;div> s en mas) 。

对于设置此设置的方式, 我最简单的方式是简单地( 我想避免使用 < code> 使用: aBlock 来在这些助手中) 写出 HTML 用于像这样包装 DIV 的 HTML :

html html:  <div class="control-group"> .

我有什么理由不这样做吗?

最佳回答

使用 HTML 画布有多种优点:

  • The HTML canvas ensures valid tags, a valid tag structure, that all tags are properly closed (at compile time), and that contents is properly escaped.
  • The HTML canvas ensures valid attributes, that all attributes are properly closed, and that contents is properly escaped.
  • As a consequence of the above two the HTML canvas automatically avoids the possibility of cross-site scripting (XSS) vulnerabilities.
  • The HTML canvas enables better reusability by enabling composition of tags (simple function calls), presenters (renderOn: in Objects), and components (renderContentOn: of components).
  • The HTML canvas avoids generating unnecessary whitespaces.
  • The use of HTML canvas enables one to use the standard tools the Smalltalk IDE provides on HTML code: senders, implementors, refactoring engine (extract to method, extract to component, inline method, automatic rewrite, ...), etc.

我同意,在某些罕见的情况下,不值得使用HTML画布:例如,当外部来源的大型静态垃圾需要嵌入一页时。

问题回答

我不认为有真正的下坡 使静态 html的片段 这样的。

不过,你可能想看看Twitter网球杆的海边整合:http://twitterbootsstrap.seaside hosting.st/

重写卢卡斯的一个论点: 它基本上不是 DRY 。 如果您只使用一次, 没有问题 。 如果您需要多次使用, 画布允许您使用所有清洁的再利用能力, 小话题可以提供您 。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签