Question Locked

Access Denied error in IE

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I was wondering if anyone could help with this, i have been asked by my boss to figure out why when one of our sites is looked at in IE it shows the following scrip error:

Problems with this site may prevent it from being displayed properly.

Line: 0
Char: 0
Error: Access is denied to http://www.mydomain.co.uk/js/csshover.htc
Code: 0
URL: http://blog.mydomain.co.uk/

6 replies

by thumbsup2

Since .HTC files can easily carry a virus, the browser is protecting the viewer. I would change the JavaScript so it's not calling that page.

by tom

I have have used this type of file many atimes for different websites, but its only started to cause the error for blogs, could it be due to this...?

by thumbsup2

Recent updates to the OS as well as anti-virus programs have the ability to block .htc files, especially those that might provide cross-domain scripting. Since the viewer has the ability to have .htc files blocked, even if they don't know they now have that ability due to default settings, the viewer isn't going to benefit from the contents of that file anyway.

Taken from one of the paragraphs at the W3C, here's what a .htc file is capable of doing.

"Another possible use for HTCs is to provide cross-domain scripting access; the HTC could declare which properties, methods and events are allowed to be accessed from outside the domain."

So, if the viewer's browser is set to block this type of file, your efforts are being ignored.

The bottom line is, IF you've got JavaScript in a .htc file, consider putting it in an external .js file instead and forget otherwise trying to script the browser behavior.

by thumbsup2

After re-reading your original post several times, it occurred to me that the access denied error is probably server related.

Did your blog server recently upgrade something? You may need to talk to them. Do you have permissions on the JS folder and the csshover.htc file set to 777 (or at least 775)? Is your server an Apache server or Linux/SUSE server? If Apache, do you have the appropriate line added to the .htaccess file (AddType text/x-component .htc)?

Of course, non of this is going to make any difference if the viewing browser has it all blocked (see post above). But, it's worth giving a shot to see if you can at least fix the error so the BOSS is happy.

.

by tom

I have realise what was wrong, it was the fact thea the .htc file was calling the main domain ie. the www. IE does not like sites to call on other sites so it tells the user the said error so afrter playing around a little with the blog I managed to get it to work via a work around thanks for all your input ThumbsUp2 much apriciated.

This discussion is closed to new replies.