If IE comments

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

If IE comments

Neil Curzon
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]><!--></a><!--<![endif]-->
...blahblah...
<!--[if lte IE 6]></a><![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
</a> 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
Reply | Threaded
Open this post in threaded view
|

Re: If IE comments

Martin Makundi
Hi!

You can output them from code... at least. For example as a label ors omething.

**
Martin

2009/11/4 Neil Curzon <[hidden email]>:

> 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]><!--></a><!--<![endif]-->
> ...blahblah...
> <!--[if lte IE 6]></a><![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
> </a> 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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: If IE comments

orden
In reply to this post by Neil Curzon
You may be interested by my code: it's adding IE only CSS in the header. You just have to add it to the page.

public class IEStylesheetHeaderContributor extends AbstractBehavior implements IHeaderContributor{
       
        private final ResourceReference ref;
       
        public IEStylesheetHeaderContributor(ResourceReference ref) {
                this.ref = ref;
        }

        public void renderHead(IHeaderResponse response){
                response.renderString("");
        }
}
Reply | Threaded
Open this post in threaded view
|

Re: If IE comments

kellerautomat
In reply to this post by Neil Curzon

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("");
        }
}



Neil Curzon wrote
Hi all,

We're currently migrating some legacy HTML pages into a sexy Wicket app.
Unfortunately, the pages use a few  sections for
browser compatibility. Sometimes this caused mismatched tags, as in the
following example:


...blahblah...


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