在这里有一个真正的谜题。我正在使用 Atalasoft DotImage 允许用户向图像添加一些注释。当我添加两个包含具有相同名称的文本的相同类型的注释时,我在 Atalasoft 的压缩 js 中收到 javascript 权限被拒绝错误。错误是访问规则的样式成员:
在调试器(Visual Studio 2010 .Net 4.0)中,我可以访问 h._rule 但不能访问 h._rule.style
访问对象的成员时,javascript中的什么会导致权限被拒绝?
只是想知道是否有其他人遇到过这种情况。我看到有几个人在 SO 上使用 Atalasoft,我什至看到有人使用 Atalasoft 的回复。是的,我正在和他们交谈,但把它扔给人群永远不会有坏处。这只发生在 IE8 中,而不是 FireFox。谢谢,布赖恩
更新:是的,使用最新版本:9.0.2.43666
使用相同的名称(请参阅下面的评论)我的意思是,我创建了默认注释并且它们被命名,以便以后可以使用 javascript 添加它们。
// create a default annotation
TextData text = new TextData();
text.Name = "DefaultTextAnnotation";
text.Text = "Default Text Annotation:\n double-click to edit";
//text.Font = new AnnotationFont("Arial", 12f);
text.Font = new AnnotationFont(_strAnnotationFontName, _fltAnnotationFontSize);
text.Font.Bold = true;
text.FontBrush = new AnnotationBrush(Color.Black);
text.Fill = new AnnotationBrush(Color.Ivory);
text.Outline = new AnnotationPen(new AnnotationBrush(Color.White), 2);
WebAnnotationViewer1.Annotations.DefaultAnnotations.Add(text);
在 JavaScript 中:
CreateAnnotation('TextData', 'DefaultTextAnnotation');
function CreateAnnotation(type, name) {
SetAnnotationModified(true);
WebAnnotationViewer1.DeselectAll();
var ann = WebAnnotationViewer1.CreateAnnotation(type, name);
WebThumbnailViewer1.Update();
}