zoukankan      html  css  js  c++  java
  • javascript 正则

    <table>
      <tr>
        <th>pic</th>
        <th>Id</th>
        <th>Name</th>
        <th>P1</th>
        <th>P2</th>
        <th>P3</th>
        <th>P4</th>
        <th>Promotion</th>
        <th>New</th>
        <th>Score</th>
        <th>S1</th>
        <th>Description</th>
        <th></th>
        <th></th>
        <th></th>
      </tr>
    <% @products.each do |product| %>
      <tr>
        <td><%=image_tag product.i1.url(:thumb)%></td>
        <td><%= product.id %></td>
        <td><%= product.name %></td>
        <td><%= product.p1 %></td>
        <td><%= product.p2 %></td>
        <td><%= product.p3 %></td>
        <td><%= product.p4 %></td>
        <td><%= product.promotion %></td>
        <td><%= product.new %></td>
        <td><%= product.score %></td>
        <td><%= product.s1 %></td>
        <td><%= product.description %></td>
        <td><%= link_to 'Show', admin_product_path(product) %></td>
        <td><%= link_to 'Edit', edit_admin_product_path(product) %></td>
        <td><%= link_to 'Destroy', admin_product_path(product), :confirm => 'Are you sure?', :method => :delete %></td>
      </tr>
    <% end %>
    </table>
    <input type="text" id="page" name="page" value="<%=@products.current_page%>" />
    <input type="text" id="source" name="source" value="" />
    <%=will_paginate @products%>
    <script type="text/javascript">
          
          //$('.pagination a').attr('data-remote', 'true');
          $('.pagination a').click(function(){
            alert($(this).attr("href"));
            var result="";
            var subject=$(this).attr("href");//  /admin/products/search?page=9
            var myregexp = /\/admin\/products\/search\?page=(\d+)/;
            var match = myregexp.exec(subject);
            if (match != null) {
                    result = match[1];
            }
            alert(result);
            $("input[name='page']").val(result);
            $("#source").val("");
            alert($("#form2").serialize());
            $.post($("#form2").attr("action")+".js",$("#form2").serialize(),null,"script");
            return false;
            
            });
          
    </script>
  • 相关阅读:
    Nginx-php-mysql
    Smokeping配置调整
    Smokeping外置邮箱告警
    部署Smokeping
    Centos7部署cacti
    通过yum安装最新服务
    Cacti部署
    MySQL磁盘写入策略以及数据安全性的相关参数
    linux中一些特殊的中文文件不能删除问题
    Slave_SQL_Running:No的两种解决办法
  • 原文地址:https://www.cnblogs.com/lexus/p/1874901.html
Copyright © 2011-2022 走看看