Thứ Hai, 20 tháng 5, 2013

jquery - ajax (localhost/cantien)

chú ý trong ajax :
bỏ phần  :  
              + include(header.php);
              + include(footer.php); 
    ------||  chỉ cần lấy <div > là đủ

<script src="http://code.jquery.com/jquery-1.7.1.js"></script>   
   
    <script type="text/javascript">
    $(document).ready(function(){
   
        $("a.chicago").click(function(){   
            var opost=$(this).attr("title");       
            $(".yuo4-body").load("<?php echo"".$site_live."modules.php?name=Shoping&op=display_ajax&cid=";?>"+opost+"<?php echo"&newlang=$currentlang";?>");               
            return false;
            // return false : thuc hien cac lenh tren & khong chuyen trang
        });   
       
        /*$("a.anhem").click(function(){   
            var mau=$(this).attr("title");
            $(".bbbb").load("< ?php echo"".$site_live."modules/Shoping/ajax.php?opi=".mau?>");               
            return false;
        });*/
       
        $("a.bent").click(function(){           
        $(".sanpham-body").load("bjax.php");                   
            return false;
        });
           
    });
    </script>
**** html
echo'<li><a class="chicago" href="#">sản phẩm</a></li>';

Không có nhận xét nào:

Đăng nhận xét