I am using the HightCharts library to draw some charts under the Play Framework. I have set up an AJAX request when the user clicks on the chart. The request returns a result with the provided page. I want to do a redirect on the rendered page.
This is the snippet code for my request:
plotOptions: {column: {colorByPoint: true}, series: {cursor: 'pointer', point: {event: {Click: function (event) {var jsonMsg = JSON.stringify ({Category: data.categories [event.point.y], Product: data.products [event.point.x]}); $ .Azax ({type: 'post', url: '@namespace.controllers.module.product.mailcopy controller.CREAT SEZBAB CORORALATION ()', data: JSONMS, content type: 'app / jason; carset = uTF-8 ', Data type:' jason '}); }}}}
And this is my return statement:
return is ok (template.RendadaO.to) (session (). "Role")), session ("email"), template. Gaylists (APKI), Segment I Tosting ()));
Any ideas about how I can do this?
You can not only make your Ajax action link to the page, but also the general results < / Code>, and not the returned page (HTML code de real) can not be returned. Note
Note: If you have sensitive data, such as credentials in the parameters, so it is worth to add some effort, namely AJAX action DB or something unique ID and random security parameters set in the cache Save with token and return the redirect URL with this ID and security token, later you will be able to retrieve these credentials using the given ID and your Will be able to render scenes in targeted action. Security token is to prevent crawlers from unauthorized access.
Using the Email Cache API, you can only insert results
in the cache, so this can be a very fast solution.
Comments
Post a Comment