Event.clientX And Y Not Working In Safari?

Apr 27, 2009

For some odd reason, event.clientX and event.clientY don't work in safari in mac os x leopard. They used to, but it appears it cannot find the object "event".

[URL]

In the file windowsxp.js (don't get confused with windowsxp.jos), the movecursor() function moves the cursor div. It works, but the event.clientX issue seems to be messing the entire function up. Why is this happening? Anything in my page that is messing it up?

(notice: the url I've given will open a "launcher" webapp, and you must click on "windowsxp.jos" to load external files and see the problem) TypeError: Result of expression 'event' [undefined] is not an object.

View 4 Replies


ADVERTISEMENT

Event.clientx Doesn't Work In Firefox?

Dec 28, 2010

someone wrote a script for me to simulate an image map on a background header in wordpress. it works great in chrome and ie, but not firefox.

<code>
<script type="text/javascript">
function geturl() {
myMouseX=event.clientX

[Code]....

View 1 Replies View Related

The 'event' Object And Event.clientX

Oct 29, 2004

Code:

<script ... javascript >
document.onmousemove=(hit_test);

function hit_test(evt)
{
if (!evt) evt = window.event;
if (evt) document.getElementById("a").innerHTML = evt.clientX;
}
</script >

which works nicely;

I understand that the 'event' object is a globally accessible object in IE but not in Mozilla; instead in Mozilla the 'event' object is sent, by default, as the first parameter in a call to a function; is this true? ...

View 2 Replies View Related

OnClick Event Not Working On IE And Safari?

Sep 15, 2009

I have written a PHP script for a secure client login system and it is working on Firefox and Chrome. But it doesn't work on Safari and IE. I have noticed that some of the javascript functions do not work at all while a few of them work.I am pasting the part of my code that does't work up here:

<script type="text/javascript">
function newdir(i)
{

[code]....

When I click on the create folder button (newdir.png), I don't see the alert message that I gave for debugging. I have the SAME problem with 2 more buttons on the same page.

View 8 Replies View Related

JQuery :: Keyup Event From Learning - 1.3 - Not Working In FF Or Safari

May 8, 2009

I am currently learning jQuery from the book Learning jQuery 1.3 and I have run across a block of code that is not working for me in FF or Safari.

Here it is copied straight from the book (page 64)

I tested the next step that accomplishes the same thing with different code but I would like to understand why this is not working.

View 2 Replies View Related

Need A "static" Variable For Using Window.event.clientX

Oct 20, 2005

I'm trying to use the window.event.clientX value for positioning a
javascript routine, but I'm having trouble. When the javascript
routine comes up, it comes up in a certain position based on
window.event.clientX. However, the user could click on something in
the script display (say, like a menu, or a calendar, or something),
that my "refresh" (reload that same script but with different values).
Thus, the first time, it works perfectly, but thereafter, it sets the
new x,y values to the most recent window.event.clientX and
window.event.clientY positions. I want it ONLY USE the positions which
were first used.

Does this make sense? Ok, here is the code snippets:

// This is the javascript
function RollOver( Text )
{
HelpText = Text ;
HelpX = window.event.clientX;
HelpY = window.event.clientY;
ToShow = setTimeout( "DoRollOver()", 1, "JAVASCRIPT" );}

// This is the HTML
<input type="Text" name="timestamp1" value="">
<img src="myImage.gif" onmousedown="RollOver( getText() );">

The first time the image is clicked, the source comes up in the correct
place. But this new script that came up is now the current "event" so
when someone clicks on something to reload the script with a different
value, it sets the position relative to the lastest script placement,
not the original image.

View 5 Replies View Related

Safari Mousedown Event

Dec 7, 2005

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?

View 2 Replies View Related

ClientX Failing On Firefox?

Jul 23, 2005

I'm trying to create a simple image gallery that has a floating image
that popups up when the user clicks on a thumbnail. So far so good.
Now, when I tried to align the popup image so it's near the cursor,
things get a little screwy: it works fine for Internet Explorer 6
(although always appears near the top for a long page) but completely
fails with Firefox (causing it to ignore the rest of the JavaScript).
Can someone help explain why? The code that's causing the problem
(which is used to calculate the x and y positions) is:

var posx = 0;
var posy = 0;
if (!e) var e = window.event;
if (e.pageX || e.pageY)
{
nc.style.left = e.pageX * 0.6;
nc.style.top = e.pageY * 0.5;
}
else if (e.clientX || e.clientY)
{
nc.style.left = (e.clientX + document.body.scrollLeft) * 0.6;
nc.style.top = (e.clientY + document.body.scrollTop) * 0.5;
}

View 5 Replies View Related

Image Map Blocking ClientX In IE?

Jan 6, 2011

I'm doing some code to show an image where a user clicks on an image map. I've got code that tracks the mouse location and uses that to place the image where you click (it also stores the value in some inputs so the co-ords are sent through post).

Works perfectly fine in FF but in IE it stops tracking the mouse's location once you move over the image (so when you click it places the image at the edge).It should be tracking the client mouse at a document level so I find it bizarre it doesn't track it for this one element.

Code:

<script>
if (window.Event) {
document.captureEvents(Event.MOUSEMOVE);

[code].....

View 1 Replies View Related

JQuery :: Handling Key Event In Chrome Or Safari During A Popup?

Jun 9, 2009

I am currently following the image popup example from:[URL]If I run the demo on Windows XP on Chrome or Safari, the escape keydoesn't close the popup window. How do I handle this in jQuery for

View 2 Replies View Related

Button OnClick Event Works Great In IE But Not In Safari/FF?

May 14, 2009

I've spend about 2 days writing this javascript code and it works great in IE only to find out that it does nothing in Safari/FF.

Here is my code:

<script type="text/javascript">function calculate() {
var thetotal = 0;
var silver = 0;
var gold = 0;

[Code]....

Basicly what the script does is using some variables in my form will calculate a total price in real time when you click the "Calculate" button. Works great in IE, but in Firefox/Safari it won't do a thing..

View 8 Replies View Related

Can't Load Image Within Onsubmit Form Event On Safari

Aug 25, 2011

I want to load an image with JS within the form event "onsubmit" without stipping the submit action of the form.

What I do is the following:

var img = new Image();
img.onload = function(){
myfunction();
};

[Code]....

This logic is a MUST for me, I mean I don't want to use settimeout to postpone the form submit, and I have to call the URL_FOR_PHP_SCRIPT_TO_DO_SOME_LOGIC this way since this code is on a JS file from different domain. This logic works fine on all browsers, and the request to call the image is sent -which is what exactly I need-, however on safari it doesn't call the image request, and start posting the form directly. I tried to add an "onunload" event on the page containing the form when the browsers is safari, but this didn't help too, and the form still submitting data directly without starting sending the request to load the image.

View 1 Replies View Related

ScrollTop Working In IE/FF But Not In Safari?

Dec 3, 2009

The following script is scrolling my page smoothly, as it is supposed to, in IE and FF however it is not working at all in Safari, any version. The page is:

[URL]

When working correctly, you click the nav buttons in the left sidebar, the page scrolls to the appropriate section.

The script:

$(function(){
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'')
&& location.hostname == this.hostname) {

[Code]....

View 2 Replies View Related

Javascript Not Working In Safari (on MAC)

Aug 15, 2007

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:

View 1 Replies View Related

Onclick Not Working In Safari?

Dec 8, 2010

I am also in onclick problem, my code works fine in FF,OPERA,Chrome but not in Safari.My problem is this onclick.

Code:

1. <?php if(has_access($userarray,'view_serverdet','server')){
2. if (('Y' == $webpanel_ajax) && ('N' == $server_details || $usergroupid == "1")) { ?>
3. <span class="expand" id="exp<?php echo $server_row['id']?>" onclick="view_details('<?php echo

[code]...

In other Browsers these values alert, but in Safari not.I use Safari 5.0.3 in Fedora 13 using Wine.

View 5 Replies View Related

Safari Not Sending Requests During The Onclick Event Due To New Page Load?

Jul 7, 2010

I have a site which displays a selection of advert listings. We log the number of clicks each advert receives via ajax requests.The listings link to both internal pages on our site and external pages, hence the ajax - we cannot log the'clicks' by logging the requests on the destination pages as these are not all on our site for us to log. Also, I don't want to potentially get false positives e.g.from bookmarked pages - hence I am logging the actual clicks, not the requests on the destination.

All is OK in most browsers, but there is a problem with Safari (I am running Safari 4.0 on Windows XP running in Virtualbox OSE) but only where the destination is to open in the same window/tab (some listings go to a new window, some don't). I am logging clicks via an ajax request in the onclick event, which is working fine when the listing is to open in a new window, but it appears that when a new window is not to be opened, the ajax never gets sent.A have constructed the following minimal test case:

index.html

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" [code].....

Note the line commented '****' in index.html which cancels the action of the link. When this is not commented out, the ajax request is sent correctly. Without it (the desired situation) the ajax request never gets sent. Its as if Safari saves up the ajax requests to do later, but never sends them as the new page cancels all such 'saved up' actions.I am using the Safari web developer tools, but I have also checked this test case by checking the Apache logs. Note that as a test case I don't pretend that it will work in IE, but it should work in standards compliant browsers and has been tested on Firefox 3.6.6 and Opera 10.6. The Apache logs show that logger.txt is being requested, unless it is already in the browser cache.Possible workarounds I've considered, but would prefer to avoid:

On the site in question the only such links that currently open in the same window are internal, so I do have the option of logging safari clicks by logging these requests as opposed to clicks and checking the http referer on the server side. As this is not a very flexible solution as it relies on these specific circumstances, also relies on all other links successfully making a new window, and furthermore relying on http referer could result in false negatives I'd rather find a solution within the javascript.I haven't checked whether an asynchonous request would work, but I don't wish to do this anyway just in case there is ever a server problem that prevents the response coming back (note that for these purposes the response is actually superfluous - we are sending the server a message but don't need anything back). I also want to avoid the delay in sending the user to the destination - there is no point having to wait for a response we don't need.Lastly, and my prefered workaround unless I can find anything better, is to make Safari (only) open all links in a new window anyway.

View 1 Replies View Related

JavaScript And RegEx Not Working On Safari...

Mar 30, 2006

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);

View 6 Replies View Related

JQuery :: Animate Not Working In Safari?

Apr 14, 2011

I'm using Fancy Form Slider and love it. In firefox, it's working great. In Safari, its not so hot. Check it out:[URL].. It renders fine in both, but the animation is acting REALLY weird in safari.

I've used alerts to see if its using the correct data, and it is. Both the "current" and the new marginLeft are properly being set (in fact, it IS being set in safari, because when i inspect the element, it has the right margin-left data thats being alerted. There's no errors being thrown into the error console, either.

[Code]...

View 1 Replies View Related

JQuery :: $().load Not Working In Safari?

Nov 10, 2010

i'm new to jquery and javascript and am self taught (so i am always new to everything!!). my concept is to keep a web page side bar and header and to use menu items ( on click and load) to place pages into my main div. I have done that with images on the first loaded page...then if you click on the images another page gets loaded into the same div this works in ie, chrome and firefox...but not in safari.i don't know if i have a code problem, i have placed my javascriptin the wrong areaor it just is not possible..

View 3 Replies View Related

Array Length Not Working In Safari?

Jun 8, 2009

The problem is that it keeps returning a value of 0 every loop. When tested in Internet Explorer, FireFox and Google Chrome, it works just fine, returning values as it should (in this case the values of 32, 36, 35, 36). However, like i said, Safri returns 0, 0, 0, 0.

Crazy thing is, before it calls the checkArray() function, i check to make sure its sending the correct number and it does, so its something to do with the .length part since i did a check on that and that's where its coming up with the 0's.

var aryItems = new Array();
function add2Array(theName){aryItems[aryItems.length] = theName;}
function checkArray(theName){
for ( var z=0, len = aryItems.length; z < len; ++z ){

[Code].....

View 6 Replies View Related

Lightbox Not Working On Safari (but Works Everywhere Else)?

Oct 16, 2009

My page with my slideshow (with lightbox integrated) is up and running fine on browsers like Firefox, IE, and Google Chrome... But Safari doesn't even show the slideshow.[URL]...

View 2 Replies View Related

Self.location.href Not Working In Safari?

Feb 11, 2010

Ok I have tried and tried and cannot get this code to work in safari or google chrome.

Basically I am working on a shopping cart. The user will click the paypal pay now button. The form is submitted to paypal via a new window target="_blank"

I also need to refresh the current page. This will write shopping cart data to DB via php upon page refresh.

Safari and google Chrome will open the paypal window, but seems to ignore the javascript to refresh the browser.

FF and IE both work fine.

<script LANGUAGE="JavaScript">
function newPage() {
self.location.href='https://www.artists2you.com/s/orderconfirm.php?ordernumber='.$_SESSION['ordernumber'].'';

[Code]....

View 2 Replies View Related

Onclick Not Working In Firefox And Safari?

Mar 11, 2010

I am trying to use AJAX to do a simple thing of displaying the results in the same page. Clicking on the <a href tag should display the results in the same page. This is working correctly in IE but the onclick() function is not working in firefox and safari.

index.php
<?php
include "dbconnect.php";

[code]...

View 5 Replies View Related

Window.closed Not Working In Safari?

Jun 25, 2010

I'm opening a new window with window.open in javascript and i'm keeping his reference to make focus on it or detect if the window is closed or not.My code is working well in Firefox and Chrome (execpt the window.focus, but there's already an issue in chromium: [URL]

In Safari window.open and window.focus works well. But window.closed has a strange behaviour. If I close the new window without navigating in it, window.closed works after closing the window. But if a navigate to another page, window.closed return false, even after closed the window.Is there a way to keep the reference on my new window event if the user navigate to another page ?

here is a sample of my code (I use jQuery 1.4.2):

Code:

MyBrowser = $.klass({
window_ref: null,
initialize: function() {

[code]....

View 1 Replies View Related

Object.src Working In Safari, Firefox, But Not IE?

Feb 15, 2009

I am integrating PHP with javascript and css to create an image gallery for an art site. When a user clicks a thumbnail, the painting shows above the thumbnails, and data about the painting, along with an artist statement (in the form of an image) shows up on the right side. Everything works as it should with firefox and safari, but the statement image is not showing up in explorer. I right click the broken image and it shows the correct url, but the image is not/won't be displayed. What am I missing?

[Code]...

View 4 Replies View Related

JQuery :: Only Working In Safari (mac) And Not For Firefox Or Chrome?

Sep 15, 2010

Why is jQuery only working in Safari (mac) and not for Firefox or Chrome?

[URL]

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved