hide some details using router.navigate in javascript

前端 未结 1 1784
甜味超标
甜味超标 2021-01-23 07:04

I need to post some data to server in ajax call. I am binding data into json format and posting it to server:

var BookMarkData = JSON.stringify(postData);
self.a         


        
1条回答
  •  鱼传尺愫
    2021-01-23 08:02

    If you need to show only 4 elements from postdata I assume that it is an array. Use slice:

    var bookMarkData = JSON.stringify(postData),
        routeData = JSON.stringify(postData.slice(0, 4))
    self.app.router.navigate('#hotels/' + bookMarkData, true);
    

    bookMarkData still holds the the whole array.

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