Ajax 获取返回值具体的字段如何获取?
时间:2010-09-25
来源:互联网
我的js如下:
想取http://dict.cn/hello
的翻译内容
应该如何获取.谢谢高人
JScript code
想取http://dict.cn/hello
的翻译内容
应该如何获取.谢谢高人
JScript code
function test(){ var xmlHttp ; try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); var web = "http://dict.cn/hello"; //异步方式 xmlHttp.open("GET",web,true); xmlHttp.onreadystatechange = function(){ // alert(xmlReq.readystate); if (xmlHttp.readystate == 4){ document.write(xmlHttp.responseText); } } xmlHttp.send(); // alert(xmlHttp.responseText); window.clipboardData.setData("Text",xmlHttp.responseText); // alert(xmlReq.responseText); } catch(e){ alert(e); } }
作者: meiyoudao 发布时间: 2010-09-25
跨域了,而且这个网站的内容使用的是ajax动态生成的,即使使用代理也获取不到ajax生成的内容
你需要使用winform编程中的webbrowser控件来解析最后包括ajax生成html代码获取内容
参考
谁能帮我抓取这个网页里的指定部分的内容?
你需要使用winform编程中的webbrowser控件来解析最后包括ajax生成html代码获取内容
参考
谁能帮我抓取这个网页里的指定部分的内容?
作者: showbo 发布时间: 2010-09-25
JScript code
function test(){ var xmlHttp ; try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); var web = "http://dict.cn/hello"; //异步方式 xmlHttp.open("GET",web,true); xmlHttp.onreadystatechange = function(){ // alert(xmlHttp.responseText); window.clipboardData.setData("Text",xmlHttp.responseText);//这个在回调里执行 // alert(xmlReq.responseText); // alert(xmlReq.readystate); if (xmlHttp.readystate == 4){ document.write(xmlHttp.responseText); } } xmlHttp.send(); } catch(e){ alert(e); } }
作者: IBM_hoojo 发布时间: 2010-09-25
我想写成firefox插件的. 所以不是用java获取. 最好是JS直接获取.
作者: meiyoudao 发布时间: 2010-09-25
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28