Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#5044 closed bug (duplicate)

Problem with js redirect when using getJSON

Reported by: mihaigrigori Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: getJson redirect back button Cc:
Blocked by: Blocking:

Description

The problem I'm facing is as follows. I'm using a JSON call to check some data before doing a JS redirect to a different page. The redirect works but it's impossible to get back to the initial page using the browser's back button. The initial location is not being stored in the browser's history.

This is the script simplified. If placed on http://site1.example.com/ when it's executed it redirects to http://site2.example.com/ but there's no way to go back to http://site1.example.com/ using the browser's back button.

$(document).ready(function(){

$('#click').click(function(){

$.getJSON('index.php?jsoncallback=?', function(msg){

location.href='http://site2.example.com/';

});

});

})

Change History (2)

comment:1 Changed 9 years ago by addyosmani

Keywords: redirect back button added
Resolution: duplicate
Status: newclosed

comment:2 Changed 9 years ago by addyosmani

Duplicate of #5097 .

Note: See TracTickets for help on using tickets.