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 人气:196
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.如果用户单击提交按钮提交了表单,

  • table of data to the json 2010-08-04

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <script type="text/javascript" src="./utils/js/jquery-1.4.2.min.js"></script> </head&g

  • js to use Print Control 2010-12-27

    Jsp page on how to landscape to print, remove the header and footer of the print, the Web a lot. However, not very good, have flaws. Here. I put my methods to achieve this, to tell you, I hope to give you some help. The following code is my own publi

  • 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之后,再移回原来所在

  • 一个用mysql_odbc和php写的serach数据库程序 2014-05-06

    <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>查询条件</title> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> </head> <

  • 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

  • JavaScript utility scripts, well, a collection of them [Links] 2010-11-13

    If you find the javascript things, I suggest you ctrl + F to find directly on this page, because you're looking for here, 80%, but let you look at it next, you're ready to go with reading glasses! ! Event source object event.srcElement.tagName event.

  • 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

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



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

CodeWeblog.com 版权所有 闽ICP备15018612号

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