方法一:
在 PHP 端
header('HTTP/1.1 204 No Content ');
利用http的原理进行
var img = document.createElement('img'); img.setAttribute('src','***.jpg');
然后绑定要点击的元素
方法四:利用iframe的特性
<html> <head> <title></title> </head> <body> <div id = 'ok'></div> <form action='1.PHP' method='post' target='tar'> Username:<input type='text' name='username'/> Password<input type='text' name='password'/> <input type='submit' value='登陆'/> </form> <iframe width="0" height="0" frameBorder="0" name='tar'></iframe> </body> </html>
PHP端
<?PHP //var_dump($_POST); ?> <script type="text/javascript"> parent.document.getElementById('ok').innerHTML = '注册成功'; </script>