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

  • 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

  • javascript中attribute和property的区别详解 2014-01-21

    这篇文章主要介绍了javascript中attribute和property的区别详解,attribute和property对新手来说,特别容易混淆概念,本文就清晰的讲解了它们的区别,需要的朋友可以参考下 DOM元素的attribute和property很容易混?x在一起,分不清楚,两者是不同的东西,但是两者又联系紧密.很多新手朋友,也包括以前的我,经常会搞不清楚. attribute翻译成中文术语为"特性",property翻译成中文术语为"属性",从中文的字面意

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



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

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

processed in 0.361 (s). 12 q(s)