Isn't it more a server side question ? I would suggest that you try in the browser location bar to generate the url (by hand) and see if there also the problem consists. If yes then you have first to solve it on the server side. I use in my scripts a session id which i pass through getjson as arguments without the ajaxSetup method
On Jun 16, 6:12 am, Antony Currington <acurring...@paradise.net.nz> wrote: > Hi all, > > Is it possible to use ajaxSetup to define a username and password that > will then be used by getJSON? > > I have an enviuronment where I have a web server that I'm passing a > URL to for a web service call that returns me JSON. I'm doing the > call via the getJSON method, and get back the data I want, except that > I'm being prompted to log in and I don't want the users to > authenticate. > > I need to provide a username and password somewhere in the URL (or > additional details) and so added an ajaxSetup call right before I call > getJSON to set the username and password as follows: > > jQuery.ajaxSetup({username: myusername, password: mypassword }); > jQuery.getJSON(url, function (jsonObject) { > > //do some stuff > > } > > ); > > For some reason I'm still getting prompted for the username and > password for the URL, even though they're being set. > > I'm working with IE6, and jQuery 1.3.2. > > Any assistance would be greatly appreciated. > > Regards, > Antony