[jQuery] Re: How to Inject style sheets/.CSS
That's what I get for not testing IE6 with my more complicated example :) I'm not surprised that IE has issues with this. Creating dynamic script tags has been an issue too. IE seems to have a lot of trouble modifying stuff in the head. Here's a version that works on IE, FF, and Safari: http://erikandcolleen.com/erik/projects/jquery/cssinject/cssinject3.html --Erik On 8/24/07, Pops <[EMAIL PROTECTED]> wrote: > > Right, I just got it to work too. But I was still at 1.1.3.1 so I > had to call evalScripts(). > > Let me try your script and mine under IE 6.0 > > Ok, your script gives as soon as you type: > > Error: Unexpected call to method or property access > > and with the my button version, I don't see an IE error but it isn't > "evaluated'. > > Guys! I am seeing for too much IE browser issues. Where is the "Cross > broiwser" support claim? jQuery seems to only really well work with > FF. Is this just one of few instances of IE problems? > > -- > HLS > > On Aug 25, 2:18 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > > And here's a version that has live updating: > > > > http://erikandcolleen.com/erik/projects/jquery/cssinject/cssinject2.html > > > > Tested of FF and Safari. I'm not motivated enough to boot up Parallels > > to test IE. It seems like it works just like one would expect it to. > > Quite frankly, I'm a little surprised that it does. > > > > --Erik > > > > On 8/24/07, Erik Beeson <[EMAIL PROTECTED]> wrote: > > > > > Right, I just noticed that I forgot to put head in quotes. Here's a > > > little test page: > > > > >http://erikandcolleen.com/erik/projects/jquery/cssinject/cssinject.html > > > > > Works in FF2/Mac, Safari 2.0.4, IE6. > > > > > --Erik > > > > > On 8/24/07, Pops <[EMAIL PROTECTED]> wrote: > > > > > > On Aug 25, 1:31 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > > > > > This seems to work in FF2/Mac: > > > > > > > var myCss = 'p { border: 2px solid #faa; }'; > > > > > $(head).append('' + myCss + ''); > > > > > > I tried something like this, but it didn't seem to take. > > > > > > I drifted into doing something with the in DOM that I see with > > > > FireBug. I figure if Firebug allows you edit it, you can program it > > > > too. I figured I can change what wast imported by overwring it with > > > > the content in the textarea. > > > > > > Anyway if it worked for you, it should work for me. Lets try it It > > > > didn''t take, but I do see it in DOM. Does it need to be "eval()"? > > > > > > -- > > > > HLS > >
[jQuery] Re: How to Inject style sheets/.CSS
Right, I just got it to work too. But I was still at 1.1.3.1 so I had to call evalScripts(). Let me try your script and mine under IE 6.0 Ok, your script gives as soon as you type: Error: Unexpected call to method or property access and with the my button version, I don't see an IE error but it isn't "evaluated'. Guys! I am seeing for too much IE browser issues. Where is the "Cross broiwser" support claim? jQuery seems to only really well work with FF. Is this just one of few instances of IE problems? -- HLS On Aug 25, 2:18 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > And here's a version that has live updating: > > http://erikandcolleen.com/erik/projects/jquery/cssinject/cssinject2.html > > Tested of FF and Safari. I'm not motivated enough to boot up Parallels > to test IE. It seems like it works just like one would expect it to. > Quite frankly, I'm a little surprised that it does. > > --Erik > > On 8/24/07, Erik Beeson <[EMAIL PROTECTED]> wrote: > > > Right, I just noticed that I forgot to put head in quotes. Here's a > > little test page: > > >http://erikandcolleen.com/erik/projects/jquery/cssinject/cssinject.html > > > Works in FF2/Mac, Safari 2.0.4, IE6. > > > --Erik > > > On 8/24/07, Pops <[EMAIL PROTECTED]> wrote: > > > > On Aug 25, 1:31 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > > > > This seems to work in FF2/Mac: > > > > > var myCss = 'p { border: 2px solid #faa; }'; > > > > $(head).append('' + myCss + ''); > > > > I tried something like this, but it didn't seem to take. > > > > I drifted into doing something with the in DOM that I see with > > > FireBug. I figure if Firebug allows you edit it, you can program it > > > too. I figured I can change what wast imported by overwring it with > > > the content in the textarea. > > > > Anyway if it worked for you, it should work for me. Lets try it It > > > didn''t take, but I do see it in DOM. Does it need to be "eval()"? > > > > -- > > > HLS
[jQuery] Re: How to Inject style sheets/.CSS
I don't know about evalScripts, but I was using 1.1.4. It doesn't have to do with doing it in document.ready. See my other response about doing it "live". --Erik On 8/24/07, Pops <[EMAIL PROTECTED]> wrote: > > But doesn't this work because it done in document.ready? > > I mean, add a button to call a function to do injection upon command. > > Ok, I got it to work by using .evalScript() > > > function applyStyle() { >var s = $('#juserCSS').text(); >$('head').append('