Add this behaviour to a StyleSheetReference.
private final class IEOnlyBehaviour extends AbstractBehavior {
private int version;
public IEOnlyBehaviour(int version) {
this.version = version;
}
@Override
public void beforeRender(Component component) {
component.getResponse().write("<!--[if IE " +
Integer.valueOf(version) +
"]>");
}
@Override
public void onRendered(Component component) {
component.getResponse().write("<![endif]-->");
}
}
Neil Curzon wrote:
>
> Hi all,
>
> We're currently migrating some legacy HTML pages into a sexy Wicket app.
> Unfortunately, the pages use a few <!--[if IE 7]><![endif]--> sections for
> browser compatibility. Sometimes this caused mismatched tags, as in the
> following example:
>
> <!--[if IE 7]><!--> <!--<![endif]-->
> ...blahblah...
> <!--[if lte IE 6]> <![endif]-->
>
> Ie we close a tag for IE 6 in one place, and other browsers in a different
> place. We're not sure whether this is the best way to accomplish the goal,
> but the site is tested and working, so we'd rather just make the final
> HTML
> output the same rather than test a new version in different browsers.
>
> This causes wicket errors because of unmatched tags (for some reason the
> seems to be interpreted despite the fact that it's inside an HTML
> comment, which I don't really understand). Has anybody found a good
> approach
> to outputting if ie comments?
>
> Thanks,
> Neil
>
>
--
View this message in context:
http://old.nabble.com/If-IE-comments-tp26205227p27657101.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]