The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why jquery doesnt wok under cPanel modules ?

Discussion in 'User Experience' started by serverack, Feb 2, 2012.

  1. serverack

    serverack Member

    Joined:
    Aug 14, 2011
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    HI,
    I am developing a cpanel module, why jquery doesnt work ?
    I want to reload a specific <div> after some X seconds, well I have a script ready with me, it is as follows >>

    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
    <script>
    var auto_refresh = setInterval(
    function()
    {
    $('#listbackup').fadeOut('slow').load(tstep3.php').fadeIn("slow");
    }, 5000);
    </script>
    
    Below <div class="body-content"> I am using <div id="listbackup"></div>

    SO it looks like >>
    <div class="body-content">
    <div id="listbackup">
    </div>
    </div>



    How can I solve this issue ?
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    I use jquery all the time within cPanel. Have you loaded up a browser with a javascript console to check for errors?

    Try wrapping your code with a try catch to output errors to the console:


    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
    <script>
    try{
        var auto_refresh = setInterval(
        function()
        {
            $('#listbackup').fadeOut('slow').load(tstep3.php').fadeIn("slow");
        }, 5000);
    }catch(err){
       console.log('There was an error: ' + err);
    }
    </script>
    
     
Loading...
Similar Threads - jquery doesnt wok
  1. Dev@SH
    Replies:
    6
    Views:
    472

Share This Page