I have several connected, external files. I tried using the shortcut of simply listing the names of the files (all are in the same folder), but only the CSS file “works” or “connects” or whatever, so I’m now using SHIFT + RMB to “copy as path.” I’m editing the files in Notepad++, and opening the files in Google Chrome on Windows 7 Home Premium, 64-bit (if it makes a difference).
HTML code:
<html>
<head>
<link rel = "stylesheet" type = "text/css" href = "No Real Purpose.css"/>
<title>Random text</title>
</head>
<body>
<div id = "clickToHide">
Hide div
</div>
<div id = "hidable">
hidden?
</div>
<!--Script inclusion-->
<script type = "text/javascript" src = "C:\Program Files (x86)\EasyPHP5.2.10\www\JQuery Test\No Real Purpose.js"></script>
<script type = "text/javascript" src = "C:\Program Files (x86)\EasyPHP5.2.10\www\JQueryTest\jQuery.js"></script>
</body>
</html>
CSS code:
div
{
color: white;
background-color: black;
box-shadow: 2px 2px black;
height: 100px;
width: 100px;
padding: 3px;
margin: 5px;
}
#hidable
{
color: black;
background-color: yellow;
box-shadow: 2px 2px black;
height: 100px;
width: 100px;
padding: 3px;
margin: 5px;
}
jQuery code:
$(document).ready(function()
{
$('clickToHide').click(function()
{
$('#hidable').slideToggle('fast');
});
});
Where have I gone wrong?
EDIT: These are NOT posted online, they are stored locally on my computer. I’m simply trying to test my knowledge of jQuery. There are no servers!
I think your issue is this:
If your
JQueryTestfolder is at root then this should work.here order matters jquery should be loaded before your
doc readycall script.