[Javascript] FW: SAFARI javascript major problem

Troy III Ajnej trojani2000 at hotmail.com
Tue Jul 15 03:55:41 CDT 2008


(Trying to clear the mess caused by missing new line characters in my 
previous post.)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      Troy III                         progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



From: trojani2000 at hotmail.comTo: trojani2000 at hotmail.comSubject: RE: [Javascript] SAFARI javascript major problemDate: Tue, 15 Jul 2008 08:26:46 +0000


Hello Roger, nice to hear from you.I'm currently on the latest Safari 3.1.2 (525.21)I am at knowledge that:     javascript:alert(document.styleSheets[0].rules[0].selectorText);will work, -on address-bar especially, but I will not be able to code onclients address bar from here. :)The:    alert(document.styleSheets[0].rules[0].selectorText);will not work inside the script body.-Of course it will work, if, and only if there are no external style-sheets presently linked to the document, but that's pointless & useless equally.Cause I'm not willing to include them all back in the header of every page right now!-Well, would you?Ironically,     javascript:alert(document.styleSheets[0].rules[0].selectorText);will continue to work (on address bar) even if external SS are present.There is another [? "%#@$" ] that might fool the coder to conclude thathis script somehow is beginning to work.If command:   javascript:alert(document.styleSheets[0].rules[0].selectorText);is present in Safari address bar, each Refresh will trigger its executionproviding you with correct output in your alert box that will make you think that existing code in your document, exmp.:<script>      alert(document.styleSheets[0].rules[0].selectorText);</script>...is working.But, for this matter, the previous, will not work in FX2 or Opera either! It will throw:"document.styleSheets[0].rules has no properties",since it has to do with syntax "rules" vs. W3C "cssRules" error. So,correcting this, will make it work as expected in Fx & Op, but not in Sf!Try:<script type="text/javascript">  dS = document.styleSheets;  //I hate discrimination, therefore I equalize:  theRules = dS[0].rules || dS[0].cssRules;     alert(theRules[0].selectorText)</script>But as I already noted, if linked external style sheets are present, it will not work in Safari.My conclusion is that this must be an obvious Safari bug.Best Regards~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      Troy III                         progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



> From: rer at datacompusa.com> To: javascript at lists.evolt.org> Date: Mon, 14 Jul 2008 07:58:15 -0400> Subject: Re: [Javascript] SAFARI javascript major problem> > Troy,> > On Jul 9, 2008, at 11:17 PM, Troy III Ajnej wrote:> > > Are there guys supporting Safari at all in this list?> Yes, but early versions were incomplete at best. Which version are > you testing?> > >> I'm having an unexpected problem with my script in Safari.> >> > > The script uses css selectors to read some css rule.> A call to > >> stylesheets collection > loop in through defined selectors> > >> matching the selector,> and reading its required property.> > I just re-tested the current version (3.1.1) and this statement, typed > into the location bar, worked as expected> > javascript:alert(document.styleSheets[0].rules[0].selectorText);> > > Roger> --> Roger Roelofs> Datacomp Appraisal Services> 3215 Eaglecrest, NE> Grand Rapids, MI 49525> > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript



Use video conversation to talk face-to-face with Windows Live Messenger. Get started. 
_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_messenger_072008


More information about the Javascript mailing list