Does javascript have any restrictions on the length or format of variables?
I only found it when I was passing parameters to UUID today. Although there is a solution, I don"t know what the reason is. Can you give me some advice? Are there any clear restrictions in the javascript standard? (looked for it but couldn"t find it)
var id = $("- sharpjqGrid") .getCell (colId, "id"). ToString ();
console.log (typeof id);
var opr = $("- sharpjqGrid") .getCell (colId, array [I]);
/ * $("- sharpjqGrid") .setCell (colId, array [I],""+ opr+""); * /
$("- sharpjqGrid") .setCell (colId, array [I],""+ opr+"");
id is obviously a string, but it must be enclosed in quotation marks before it can be considered a string parameter.
is it because the syntax of js is so loose?
title and content sense don't ask the same thing.
< H2 > title question: < / H2 >
The variable naming of
js is regular:
:
1" _" " $" _
2
3255
4(javascript)
5
6truefalse null
Disallowed characters
-
appear in
id
< H2 > questions about content: < / H2 >
After
becomes a string, you say you have solved the problem
then I guess your id should be a key name, similar to the usage of map [id]
. The problem of usage and variable naming rules are actually two problems that have nothing to do with each other
.
< H2 > revised question: < / H2 >
$("-sharpjqGrid").setCell(colId, array[i], '<a href="javascript:vm.'+array[i]+'('+id+')">'+opr+'');
the generated HTML
$("-sharpjqGrid").setCell(colId, array[i], '<a href="javascript:vm.'+array[i]+'(\''+id+'\')">'+opr+'');
the generated HTML
above is the execution of vm.xxx (aaaa-bbbb-cccc-dddd)
here aaaa-bbbb-cccc-dddd
is not a string in terms of syntax, it is an expression, four variables are successively subtracted), and then aaaa
, bbbb
, cccc
, dddd
are not defined
the following is the execution of vm.xxx ('aaaa-bbbb-cccc-dddd')
where ' aaaa-bbbb-cccc-dddd'
is a string
what are you trying to say above? your last line is obviously a grammatical error, not a length limit or something like
.