简体   繁体   中英

Symfony project not redirect me well, using JavaScript

I'm doing a project with Synfony and I have included a button 'submit' which when pressed I must make an insert into my database and then must take or redirect to the "reportepreliminar.html" page using JavaScripts:

This is the code you use to redirect:

window.location.href = "reportepreliminar.html";

This is my home page where my button is:

(1) http://localhost/apis/web/app_dev.php/general/1

and this I want to get, when you press:

(2) http://localhost/apis/web/app_dev.php/general/reportepreliminar.html

The problem is when I press the button, the URL changes to (2) but in the browser always displays the home page (1) .

I do not understand that you can be doing wrong?

regards

尝试这个

window.location.href = "{{ path('route_name_of_reportepreliminar.html') }}";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM