Hey guys
I tried to write a js application for karotz, where I need to do some basic auth stuff.
I want to call a REST Service, where I need to be logged in.
Well, so i tried to use jQuery for handling the authenitaction part like that:
var auth = //my basic auth basic64 encrypted user:password
var data = jQuery.ajax({
type : "GET",
url : url,
beforeSend : function(req) {
req.setRequestHeader("Authorization", auth);
},
success : callback,
dataType : "json"
});
... but i always get the same error: Exception in thread "main" org.mozilla.javascript.EcmaError: ReferenceError: "window" is not defined. (jquery.js#15)
So there is no "window" defined, because there is no brower-window on the karotz.
After that, I thought about another method i could try. So I decided to use the XMLHttpRequest, but same problem here.
So is there any way to handle basic auth with karotz?
Regards
Lenny