拒绝jQuery脚本的权限

时间:2012-04-14 17:11:11

标签: jquery fancybox

全部, 我正在使用以下代码:

<head>
<title>Wedding Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<!--<script src="js/jquery-1.6.4.js" type="text/javascript"></script>-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/cufon-replace.js" type="text/javascript"></script>
<script src="js/Century_Gothic_400.font.js" type="text/javascript"></script>
<!--<script type="text/javascript" src="./fancybox/jquery.mousewheel-3.0.4.pack.js"></script>-->
<script type="text/javascript" src="./fancybox/jquery.fancybox.js"></script>
<link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox.css" media="screen" />
<script type="text/javascript">
$(function() {
    $(".select_song").click(function(){
        event.preventDefault();
        song_id = jQuery(this).attr("id");
        song_id = song_id.split("_");
        song_id = song_id[1];
        $.post("save_song.php", { song_id: song_id, time: "2pm" },
            function(response) {
                $("#update_"+song_id).html(response.responseText1);
        }, "json");
    });

    $(".display_songs").fancybox({
        'maxWidth'    : 675,
        'maxHeight'   : 800,
        'fitToView'   : true,
        'closeClick'  : false,
        'openEffect'  : 'none',
        'closeEffect' : 'none',
        'scolling'    : 'no',
        'href'        : 'display_songs.php'
    });
});
</script>
</head>

每当我在IE中点击显示歌曲链接(有一类display_songs)时,我都会收到以下错误消息:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8; AskTbAD2/5.14.1.20007)
Timestamp: Sat, 14 Apr 2012 17:11:00 UTC


Message: Permission denied
Line: 4
Char: 2462
Code: 0
URI: https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

知道为什么会这样或如何修复它?提前谢谢!

4 个答案:

答案 0 :(得分:1)

您在jQuery .js文件的网址中使用https而不是http。放弃“s”会有用吗?

答案 1 :(得分:1)

我实际上已经在我的AJAX页面上加载了jquery。我把它从那里删除了,现在效果很好。

答案 2 :(得分:0)

您是否可以下载此脚本https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js并将此脚本包含在您的页面中,就像其他脚本一样

<script src="js/jquery.min.js" type="text/javascript"></script>

答案 3 :(得分:0)

现在已经很晚了,但这有助于有问题的人

我找到了解决这个问题的方法。我使用onUpdate回调并调用iframe。

$(&#39; a.js-fancybox-iframe&#39;)。fancybox({ 类型:&#39; iframe&#39;, 滚动:&#39 ;可见&#39;, 宽度:800, 身高:&#34;自动&#34;, autoHeight:true, db.nodes.insert([ { "ACTIVE" : 1, "GEOLOCATION": { "GEO_CODE": [], "ACTIVE_GEOLOCATION": false }, "META": { "CATEGORY": "levis", "DESCRIPTION": "dsad", "PRIVACY": "PUBLIC", "TEMPLATE_NAME": "B", "TEMPLATE_GROUP": "Product", "KEYWORDS": [ "sda" ], "CREATEDBY": "", "SUBCATEGORY": "Blue", "PRODUCT_TEMPLATE_TYPE": "Consumable", "UOM": "", "TEMPLATE_SUBGROUP": "" }, "VARIENTS": [ { "COMMENT": "Demo", "INDEX": 0, "NAME": "Brand", "IS_PARENT": false, "DATATYPE": "Text", "ACCESS": "PUBLIC", "PARENT_VARIENT": "Parem", "TYPE": "PERMANENT" }, { "COMMENT": "Demo", "INDEX": 0, "NAME": "Account", "IS_PARENT": false, "DATATYPE": "Text", "ACCESS": "PUBLIC", "PARENT_VARIENT": "Parem", "TYPE": "PERMANENT" }, { "COMMENT": "Demo", "INDEX": 0, "NAME": "Price", "IS_PARENT": false, "DATATYPE": "Text", "ACCESS": "PUBLIC", "PARENT_VARIENT": "Parem", "TYPE": "PERMANENT" }, ] } ]) onUpdate:function() {     $(&#34; iframe.fancybox的iframe&#34);   } });