jquery file does not work outside of domain (crossdomain.xml)

可紊 提交于 2020-01-06 04:27:13

问题


I have read through numerous questions posted here about jquery and cross-domain implementation. What I am about to ask I believe is illegal but...

Background: I "downloaded" (ripped really) a web-template from templatemonster. This template does NOT contain ANY flash, only JS, CSS, HTML. I downloaded ALL files and placed them in my apache web server BUT all I got was the google page.

I started looking at the html, css & js files and could not find anything (all js were minified obviously).

I decided to try to replace ALL js files for "original" ones and I started with jquery. To my surprise replacing the jquery JS file made the ripped website work. So, my question is...

What code was added to the jquery.js to restrict its execution/loading? Could I do this with ANY JS file? Can this type of restriction be applied locally (localhost)? I really appreciate any advice or directions as to how this can be accomplished?

Thank you very much!

By the way, I DO NOT intend to use the template for any commercial or otherwise purpose. I just ripped it because it blew my mind in terms of animations not using flash.


回答1:


First: crossdomain.xml is only important for the FlashPlayer.

Second: The jQuery file you downloaded probably wasn't the one you get from the jQuery website. It is easy add a check for the current domain in JavaScript. If the domain does not match, the JavaScript will change the location of the current window, which is very very easy (window.location)



来源:https://stackoverflow.com/questions/10821790/jquery-file-does-not-work-outside-of-domain-crossdomain-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!