简体   繁体   English

jQuery无法正确链接html

[英]jQuery not linking with html correctly

I am new to html/css/jquery but I started working on a little sample webpage. 我是html / css / jquery的新手,但是我开始研究一个示例网页。 I uploaded the files to godaddy where I am hosting the site but am having trouble getting the jquery portion to work. 我将文件上传到托管网站的Godaddy,但无法使jquery部分正常工作。 Not sure if I am not linking the .js file to the .html file correctly or if there is another issue. 不知道我是否没有正确地将.js文件链接到.html文件,或者还有其他问题。

<!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 这是我要使用的jQuery

$(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并将其从项目文件夹中链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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