Bug Tracker

Modify

Ticket #5044 (closed bug: duplicate)

Opened 4 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by addyosmani

  • Keywords redirect back button added
  • Status changed from new to closed
  • Resolution set to duplicate

comment:2 Changed 3 years ago by addyosmani

Duplicate of #5097 .

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.