JavaScript Object Syntax error -



JavaScript Object Syntax error -

i trying assemble object form data, i'm pretty sure i'm messing syntax - here's snippet

$device1.u_data.create.nodes.[$('#device-1-ip-1').val()] = {"enabled": true}; $device1.u_data.create.nodes.[$('#device-1-ip-2').val()] = {"enabled": true}; $device1.u_data.create.nodes.[$('#device-1-ip-3').val()] = {"enabled": true}; $device1.u_data.create.nodes.[$('#device-1-ip-4').val()] = {"enabled": true};

i think must messing piece i'm trying pull form. error i'm seeing in console "syntaxerror: missing name after . operator"

anything obvious i'm missing? help much appreciated.

you attempting utilize square bracket notation access items in .nodes, have dot between "nodes" , open square bracket.

on lines should have like:

$device1.u_data.create.nodes[$('#device-1-ip-1').val()] = {"enabled": true};

notice not have dot after "nodes"

javascript

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -