Re: Writing IE specific code
Re: Writing IE specific code
- Subject: Re: Writing IE specific code
- From: David Masters <email@hidden>
- Date: Wed, 4 Apr 2007 20:16:02 +0100
Hi,
On 3 Apr 2007, at 22:08, Helmut Schottmüller wrote:
use -WOIncludeCommentsInResponse true with your application, The WO
leaves the comments in the response.
Am 02.04.2007 um 17:55 schrieb Jean Pierre Malrieu:
I know it is not recommended, but I am trying (for the first time)
to write specific code for IE (which has problems with Ajax).
I have tried to use comments in HTML ( <!--[if IE] etc.) but it
does not seem to work fine. WebObjects seems to just eat them, and
they don't event reach the client. Or is it because I am using
direct connect in development mode?
If one does not rely on HTML comments, how does one write browser
specific code?
Even when including comments in the response I ran into particular
problems with the IE conditional comments because of the inclusion of
the angle brackets that follow the conditional. One solution that I
found was to put in a WOGenericElement in the <head> of the html of my
page wrapper:
<webobject name="IEStyles"></webobject>
This was defined as:
IEStyles: WOGenericElement
{
elementName = "!--[if lt IE 7]><link rel=\"stylesheet\" href=
\"url_for_stylesheet.css\" type=\"text/css\" /><![endif]--";
}
Essentially the elementName is whatever you'd normally put in to a
static html file for an IE Conditional comment, minus the beginning
and end angle-brackets (which get supplied by the WOGenericElement),
and with the quotation marks escaped.
I suspect WOGenericElement was never intended to be (ab)used with such
a bizarre elementName, but it did work quite nicely!
In case the formatting doesn't work properly here, I'd previously
posted this hint at <http://www.pyrusmalus.com/blog/archives/2006/07/04/adding_ie_conditional_comments_in_wo.html
>
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden