更新时间:2023-11-21 11:52:46
Aj就在这里,因为我没有列出我正在使用的服务器端代码,所以我想使用php,但简单地说,我将ajax调用更改为>
Aj was right here I guess for php as I did not list what server side code I was using, but simply put, I changed my ajax call to
return $.ajax({
type: 'GET',
url: '/users/show',
data: { currentuser1var: 'variable1'},
});
其中键是currentuser1var
,值variable1
是字符串,并且省略了定义变量的位置,否则位于代码中.这样,URL可以正确地到达/users/show?currentuser1var=variable1
服务器.然后在我的目标文件中添加我的ruby代码以使用这些变量.
where the key is currentuser1var
and the value variable1
is a string and leave out defining the variable else where in the code. That way the url comes through correctly to the server being /users/show?currentuser1var=variable1
. And in my destination file add my ruby code there to use the variables.