1


I've done a search, and I've found a few results, but none that seem to work - hoping someone can help me or point me in the right direction.

I have a web page with jQuery loaded and a 3rd party script, News Ticker. I have an existing site with this working fine with no problems, however, when I copy the code to another side, I keep getting:
Uncaught TypeError: Object #<Object> has no method 'newsticker'

The code causing this error is the following:

$(document).ready(function() {
    $("#guestbook").newsticker();
});

The News Ticker script details can be seen at their site - http://www.texotela.co.uk/code/jquery/newsticker/.

Thanks in advance!


pecl installing extension on production server troubles

So I installed the pecl oauth module locally, and it all works perfectly. I then tried to do this for the production server but ran into some problems.

If I say sudo pecl install oauth, I get this error:

No releases available for package "pecl.php.net/oauth"
install failed

So I figure I have to update pecl.php.net, so I try the command sudo pecl channel-update pecl.php.net, but then I get this output:

Updating channel "pecl.php.net"
Channel "pecl.php.net" is not responding over http://, failed with message:
Connection to 'pecl.php.net:80' failed: Connection refused
Trying channel "pecl.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `pecl.php.net:443' failed: Connection refused)

Any ideas?

4

2 に答える 2

0

その要素が存在しない可能性があります。これを試して:

$(document).ready(function() {

    alert("jQuery loaded!");

    if($("#guestbook").length == 0)
        alert("#guestbook doesn't exist");
    else if(!('newsTicker' in $("#guestbook")))
        alert("newsTicker not loaded");
    else
        $("#guestbook").newsTicker();
});
于 2012-06-22T23:32:43.900 に答える
0

Because newsTicker has a capital T

$("#guestbook").newsTicker();

You have to be wary that JS is case sensitive in it's syntax.

于 2012-06-22T23:29:18.023 に答える