简体   繁体   中英

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>

Check your console via Inspect Element,

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM