When I write the following in console, the function works:
$('.searchProductLoadMore').click();
However, when I try to do this via iMacro, nothing happens and no error is displayed.
I loaded jQuery in iMacro by looking at the following post:
include jQuery into javascript and use it in imacros ?
following is my entire code.
function loadScriptFromURL(url) {
var request = Components.classes['@mozilla.org/xmlextras/xmlhttprequest;1'].createInstance(Components.interfaces.nsIXMLHttpRequest),
async = false;
request.open('GET', url, async);
request.send();
if (request.status !== 200) {
var message = 'an error occurred while loading script at url: ' + url + ', status: ' + request.status;
iimDisplay(message);
return false;
}
eval(request.response);
return true;
}
loadScriptFromURL('http://127.0.0.1:8080/jquery.js');
$ = window.$;
JQuery = window.JQuery;
$('.searchProductLoadMore').click();
Would really appreciate any help on this.
Thanks.