javascript Firebug错误:标识符在数字文字后立即启动 [英] javascript Firebug error: Identifier starts immediately after numeric literal
问题描述
我在firebug中报告了这个错误,但我不知道它是什么意思:
标识符在数字文字后立即启动
以下是我的网页:
http ://www.austintreeexperts.com/maps/optionUpdateMap.cfm?zoom = 15
加载页面和地图时,点击其中一个蓝色或绿色标记。然后点击其中一个复选框来获取错误。我有一个onclick =输入复选框。
您的字符串连接已断开。您需要将您的方法参数封装在引号中
var statusForm ='< input id =tU'+ Aid +'type =checkboxonclick =optionAUpdate(tU'+ Aid +','+ color +','+ optionB +')/>选项A | < input id =iU'+ Aid +'onclick =optionBUpdate(iU'+ Aid +','+ color +','+ optionA +')type =checkbox/>选项B';
从这里开始-------------------------------------------- -------------------------------- ^
更正的版本
var statusForm ='< ; input id =tU'+ Aid +'type =checkboxonclick =optionAUpdate(\'tU'+ Aid +'\',\''+ color +'\',\' '+ optionB +'\')/>选项A'
注意:我已将所有参数视为字符串
I've got this error being reported in firebug, but I have no idea what it means:
Identifier starts immediately after numeric literal
Here is my webpage: http://www.austintreeexperts.com/maps/optionUpdateMap.cfm?zoom=15
When the page and map loads, click on one of the blue or green markers. Then click on one of the check boxes to get the error. I have an onclick= for the input checkboxes.
Your string concatenation is broken. You need to wrap your method parameters in quotes
var statusForm = '<input id="tU'+Aid+'" type="checkbox" onclick="optionAUpdate(tU'+Aid+', '+color+', '+optionB+')"/> option A | <input id="iU'+Aid+'" onclick="optionBUpdate(iU'+Aid+', '+color+', '+optionA+')" type="checkbox"/> options B';
From here ----------------------------------------------------------------------------^
Corrected version
var statusForm = '<input id="tU' + Aid + '" type="checkbox" onclick="optionAUpdate(\'tU' + Aid + '\', \'' + color + '\', \'' + optionB + '\')"/> option A'
Note : I've treated all your params as strings
这篇关于javascript Firebug错误:标识符在数字文字后立即启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!