JQuery Taconite C# 帮助器
我正在编写一个帮助程序类来包装 JQuery Taconite 插件的功能。该插件使您能够在单个 Ajax 调用中处理多个 DOM 更新。
该类仅使您能够构造发送回客户端的适当 xml 结构。我正在尝试将这个功能包装在一个流畅的界面中。基本示例如下所示:
FluentTaconite ft = new FluentTaconite(writer);
ft
.Select("#id1").ReplaceContentWith("Hello World!").FadeIn("100")
.Select("#id2").AppendWith("<div>Another div</div>")
return ft.Output();
我担心的是,您期望在调用此后创建什么结构:
ft.Select("#A").AppendWith("<div id=B/>").AppendWith("div id=C/>")
您期望构建:
<div id=A>
<div id=B>
<div id=C/>
</div>
</div>
或者:
<div id=A>
<div id=B/>
<div id=C/>
</div>
问题是 - 您是否期望上下文转移到新的添加内容还是保留在选择器上?
更新 相关项目已上传至 code.google。希望您觉得它有用。
感谢您的投入!
I'm writing a helper class to wrap the functionality of JQuery Taconite plugin. The plugin enables you to process multiple DOM updates in a single Ajax call.
The class simply enables you to construct the appropriate xml structure that is sent back to the client. I'm trying to wrap this functionality in a fluent interface. The basic example looks like this:
FluentTaconite ft = new FluentTaconite(writer);
ft
.Select("#id1").ReplaceContentWith("Hello World!").FadeIn("100")
.Select("#id2").AppendWith("<div>Another div</div>")
return ft.Output();
What I'm worried about is this, what structure would you expect be created after a call to this:
ft.Select("#A").AppendWith("<div id=B/>").AppendWith("div id=C/>")
Is your expectation to build:
<div id=A>
<div id=B>
<div id=C/>
</div>
</div>
Or:
<div id=A>
<div id=B/>
<div id=C/>
</div>
The question is - are you expecting context to shift to a newly added content or remain at the selector?
Update
The project in question is uploaded to code.google. Hope you find it useful.
Thanks for the input!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望它保留在选择器上。看下面的示例:
我期望以下输出:
AppendWith imo 太吵了,简单的 Append 就足够了。 “End”方法具有与 JQuery 类似的功能。
我还有一个问题,你确定这比 javascript 代码更有用吗?
I expect it to remain at selector. Look at the following sample:
I expect the following output:
AppendWith imo is too noisy, it's enough of simple Append. 'End' method has similar functionality to JQuery's one.
And I have one more question, are you sure that this will be more usable in comparison with javascript code?