473,563 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

page redirecting in javascript

1 New Member
hi friends...this is keerthi...i am doing a project where i want to redirect my page when ever the back button is clicked...for this i am using window.onbefore unload method..and for page redirection i am using window.location and my code is as follows

<html>
<head>
<script type="text/javascript">
var confirm = true;
window.onbefore unload = unload;
function unload()
{
if(confirm)
{
window.location ="http://www.google.com" ;

}
}
</script>
</head>
<body>
<input type="submit" value="save" onclick="confir m=flase;"/>
</body>
</html>
but my page is not redirecting when ever the back button is clicked...

NOTE:when i use window.open() its redirecting but i dont want pop ups...
please any one could help mee...

byee
keerthi.
Apr 6 '07 #1
1 1446
acoder
16,027 Recognized Expert Moderator MVP
See this link.
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3208
by: Wes | last post by:
This should be really simple ... but how to do it has been eluding me ... I am writing an ASP.NET application and am using ASP.ImageButtons & ASP.Buttons. Instead of redirecting to another page (ie. Response.Redirect("xxx.htm")) I want to open the page in another window. Sounds pretty basic, but ..... If you can help, I'd sure...
3
2317
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the main page from the code behind the contents page. I want to do this to allow the use of asp "linkbuttons" instead of hyperlinks so I can do a...
13
2067
by: AMC | last post by:
Hi, I have the below code in an asp page. When I run this page in IE or Opera it correctly displays the header info and does not redirect me to 'test.html'. However, when I run this in Netscape it goes straight to the redirect page 'test.html' which indicates that javascript is not enabled and it also does not display the header info. Can...
12
6949
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
4
1486
by: Greg Smalter | last post by:
Redirecting from page to page within a web project is pretty easy. However, all Redirect methods take strings as arguments, as if you mistype the string, you don't find out until run time that you are redirecting to somewhere that doesn't exist. Worse, if you do type it correctly, but then later the page name changes or the page moves, you...
1
1015
by: IkBenHet | last post by:
Aldo it is something very simpel, it is not easy to find good information on this subject. For the moment we have only 1 ASP.NET page and we want that if vistors access it, this visit is logged into a database. Because we are developing the future site right now, we also want to know what browser, screensize and resolutions the visitors of...
5
1618
by: mherman3 | last post by:
I have a page that sends a request to another PHP page on my site. If I try and set the header in the page that is being called, with header(Location: ...), the site doesn't get redirected like I'd like it to, it just writes a response to the original page. The response that it writes is the HTML of the page that I'd like the site to be...
2
44405
nirmalsingh
by: nirmalsingh | last post by:
hai all, i am having 2 pages. login.html and city.html login.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title>
1
3215
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page again to re-signup, however, i would like to remain all the correct infromation, and let users re-entered their NRIC. how can i do this. can i use...
0
7659
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...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
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...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
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...
1
2079
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

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.