user6568810
user6568810

Reputation:

JavaScript and jQuery not working for my HTML code

I have finished an assignment for a bed and breakfast website. I completed everything offline, and all was working well; but when I went live the none of the interaction followed. I have an FAQ page with drop down and a fancybox for viewing the rooms.

I tried rearranging my links and scripts, i moved all my JS to separate files and called them all individually. I have checked everything I can think of, but still no luck. How/why would it all work fine offline, but fail when live?

Have been following the website since I began studying. Hopefully the community can help!

Puzzled as to what the issue might be. all links and scripts are accounted for in the appropiate folders.

You can view the website here

I hope I have provided enough information. Let me know if I should include something else.

Cheers, Gav.

JavaScript

$(document).ready(function() {
$(".answer").hide();
$(".question").click(function()
{
$(this).next(".answer").slideToggle(500);
});
});

HTML

<head>
    <meta charset="utf-8"/>
    <meta name="description" content="Gimme Moore BnB, luxury, affordable accomodation located in Galway. Explore Irelands beautiful West Coast in style and comfort."/>

    <link rel="icon" type="image/ico" href="imgs/favicon.ico" />
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/styles.css" />

    <script type="text/javascript" src="javascript/jquery-3.0.0.min.js" ></script>
    <link rel="stylesheet" href="javascript/fancyBox/source/jquery.fancybox.css" media="screen" />

    <script type="text/javascript" src="javascript/fancyBox/source/jquery.fancybox.pack.js"></script>
    <script type="text/javascript" src="javascript/faq.js"></script>
    <script type="text/javascript" src="javascript/fancyJava.js"></script>

    <title>FAQ</title>
</head>

Upvotes: 0

Views: 61

Answers (1)

Dimas Satrio
Dimas Satrio

Reputation: 309

Check your console via Inspect Element,

enter image description here

The file location cannot be found :), you need to make sure the path is reachable by the server.

Upvotes: 4

Related Questions