結(jié)果這段代碼在firefox中生效,在opera中也生效,但是在Safari和chrome中卻沒有效果,于是我上jQuery的官方論壇,和StackFlowover 論壇提問,后者有人回復(fù)我: I assure you I was using $.ajax with Chrome just five hours ago at the office, and had no such problem. I also imagine they use it here on SO and I have no problems here. I have no problems on jQueryUI in Chrome. I think it is your code. 大意就是斬釘截鐵的說他用起來沒有問題,是我自己的問題,我也納悶了,后面也有人給我的建議更復(fù)雜:
You should use chrome's or safari's built-in developer tools (ctrl+shift+i) to track JS errors and track actual AJAX requests.
Is your code wrapped in document.ready? Is there any erros in javascript console? Also try to output something after success callback line. Another cause for this could be incorrect mime-type for your XML file returned by server. It should be [Content-type: text/xml]. You can check that in chrome's or safari's built-in developer tools - just look for headers tab when xml resource is selected. If it 's actual problem, you may need to tweak web-server configuration (main config or .htaccess for apache) to return correct mime-type