一、HTML局部加载
.load()函数根据input内容局部加载html页面。
$searchInput
.on('input', function () {
if (!this.value.length) {
$searchResult.load('search_main.html');
}
});
});
二、HTML延迟加载
setTimeout函数控制页面延迟加载时间,延迟一秒后加载页面。
setTimeout(function({$searchResult.load('../html/cmcc_result.html')}, 1000);
三、js函数动态加载
$.getScript("../js/html_href.js",function () {
方法名;
});