-1

I have some JS that is working perfectly on my local machine, as soon as I upload it to my web server it stops functioning. The site is www.turnbulldesigns.co.uk if you want to take a look.

I have uploaded the entire folder structure from my local machine so it's not wrong/missing files. What could stop the following JS from working once uploaded?

$(document).ready(function ($) {

    $(".orange").click(function () {
        $("#colors").attr("href", "colors/orange.css");
    });
    $(".blue").click(function () {
        $("#colors").attr("href", "colors/blue.css");
    });
    $(".green").click(function () {
        $("#colors").attr("href", "colors/green.css");
    });
    $(".red").click(function () {
        $("#colors").attr("href", "colors/red.css");
    });
    $(".violet").click(function () {
        $("#colors").attr("href", "colors/violet.css");
    });
    $(".pink").click(function () {
        $("#colors").attr("href", "colors/pink.css");
    });
    $(".yellow").click(function () {
        $("#colors").attr("href", "colors/yellow.css");
    });
    $(".tan").click(function () {
        $("#colors").attr("href", "colors/tan.css");
    });
    $(".grey").click(function () {
        $("#colors").attr("href", "colors/grey.css");
    });

    $('.color-switcher li a').click(function (e) {
        $(this).parent().parent().find('a').removeClass('active');
        $(this).addClass('active');
    })

})
4

1 回答 1

2

该页面上的 Javascript 错误与 twitter 有关

Twitter Error: "Invalid or expired token", Error Code #89

可能您正在使用与域相关的令牌,这就是给您带来麻烦的原因。

供将来参考:使用浏览器开发工具很容易检测到这类问题。

在这里,您将找到 Chrome 工具的教程。无需下载任何内容,因为它们是浏览器的一部分。

在这里您可以下载等效的 Firefox 插件 (firebug)

于 2013-08-03T15:03:51.330 回答