![](/img/trans.png)
[英]How to pass table value parameter to user defined data table using C# and SQL
[英]using data table sAjaxSource with parameter
我想將用戶插入的值作為參數發送到JQuery數據表sAjaxSource屬性中。 像這樣的東西
var UsersData = $('input[name="UserValue"]').val();
$('#myTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/ProcessThis/UsersData",
"aaSorting": [[1, 'desc']],
...
如何在sAjaxSource示例上方的sAjaxSource內部使用此UsersData變量無效。
像這樣,我相信:
var UsersData = $('input[name="UserValue"]').val();
$('#myTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/ProcessThis/" + UsersData,
"aaSorting": [[1, 'desc']],
我假設您已經習慣了PHP,可以在其中將變量名插入字符串,但是在JavaScript中您必須進行連接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.