Vebers Posted December 4, 2005 Report Share Posted December 4, 2005 reku kods http://paste.php.lv/2952 Lieta tada, ka man ir pieejami 3 serveri. piem. 1) zirneklis 2) lapsa 3) kalps šo kodu izmetu uz visiem trijiem serveriem. Taču no servera 'zirneklis' varu iegut datus no 'lapsa' , 'kalps' un paša 'zirneklis' serveriem, taču no 'lapsa' un 'kalps' nedarbojas.. Tur darbojas tikai uz pasa servera "?id=bla&waha=hm". pat neparadas errors ka neko nesanjema no otra servera! Kapec ta ? Link to comment Share on other sites More sharing options...
bubu Posted December 4, 2005 Report Share Posted December 4, 2005 Tāpēc, ka ar XMLHttpRequest var veikt pieprasījumus tikai no sava domēna urļiem. pat neparadas errors ka neko nesanjema no otra servera! Esi pārliecināts? Paskatījies Firefox'ša JS Consolē? Man tur gan uzrādās errori. Te vari palasīt workaroundus: http://fettig.net/weblog/2005/11/28/how-to...in-your-domain/ http://fettig.net/weblog/2005/11/30/xmlhtt...bdomain-update/ Link to comment Share on other sites More sharing options...
Vebers Posted December 4, 2005 Author Report Share Posted December 4, 2005 aa.. paradas gan -->Error: uncaught exception: Permission denied to call method XMLHttpRequest.open bet nav kada cita iespeja ka no svesha servera iegut ar JS kadu textu ? piemeram 30 simbolus garu ? Link to comment Share on other sites More sharing options...
bubu Posted December 4, 2005 Report Share Posted December 4, 2005 Tu linkus izlasīji? Link to comment Share on other sites More sharing options...
Vebers Posted December 4, 2005 Author Report Share Posted December 4, 2005 jaa, bet cik sapratu tad tas darbojas tikai uz subdomeeniem. Link to comment Share on other sites More sharing options...
bubu Posted December 4, 2005 Report Share Posted December 4, 2005 A tev tā nav? Tu tur sakot "man ir 3 serveri.." es nodomāju, ka tev tie vienā tīklā ir. Bet, cik zinu, tad XHR nevar starp domēniem šitā darīties. Link to comment Share on other sites More sharing options...
Vebers Posted December 4, 2005 Author Report Share Posted December 4, 2005 nea, nava gan! ideja ir tada ka ar javascript vai html [k-kaa] vaidzetu nolasit pic_id no zirneklis.lv [shis kods apmeram butu izvietots daudzas lapas, bet daudzaam lapam nav php]. Ta ir baneru apmainas sistema. <a href="http://zirneklis.lv/url.php?id=1&pic_id=[bildes id]"><img src ="zirneklis.lv/?user_id=1"></a> tatad ideja bija no http://zirneklis.lv/urlis.php nolasit kads banera_id tagad paradas lapa un kada ir banera adrese, tad ar javascript to aizvietot. piem <script> var string = '12||925.gif'; //to izdod urlis.php var string2 = string.split('||'); var id = string2[0]; var url = string2[1]; document.write('<a href="http://zirneklis.lv/url.php?id=1&pic_id=' + id + '"><img src ="http://zirneklis.lv/banner.php?img=' + url +'"></a>'); </script> bet taa kaa nevar ar xmlhttprequest tad man truukst ideju kaa lai es panaaku ka dotais id kas ir bildei lai paraadas arii ieks <a href... Link to comment Share on other sites More sharing options...
bubu Posted December 4, 2005 Report Share Posted December 4, 2005 A obligāti vajag ar JS? Ar php nedrīkst? Link to comment Share on other sites More sharing options...
Vebers Posted December 4, 2005 Author Report Share Posted December 4, 2005 Nea.. jo daudziem serveriem [kur tiks izvietots shis lietotaja kods] nav pieejams php. Par to stipri shaubos, bet boss neljauj :( Link to comment Share on other sites More sharing options...
Recommended Posts