Jump to content
php.lv forumi
  • 0

$.post uz cita servera


reiniger

Question

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 by reiniger
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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 by codez
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...