$.get in Jquery problem

I'm trying to do an ajax (restful service) call using $.get. It works perfectly in IE but gives '401 unauthorized' in case of firefox. At first I thought it was 'NTLM authentication' issue and tried adding the domain( of restful service - eg: http://mydomain.com in about:config -> network.automatic-ntlm-auth.trusted-uris ) but no success. I'm sure it's not the ntlm issue, as entering the same url (restful service) in the firefox browser is giving me the data, but gives 401 unauthorized through $.get. Does anyone have any idea what could be the issue here. Thanks ###Update: I just figure out, it was due to 'cross domain' issue as sAc mentioned. I've one more doubt w.r.t JSONP, the service which I'm using doesn't support additional parameters in the url. but if i've to use JSONP callback, i've to add "callback=?" to the url. Is there any way I can achieve this.
Are you fetching data from another domain?

以上就是$.get in Jquery problem的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准