473,836 Members | 1,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Safari and javascript

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
Sep 22 '05 #1
13 2893
ASM
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.getEle mentById('div_s ubmit").style.d isplay = "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
Sep 22 '05 #2
ASM
ASM wrote:

what was have to read :

document.getEle mentById('div_s ubmit').style.d isplay = "none";

if div_submit
is the id of the div !
--
Stephane Moriaux et son [moins] vieux Mac
Sep 22 '05 #3
ASM wrote:
Christine Forber wrote:
How can you make a div visible and hidden in safari?

document.al l["div_submit "].style.display = "none";

Does not appear to work.


of course !
document.all
is Internet Explorer slang !

document.getEle mentById('div_s ubmit").style.d isplay = "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
Sep 22 '05 #4
Christine Forber <fi*******@last name.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)cybers pace.org | don't, I need to know. Flames welcome.
Sep 22 '05 #5
ASM
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
Sep 22 '05 #6

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.Safar i IncludeDebugMen u 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

Sep 22 '05 #7
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.
Sep 22 '05 #8
ASM
Ian Osgood wrote:

Close Safari, open a Terminal window, and type at the prompt:

defaults write com.apple.Safar i IncludeDebugMen u 1
wonderfull !
I didn't know that !
Great ! it works ! I have a new menu.

Is there a way to internationaliz e 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
Sep 22 '05 #9
Ian Osgood <ia**@quirkster .com> wrote:
Close Safari, open a Terminal window, and type at the prompt: defaults write com.apple.Safar i IncludeDebugMen u 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)cybers pace.org | don't, I need to know. Flames welcome.
Sep 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6018
by: Bernard | last post by:
Hi, I am suddenly getting Safari script errors with the following user agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 In a frameset scenario, the framesetting document (top) contains a
5
5216
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have to wait for the external resource to load to show up the page, thus giving a perceiving faster load time for the user.
8
3792
by: Giuseppe Chielli | last post by:
Hi to everyone? Can someone tell me if there is a way to identify Safari...I found out that navigator.appName returns "Netscape" and I didn't found any option to change the browser's definition... I can use document.all for IE, and so on but what can I do with Safari? I need to distinguish Safari from other browsers... Thanks to everyone.
3
1678
by: Shiva | last post by:
This is my HTML Page containing javascript --------------------------------------------------- <html> <head> <script language="JavaScript"> var isSafari = (agent.indexOf("Safari") != -1); // LINE 1 var myimg = new Object(); // LINE 2
2
1945
by: laredotornado | last post by:
Hi, Is it possible to fool Javascript running on a Mac Safari web browser into believing it is a PC IE browser? We have the following JS code that is detecting both Mac and Safari. Sadly, we do not have control over the code. // Global variables for platform branching var NN, IE, MAC, browserVersion
3
6699
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created with the html <img> tag), I can make the image visible or not, i.e. '<img style="visibility='hidden'" src='xxxx'/>'. But if I create the image dynamically with javascript: new Image() then try to modify the style, Safari chokes, and the Debug...
7
2558
by: Tom | last post by:
I have an oo-type javascript program running perfectly on IE 6.0+, FF 1.5+, and Opera 7+ on Windows 98+, Linux (RH 9, FC 6), and Mac OS X. 4. As usual, the Safari browser is not working correctly, and because it lacks an internal debugger, I'm completely unable to see what the problem is. So I downloaded that "Drosera" debugging program, but I'm finding it useless for the following reasons: 1) I cannot "Attach" it to Safari 2.0...
13
2086
by: Zwerfkat | last post by:
When running the code below, all browsers are showing "Hello World" except Safari which cannot match the regular expression. See also http://www.testabc.nl/safari/test.html When I change *? into .*? or add a space at the end of the string Safari is working alright again. I guess this is a bug in Safari Javascript, or?
15
2676
by: GinnTech | last post by:
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the latest Safari. Here is the issue. I am attempting to call functions within a flash object. When trying to attempt to retrieve the object to call the functions IE6 IE7 FF2 FF3 all return Objects to work with. In Safari a function is returned. Here is the code. /
0
9825
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10854
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10600
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4459
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.