透過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。
Confie neste cassino confiavel Tigrinho
trouver un mГ©dicament en pharmacie: cialis sans ordonnance – pharmacie en ligne
Viagra gГ©nГ©rique pas cher livraison rapide: viagra sans ordonnance – Viagra homme sans ordonnance belgique
trouver un mГ©dicament en pharmacie: pharmacie en ligne france livraison internationale – trouver un mГ©dicament en pharmacie
Pharmacie en ligne livraison Europe: kamagra pas cher – pharmacie en ligne france livraison internationale
Viagra pas cher paris: Meilleur Viagra sans ordonnance 24h – SildГ©nafil Teva 100 mg acheter
Confie neste cassino confiavel Tigrinho
As maiores probabilidades neste cassino Tigrinho
Live Cricket Match Score : }1 Today IPL Match 2024: As per IPL 2024 Schedule, the tournament will begin on March 22, 2024 with the final game to be played on May 26, 2024. Following are the full details of the Today IPL Match 2024: Chennai Super Kings won by 7 wickets View Scorecard Today Prediction of Punjab Kings vs Royal Challengers Bengaluru Today IPL Match 2024. Today match prediction of Indian Premier League… Sunrisers Hyderabad will win in today’s IPL Hyderabad vs Rajasthan match. Sunrisers Hyderabad, on their day, are the team to beat. Despite facing defeats in their last two IPL 2024 outings, they will be confident to come back hard and put up a strong show against the league leaders, Rajasthan Royals. Throughout this IPL season, Sunrisers Hyderabad have showcased remarkable batting displays on multiple occasions. Rajasthan Royals have established themselves as the most well-rounded team thus far. They have excelled both in batting and bowling, showing excellent prowess in all aspects of the game.
https://www.fundable.com/dale-smith-1
A lot has been written about Gukesh but have you wondered about how it is to be the… DC Vs KKR IPL 2024 Live Score: Aiming for a hat-trick of the winning matches, it will be a test for Shreyas Iyer-led Knights, who will face Rishabh Pant’s Delhi Capitals from 7:30 pm today at in Visakhapatnam. Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings. Live Cricket Match Score : }1 Stay informed with our extensive coverage of cricket news, analysis, interviews, match previews, reviews and much more. From the exhilarating highs of Test matches to the fast-paced excitement of T20 internationals and the strategic battles of One Day Internationals, we provide a complete picture of the cricketing world. A lot has been written about Gukesh but have you wondered about how it is to be the…
pharmacie en ligne fiable: kamagra 100mg prix – pharmacie en ligne livraison europe
© 2024 WherestheMatch Ltd Fancode will stream the PSL 2024 final live on their website and app. © 2024 WherestheMatch Ltd Live: South East Stars vs Lancashire Thunder, 7th Match, Charlotte Edwards Cup Jio customers can watch their favorite TV channels & live cricket matches on mobile devices for free and can even pause & play a live program, or catch-up shows telecast over the last seven days. Besides that, anytime, any cricket match can be watched live on this fantastic app. Even the highlights matches are available on the best jio app. We are providing streaming in our Android App. If you are visiting our website from mobile or tablet then it is quite easy to download and install our app and watch your favorite sports in HD. Experience the thrill of live sports like never before with PTV Sports Live Streaming. This platform ensures you catch every moment of your favorite sports events without any lags or interruptions. From live cricket streaming to football, hockey, and tennis, PTV Sports Live Streaming brings it all to your screen in real time.
https://www.udrpsearch.com/user/tettwillgoodpmo1983
The India vs Bangladesh U19 World Cup match will take place at the Mangaung Oval, Bloemfontein.Where can we watch the live broadcast of India vs Bangladesh U19 World Cup match on television in India? The U.S. is set to host its first ever ICC cricket tournament this year, the ICC Men’s T20 World Cup, as a co-host with West Indies. A news release by the International Cricket Council announced 55 matches to be played at various stadiums across the U.S. including in Texas, New York and Florida from June 1-29. Related Stories Keep track of every signing made by each of the 18 counties ahead of the 2024 season. However, the BAN vs ZIM 3rd T20I will not be available on the television. Live streaming of Ban vs Zim 3rd T20I will be available on the FanCode app and website. The exciting match between two talented sides would be a great experience for the fans.
SildГ©nafil 100 mg prix en pharmacie en France: Acheter du Viagra sans ordonnance – Viagra en france livraison rapide
Casa de apostas com condicoes favoraveis Tigrinho
pharmacie en ligne avec ordonnance: cialis sans ordonnance – Achat mГ©dicament en ligne fiable
Casa de apostas Selecao ideal de cassino Tigrinho
pharmacie en ligne fiable: kamagra pas cher – pharmacie en ligne france livraison internationale
Viagra pas cher livraison rapide france: viagra en ligne – Viagra prix pharmacie paris
I am really glad to glance at this webpage posts which includes lots of useful data,
thanks for providing such information.
Feel free to visit my blog eharmony special coupon code 2024
Os melhores bonus deste cassino Tigrinho
Casa de apostas com condicoes favoraveis Tigrinho
pharmacie en ligne fiable: Pharmacies en ligne certifiees – pharmacie en ligne
Отличный сайт! Рекомендую заглянуть тудаГрадостроительный консалтинг
Ganhos maximos neste cassino Tigrinho
pharmacie en ligne france livraison internationale: Acheter Cialis 20 mg pas cher – pharmacie en ligne france livraison belgique
Jogue em um cassino confiavel Tigrinho
pharmacie en ligne pas cher: pharmacie en ligne sans ordonnance – pharmacie en ligne france livraison internationale
trouver un mГ©dicament en pharmacie: cialis sans ordonnance – pharmacie en ligne
O cassino mais confiavel para voce Tigrinho
A melhor opcao para jogos de azar Tigrinho
Отличный сайт! Рекомендую заглянуть тудаСтроительный консалтинг в Москве