weixin_33738578 2011-09-24 18:14 采纳率: 0%
浏览 21

AJAX阻止Javascript

Consider the following code:

    <script src="js/backgroundChanger.js" type="text/javascript"></script>
    <script>
            $(document).ready(function() {
                $('.Themes').click(function(){
                    $('#dcontent').load('printThumbs.php');
                });
            });
        </script>

The first script is for background changing logic and the second script gives list of thumbnails of the themes. The problem is that the first script doesn't work beacause of the second. If I don't use this AJAX technique everything works fine. Working code:

<script src="js/backgroundChanger.js" type="text/javascript"></script>
    <div id="dcontent">
                    <?php include('printThumbs.php'); printThemesThumbs();?>
                </div>

The background changing logic looks like:

$(function() {
        $('.themes li a img').click(function() {//code
});

Any help will be greatly appreciated.

  • 写回答

3条回答 默认 最新

  • python小菜 2011-09-24 19:41
    关注

    in your first snippet of the code you defined a click function on .Theme and in the third snippet of the code .theme, is this correct?, i mean both classes seems to be different try to use the same class name return by your php function.

    评论

报告相同问题?