简体   繁体   中英

jQuery not linking with html correctly

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

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>

如果要运行Google托管的jquery,则必须安装xampp / wamp / mamp / etc或将文件上传到服务器,否则,您可以下载jquery并将其从项目文件夹中链接。

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