透過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。
Experimente o cassino mais popular Blaze
Top Stage Hypnotist for hire Kristian von Sponneck performs private stage hypnosis shows anywhere in the UK, Europe or worldwide. Hire hime for your next event!
vasotec 10mg without prescription – zovirax eye drops order zovirax for sale
Seu cassino online favorito Blaze
Sua sorte esta no cassino confiavel Blaze
Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! However, how can we communicate?
baby books should have as many pictures as possible because babies like to see pictures.,
My coder is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he’s tryiong none the less. I’ve been using Movable-type on a number of websites for about a year and am worried about switching to another platform. I have heard good things about blogengine.net. Is there a way I can import all my wordpress content into it? Any kind of help would be greatly appreciated!
Hello i am kavin, its my first occasion to commenting anyplace, when i read this post i thought i could also make comment due to this good article.
http://arusak-attestats24.com
Hello very cool website!! Guy .. Beautiful .. Amazing .. I’ll bookmark your site and take the feeds additionally? I’m satisfied to search out a lot of useful information here within the publish, we need develop more strategies on this regard, thank you for sharing. . . . . .
Thank you, I’ve recently been searching for information about this subject for ages and yours is the greatest I have discovered till now. However, what concerning the conclusion? Are you positive concerning the supply?
http://www.arusak-attestats24.com
Hi there, You have done an excellent job. I will definitely digg it and personally suggest to my friends. I’m confident they’ll be benefited from this website.
голяк кубик в кубе бесплатно https://golyak-serial-online.ru
dramamine pills – brand dimenhydrinate 50mg order actonel generic
O cassino mais popular Blaze
В нашем мире, где аттестат является началом успешной карьеры в любой сфере, многие пытаются найти максимально быстрый путь получения образования. Наличие официального документа об образовании переоценить невозможно. Ведь диплом открывает дверь перед людьми, стремящимися начать трудовую деятельность или учиться в университете.
В данном контексте мы предлагаем быстро получить любой необходимый документ. Вы можете приобрести аттестат, что является выгодным решением для человека, который не смог закончить образование, потерял документ или хочет исправить плохие оценки. Аттестат изготавливается с особой аккуратностью, вниманием ко всем нюансам, чтобы на выходе получился 100% оригинальный документ.
Преимущества этого подхода состоят не только в том, что можно оперативно получить аттестат. Процесс организовывается удобно, с нашей поддержкой. Начав от выбора необходимого образца до консультаций по заполнению личных данных и доставки по стране — все находится под полным контролем опытных специалистов.
Всем, кто ищет оперативный способ получить необходимый документ, наша компания может предложить отличное решение. Приобрести аттестат – значит избежать продолжительного обучения и сразу переходить к достижению собственных целей: к поступлению в ВУЗ или к началу трудовой карьеры.
http://www.gasts.de/modules.php?name=Your_Account&op=userinfo&username=edefyg
голяк кубик в кубе смотреть https://golyak-serial-online.ru
голяк кубик онлайн https://golyak-serial-online.ru
O melhor cassino para grandes vitorias Blaze
Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say fantastic blog!
tnrevergreen.com.vn/dien-tich-tim-tuong-la-gi-mua-nha-nen-dung-cach-tinh-dien-tich-nao/В
my-digital.ro/contact/В
jaezfinancialgroup.icu/pages/contact-usВ
fkf36.ru/183/В
http://www.underworldralinwood.ca/forums/member.php?action=profile&uid=246355В
what online casino gives you free money without deposit? online casino
i can say that David Archuleta has some great potential. all he need is more epxerience’
what is the most legit online casino gaming bets
Desfrute da emocao no melhor cassino Blaze
The following time I learn a weblog, I hope that it doesnt disappoint me as a lot as this one. I imply, I do know it was my option to read, but I really thought youd have one thing attention-grabbing to say. All I hear is a bunch of whining about something that you may fix in case you werent too busy in search of attention.
Sua sorte em um cassino confiavel Blaze
dance shoes that are shiny are the most cool stuff that you could possibly wear,
Jogue em um cassino confiavel Blaze
Melhores jogos neste cassino Blaze
купить мебель цена
https://formomebel.ru/stoliki/kruglye
when there are fund raising events in our community, i always see to it that i participate in it;
атака титанов смотреть онлайн атака титанов онлайн