gpt4 book ai didi

javascript - Jquery $ 标记转义

转载 作者:行者123 更新时间:2023-11-30 08:38:10 25 4
gpt4 key购买 nike

$("#Camera").webcam({
width: 320,
height: 240,
mode: "save",
swffile: "@Url.Content("~/Content/jQueryWebcam/jscam.swf")",
onTick: function () { },
onSave: function () {
},
onCapture: function () {

webcam.save("@Url.Content("~/StudentRSRegistration/Capture?StudentIDD="+$("#StudentID").val())");
},
debug: function () { },
onLoad: function () { }
});

上面的代码在 $("#StudentID").val() 美元符号附近显示错误。如何逃脱他的性格?

最佳答案

问题不在于美元符号 - 而是您试图混合服务器端和客户端代码,这在您使用的方式中是不可能的。您需要重构逻辑,如下所示:

webcam.save('@Url.Content("~/StudentRSRegistration/Capture?StudentIDD=")' + $("#StudentID").val());

关于javascript - Jquery $ 标记转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29555653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com