jquery custom attributes, to resolve the issue by value List of button

JQuery on the front with a standard code, encountered some problems. Collection of data on the traverse, the operation of a single data, add, delete, change, check, need to pass some parameters for background processing.
I used the label in the project custom attribute-value, and then jquery attr can be accessed using, this can reduce the javascript code scripts and data coupling

The following is an example code for reference:
<script type="text/javascript">
$ (Document). Ready (function () (
/ / Ajax delete
$ (". Btn_delete"). Click (function () (
ret = window.confirm ('$ (texts [' dtaq.common.delete.msg']}');
if (ret) (
$. Ajax ((
type: "POST",
url: 'sysCodeRuleitemAction.do? method = delete'
+ '& Id ='+$( this). Attr ("paramId")
+ '& Ruleid ='+$( this). Attr ("paramRuleid"),
success: function (msg) (
$ ('# Childbody'). Html (msg);
/ /
</ Script>
</ Legend>
<th width="5%"> Serial Number </ th>
<th width="25%"> *****</ th>
<th width="10%"> *****</ th>
<th width="10%"> *****</ th>
<th width="25%"> *****</ th>
</ Tr>
</ Thead>
<C: forEach items = "$ (sysCodeRuleitems)" varStatus = "index"
var = "sysCodeRuleitem">
<td> $ (index.count) </ td>
<td> $ (sysCodeRuleitem.ruletype) </ td>
<td> $ (sysCodeRuleitem.rulecontent) </ td>
<td> $ (sysCodeRuleitem.orderno) </ td>
<Input type = "button"
value = "$ (texts ['button.edit'])"
paramId = "$ (sysCodeRuleitem.id)"
paramRuleid = "$ (param.ruleid)" />
<Input type = "button"
value = "$ (texts ['button.delete'])"
paramId = "$ (sysCodeRuleitem.id)"
paramRuleid = "$ (param.ruleid)" />
</ Div>
</ Td>
</ Tr>
</ C: forEach>
</ Table>
</ Fieldset>

分类:Web 时间:2010-07-27 人气:192
blog comments powered by Disqus


  • 如何用正则取input type="text"中的value 2014-02-04

    1.如何通过正则取input type="text"中的value呢? 2.如何过滤掉input type="checkbox"的标签? 这样只能达到正则取input type="text"中的value可是不能过滤掉input type="checkbox"的标签! alert [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] alert [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 解决: aler

  • DIV input and text vertically in the center to solve the problem 2011-01-11

    <div> <ul> <li><label><input type="checkbox"> Baidu </label></li> <li><label><input type="checkbox" /> The Google search engine </label></li> <li><label&g

  • input type=submit 的小问题 2013-07-16

    以前使用strtus2时,在jsp页面中有input时要去name才可以保证数据不会被提交到服务器,一直没有弄明白为什么会这样的,看到一段解释明白了. HTML元素 - input type=submit 定义 创建一个按钮,点击该按钮后,即提交表单. Creates a button that, when clicked, submits the form. 注释 使用 VALUE 标签属性将创建无法由用户编辑的显示标签.默认的文字是 Submit Query.如果用户单击提交按钮提交了表单,

  • JS清空上传控件input(type="file")的值的代码第1/2页 2014-04-29

    最近做的一个小功能,需要清空<input type="file">的值,但上传控件<input type="file">的值不能通过JavaScript来修改. google找到这样一个解决方法: 在上传控件中插入了值,就只能通过form的reset功能来清空了,但是form里面其他的值也被reset了. 既然可以使用form的reset清空,那就有办法了:新建一个临时form,然后将需要清空的上传控件移入其中,reset之后,再移回原来所在

  • Script tab in the defer attribute, you Know? 2010-11-07

    The following three sections look at the code and write the output do you think? <button>test</button><script> $('myButton').click(); </script> <script defer> $('myButton').click(); </script> <button>test</butt

  • How to optimize the performance of JavaScript scripts 2009-04-14

    How to optimize the performance of JavaScript scripts With the development of network, network speed and machine speed improve, more and more used in a rich web client technologies. Ajax is now the most popular way. JavaScript is an interpreted langu

  • Implementation of the AJAX return HTML fragments of JavaScript scripts 2010-09-12

    If the AJAX loading of data is an HTML fragment, but the HTML Pianduan Huan <script> contains script blocks, then this Shuju xmlHttp.responseText you insert Dao Dang Qian Yong innerHTML Fang Fa Yuan Su in a document, you will find loads back AJAX Th

  • Optimize the performance of JavaScript scripts 2010-04-07

    With the development, speed and machine speed increase, more and more sites use a rich client technology. Ajax is now the most popular way. javascript is an interpreted language, it can not be achieved and the C / Java like level, it limits the thing

  • nginx gzip duplicate MIME type "text / html" 2010-09-14

    Instruction [# Gzip gzip] [# Gzip_buffers gzip_buffers] [# Gzip_comp_level gzip_comp_level] [# Gzip_min_length gzip_min_length] [# Gzip_http_version gzip_http_version] [# Gzip_proxied gzip_proxied] [# Gzip_types gzip_types] After the upgrade to the l

  • Dynamically change the input type tag attributes (such as the password to text) 2010-12-25

    <HTML> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script> function removeSubmitFocus () { document.all ('pass'). outerHTML = "<input type = text name ='" + document

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.428 (s). 10 q(s)