0

Here is my code:

    <head>
        <link rel="stylesheet" href="http://localhost/css/estilos.css">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <script type="text/javascript" src="../js/jquery.min.js"></script>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>

The program works, but if I use the inspect element, I get these warnings. Can anyone help me to figure it out?

Errors

Hope you can help me :D

j08691
  • 204,283
  • 31
  • 260
  • 272
  • It looks to me like it's not recognizing the file paths from local host. Are your folder paths matching the link paths? – Callat Mar 22 '17 at 01:06

2 Answers2

2

The problem is that you have linked to your own version of jQuery incorrectly. As you are already loading it twice from the CDNs, you shouldn't even need to load it locally. Just load the latest version of jQuery from the CDN once, and don't worry about loading a local copy as well:

<head>
    <link rel="stylesheet" href="/css/estilos.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>

Note that your CSS was throwing an error as well as your jQuery, meaning that you do not have a file at http://localhost/css/estilos.css. I've used /css/estilos.css/ in my anser, to refer to the root. This would point the CSS file at: [root]/css/estilos.css. Depending on your file structure, you may need to use css/estilos.css/ instead (without the leading slash). For more information about relative paths, check out CSS Trick's article.

Hope this helps!

Obsidian Age
  • 41,205
  • 10
  • 48
  • 71
  • Dude, what should i do then? –  Mar 22 '17 at 01:07
  • I've included the code that you should use. Also note that you are loading CSS absolutely from localhost, which won't work in production. I've changed this code to reference the root, with the CSS in a folder called `/css/`. – Obsidian Age Mar 22 '17 at 01:09
  • Dude, gonna check this out!, but what is wrong with this? http://ideone.com/vxIMCn –  Mar 22 '17 at 01:12
  • Your link points absolutely to **`localhost`**. As your website is not hosted locally once it is published, the links will break. Please use relative links, so that the links will work regardless of the production environment. See [this answer of mine](http://stackoverflow.com/a/41710786/2341603) for more information on absolute v.s. relative links. – Obsidian Age Mar 22 '17 at 01:15
  • Mate, i got another issue, but this time with bootstraps: https://i.gyazo.com/000b22c1a5f8cd5f7a44567719e32b62.png –  Mar 22 '17 at 01:44
  • That's not an issue. Note the `200` there. That's the status code for OK (which it **explicitly says**). That means the files are being pulled through correctly. You may want to look into the [**Getting Started with Bootstrap**](https://www.w3schools.com/bootstrap/bootstrap_get_started.asp), and [**Status Codes for Beginners**](https://www.addedbytes.com/articles/for-beginners/http-status-codes/). – Obsidian Age Mar 22 '17 at 01:51
  • Mate, there is an error, take a look: https://i.gyazo.com/681460af2a2fac9be46e022b530e5e3b.png –  Mar 22 '17 at 01:57
  • Again, those are not errors. Those are styles that are being overridden by styles with higher specificity. I recommend you read the [**CSS Tricks article on Specificity**](https://css-tricks.com/specifics-on-css-specificity/), and **[research your problem](http://meta.stackoverflow.com/questions/261592)** *before* asking for help on StackOverflow. For further information, please refer to the [**help article**](http://stackoverflow.com/help/how-to-ask) regarding how to ask good questions. – Obsidian Age Mar 22 '17 at 02:06
0

It says your local css and js files are not found. look right at the debug panel, there is a 404 code.

chouyangv3
  • 467
  • 5
  • 12