ysy950803 2018-09-15 14:59:11

用img标签实现异步执行代码

// 先把相关任务写在一个php文件里
<?php
$con = new mysqli('xxx.xxx.xxx.xxx', 'root', '123456', 'db_name');
// ...
$con -> query($sql);
$con -> close();
// ...
?>
// 然后在html中这样写,就能异步跑了,不会阻塞页面加载
<img src="crwd.php" border="0" style="display:none;"/>

评论

trang chủ - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.1. UTC+08:00, 2024-11-05 22:00
浙ICP备14020137号-1 $bản đồ khách truy cập$