jQuery文件无法在域外运行(crossdomain.xml) [英] jquery file does not work outside of domain (crossdomain.xml)

查看:97
本文介绍了jQuery文件无法在域外运行(crossdomain.xml)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了许多有关jquery和跨域实现的问题.我要问的我相信是非法的,但是...

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...

背景: 我从templatemonster下载"(确实是翻录了)一个Web模板.该模板不包含任何Flash,仅包含JS,CSS,HTML.我下载了所有文件,并将它们放在我的apache网络服务器中,但我所得到的只是Google页面.

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.

我开始查看html,css& js文件,却找不到任何内容(所有js都明显缩小了.)

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

我决定尝试将所有js文件替换为原始"文件,并从jquery开始.令我惊讶的是,替换了jQuery JS文件使翻录的网站正常工作.所以,我的问题是...

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...

在jquery.js中添加了哪些代码来限制其执行/加载?我可以使用任何JS文件执行此操作吗?可以在本地(本地主机)应用这种限制吗?我真的很感谢关于如何实现此目标的任何建议或指导?

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?

非常感谢!

顺便说一句,我无意将模板用于任何商业目的或其他目的.我只是撕掉它,是因为它使我不使用Flash动画令人震惊.

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.

推荐答案

首先:crossdomain.xml仅对FlashPlayer重要.

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

第二:您下载的jQuery文件可能不是从jQ​​uery网站获得的文件.很容易在JavaScript中添加对当前域的检查.如果域不匹配,JavaScript将更改当前窗口的位置,这非常简单(window.location)

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)

这篇关于jQuery文件无法在域外运行(crossdomain.xml)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆