【发布时间】:2015-03-04 07:56:08
【问题描述】:
对于一个请求,需要传递四个参数,其中只有三个被传递。参数timestamp 未通过。这可能是什么原因?
$.ajax( {
url : 'http://localhost:8081/Football/FeFeed',
data : {
playernumber : $('#playernumber_goal').val(),
timestamp : $('#match').get(0).currrentTime,
event : 'goal',
team : 'team-name'
},
type : 'GET'
}) .done(function(message){
}).fail(function(message) {
});
#match 的 HTML:
<video id="match" width="440" controls>
<source src="match.mp4" type="video/mp4">
<source src="match.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
形成的网址是:http://localhost:8081/Football/FeFeed?playernumber=22&event=goal&team=team-name
编辑:我可以传递一个静态变量,例如 100.232
【问题讨论】:
-
尝试为键时间戳传递静态值,例如“17h15”或您期望的东西
-
@Med.Amine.Touil 我需要发送一个浮点值
-
也许 $('#match').get(0).currrentTime 会导致问题。所以传递一个静态浮点值。并检查新的构建 URL
-
@Med.Amine.Touil 能够顺利通过。
-
所以你的问题正如我所料。现在尝试提醒 $('#match').get(0).currrentTime 。你会发现它有问题。你想从这个 jquery 表达式中得到什么?
标签: jquery html ajax floating-point httprequest