9

Why this link doesn`t work?

//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

<!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>

error example: enter image description here

powtac
  • 40,542
  • 28
  • 115
  • 170
Rafał Developer
  • 2,135
  • 9
  • 40
  • 72
  • Is your html page sitting on a frame? Is it located on an HTTP or HTTPs port? If it's on a frame it wont let you load cross domain scripts. – Federico Giust Mar 11 '13 at 16:01
  • @FedericoGiust You can load scripts from a different origin. That's why we have JSONP. – Antony Mar 11 '13 at 16:03

4 Answers4

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

you did not included http://

whenever you are downloading from the server directly then usehttp://

PSR
  • 39,804
  • 41
  • 111
  • 151
9

Change

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

into

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

You missed the http:. You can skip the http: to let your browser automatically choose between HTTPS and HTTP. But in your case the debugging tool seems not to understand this syntax.

Find more information here: Can I change all my http:// links to just //?

Community
  • 1
  • 1
powtac
  • 40,542
  • 28
  • 115
  • 170
3

The link must start with http://

tomsv
  • 7,207
  • 6
  • 55
  • 88
0

Please change your script src to:

    <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">

script src should start with http://

Nawrez
  • 3,314
  • 8
  • 28
  • 42
Gideon Babu
  • 336
  • 2
  • 5
  • 11