How can you make a div visible and hidden in safari?
document.all["div_submit"].style.display = "none";
Does not appear to work.
Also, can anyone tell me how to turn on javascript error commenting in
Safari? Right now, if javascript fails or errors, the browser just sits
there and doesn't return any error message.
--
Christine
|
|
0
|
|
|
|
Reply
|
Christine
|
9/22/2005 4:03:01 PM |
|
Christine Forber wrote:
> How can you make a div visible and hidden in safari?
>
> document.all["div_submit"].style.display = "none";
>
> Does not appear to work.
of course !
document.all
is Internet Explorer slang !
document.getElementById('div_submit").style.display = "none";
and ... miracle ... it is also understood by IE :-)
get FireFox and its add-on : "Web developer"
to fix your pb of JS console (and much more)
--
Stephane Moriaux et son [moins] vieux Mac
|
|
0
|
|
|
|
Reply
|
ASM
|
9/22/2005 4:04:50 PM
|
|
ASM wrote:
what was have to read :
document.getElementById('div_submit').style.display = "none";
if div_submit
is the id of the div !
--
Stephane Moriaux et son [moins] vieux Mac
|
|
0
|
|
|
|
Reply
|
ASM
|
9/22/2005 4:07:48 PM
|
|
ASM wrote:
> Christine Forber wrote:
>
>>How can you make a div visible and hidden in safari?
>>
>>document.all["div_submit"].style.display = "none";
>>
>>Does not appear to work.
>
> of course !
> document.all
> is Internet Explorer slang !
>
> document.getElementById('div_submit").style.display = "none";
>
> and ... miracle ... it is also understood by IE :-)
>
> get FireFox and its add-on : "Web developer"
> to fix your pb of JS console (and much more)
Thank you, I've relayed this response to my colleague. Re your
suggestion about FireFox, is it close enough to Safari to detect js
problems that would cause problems in Safari too?
--
Christine
|
|
0
|
|
|
|
Reply
|
Christine
|
9/22/2005 4:27:51 PM
|
|
Christine Forber <firstname@lastname.net> wrote:
> Thank you, I've relayed this response to my colleague. Re your
> suggestion about FireFox, is it close enough to Safari to detect js
> problems that would cause problems in Safari too?
It will certainly catch the vast majority of IE-specific script (for
example, uses of the document.all object), but AFAIK Safari uses a
script engine that is not based on anything used by Firefox. Both aim
for a good approximation of standards compliance, so script that runs
on Firefox has a good chance of running on Safari, but there are no
guarantees.
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
|
|
0
|
|
|
|
Reply
|
Christopher
|
9/22/2005 4:46:49 PM
|
|
Christine Forber wrote:
> ASM wrote:
>
>>Christine Forber wrote:
>
> Thank you, I've relayed this response to my colleague. Re your
> suggestion about FireFox, is it close enough to Safari to detect js
> problems that would cause problems in Safari too?
except IE's slang,
generaly javascript (and beter DOM) is javascript
even for Apple :-)
fiew css3 understood by FF aren't by Safari
or not same way ...
-moz-opacity: 0.3; /* FF */
-khtml-opacity: 0.3; /* Safari */
filter: blah blah; 30; /* IE Windows */
-moz-radius: 10px;
radius: 10px;
it is Opera which could give some pb (as iCab)
(they can tell they ARE IE ! !)
in javascript jscript ->
sure detection if it is IE (all environnement and versions) :
var ie = false; /*@cc_on ie = true; @*/
--
Stephane Moriaux et son [moins] vieux Mac
|
|
0
|
|
|
|
Reply
|
ASM
|
9/22/2005 4:47:00 PM
|
|
Christine Forber wrote:
>
> Also, can anyone tell me how to turn on javascript error commenting in
> Safari? Right now, if javascript fails or errors, the browser just sits
> there and doesn't return any error message.
>
> --
> Christine
Close Safari, open a Terminal window, and type at the prompt:
defaults write com.apple.Safari IncludeDebugMenu 1
Now there will be a Debug menu as the rightmost menu in Safari. Check
"Log JavaScript Exceptions" and select "Show JavaScript Console". Many
of the other items in the Debug menu are also useful.
You can then also use window.console.log("custom message") for your own
custom debugging messages.
Ian
|
|
0
|
|
|
|
Reply
|
Ian
|
9/22/2005 5:03:43 PM
|
|
On 22/09/2005 17:47, ASM wrote:
[snip]
> in javascript jscript ->
> sure detection if it is IE (all environnement and versions) :
I fail to see how browser detection is at all necessary. The OP simply
needs to avoid IE-specific methods and properties, and to test on a
range of browsers.
The closest browser to Safari would be Konqueror as the former uses the
latter's rendering engine (I don't know if that includes scripting
engine, though). Konqueror is part of the KDE windowing system for
Linux, and can be used in Windows through Cygwin.
Mike
--
Michael Winter
Prefix subject with [News] before replying by e-mail.
|
|
0
|
|
|
|
Reply
|
Michael
|
9/22/2005 5:08:18 PM
|
|
Ian Osgood wrote:
>
> Close Safari, open a Terminal window, and type at the prompt:
>
> defaults write com.apple.Safari IncludeDebugMenu 1
wonderfull !
I didn't know that !
Great ! it works ! I have a new menu.
Is there a way to internationalize this menu ?
(to get it in french for instance)
> Now there will be a Debug menu as the rightmost menu in Safari. Check
> "Log JavaScript Exceptions" and select "Show JavaScript Console". Many
> of the other items in the Debug menu are also useful.
as : Use Transparent Window
> You can then also use window.console.log("custom message") for your own
> custom debugging messages.
thanks
--
Stephane Moriaux et son [moins] vieux Mac
|
|
0
|
|
|
|
Reply
|
ASM
|
9/22/2005 5:22:05 PM
|
|
Ian Osgood <iano@quirkster.com> wrote:
> Close Safari, open a Terminal window, and type at the prompt:
> defaults write com.apple.Safari IncludeDebugMenu 1
You know, I'd really be ecstatic if Apple did less "thinking
differently" and more making their product sane, say by supporting
window.onerror; I was going to suggest it to OP before I realized how
pathetically broken Safari is in this respect...
I'd love to be proven wrong on this, by the way :-)
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
|
|
0
|
|
|
|
Reply
|
Christopher
|
9/22/2005 5:50:58 PM
|
|
Christine Forber wrote:
> ASM wrote:
>
>>Christine Forber wrote:
>>
>>
>>>How can you make a div visible and hidden in safari?
>>>
>>>document.all["div_submit"].style.display = "none";
>>>
>>>Does not appear to work.
>>
>>of course !
>> document.all
>>is Internet Explorer slang !
>>
>>document.getElementById('div_submit").style.display = "none";
>>
>>and ... miracle ... it is also understood by IE :-)
>>
>>get FireFox and its add-on : "Web developer"
>>to fix your pb of JS console (and much more)
>
>
> Thank you, I've relayed this response to my colleague. Re your
> suggestion about FireFox, is it close enough to Safari to detect js
> problems that would cause problems in Safari too?
>
Not really, I found that developing in Safari (pre 1.3) is a pain. The
tools available for Firefox a great and work pretty consistently on all
platforms so use that and just test in Safari.
It seems the tools for Safari have been greatly improved but I haven't
got the latest version and so can't comment on that.
But back to the question... how to debug in Sarari:
<URL:http://developer.apple.com/internet/safari/faq.html#anchor14>
--
Rob
|
|
0
|
|
|
|
Reply
|
RobG
|
9/22/2005 11:32:17 PM
|
|
RobG <rgqld@iinet.net.au> wrote:
> Not really, I found that developing in Safari (pre 1.3) is a pain. The
> tools available for Firefox a great and work pretty consistently on all
> platforms so use that and just test in Safari.
It's still a pain in 1.3, unless there is some way to get around the
fact that window.onerror doesn't work.
> But back to the question... how to debug in Sarari:
> <URL:http://developer.apple.com/internet/safari/faq.html#anchor14>
I love how this FAQ is staying on the bleeding edge by validating
under the advanced HTML 4.01 Transitional specification.
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
|
|
0
|
|
|
|
Reply
|
Christopher
|
9/23/2005 2:59:02 AM
|
|
Christopher Benson-Manica wrote:
> Ian Osgood <iano@quirkster.com> wrote:
>
> > Close Safari, open a Terminal window, and type at the prompt:
>
> > defaults write com.apple.Safari IncludeDebugMenu 1
>
> You know, I'd really be ecstatic if Apple did less "thinking
> differently" and more making their product sane, say by supporting
> window.onerror; I was going to suggest it to OP before I realized how
> pathetically broken Safari is in this respect...
>
> I'd love to be proven wrong on this, by the way :-)
>
> --
> Christopher Benson-Manica | I *should* know what I'm talking about - if I
> ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
I thought window.onerror had gone the way of the dodo. quirksmode.org
reports that it no longer works in *any* modern browser. I guess we
should be using try/catch/finally in these modern times. Only the
onerror handler for individual IMG elements seems to work reliably.
http://www.quirksmode.org/js/events_compinfo.html#misc
Ian
|
|
0
|
|
|
|
Reply
|
Ian
|
9/23/2005 5:06:50 PM
|
|
Ian Osgood <iano@quirkster.com> wrote:
> I thought window.onerror had gone the way of the dodo. quirksmode.org
> reports that it no longer works in *any* modern browser. I guess we
> should be using try/catch/finally in these modern times. Only the
> onerror handler for individual IMG elements seems to work reliably.
http://ataru.gomen.org/scripterror.html
catches the script error in IE 6 and lower; in the IE 7 beta that I'm
running, "Display a notification about every script error" must be
enabled for the message to be displayed. Firefox 1.0.4 and Netscape 8
both catch it. Safari does not, nor does Opera 8.5. I suppose the
consensus is mixed, but I would certainly not say that it's "gone the
way of the dodo", and it continues to be an extremely useful feature,
at least in my eyes. Rather than littering code with try/except
blocks, it's very helpful to have a window.onerror to catch exceptions
and tell you where they happen. We use it to add script errors to a
database for tracking and fixing bugs, and it's been very successful
(although it also alerts us to a variety of arcane situations).
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
|
|
0
|
|
|
|
Reply
|
Christopher
|
9/23/2005 6:01:44 PM
|
|
|
13 Replies
319 Views
(page loaded in 0.168 seconds)
Similiar Articles: Safari and javascript - comp.lang.javascriptHow can you make a div visible and hidden in safari? document.all["div_submit"].style.display = "none"; Does not appear to work. Also, can anyone t... XML validation with parseFromString on Safari - comp.lang ...Hi, When I use parseFromString on Firefox or loadXML on Internet Explorer, I can know if it's a valid xml content but when I use parseFromString on Safari, I get a ... onbeforeunload doesn't work in Safari - comp.lang.javascript ...Hi, I'd like to use onbeforeunload to submit a form before leaving a page. This works in Firefox and IE. Safari, however, blithely ignores this. Doe... How do I get the caret position in a textarea? - comp.lang ...Safari and javascript - comp.lang.javascript How do I get the caret position in a textarea? - comp.lang ... javascript - How to get caret position in textarea? Trigger file upload click event from javascript - comp.lang ...how to create file upload using activeX object using javascript ... Safari and javascript - comp.lang.javascript... example, uses of the document.all object ... have to ... firefox reload(true) problem - comp.lang.javascriptonbeforeunload doesn't work in Safari - comp.lang.javascript ... firefox reload(true) problem - comp.lang.javascript onbeforeunload doesn't work in Safari - comp.lang ... How to Freeze Columns in a html table Using Javascript and HTML ...Safari and javascript - comp.lang.javascript How to Freeze Columns in a html table Using Javascript and HTML ... How to Freeze Columns Using Javascript and HTML How to ... Username in a Cookie - comp.lang.javascriptSafari and javascript - comp.lang.javascript Username in a Cookie - comp.lang.javascript Username in a Cookie - comp.lang.javascript Safari won't save User ID and Password ... Insert,view,update and delete using javascript and xml - comp.lang ...Safari and javascript - comp.lang.javascript "Microsoft.XMLHTTP = delete request? - comp.lang.javascript ... XML validation ... How to Freeze Columns Using Javascript and ... developer forum - comp.lang.java.securitySafari and javascript - comp.lang.javascript... it is also understood by IE :-) get FireFox and its add-on : "Web developer" to fix ... Enable Or Disable JavaScript ... Safari won't save User ID and Password - comp.sys.mac.apps ...Safari and javascript - comp.lang.javascript Username in a Cookie - comp.lang.javascript Username in a Cookie - comp.lang.javascript Safari won't save User ID and Password ... "Microsoft.XMLHTTP = delete request? - comp.lang.javascript ...Safari and javascript - comp.lang.javascript XML validation with parseFromString on Safari - comp.lang ... "Microsoft.XMLHTTP = delete request? - comp.lang.javascript ... IE problem with open.window - comp.lang.javascriptI am quite new to javascript, and don't seem to find the problem with stupid internet explorer. The script works fine in safari and mozilla. I search... Hotmail problem with Safari - comp.sys.mac.appsSafari and javascript - comp.lang.javascript Hotmail problem with Safari - comp.sys.mac.apps onbeforeunload doesn't work in Safari - comp.lang.javascript ... Reading Firefox about:config settings via Javascript - comp.lang ...firefox reload(true) problem - comp.lang.javascript Reading Firefox about:config settings via Javascript - comp.lang ... Safari and javascript - comp.lang.javascript ASM ... Enable Or Disable JavaScript - Safari - MisterEd.USMr. Ed's Computer Help Forum, a Forum to ask Computer related questions Apple - Safari - Learn about the features available in Safari.JavaScript Support. Safari supports ECMA 262 version 5, the latest edition of the JavaScript standard. JavaScript powers many dynamic features on the web and has served as ... 7/20/2012 8:22:32 PM
|