GazEcc
GazEcc

Reputation: 5

Can't load edits to my website

Im trying to get my gigs page to load content at the push of a button but it doesn't seem to be loading the content this is what i have

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function() {
            $("#apr").click(function(){
                $("#gigs").load(gigs/april13.html);
            }); 
        });
    </script>
    <title>Where We're Playing</title>
</head>

Where, #apr is the button id, #gigs is the id of the div where I want it to appear and on the side I have an unordered list containing the button(s). the file gigs/april13.html is the url of the gigs info.

This is the gigs page I'm talking about.

Upvotes: 0

Views: 71

Answers (4)

DannyTheDev
DannyTheDev

Reputation: 4173

You need to include the jQuery library

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

or

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

You also need to do what @tymeJV said and make sure you keep the load URL in quotes

You may want to change click to .on

$(document).ready(function() {
    $("#apr").on("click",function(){
        $("#gigs").load("gigs/april13.html");
    }); 
});

Upvotes: 3

Eli
Eli

Reputation: 14827

After view your page source, the obvious reason is that you haven't included jQuery library.

Put this under your referenced css file and before your jQuery code:

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

Upvotes: 0

Lior Elrom
Lior Elrom

Reputation: 20852

You forgot to include the jQuery API and also you have a typo mistake.

Try this instead:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function() {
            $("#apr").click(function(){
                $("#gigs").load('gigs/april13.html');
            }); 
        });
    </script>
    <title>Where We're Playing</title>
</head>

Upvotes: 0

tymeJV
tymeJV

Reputation: 104775

Seems you forgot quotes around your path

$("#gigs").load("gigs/april13.html");

Upvotes: 0

Related Questions