Hmm ok, I guess the easiest solution would be to put all the javascript into
one file and do the browser sniffing in that file.
It's weird - people always complain about IE's bugs, but lately I've had a
lot of problems getting things to work in Safari; whereas IE(7) will just
work.
Brandon Aaron wrote:
>
> Last time I tried an ID on a script tag, Safari wouldn't find it.
>
> --
> Brandon Aaron
>
> On 3/28/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
>> Safari is very weird with <script> tags! any script tag is assumed to be
>> javascript, and loaded in the beginning and that's it.
>> Try making a new script tag, and inserting it.
>> Safari broke many of my cute tricks!
>>
>> I'd never considered using an id on a script tag, but they are in the
>> dom,
>> so it should work.
>>
>>
>> On 3/28/07, Yansky < [EMAIL PROTECTED]> wrote:
>> >
>> > Hi guys, I'm trying to get the following to work in Safari, but it just
>> wont
>> > add the script source & I can't figure out why.
>> >
>> > This is my code:
>> > <head>
>> > <title></title>
>> > <script type="text/javascript" src="jquery-latest.js"></script>
>> > <script type="text/javascript">
>> > $(document).ready(function() {
>> > if($.browser.msie) {
>> > $('#scriptReplace').attr("src","test2-ie.js");
>> > }
>> > else {
>> > $('#scriptReplace').attr("src","
>> test2-mozilla-EtAl.js");
>> > }
>> > });
>> > </script>
>> > <link rel="stylesheet" href="test2.css" media="screen,projection"
>> > type="text/css" />
>> > <script id="scriptReplace" type="text/javascript" ></script>
>> > </head>
>> >
>> > It works fine in IE, Opera & Firefox, yet it wont work in Safari
>> (2.0.4).
>> > Does it take longer for Safari's DOM to be ready? Is using an ID to
>> locate
>> > the correct script tag the right way to go?
>> >
>> > Cheers.
>> > --
>> > View this message in context:
>> http://www.nabble.com/Problems-with-script-replacement-in-Safari-tf3481746.html#a9718408
>> > Sent from the JQuery mailing list archive at Nabble.com.
>> >
>> >
>> > _______________________________________________
>> > jQuery mailing list
>> > [email protected]
>> > http://jquery.com/discuss/
>> >
>>
>>
>>
>> --
>> Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
>>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/Problems-with-script-replacement-in-Safari-tf3481746.html#a9722143
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/