Uncaught SyntaxError:提供给RegExp构造函数’Capture’的无效标志
$("#test_point_geck_info") .html("" + "");
浏览器上的结果如下:
正在调用的函数:
function PopImage(imagesrc,caption) { var PopupImageContainer = new Image(); PopupImageContainer.src = PopupImageSRC; setTimeout("PopupImageDisplay()",loadDelay); }
/assets/Capture.PNG
被解释为带有Capture.PNG
作为标志的正则表达式文字 (用于assets
) – 这些都是无效的。 你想要一个字符串: '/assets/Capture.PNG'
。
无论如何,您不应该使用内联事件处理程序属性 – 尤其是当您已经有jQuery可用时。 更好:
$("#test_point_geck_info").html('' + '').find("img").click(PopImage);
function PopImage(e) { var imagesrc = this.src, caption = this.title; var PopupImageContainer = new Image(); PopupImageContainer.src = PopupImageSRC; PopupImageContainer.onload = function() { PopupImageDisplay(PopupImageContainer, PopupImageCaption, PopupImageSRC); }; }
.thumbnail { cursor: pointer; }
当我在javascript之间错误地放置一些代码时,它发生了
- validationasp.net中的单个复选框
- 突出显示字符串中的匹配文本(JQuery / Javascript)
- jQuery.ajax在服务器上给出了“TypeError:无法读取null的属性’documentElement’,但不是本地的
- 使用jQuery Validation插件validation不在表单内的输入
- 如果条件为true,如何将类添加到jQuery元素,如果条件为false,则删除相同的类?
- 如何在调试模式下在浏览器中动态修改javascript代码?
- 如何根据浏览器文化格式化JavaScript Date?
- Jquery – 从另一个函数中获取变量
- TradingView小部件替换整个HTML正文