473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

history.go(-1), is not working.

42
Hi ,

I have a problem. In my aspx page I have a onClick="history.go(-1)"

Later I moved it into external .js file. but it is not working. Can anyone help me?

Thanks in advance,
Siju George.
Jul 29 '08 #1
6 5142
acoder
16,027 Expert Mod 8TB
What do you mean by moving it to an external JS file? If it's in an onclick, that means you'll have to change the code to put it in an external file.
Jul 29 '08 #2
sijugeo
42
It's fixed.

I give the calling of the function in href="function()"
like this,
<a href="function()" id="functioncalling">Call</a>


Sorry its confusing I know, actually its an anchor tag used with onlick earlier, however when changed the method calling to hrref, it worked.

Siju
Jul 31 '08 #3
acoder
16,027 Expert Mod 8TB
So you put history.go(-1) in a function and called that?

Does the following not work?
Expand|Select|Wrap|Line Numbers
  1. <a href="someURL.html" onclick="return historyFunc();">Back</a>
where historyFunc is the function.
Jul 31 '08 #4
Expand|Select|Wrap|Line Numbers
  1. <A href="javascript:back()">Back</A>
In Js file,
Expand|Select|Wrap|Line Numbers
  1. function back(){
  2.    history.go(-1);
  3. }
Jul 31 '08 #5
acoder
16,027 Expert Mod 8TB
Studying, welcome to Bytes and thanks for your contribution.

You should avoid the "javascript:" protocol in href attributes. You can use the function in onclick and point the href to a real URL in case JavaScript is disabled.
Jul 31 '08 #6
rajujrk
107 100+
Hai better you this

<a href="#" onclick="history.go(-1);">Back</a>

or

<a href="#" onclick="history.back();">Back</a>
Aug 16 '08 #7

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

Similar topics

2
by: vbfoobar | last post by:
Hello, My question is: Is there an easy mean to make Python "command history" persistent across interpreter invokations? PS: In the case the question above is not clear, I rephrase it below...
1
by: Aravind | last post by:
Hi folks. My database project has the following: -------------------------------------------------------------------------------- tables: Member: MemName, MemNo , MemType, CourseFaculty...
1
by: KC | last post by:
I am using Access 2002, with a database template from MS Office. The Orders Management Database. I have tweaked this for use with our company. It is a small database with close to a 1000 records...
2
by: | last post by:
I am working on an ASP.NET application that seems to be limiting browser histories to only one entry. I am not using SmartNavigation on any of the pages, and that is the only thing that I have...
2
by: ShaneFowlkes | last post by:
I created a couple of quick test pages and to my surprise, these do not work either. When I click "Go Back" on test2.aspx, nothing happens. Ideas?? Surely I must be missing something obvious........
13
by: One | last post by:
hi group - I had this in a function - so I've just moved this out of the function for readabilty. Can someone please tell me WHY does this not return the result of : n1 times n2 As I said...
0
by: =?Utf-8?B?bWtlbGx5NGNh?= | last post by:
I've spent quite some time searching for a way to prevent the browser from adding each of my postbacks to the History list, and have found several different methods to do that or something similar,...
10
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you...
0
by: Marcin Wiszowaty | last post by:
Hello, I am working with databases,datasets, sqlserver 2000, vb.net, vs.net 03 But this is more of a general question. I like to do my dataacces by reading in the whole db table into a...
0
by: Prakash | last post by:
hi, I have developed application using asp.net2.0 +ajax with history control of asp.net future. All application is working fine without adding history control. But when I add history control...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
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,...

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.