![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 251 Pomógł: 2 Dołączył: 24.08.2005 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
potrzebuje synchronicznie odpytac serwer Kod <script> r=new XMLHttpRequest() r.onreadystatechange=function(){if(r.readyState==4)alert(r.responseText)} r.open('GET','1.txt',false) r.send(null) </script> nie wiem czemu pod FF 3.0.1 nie dziala, pozostale wyswietlaja okienko alerta. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 012 Pomógł: 109 Dołączył: 26.09.2003 Skąd: nexis.pl Ostrzeżenie: (0%) ![]() ![]() |
Obiekt XMLHttpRequest() nie jest uniwersalny dla wszystkich przeglądarek, więc może spróbuj użyć jQuery:
Kod <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript"> var GET = { init : function(){ var request = $.ajax({ url: "1.txt", async: false }).responseText; alert(request); } }; $(document).ready(function(){ GET.init(); }); </script> Ten post edytował nexis 21.07.2008, 10:15:10 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 5.10.2025 - 06:57 |