将会话值调用到jquery中 [英] call a session value into jquery
本文介绍了将会话值调用到jquery中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
这里我想将会话[userid]传递给下面的数据参数
Hi All,
Here I wanted to pass the session["userid"] to the data parameters on below function
$.ajax({
cache: mvc3_web.common.DefaultOptions.cache,
type: 'GET',
url: requestUrl,
data: ,
contentType: mvc3_web.common.DefaultOptions.contentType,
dataType: mvc3_web.common.DefaultOptions.dataType,
success: onSuccess,
error: onError
});
谢谢&问候
Soumya
Thanks & Regards
Soumya
推荐答案
.ajax({
cache:mvc3_web.common.DefaultOptions.cache,
type :' GET',
url:requestUrl,
data:,
contentType:mvc3_web.common.DefaultOptions.contentType,
dataType:mvc3_web.common.DefaultOptions.dataType,
success:onSuccess,
error:onError
});
.ajax({ cache: mvc3_web.common.DefaultOptions.cache, type: 'GET', url: requestUrl, data: , contentType: mvc3_web.common.DefaultOptions.contentType, dataType: mvc3_web.common.DefaultOptions.dataType, success: onSuccess, error: onError });
谢谢&问候
Soumya
Thanks & Regards
Soumya
试试这个
try this
.ajax({
cache:mvc3_web.common.DefaultOptions.cache,
type:' GET ',
url:requestUrl,
data: {'id', '@session [ userid ]'},
contentType: mvc3_web.common.DefaultOptions.contentType,
dataType:mvc3_web.common.DefaultOptions.dataType,
success:onSuccess,
error:onError
});
.ajax({ cache: mvc3_web.common.DefaultOptions.cache, type: 'GET', url: requestUrl, data:"{ 'id', '@session["userid"]' }" , contentType: mvc3_web.common.DefaultOptions.contentType, dataType: mvc3_web.common.DefaultOptions.dataType, success: onSuccess, error: onError });
希望这有帮助
Hope this helps
这篇关于将会话值调用到jquery中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文