html页面跳转及参数传递
2017-08-26 15:08
393 查看
点击第一个html页面上 table数据的一行,跳转到第二个html页面显示这个场景下的详细数据,跳转过去时需要把这行数据的id传递给第二个html页面
1. 第一个html页面代码
2.第二个html页面代码
1. 第一个html页面代码
// table点击事件 $('#table').on('click-row.bs.table', function (e, row, $element, field) { if(field == "scene_name" || field == "scene"){ var index = $('#table').bootstrapTable('getSelections')[0]; //获取用户选择的行 if(typeof(index) == "undefined"){ alert("请选择一行数据"); }else{ var sceneid = index.id; var exptscene = index.scene; location.href = "get_template?template=recalltactic.html¶ms={\"APP_scene\":{\"scene_id\":\"" + sceneid + "\"}}"; //跳转到recalltactic.html页面,跳转参数放在params里 } } });
2.第二个html页面代码
{% set APP_scene = params['APP_scene'] %} //获取页面传递的参数params <!DOCTYPE html> <html> <head> </head> <body> <script type="application/javascript"> var APP_scene = { {% for APP in APP_scene %} "{{APP}}": "{{APP_scene[APP]}}", {% end %} }; //tornado模版,解析APP_scene var SCENE_id = APP_scene["scene_id"]; //获取传递的scene_id </script> </body> </html>
相关文章推荐
- HTML页面做中间页跳转传递参数
- HTML页面跳转及参数传递问题
- html两个页面跳转时传递参数location.search
- html页面跳转传递参数
- html中如何在页面跳转中传递参数
- HTML页面做中间页跳转传递参数
- html页面跳转传递参数
- 在一个页面文件中(JSP 或者HTML)使用href 跳转另一个页面时使用Js中获取传递过来的参数
- activity页面跳转传递参数的几种方法
- JQueryMobile页面跳转参数的传递解决方案
- Swift - 纯代码实现页面segue跳转,以及参数传递
- Android 页面跳转 传递参数
- JSP中参数传递以及页面跳转
- 微信小程序 页面跳转 传递参数
- js实现两个页面之间跳转参数传递
- LinkButton跳转页面传递绑定参数
- jsp与servlet之间页面跳转及参数传递实例
- JQueryMobile页面跳转参数的传递解决方案
- 前端在html页面之间传递参数的方法
- html页面间传递参数的方法