1

I'm looking for a way insert JS into web page using CSS file, in Opera. In Internet Explorer [I tested it on 5.5,6,7,8] it's possible using behaviour property.

behavior: url(file.htc);

From my experience it's very useful. Now I need it for Opera.

5
  • 6
    What's the underlying design problem you're trying to solve doing this? It just immediately seems as though there may be a better approach available... Commented Jul 4, 2011 at 11:24
  • 1
    The behavior property is a Microsoft-only one, and as far as I know there is no equivalent property that will work in Firefox, Opera, and other browsers. Commented Jul 4, 2011 at 11:25
  • I tried to insert 'background-image: url("svg.svg")', and script tag into SVG file. But I found that opera execute scripts in SVG only if I call it through <embd> tag. Commented Jul 4, 2011 at 11:29
  • What exactly are you trying to do? Give some more detail like the JS you want to use, and what browsers you actually want to target... Commented Jul 4, 2011 at 11:29
  • @Dani-Br: Assuming that comment of yours is all true, it's probably because the Opera devs realise that allowing CSS to execute JavaScript in any way is a bad idea. Commented Jul 4, 2011 at 11:35

2 Answers 2

2

There is no such equivalent feature in Opera.

You'll have to find another way to solve your problem.

Sign up to request clarification or add additional context in comments.

Comments

0

The behaviour property is a proprietary to internet explorer. So it's unlikely you will find an equivalent.

However interestingly, looking through an old W3 working draft, it is proposed as a standard - but I haven't seen anything about other browsers actually supporting it nor an equivalent.

On a side note: The behaviour property is very useful for "patching" internet explorer to enhance old browsers with newer features e.g. adding css3 rounded corner support etc. But at this time, because it is non-standard I would not recommend using it for anything other than adding support to outdated browsers.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.