I have a small Javascript problem with that mutch love web browser
safari, I tested the code on all other browsers PC (Win) and Linux and
IE on the mac and it seams to work ok, but for some reason it will not
work with safari.
Im using Javascript to expand a unordered list menu and it works on my pc in the latest versions of Opera, Safari, Firefox and IE. But i have been told that the buttons do not work in Safari on a MAC. It does however work in IE on a MAC.
Is there a difference between the way Safari on a MAC would read the code? Code:
Anyone have any tips on a good site with a few pointers on how to convert javascript working on IE to work with NS and Safari. For example, this code doesn't work on Safari but on IE and I have no idea why:
I am using Regular Expressions and Javascript to validate a form, specifically I want to make sure that if they try to upload a file that it has a proper name w/ certain extensions (doc,pdf, rtf). The script works on IE and Mozilla but fails on Safari on the MacOSX. Here is my code..
// ok files with proper extension var reOKFiles = /^([a-zA-Z].*|[1-9].*).(doc|DOC|pdf|PDF|rtf|RTF)$/;
//where i check for the file... if(window.document.myForm.myDocument.value != ""){ var fileStr = window.document.myForm.myDocument.value; if(!reOKFiles.test(fileStr)){ alert("Please try again, you tried to upload an invalid file type for CRITERIA 1"); window.document.myForm.myDocument.focus(); return (false);
I have some very strange problem on the Mac (OS-X) with the Safari browser 1.0 (v85). Some information in my form was not filled in... after I turned on debugging and checked the console it displayed some error messages.
The messages displayed were like:
(event handler): value undefined (result of expression trim) is not object. Cannot be called.
I have no idea what this means!!! Does anyone know where to find the solution for this problem? The page works fine on Windows with IE (and probably some more browsers).
The trim function is located in an exteral javascript file which is referenced in the head of the html. Code:
I'm using input hidden control's value in the javascript function.
same code is working fine on all other browser except a specific version of safari(i.e.: MAC OS 10.3.7 and Safari 1.2.4).
problem: control's value is not getting displaying at the first time when the page gets load, although the same piece of code would work if I just refresh the page, strage.
declaration of hidden control: <INPUT id="hSliders" type="hidden" runat="server">
javascript code which is calling the value of hSliders:
alert(document.Form1.hSliders.value)
this alert is showing nothing although it should display string.
i check the view source also control's value is getting populated.
I am using a standard javascript that I downloaded from javascriptsource.com to read from and fill in a form using cookies. The page tests well in every browser except Apple's Safari (from 10.3.2)
Unfortunately, my clients daughter uses Safari so I have to get it to work with it, even though most of his clients use IE.
What do I need to do to change the code so this will all work in Safari? Code:
I have a DHTML Folder Tree, also known as a TreeView. That is, an expandable/collapsible tree of links. In a frame-less layout everything works great. In a frame-based layout, it doesn't work on Safari/Konqueror.
There are two frames: the left frame contains the tree control; when you click on a link in the tree, the right frame is the target for the links in the tree.
The tree mechanism itself works fine. But there is a problem with the links. What happens on Safari/Konqueror with the frame-based layout is the first link works fine, but all links after that do not. That is, the first click loads a picture on the right frame, but when I click on any other links after that, the target frame is not updated.
The very simple code (below) works fine in Safari (and Chrome, Firefox etc.), but it doesn't work in Mobile Safari. Why?(You can find a working example at: http:[url]....)
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>[code]......
Does anyone know if there is a quick test to tell if Safari 1.3 (or 2.0 will suffice) is the browser that doesn't rely on the typical navigator.* methods? For instance, there is the good 'ol document.all test for MSIE... Looking to add Safari support to my tty editor for my cms.
I am currently working on a project that displays preview of a jpeg in an iframe. we can edit this preview - like increasing its zoom level and changing pages , images etc. This works fine with IE on windows but whenit comes to Safari on Mac , the preview is lost on refreshing the browser.
I have noticed that this problem occurs when ever I use Iframes. Although the main jsp page is refreshed and shown, the jsp page that is the source for iframe contained in the main jsp page is not shown.
that some_script would not be called until the <body> was completely loaded - is this not the case? With Safari 1.3 I seem to have to delay inside some_script (there is some php in the <body> that slows down the loading). Since I happen to have a spare iframe in my <body>, I load a tiny bit of html in it whose job is simply to set a "loaded" flag, tested inside my delay code.
What I was observing was that some fields inside a <form> in the <body>, whose values are set by some_script, were, with Safari, not visible until I clicked in one of them - then they all popped into sight. I wasn't seeing this with other browsers and a delay mechanism fixed it.
It was as if the onload was triggered as soon as it was encountered rather than when the loading was complete.
I am having problems with a website. It uses javascript to choose a payment option and then calculates the price accordingly. It works on I.E and firefox, but not on safari. A few of our clients use it so it has to be sorted out urgently.
I have no idea why it wouldn't work in safari and i don't have broad enough skills for that.
I have a form that has a Javascript function being called when a button is clicked. The function works properly in every browser except Safari and IE 5.2 for Mac. Any ideas?
I'm writing some stuff where I wish to allow the cursor keys to control elements in a page. This has not been a problem except with Safari which appears to duplicate the keydown and keyup events which are fired when the cursor keys are pressed. I.e. pressing and releasing say, K, results in one keydown event followed by one keyup event. Press any of the cursor keys results in two keydown events followed by two keyup events.....
I have a big <table> and I have added an onmousedown handler. When I get back the event in IE and Firefox, the individual <td> element appears in window.event.srcElement (IE) and in event.target (Firefox). However in Safari the target is just the <table>, not the <td>.
I need to get back the <td> associated with the event, and I would not like to put an onmousedown handler on each table cell because there are a lot of them. Does anybody know how I can get the event and figure out which table cell was clicked?
The stuff I've built recently works (in the sense that it does what I'm expecting it to do without any errors or warnings) in IE and FF but fails silently in Safari. I don't have a Mac to test on. I write some stuff and send it to the client who tests and reports back.
I don't do any browser sniffing, I test for a feature for I try to use it...
Are there any known oddities about scripting for Safari that might possibly help me out.
In my applications I've a ton of scripts that use remote XML file to fill forms and evaluate contents; In these scripts I always use the method SelectNode (that, with some workaround, works fine also in Mozilla).
I've just found out that this method doesnt work in Safari browser, therefore my applications are not usable by this browser. Can anyone provide me any solution or workaround to be able to read XML files in Safari wihout rewriting all of my scripts?
Ok, I've been noodling with this for several days now and I'm starting to go crazy. Does Apple's Safari browser support drag events on Textarea elements? The few specs and docs I've found seem to indicate that it does but I can't get it to work for the life of me. I've tired everything I can think of to try get notifications for the events:
ondragenter ondragleave ondragover ondrop
Not only do these events not seem to fire over the body of the textarea, but also the textarea seems to sink the events (so setting event handlers on document or body report no events while occurring over the text area). Even stranger the 1px border around the textarea *does* respond to the events, but once the mouse moves into the actual textarea it stops. I thought perhaps it was that native OSX UI elements don't fire events, but all "regular" mouse events seem to work (onmousemove, onclick, etc...).
Even more frustratingly, if I absolutely position a new element above the textarea (zIndex of new element textarea's) to try and catch these events, the text area *below* the element still sinks the events (even though it's not in the bubbling or capture path for the event). In other words, a div absolutely positioned above the textarea won't fire dragevents anywhere it overlaps the textarea. I can't click on the textarea below or manipulate it in any way, but dragevents still seem to be sunk by the textarea.
I've tried using event capturing vs. bubbling as well as different methods of applying the event handler to the text area (textarea.ondragenter, vs addEventListener(textarea,dragenter,true/ false) all to no avail.
I'm assuming Safari's textarea just doesn't work with drag events, unless I'm missing something really basic. Anyone gotten this to work? Any pointers or tips. Google searches have resulted in nothing, I can't imagine I'm the only person who's tried to get this to work as it seems like manipulating drag events on textareas would be a common thing to want to do.
In firefox, this script works just fine. But in safari, it doesn't do anything and I can't figure out why.The intention of this code is to just create a draggable item.