使用easyscroll时,jquery变量在url中没有变化

时间:2012-07-19 21:53:17

标签: javascript jquery jquery-plugins

$ account在传递时保持不变,即使它更改了其值,url也会发送相同的旧值

<script type="text/javascript">
    var $catcount=1;
    jQuery(document).ready(
        function() {

            jQuery('.scroll_container').scrollExtend(
                {   
                    'target': 'div#scroll_items',           
                    'url': 'populates.php', 
                    'newElementClass': 'list_item more_content',
        'ajaxSettings': {'data':'cid='+$catcount},
        'onSuccess':function(){
                                    jQuery('.scroll_container').scrollExtend('enable');
                                    $catcount++;
                                    alert($catcount);
                                  }     
                }
            );

        }
    );
   </script>

1 个答案:

答案 0 :(得分:1)

<script type="text/javascript">
    var $catcount=1;
    jQuery(document).ready(
        function() {

            jQuery('.scroll_container').scrollExtend(
                {   
                    'target': 'div#scroll_items',           
                    'url': function() {
                             return 'populates.php?cid='+$catcount;
                     },
                    'newElementClass': 'list_item more_content',
                    'onSuccess':function(){
                                    jQuery('.scroll_container').scrollExtend('enable');
                                    $catcount++;

                     }     
                });

        }
    );
   </script>