Hi Ramsey,
I understand the frustration with IE. Every time Microsoft's IE 9 "Welcome to the Beautiful Web" commercial runs I want to throw up. It's almost as good as their "the smartphone beta test is over" commercial. But unfortunately, I can't dictate to my customers what browser they can use.
My problem is that I'm loading my dependencies at the component level (like the Ajax components) and in this project's case the only universal _javascript_ file is the one for IE.
I agree my implementation is not complete. I kind of put it out there expecting someone would know of a more Wonderful way of doing it. An alternative I considered is to first get the script index and then test to see if it is wrapped inside the conditionals. If it is then put it in front of the if ie index.
What do you think?
On Jun 26, 2012, at 10:48 AM, Ramsey Gurley wrote: Scripts validate just fine in the body. Some yahoos have even suggested putting all your scripts at the bottom of the body so the page can load before scripts start sucking the life out of your browser ;-) [ http://developer.yahoo.com/performance/rules.html ]
I didn't test it, but it looks like your implementation needs work. If I put an IE conditional after a script, I'm going to end up with all my stylesheets after the script too. No? It looks like you should get ieIndex and scriptIndex and compare them first.
Ramsey On Jun 26, 2012, at 1:26 PM, Johnny Miller wrote: Hi Ramsey,
Doesn't it seem like not best practices to have to include a script in the body section of the HTML page? Isn't that what the head section is for? Or to have to include an empty script?
On Jun 26, 2012, at 8:46 AM, Ramsey Gurley wrote: 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
|