Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 235 Vote(s) - 3.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JScript/CScript promise

#1
I am currently trying to run Q promise library from JScript/CScript from command prompt. But it seems that JScript is throwing an error when it tries to execute/eval the code.

Code:

function createXMLHTTPObject() {
var XMLHttpFactories = [
function () {return new XMLHttpRequest()},
function () {return new ActiveXObject("Msxml2.XMLHTTP")},
function () {return new ActiveXObject("Msxml3.XMLHTTP")},
function () {return new ActiveXObject("Microsoft.XMLHTTP")}
];
var xmlhttp = false;
for (var i=0;i<XMLHttpFactories.length;i++) {
try {
xmlhttp = XMLHttpFactories[i]();
}
catch (e) {
continue;
}
break;
}
return xmlhttp;
}
var loadScript = function(url){
var script= createXMLHTTPObject();
script.Open("GET",url,false);
script.Send()
var response = eval(script.responseText);
}
//execute Q library
loadScript("http://jquery-for-admins.googlecode.com/svn/trunk/jq4a.js");
loadScript("http://cdnjs.cloudflare.com/ajax/libs/json2/20130526/json2.min.js");
loadScript("http://cdnjs.cloudflare.com/ajax/libs/q.js/1.0.1/q.js");

This is the execution code from cmd:

wscript //x script.js

The code above could execute jquery4admin and json2.min.js. But for some reasons it couldn't execute the Q library. So the question is: Is there any other promise library that support JScript/CScript? If it is not possible then I will just run all XHR in synchronous mode.

Update:
the error was actually within q.js, when I tried to declare the deferred object and resolve it, visual studio debugger basically break and stopped at this line of code:
`// old browsers
requestTick = function () {
setTimeout(flush, 0);
};`

And this is what visual studio says:

> Unhandled exception at line 618, column 13 in eval code
>
> 0x800a138f - Microsoft JScript runtime error: Object expected

Thanks
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through