1

I am new to html/css/jquery but I started working on a little sample webpage. I uploaded the files to godaddy where I am hosting the site but am having trouble getting the jquery portion to work. Not sure if I am not linking the .js file to the .html file correctly or if there is another issue.

<!DOCTYPE html>
    <html>
        <head>
            <title>Sample Webpage</title>
            <link rel="stylesheet" href="faq.css" />
            <link rel='stylesheet' type='text/css' href='http://www.code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css'/>
            <script src="http://www.ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">
            <script src="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
            <script type='text/javascript' src='faq.js'></script>
        </head>

here is the jquery that I am trying to use

$(document).ready(function() {

    $('#FAQmenu').accordion({
        event: "click",
        active: false,
        collapsible: true,
        autoHeight: false
    });
});

Thanks in advance

6
  • 4
    There is a missing </script> after this <script src="ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">` Commented May 27, 2013 at 20:11
  • Well, with the HTML code you are showing, your jQuery code does nothing of course. Could you please provide more code and possibly update this fiddle with your code: jsfiddle.net/3LJPj Commented May 27, 2013 at 20:26
  • I updated the fiddle with the html and css that I am linking to and it appears to work there. This makes me think it is an issue with the linking or with godaddy Commented May 27, 2013 at 20:34
  • fiddle link: jsfiddle.net/3LJPj/5 Commented May 27, 2013 at 20:37
  • Well, that's why I love asking for a fiddle. ;-) As we have no more info, it's very hard to help. Maybe double check all links again, see if your browser's error log shows errors, test with stupid things like an alert('test') and so on. Commented May 27, 2013 at 20:40

2 Answers 2

1

You have not closed the first script tag. Instead try:

<script src="http://www.ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
Sign up to request clarification or add additional context in comments.

2 Comments

as embarrassing as that was, it still did not fix the issue :'(
is faq.js placed in same directory as your html ?
0

You must install xampp/wamp/mamp/etc or to upload your files to a server if you want the Google hosted jquery to work, otherwise you can download jquery and link it from your project folder.

3 Comments

Why should it be necessary to install anything to link to hosted files?
Just try to use the Google hosted library from a folder on your computer and see if it works
I really don't know what you mean. e.g. if you have a html file with something like <link href="http://fonts.googleapis.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css" />, it does not matter if you host that html file on a server or call it locally from a directory (with file:///...). The browser makes the request anyway, Google would not even know if the file is hosted or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.