I'm using the below url to pass few parameters along with the url. But I want to pass an JSON object instead of params.
So any solution or suggestion from your end.
javascript:void window.open("http://173.229.213.72:9000/index.html#/myurl/seeallmyassets/**param_1/param_2**"%2C""%2C"toolbar=no%2Clocation=no%2Cdirectories=no%2Cstatus=no%2Cmenubar=no%2Cscrollbars=no%2Cresizable=1%2Ccopyhistory=no%2Cwidth=1050%2Cheight=750%2Ctop=42%2Cleft=195");
I am using angular js 1.5 also tell me the what I need to do in the state provider.
$stateProvider.state('myurl', { url: '/test/:param_1/:param_2/:param_3', templateUrl: 'mon/templates/myUrl.html', controller: 'myCtrl' });
I want to pass request = { param_1: abc, param_2 :def, param_1: ghi, param_2 :jkl, param_1: mno, param_2 :pqr, param_1: stv, param_2 :uvw, param_1: xyz, param_2 :qwe }; "http://173.229.213.72:9000/index.html#/myurl/seeallmyassets/:request"
I'm using the below url to pass few parameters along with the url. But I want to pass an JSON object instead of params.
So any solution or suggestion from your end.
javascript:void window.open("http://173.229.213.72:9000/index.html#/myurl/seeallmyassets/**param_1/param_2**"%2C""%2C"toolbar=no%2Clocation=no%2Cdirectories=no%2Cstatus=no%2Cmenubar=no%2Cscrollbars=no%2Cresizable=1%2Ccopyhistory=no%2Cwidth=1050%2Cheight=750%2Ctop=42%2Cleft=195");
I am using angular js 1.5 also tell me the what I need to do in the state provider.
$stateProvider.state('myurl', { url: '/test/:param_1/:param_2/:param_3', templateUrl: 'mon/templates/myUrl.html', controller: 'myCtrl' });
I want to pass request = { param_1: abc, param_2 :def, param_1: ghi, param_2 :jkl, param_1: mno, param_2 :pqr, param_1: stv, param_2 :uvw, param_1: xyz, param_2 :qwe }; "http://173.229.213.72:9000/index.html#/myurl/seeallmyassets/:request"
Share Improve this question edited Jul 27, 2017 at 10:18 Joydeep Roy asked Jul 27, 2017 at 10:03 Joydeep RoyJoydeep Roy 651 gold badge1 silver badge11 bronze badges1 Answer
Reset to default 2Just pass it as a string, after encoding it:
var uri = "http://173.229.213.72:9000/index.html#/myurl?jsonObj={'property1':'val1', 'property2':54}";
var encodedUri = encodeURI(uri)
window.open(encodedUri );
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745335770a4623095.html
评论列表(0条)