reiniger Posted October 4, 2011 Report Share Posted October 4, 2011 (edited) Sveiki Vai ir iespējams kaut kā apiet šo lietu. gribu dabūt datus no domens2.com ( nav mans ). $('#get_s').click(function() { var t_r = $('#sup').val(); $.post("http://www.domens2.com?test.php", {getID : t_r}, function(data) { $('#gets_s').val(data); }); }); Parāda šadu lietu ka liegta pieeja HttpRequest cannot load http://www.domens2.com?test.php Origin http://www.domens.com is not allowed by Access-Control-Allow-Origin. Vai var apiet šo lietu vai arī būs jāpaliek gribot! Edited October 4, 2011 by reiniger Quote Link to comment Share on other sites More sharing options...
0 briedis Posted October 4, 2011 Report Share Posted October 4, 2011 Meklē google: Cross domain ajax. Quote Link to comment Share on other sites More sharing options...
0 codez Posted October 4, 2011 Report Share Posted October 4, 2011 (edited) Tas nav iespējams, tu nevar browserī veikt ajax izsaukumu uz citu domeinu. Lielākais, ko tu vari ir ielādēt ir resursus no cita domeina: bildes, css, js, iframe, bet tu nevari piekļūt to saturam. Padomā taču loģiski, ja tā varētu, tad es veiktu pieprasījumsu uz draugiem, facebook, utt sarakstēm un ja tu ienāc manā lapā un esi kādā no tiem ielogojies, es nolasu tavu saraksti. Edited October 4, 2011 by codez Quote Link to comment Share on other sites More sharing options...
0 daGrevis Posted October 5, 2011 Report Share Posted October 5, 2011 Te vēl var palsīties... http://en.wikipedia.org/wiki/Same_origin_policy Quote Link to comment Share on other sites More sharing options...
0 nemec Posted October 10, 2011 Report Share Posted October 10, 2011 Ja tik tiešām vajag, tad var veikt crossdomain get un post http://alotaiba.github.com/FlyJSONP/ Quote Link to comment Share on other sites More sharing options...
Question
reiniger
Sveiki
Vai ir iespējams kaut kā apiet šo lietu.
gribu dabūt datus no domens2.com ( nav mans ).
Parāda šadu lietu ka liegta pieeja
Vai var apiet šo lietu vai arī būs jāpaliek gribot!
Edited by reinigerLink to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.