透過JS跨網域存取XML檔
為了一些安全性的因素,通常伺服器會阻擋跨網域的XML存取,當然如果你是該網站開發者,所開發的頁面應該將會被放在被認可的網域中,不會碰到這個問題,但我們在開發前期有可能會不在所屬的網域,這樣就會造成開發上的困難,不過我們可以透過Yahoo所提供的YQL查詢語法來解決這個問題,以下就是相關的說明:
若我們在自己的電腦用以下的語法去存取一個網路上的XML
<script> $(function () { var xmlSource = "http://stanley.cloudlab.tw/crossDomainXML/testXML.xml"; $.ajax({ url: xmlSource, success: function (data) { console.log(data); } }) }) </script>
很可能會出現「No Access Control Allow Origin」的訊息:

但如果套用上YQL之後
<script> $(function(){ var xmlSource = "http://stanley.cloudlab.tw/crossDomainXML/testXML.xml"; var yqlURL = [ "http://query.yahooapis.com/v1/public/yql", "?q=" + encodeURIComponent("select * from xml where url='" + xmlSource + "'"), "&format=xml&callback=?" ].join(""); $.getJSON(yqlURL, function(data){ console.log(data) }); }) </script>

可以看到已經可以抓到XML內容,這樣可以讓我們較為方便的去開發,其他詳細的使用說明可以參考Yahoo YQL Guide。
zithromax 250 mg australia: zithromax 500 mg lowest price drugstore online – buy zithromax without prescription online
zithromax 500: where can i buy zithromax capsules – zithromax online usa no prescription
amoxicillin from canada: AmoHealthPharm – amoxicillin in india
cheap clomid no prescription: ClmHealthPharm – can you get clomid for sale
where can i buy zithromax uk ZithroPharm zithromax 250mg
zithromax online australia: zithromax order online uk – can you buy zithromax over the counter in mexico
amoxicillin 200 mg tablet: buy amoxicillin online uk – amoxicillin 500 mg tablet
https://amohealthpharm.com/# buy amoxicillin online no prescription
amoxicillin online pharmacy: amoxil generic – amoxicillin 500 mg tablets
amoxicillin no prescipion: AmoHealthPharm – rexall pharmacy amoxicillin 500mg
zithromax generic price: ZithroPharm – zithromax 500 tablet
can you buy cheap clomid where can i get clomid pill how can i get cheap clomid without prescription
http://zithropharm.com/# zithromax capsules 250mg
zithromax prescription online Zithro Pharm zithromax 500 price
amoxicillin 500mg without prescription: where to buy amoxicillin – buy amoxicillin online mexico
antibiotic amoxicillin: can you buy amoxicillin over the counter – amoxicillin 500mg for sale uk
can you buy zithromax over the counter in mexico: zithromax tablets for sale – zithromax 500mg over the counter
buy amoxicillin from canada: amoxicillin order online no prescription – amoxicillin in india
how can i get cheap clomid without dr prescription: ClmHealthPharm – cost cheap clomid online
can you buy amoxicillin over the counter amoxicillin 500mg amoxicillin 500mg price canada
generic amoxil 500 mg: AmoHealthPharm – cost of amoxicillin 875 mg
buy generic zithromax no prescription: Zithro Pharm – buy zithromax without presc
generic clomid pills: ClmHealthPharm – can i buy generic clomid no prescription
generic clomid without a prescription: ClmHealthPharm – can i order generic clomid without dr prescription
zithromax 500mg over the counter: buy azithromycin zithromax – zithromax 250
zithromax 500mg price in india Zithro Pharm can you buy zithromax online
http://zithropharm.com/# generic zithromax online paypal
order amoxicillin online uk: AmoHealthPharm – amoxicillin 500mg price in canada
zithromax 500 mg ZithroPharm zithromax capsules 250mg
zithromax 500 mg lowest price online: where can i get zithromax over the counter – can you buy zithromax over the counter in canada