问题
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