try this! $.ajaxSetup({beforeSend:function(req){req.setRequestHeader ("User-Agent","pokemon")}})
On 4/22/07, Yansky <[EMAIL PROTECTED]> wrote:
Hmm, I thought I responded earlier but it seems google groups didn't get my message. Apologies if I'm double posting. On Apr 23, 12:48 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote: > What are you trying to do exactly? The user agent is passed in during a XHR > request--just like a normal HTTP call. > > Also, the navigator.userAgent is available to the core template (and > wouldn't change via an AJAX call.) > > -Dan I'm writing a greasemonkey script that calls a page which is served up differently for IE than for FF, so I want to add the Mozilla/FF user agent string to the request. On Apr 23, 2:38 am, "????" <[EMAIL PROTECTED]> wrote: > beforeSend:function(req){req.setRequestHeader > ("User-Agent","pokemon")}, > > inside a $.ajax call sets my user-agent to pokemon. (tested in firefox2) > > On 4/22/07, Yansky <[EMAIL PROTECTED]> wrote: > Thanks Jake, I tried your suggestion but it didn't seem to work for me. I did what you said and changed it to an $.ajax call instead of $.get, but no joy. I ended up just using a generic non-jQuery XMLhttpRequest and specifying the user agent in that request. It seemed to do the trick. Thanks anyway. :)
-- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ