weixin_33725722 2016-04-21 04:36 采纳率: 0%
浏览 26

单击按钮加载Ajax

i have following :

   <button id="not" class="notification btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
<i class="fa fa-bell"></i>   


  <span class="badge badge-success" style="background-color:#f3b760">
10  </span>               




</button>  

<div id="show"></div>

I want div id "show" to load job-notification.php on clicking the button above, so i got this:

<script>
$(document).ready(function(){
    $("#not").click(function(){
        $("#show").load("job-notification.php");
    });
});
</script>  

FYI, Button is a DROPDOWN & job-notification.php contains results like this:

  <ul class="dropdown-menu dropdown-menu-right">
          <li>
    EXAMPLE 1
    </li>

     <li>
    EXAMPLE 2

    </li>

    </ul>

Why is this not working?

  • 写回答

2条回答 默认 最新

  • weixin_33725126 2016-04-22 01:58
    关注

    You can also try this one:
    $(document).on("click","#not",function() {});

    评论

报告相同问题?