Mixing JavaScript and Scala in a Play template

前端 未结 1 1774
离开以前
离开以前 2021-01-05 16:06

I\'m not sure how this is done. I could hard code the route I\'m trying to use, but I\'d like to do this the right way.

I have a dropdown that needs to load a new pa

1条回答
  •  我在风中等你
    2021-01-05 17:08

    You need a way of storing all URLs in the page, e.g.

    
    

    Then onChange, you can:

    $("select[name='product']").change(function() {
      location.href = $(this).val();
    });
    

    0 讨论(0)
提交回复
热议问题