透過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。
Attractive component to content. I simply stumbled upon your blog and in accession capital to
say that I get in fact loved account your blog posts.
Any way I will be subscribing on your feeds and even I fulfillment you get right
of entry to persistently fast.
best price cialis Li G, Tang D, Song B, Wang C, Qunshan S, Xu C, Geng H, Wu H, He X, Cao Y
I think that everything published was actually very logical.
However, what about this? what if you were to write a awesome headline?
I ain’t saying your content is not solid, however suppose you added a headline
that grabbed people’s attention? I mean 透過JS跨網域存取XML檔 – 馬老師 雲端研究室 is kinda vanilla.
You ought to peek at Yahoo’s home page and watch how they create post headlines to get people to click.
You might add a video or a picture or two to grab
people excited about what you’ve written. Just my opinion, it might bring your
posts a little bit more interesting.
After such a long period of time, Yang Ye was able to stabilize in Yanzhou, but the officials in the DPRK did not seem so patient, and various voices came cialis pill male enhancement cialis pill male enhancement out buy cialis online without a prescription
gay chat no registration
gay perv chat
boy self sucking chat room gay chum’s brother calhoun couldn’t stop
buy prescription drugs online legally canadian online drugstore
canadian online drugs buy prescription drugs without doctor
It’s fantastic that you are getting ideas from this post
as well as from our dialogue made at this time.
https://molnupiravir.life/# cost of molnupiravir
live gay web cam chat rooms
gay chat phone
gay chat mature
Indeed, on-demand PDE5-inhibitor use means making an appointment with oneself or one s partner at a given time during the day or week tadalista vs cialis Are there any coupons for CIALIS TADALAFIL
I must thank you for the efforts you’ve put in penning this website.
I really hope to view the same high-grade blog posts by you later on as well.
In fact, your creative writing abilities has motivated me
to get my own site now 😉
Selection favours T-cells with small differences in antibody binding that give a stronger reaction cialis for sale Some items may interact with your medicine
5 g kg in healthy volunteers with mean maximum blood alcohol levels of 0 generic cialis tadalafil
order cialis 40mg pill accutane 40mg sale prednisone 20mg cheap
Hello! I realize this is sort of off-topic however I needed to
ask. Does managing a well-established blog like yours
take a lot of work? I’m completely new to running a blog
but I do write in my diary everyday. I’d like to start a blog so I can easily share my personal experience and
feelings online. Please let me know if you have any kind of ideas or tips for
brand new aspiring blog owners. Thankyou!
order cialis 5mg without prescription purchase cialis online prednisone buy online
https://tamoxifen.best/# low dose tamoxifen
buy tadalafil 10mg online deltasone 5mg price prednisone online buy
обменник биткоин
обмен биткоин
gay chat rooms
gay chat pittsburgh
free gay video chat rooms
https://viagracanada.xyz/# is viagra government funded
https://molnupiravir.life/# cost of molnupiravir
gay tranny webcam chat
gay couple chat
gay geek chat
non prescription erection pills pain meds online without doctor prescription
Oh my goodness! Incredible article dude! Thank you so much, However I am encountering troubles with your RSS.
I don’t understand why I cannot join it. Is there anybody else
having similar RSS problems? Anyone that knows the solution can you kindly respond?
Thanx!!
You could definitely see your enthusiasm within the article you write.
The arena hopes for even more passionate writers like you who aren’t afraid to mention how
they believe. Always go after your heart.
cialis vs viagra Penulis mengungkapkan dengan dalam, sungguh-sungguh, Cialis super Active From India there Cialis super Active From India isnt much point in making the correction as it is likely to be something beyond their current level of competence
Менеджер маркетплейсов – обучение обучение
на бесплатных и платных курсах работе с маркетплейсами ВБ, Озон, Yandex.Market и т.п., и получение работы для начинающих новичков с нуля “Менеджер маркетплейсов”, на курсе научат аналитике, разным форматам продвижения уже через короткое время, освойте востребованную профессию дистанционно и получите навыки и практику в интернет-маркетинге, для того, чтобы зарабатывать деньги и оказывать помощь предпринимателям; в обучении вы узнаете все: работа с карточками, планирование стратегии продвижения, работа с поставщиками, особенности маркетплейсов, после прохождения обучения выдаётся диплом и сертификат, стоимость есть по ссылке.