_onRequestComplete : function(request) {
alert(1);
var fh = fopen("c:\\response.txt", 3); // Open the file for writing
alert(2);
if(fh!=-1) // If the file has been successfully opened
{
var str = request.responseText;
fwrite(fh, str); // Write the string to a file
fclose(fh); // Close the file
}
..............................这是我插在第三方库(rico livegrid)里面的几个简单语句,希望把ajax的返回结果打印到一个文本看一下(response内容太多,alert显示不下)。从执行结果来看,alert(1);有显示,执行到了;alert(2);没有执行到,2没打出来,后续也都没有再执行,似乎卡在这了。我不知道哪里没写对请高手看一下,谢谢。fopen的写法是从网上找的。
alert(1);
var fh = fopen("c:\\response.txt", 3); // Open the file for writing
alert(2);
if(fh!=-1) // If the file has been successfully opened
{
var str = request.responseText;
fwrite(fh, str); // Write the string to a file
fclose(fh); // Close the file
}
..............................这是我插在第三方库(rico livegrid)里面的几个简单语句,希望把ajax的返回结果打印到一个文本看一下(response内容太多,alert显示不下)。从执行结果来看,alert(1);有显示,执行到了;alert(2);没有执行到,2没打出来,后续也都没有再执行,似乎卡在这了。我不知道哪里没写对请高手看一下,谢谢。fopen的写法是从网上找的。
你们知道怎么让我看到完整的request.responseText变量内容吗?如果不能写文件的话。
2 function (r)
{
var win = window.open("", "", "width=100, height=100");var doc = win.documentdoc.open();
doc.writeln(request)
doc.close();
}
2 function (request)
{
var win = window.open("", "", "width=100, height=100");var doc = win.documentdoc.open();
doc.writeln(request)
doc.close();
}JS不能操作客户端IO,但可以再打开一个新窗体.