简体   繁体   中英

how to use AJAX in javascript and then linking it to html file

I have written AJAX in .js file. I am no sure how to link it to the html file. Below is the JS file I have written:

function spin(){
$("#sq-two").toggleClass("spinEffect");
}

<head>元素中,添加一个新标签:

<script src="./path_to_your_file.js"></script>

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