/    Sign up×
Community /Pin to ProfileBookmark

if have this script written to handle back button problem
it works fine with IE 1.8 but in chrome3.0 and firefox 3.0 i’m not able to get the mouse position.

function checkback(e)
{
if(!e)
e=window.event;
var vx=e.clientX;
var vy=e.clientY;
if(0 < vx & vx < 150 & vy < 0)
{
window.location.reload();
}
}
i printed the values of vx and vy and found them ‘undefined’
Even pageX/Y and screenX/Y are not working.
please suggest me something.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 29.2009 — and your function checkback() is called [I]where[/I]?[I] How[/I]?

A note: in javascript the logical AND operator is [I]double ampersand[/I]: [COLOR="blue"][B]&&[/B][/COLOR] , not [B]&[/B]
Copy linkTweet thisAlerts:
@shwetankaauthorJul 30.2009 — i called check back like this just after the script

window.onbeforeunload=checkback;

also window.location.reload() is also not working in mozilla firefox.
×

Success!

Help @shwetanka spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...