|
AJAX, немогу решить проблему.
|
|||
---|---|---|---|
#18+
Вот сам код function get_cat ( selected ) { document.form1.ch_sel.options.length = null; document.form1.static_s.options.length = null; message = document.getElementById('nameCheckFailed'); url = "./?cat=ajax&cat_id=" + selected; loadXMLDoc(url); } function loadXMLDoc(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(); } } } function processReqChange() { // only if req shows "complete" if (req.readyState == 4) { alert ( req.status ); // only if "OK" if (req.status == 200) { alert (req.status); // ...processing statements go here... response = req.responseXML.documentElement; len = response.getElementsByTagName('value').length; alert (len); for ( i=0; i < len; i++) { val = response.getElementsByTagName('value') .firstChild.data; text = response.getElementsByTagName('text').firstChild.data; document.form1.static_s.options = new Option (text,value); } } else { alert("There was a problem retrieving the XML data:\n" + req.statusText); } } } ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2006, 11:13 |
|
AJAX, немогу решить проблему.
|
|||
---|---|---|---|
#18+
Сорри, не то нажал, и не дописал вот хмл данные <?xml version="1.0" encoding="UTF-8" ?> - <response> <val>89583</val> <txt>89583</txt> <val>89779</val> <txt>89779</txt> <val>89629</val> <txt>89629</txt> <val>89729</val> <txt>89729</txt> <val>89759</val> <txt>89759</txt> <val>87241</val> <txt>87241</txt> <val>92375</val> <txt>92375</txt> <val>92394</val> <txt>92394</txt> <val>89755</val> <txt>89755</txt> <val>89757</val> <txt>89757</txt> <val>87929</val> <txt>87929</txt> <val>87853</val> <txt>87853</txt> <val>92373</val> <txt>92373</txt> <val>92396</val> <txt>92396</txt> <val>89798</val> <txt>89798</txt> <val>89780</val> <txt>89780</txt> <val>89942</val> <txt>89942</txt> <val>89943</val> <txt>89943</txt> <val>92369</val> <txt>92369</txt> <val>92290</val> <txt>92290</txt> <val>86035</val> <txt>86035</txt> <val>89941</val> <txt>89941</txt> <val>89939</val> <txt>89939</txt> <val>92289</val> <txt>92289</txt> <val>89938</val> <txt>89938</txt> <val>89528</val> <txt>89528</txt> <val>89530</val> <txt>89530</txt> <val>89777</val> <txt>89777</txt> </response> выводит ошибку, что response null. Что не так? ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2006, 11:15 |
|
|
start [/forum/topic.php?fid=22&msg=34002285&tid=1459324]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
40ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
53ms |
get tp. blocked users: |
2ms |
others: | 250ms |
total: | 393ms |
0 / 0 |