What does the crossDomain: false parameter in Ajax mean?

5

I'm implementing an image upload web app in Ajax and there is the crossDomain:false parameter in a finding example. What is the function of this parameter?

    
asked by anonymous 19.07.2014 / 01:34

1 answer

4

In the JQuery concept, the crossDomain:false parameter defines the behavior if redirects between domains occur on the page called by the method. For example:

  • www.dominio.com/pagina.html invokes Ajax method: www.dominio.com/servico.ashx .
  • www.dominio.com/servico.ashx returns HTTP 302 Found pointing to shop.dominio.com/servico.ashx .

If crossDomain:false , this Ajax call fails automatically.

If crossDomain:true , this Ajax call is allowed.

    
19.07.2014 / 02:23