Article View: pl.comp.lang.javascript
Article #39904AJAX - prosty problem ale dupa zbita ?
From: Marcin 'goral' Goralski
Date: Mon, 15 May 2006 13:01
Date: Mon, 15 May 2006 13:01
54 lines
2362 bytes
2362 bytes
Witajcie,
zrobilem sobie taki prosty tescik :
function makeRequest(url) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/xml');
// See note below about this line
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot make a request ... failed !');
return false;
}
http_request.onreadystatechange = getResults();
http_request.open('GET', url, true);
http_request.send(null);
}
function getResults() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
alert('Done');
} else {
alert('Data error');
}
}
}
proste. Ale puszczone zarowno na IE6/IIS+WSS nie idzie, oraz nie chce
pojsc na Oracle HTTP Server Powered by Apache/1.3.22 czyli
zmodyfikowanym Apaczu. Moze ktos podszepnac cos ?
Wolam to przez <A ... onClick="makeRequest('./plik.xml');"> lub, zeby
dostac dane bezposrednio z bazy ...
makeRequest('http://server/path/zrodlo_xmla'); ktore zwraca text/xml
dzieki
marcin
Technical Details
Message-ID:
<newscache$nm5bzi$hc3$1@cache3.nc3a.nato.int>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!news-fra1.dfn.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.freenet.de!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!txtfeed2.tudelft.nl!tudelft.nl!binfeed2.tudelft.nl!news1.tudelft.nl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!newsfeed.pionier.net.pl!news-fra1.dfn.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.freenet.de!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!txtfeed2.tudelft.nl!tudelft.nl!binfeed2.tudelft.nl!news1.tudelft.nl!not-for-mail Date: Mon, 15 May 2006 15:01:54 +0200 From: Marcin 'goral' Goralski <goralski.marcin@BEZ.SMIECI.wp.pl> User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 Newsgroups: pl.comp.lang.javascript Subject: AJAX - prosty problem ale dupa zbita ? Message-ID: <newscache$nm5bzi$hc3$1@cache3.nc3a.nato.int> X-Complaints-To: sysadmin@dto.tudelft.nl Organization: www.tudelft.nl Lines: 54 NNTP-Posting-Host: cache3.nc3a.nato.int (195.169.112.21) NNTP-Posting-Date: Mon, 15 May 2006 15:04:00 +0200 X-Trace: cadfb44687c40660cd5b019476 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit