zoukankan      html  css  js  c++  java
  • 循环中点击单个事件(巧用this,指向当前对象)

    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>
    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>
    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>
    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>
    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>
    <em id='show' value="<?php echo $member['phone']; ?>" class="sui"><a href="#">查看归属地</a></em>

    Jquery:

    //也可以用类 $(".sui").bind('click', function(event) 
    $("em").bind('click', function(event) {
        build = $(this);
        var phone = $(this).attr("value");
        $.ajax({
            url: "<?php echo SITE_ADMIN_URL . '/member/get_phone/'; ?>"+phone,
            type: 'Get',
            dataType: '',
            success:function(result){
                build.html("<em>"+result+"<em>");
            }
        });
    });
  • 相关阅读:
    Valid Parentheses
    3Sum
    泛型(一)
    Longest Common Prefix
    Roman to Integer
    Integer to Roman
    Container With Most Water
    知道创宇研发技能表v2.2
    anti-dns pinning 攻击
    dominator
  • 原文地址:https://www.cnblogs.com/boundless-sky/p/7101226.html
Copyright © 2011-2022 走看看