• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 607
  • Last Modified:

CSS Behavior file gives access is denied when document has a base href

I want to add a behavior to my style sheet:

BODY
{
      behavior: url("mybehavior.htc");
}

This works fine until I add a base href to the document.

After this I always get an "access is denied" message trying to open the behavior file.

Why am I getting this message and how can I avoid it?

I'm running IIS and IE 6.
0
purplesoup
Asked:
purplesoup
1 Solution
 
GwynforWebCommented:
take out the quotes

BODY
{
     behavior: url(mybehavior.htc);
}
0
 
GwynforWebCommented:
thinking again I doubt that is it.
0
 
German_RummCommented:
Hi purplesoup,

Access is usually denied when you are trying access behavior's from different host.
www.site.com and site.com are considered to be different hosts.
Can you paste a source code of the page, on which you are trying to attach behavior?

---
German Rumm.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
BatalfCommented:
Where is the mybehavior.htc file?

When you change the base, IE will search for the file on the domain specified by the <base> tag.

Try to put in an absolute url in the CSS

i.e.

BODY
{
     behavior: url("http://www.myDomain.com/mybehavior.htc");
}

0
 
infoseeker99Commented:
Also double check the permissioning on the directory the file is in, the file itself and the directory above that IUSER_*  has read permissions for these items.
0
 
purplesoupAuthor Commented:
It looks like it was because the named URL was different - I am running it on my local machine and the page url was

http://machinename/folder/page.html

whereas when I tried to put the full url in the behavior it was

http://localhost/folder/filename.htc

By entering "http://machinename/folder/filename.htc" or even "./folder/filename.htc" it works ok
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now