我正在使用jQuery在页面上动态显示可选图像。当我选择图像时,控制台显示错误“未捕获的ReferenceError:HTMLAnchorElement.onclick(AwardsEdit.html:1)上未定义MTU4”。这就是所谓的:
“ getAwardDetailsFunction(MTU4)”。
jQuery:
{"patients":["Bob","Tom"],"doctors":["Dr. Grimmer","Dr. Who"]}
我尝试使用:在变量MTU4周围加上引号:
contents += '<figure>';
contents += '<a href="#" onclick="getAwardDetailsFunction('+obj.awardId+')">';
contents += '<img id="awardImage'+obj.awardId+'" src="' + obj.awardPicture + '" alt="Award image" class="img-thumbnail">';
这在控制台中给我错误“ AwardsEdit.html:1 Uncaught SyntaxError:无效或意外的令牌”。
被调用的函数是:
contents += '<figure>';
contents += '<a href="#" onclick="getAwardDetailsFunction('+'\\"'+obj.awardId+'\\"'+')">';
contents += '<img id="awardImage'+obj.awardId+'" src="' + obj.awardPicture + '" alt="Award image" class="img-thumbnail">';
答案 0 :(得分:-1)
我已经花了几天时间,然后在发布后才找到答案:
替换:
fun select (l : int list, f:int -> bool) =
let val newlist : int list = []
fun recurse (x::xs) =
if f(x)
then newlist :: [x] :: recurse(xs)
else
newlist :: recurse(xs)
in
recurse(l : int list)
end
使用:
local x = script.Parent.Smile
local y = script.Parent.Smile2
while true do
x:TweenPosition(UDim2.new(0, 0, 1, 0),"Out","Linear",0.1)
y:TweenPosition(UDim2.new(0, 0, 1, 0),"Out","Linear",0.1)
wait(.105) -- making sure to tween again after 0.1 seconds, the 0.105 safely accounts for any latency in the game
x.Position = y.Position + UDim2.new(0, 0, -1, 0)
y.Position = UDim2.new(0, 0, 0, 0)
end