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
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.
bookMarkData