Monday, 3 June 2019

Back to previous page in Ajax Call

acutally i have a working Ajax Call that get me back after succeed to a static defined Site.

$.ajax({ 
            url: 'myPage.php',
            type: 'get', 
            data: {TestaufstellungID:TestaufstellungID, Datum: Datum}, 
            dataType: 'text',

            success:function(data){ 

                    window.location = "staticPage.php";
                 console.log('SQL Eintrag Erfolgreich Aktuallisiert');
     },
     error: function(jqxhr, status, exception) {
         console.log(exception);


            }
        });

It works fine with window.location but i want a dynamic site, back to this site where the use came from, like in PHP:

header('Location: ' . $_SERVER['HTTP_REFERER']);

Please dont give me answer like history.go(-1); becasue i dont want cached sites. Should be do the same like the php code, because in some cases i need the page URL with all string (Get-Method).

Thx for you help.

EDIT: My reference Post, to understand the step by step page working order, i want to be back all in all to the first step(page) but this page is not always the same one.

Update SQL Query with populated variables from AJAX functions over multiple PHP Pages



from Back to previous page in Ajax Call

No comments:

Post a Comment