Jump to content
php.lv forumi

Izsaukt caur ajaxu skriptu no cita servera


freak

Recommended Posts

Man ir viens php fails, kas atrodas uz cita servera, ko megjinu izsaukt caur ajaxu.

Tikai nezinu kapec uz Mozzilas shitas neiet cauri. Uz IE strada.

Ja visi faili uz viena servera, tad arii iet.

 

Kapec ta? Vai uz mozzilas tas nav iespejams?

 

var url="http://manacitalapa.lv/out.php";

url=url+"?id="+id;

url=url+"&sid="+ new Date().getTime();

 

xmlHttp105.onreadystatechange=f105;

 

//aiz shitaas vietas nereagje

xmlHttp105.open("POST",url,true);

Edited by freak
Link to comment
Share on other sites

Nu vispār uz IE arī nevajadzētu tam strādāt. Vismaz pie defaultiem settingiem. To nevar darīt dēļ security - visādas jaukas lietas varētu šādi taisīt ;)

 

Ja dikti vajag sauk ar AJAX, taisi uz sava domēna proxy - kādu PHP skriptu, kas ielādēs tos remote skriptus ar curl vai fopen()

Link to comment
Share on other sites

Nu nezinu gan vai crossdomain var nosutit POST. Ar GET cik pagaidam pats esmu atradis var izmantot jQuery getJson

$.getJSON("http://crossdomain.lv/index.php?id="+id+"&jsoncallback=?",
       function(data){
         //data faktiski satur json objektu
       });

 

un pec tams php varetu atgriezt kaut ko lidzigu sim te

<?php echo $_GET['jsoncallback'];?>({'id':'<?php echo $_GET['id'];?>'})

 

cerams noderes...

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
Reply to this topic...

×   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...