On Jun 25, 2012, at 2:13 PM, Johnny Miller wrote: Hi,
I've made the two updates (using ERXIEConditionalComment and using the static method from ERXResponseRewriter instead of AjaxUtils - although AjaxUtils just calls ERXResponseRewriter so that's not really a change).
But I'm still having the same issue. Looking through ERXResponseRewriter there is the static method insertInResponseBeforeTag that is being called and which has a block of code like this:
if (content.toLowerCase().startsWith("<link") || content.toLowerCase().startsWith("<style")) { int scriptIndex = responseContent.toLowerCase().indexOf("<script"); if (scriptIndex > 0 && scriptIndex < insertIndex) { insertIndex = scriptIndex; } } response.setContent(ERXStringUtilities.insertString(responseContent, content, insertIndex)); inserted = true;
So, because my first (and only script) in the head is inside the if IE conditional comment I believe that is why the stylesheet is being put in there.
From my original reply:
You could try putting the script in the body or have a script tag outside and above the ie conditional. I believe the ERXResponseRewriter is going to try to add scripts to the end of head, and stylesheets before the first script... which seems to land it right inside your conditional comment.
Should I log a bug for this?
I think this falls under "Just don't do that." :-) The point of loading the css first is for performance optimization in the browser. Parsing for IE conditionals would probably negate those performance gains.
Ramsey
Thank you,
On Jun 23, 2012, at 11:16 AM, Amedeo Mantica wrote: Remember to put erxresponserewriter after super too. I'm not sure will solve. But try
Sent from my iPhone On 23/giu/2012, at 21:35, Johnny Miller < email@hidden> wrote: Hi Amedeo,
Ok. I'll try that.
re: why not use erxieconditionalcomment: just ignorance, now that I know about it I'll start using it. I should have realized that someone had created a simple solution for this already.
Thank you,
Johnny
Sent from my iPad On Jun 23, 2012, at 7:08 AM, Amedeo Mantica < email@hidden> wrote: put ERXResponseRewriter after the super of appendToResponse
one more thing;... why u don't use ERXIEConditionalComment ?
Amedeo
On 22/giu/2012, at 02:18, Johnny Miller wrote: Hi,
In my page wrapper's head section I have something like this:
// HTML <head> ... <webobject name = "IFLTIE9Open" /> <script src=""http://html5shim.googlecode.com/svn/trunk/html5.js">http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <webobject name = "IFIEClose" /> ... </head>
// WOD
IFIEClose : WOString { escapeHTML = false; value = "<![endif]-->"; }
IFLTIE9Open : WOString { escapeHTML = false; value = "<!--[if lt IE 9]>"; }
For some reason a stylesheet that gets added through addStylesheetResourceInHead function is stuffed in-between the IF IE tags.
Can someone please tell me how to fix this?
Thank you,
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
|