跳至內容
選單
此問題已被標幟

i want to get current url from javascript and i keep current url in session on controller and call the session in my model but i got nothing and no error:

controller.py:

@http.route(['/action_set_current_url/<string:url>'], type='json', auth="public")
def set_current_url(self, url, **post):
request.session['my_current_url'] = url
return {"my_current_url":my_current_url}

mymodel.py to get session:

current_url = http.request.session.get('my_current_url')

javascript code:

$(window).on('hashchange', function(e){
var url=window.location.href
    openerp.jsonRpc("/action_set_current_url/", 'call',url)
});
頭像
捨棄

in the js, console the url and check whether there is value inside it

作者

how to check the value inside when i'm working in remote server??

you can check the in console of the browser

相關帖文 回覆 瀏覽次數 活動
1
6月 15
10475
0
11月 23
1776
1
12月 20
4845
3
7月 19
15119
0
3月 18
365