"Access is Denied" javascript error in IE6.0

本文探讨了在Internet Explorer 6中遇到的Access is Denied JavaScript错误现象,详细分析了错误产生的原因,包括跨域限制及窗口操作限制等,并提供了相应的解决方法。
Today I encountered a javascript error: "Access is Denied" in IE6.0.

This module I run allows the user to download a excel file which contains some table concerned in DB and their all fields, also allows to set a alias for each field, and upload the file contains these aliases.

At first, the browser was navigated to the select table page, there're two buttons('Download Table Template' and 'Upload Defined Alias' button) and a list which contains all tables. These two operations use one form and change it's action attribute with javascript.

Select one table and Click the 'Download Table Template' button, The save dialog will be shown, if this operation was canceled there will be no javascript error and can do any other operation. But the file was saved, the other operation and download operation will be stopped because of the javascript error "Access is Denied"(the line number shows cannot access the form).

The same operation was done in IE7.0 and firefox2.0, no javascript found. WHY? Could somebody help me?

Below is a FAQ found in 'http://www.dannyg.com/ref/jsminifaq.html'.

Q. What does the IE "Access is Denied" error mean?
A. The "Access Denied" error in any browser usually means that a script in one window or frame is trying to access another window or frame whose document's domain is different from the document containing the script. What can seem odd about this is that you get this error in IE for Windows frequently when a script in one window generates a new window (with window.open()), and content for that other window is dynamically created from the same script doing the opening. The focus() method also triggers the error.
The error can also occur if scripts try to access objects, properties, or methods that have been locked down by Microsoft's security platoon. For instance, the document.styleSheets.rules property used to be accessible in IE 5 and IE 5.5, but is not in IE 6.

For the new window problem, there is a bit of history associated with the problem and workarounds. For example, the problem occurs frequently when the scripts are being run from the local hard disk. You get a clue about the situation in the titlebar of the new window: It forces an about:blank URL to the new window, which is a protocol:domain that differs from wherever your main window's script comes from. If, however, you put the same main window document on a server, and access it via http:, the problem goes away.

There is a workaround for the local-only problem: In the first parameter of the window.open() method call, load a real document (even if it is a content-free HTML document) into the sub-window before using document.write() to generate content for the subwindow. The loading action 'legitimizes' the window as coming from the same domain as your main window's document.

(This solution does not affect scripts that load a page from a secure server into a separate window or frame. An http: protocol in one window and https: in the other--even if from the same server.domain--yield a security mismatch and "Access Denied." Setting the document.domain properties of both pages may solve the problem (but I am unable to test it for sure).)

For other situations (such as the document.styleSheets.cssRules problem, there are no workarounds, so you'll have to find another way around your task.

One more source of this error in IE occurs if you assign a too-long search string to a URL or a form (using the GET method) has lots of elements and data. The HTTP GET method has a built-in limit of approximately 512 characters. If you run into the problem, change the method to POST, which has no data length limit. But POST won't reflect the search string in the URL of the replacement page (in case you're expecting to parse that data as a way to convey data from one page to the next).
// var roi = roi_SY var roi = table var S2_Collection = ee.ImageCollection('COPERNICUS/S2') .filterDate('2025-03-18', '2025-03-19') .filterBounds(roi) .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5)) .map(clipImage) //.map(lswi) .map(ndvi) // .map(ndyi) // .map(bsi) // .map(evi) // .select('LSWI','NDVI','NDYI','BSI','EVI'); // .select('NDVI'); print('S2_Collection', S2_Collection); Map.centerObject(roi, 10); // 设置地图中心 Map.addLayer(roi) // Map.addLayer(S2_Collection, {bands: ['B4', 'B3', 'B2'], min: 500, max: 2500}, 'ls_S2_RGB_20250402'); Map.addLayer(S2_Collection, {bands: ['NDVI'], min: -1, max: 1}, 'ls_S2_NDVI_20250402'); function clipImage(image) { return image.clip(roi); } var medianImage = S2_Collection.mosaic(); // 设置导出云 Export.image.toDrive({ // image: medianImage.select(['B4', 'B3', 'B2']), image: medianImage.select(['NDVI']), description: 'ls_NDVI_20250319', folder: 'GEE_Exports', // Drive中的文件夹名称 fileNamePrefix: 'ls_NDVI_20250319', region: roi, scale: 10, // 分辨率(Sentinel-2 的原始分辨率) maxPixels: 1e13 }); // Export.image.toAsset({ // image: S2_Collection, // description: 'Lishui_s2', // region: roi, // scale: 10, // maxPixels: 1e13 // }); //计算植被指数 function lswi(image){ return image.addBands(image.normalizedDifference(['B8', 'B11']).rename('LSWI')); } function ndvi(image){ return image.addBands(image.normalizedDifference(['B8', 'B4']).rename('NDVI')); } function ndyi(image){ return image.addBands(image.normalizedDifference(['B3', 'B2']).rename('NDYI')); } function bsi(image) { // 计算BSI var bsiCalculation = image.expression( '((RED + SWIR) - (NIR + BLUE)) / ((RED + SWIR) + (NIR + BLUE))', { 'RED': image.select('B4'), 'SWIR': image.select('B11'), 'NIR': image.select('B8'), 'BLUE': image.select('B2') }).rename('BSI'); // 将BSI波段添加到图像中 return image.addBands(bsiCalculation); } function evi(image) { var Evi = image.expression( 'G * ((NIR - RED) / (NIR + C1 * RED - C2 * BLUE + L))', { 'NIR': image.select('B8'), 'RED': image.select('B4'), 'BLUE': image.select('B2'), 'G': 2.5, 'C1': 6.0, 'C2': 7.5, 'L': 10000.0 }).rename('EVI'); // evi = evi.clamp(-1, 1); return image.addBands(Evi); } 报错Error: Permission denied to create object in folder: 11rtYnXFvytqRymcjVlz_b74IJg0wkppJ (Error code: 3)怎么解决
07-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值