1

We are submitting data and then showing the result in a a alert box, what we want to do is send the user to a another page(response.php?r=result) instead of showing the alert.

The code we are using is below

function (result) {
            
                    setTimeout(function() {
                        alert("We got a barcode\n" +
                              "Result: " + result.text + "\n" +
                              "Format: " + result.format + "\n" +
                              "Cancelled: " + result.cancelled);                            
                    }, 0);
                },
vvvvv
  • 25,404
  • 19
  • 49
  • 81
Chris Campbell
  • 91
  • 2
  • 11
  • If you really want it to open a new page, then the response should be a URL to the new page and you'd use something like `window.location=result.URI;` in the javascript to go to the new page. This would mean the server needs to store the results somewhere to generate the new page though. – Matthew Sep 30 '15 at 11:39

1 Answers1

1

How about something like that

location.href = 'response.php?r=' + JSON.stringify(result);

?

Norman
  • 3,279
  • 3
  • 25
  • 42