jquery.min.js无法加载资源

问题描述 投票:6回答:4

为什么这个链接不起作用?

//Ajax.Google APIs.com/Ajax/礼拜四/jQuery/1.9.1/jQuery.民.就是

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="Description" content=" [wstaw tu opis strony] ">
    <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
    <meta name="Author" content=" [dane autora] ">
    <title>[tytuł strony] </title>
    <link rel="stylesheet" href="style.css" type="text/css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".animat_kon").click(function () {
                $(".animat_text").slideToggle("slow");
            });
        });
    </script>
</head>

错误示例:

javascript debugging
4个回答
13
投票
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

你没有包括http://

无论何时从服务器直接下载,请使用http://


8
投票

更改

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

你错过了http:。您可以跳过http:,让您的浏览器自动在HTTPS和HTTP之间进行选择。但在您的情况下,调试工具似乎不理解这种语法。

在这里查找更多信息:Can I change all my http:// links to just //?


2
投票

链接必须以http://开头


0
投票

请将您的脚本src更改为:

    <link rel="stylesheet" href="style.css" type="text/css"> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">

脚本src应该以http://开头

© www.soinside.com 2019 - 2024. All rights reserved.