Click here to Skip to main content
15,921,697 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi , I am getting error when i use brackets in key value in javascript ,

Below is my javascript code:

JavaScript
var cxmLanHi = {
    aboutassistpro: "असिस्ट प्रो बारे में",
    acallscycle: " एक कॉल / साइकिल",
    access: " पहुंच",
    accessiblemenus: " सुलभ मेनू",
    accessiblereports: " सुलभ रिपोर्ट",
    accompaniedby: " के साथ",
    accountid: " खाता आईडी",
    accountname: " खाता नाम",
    accounttype: " खाते का प्रकार",
    achievement: " उपलब्धि",
    acknowledgedby: " द्वारा स्वीकार किया",
    acknowledgeddate: " स्वीकार किया की तारीख",
    acknowledgedqty: " स्वीकार किया मात्रा",
    active: " सक्रिय",
    activechemistsonly: "सक्रिय कैमिस्ट केवल",
    activeclientsonly: " सक्रिय ग्राहकों को केवल",
    activeemployeesonly: " सक्रिय कर्मचारियों को केवल",
    activemeetingplacesonly: " सक्रिय बैठक स्थानों केवल",
    activeonly: " सक्रिय केवल",
    activerecordsonly: " सक्रिय रिकॉर्ड केवल",
    activeusers: " सक्रिय उपयोगकर्ता",
    activeusersonly: "  सक्रिय उपयोगकर्ता केवल",
    activity: " गतिविधि",
    activityanalysis: " गतिविधि विश्लेषण",
    activityrate: " गतिविधि दर",
    activityratereport: " गतिविधि दर रिपोर्ट",
    activitystatus: " गतिविधि स्थिति",
    activitysummary: " गतिविधि समीक्षा",
    activitysummaryreport: " गतिविधि सारांश रिपोर्ट",
    actual: " वास्तविक",
    actualappointment: " वास्तविक नियुक्ति",
    actualcall: " वास्तविक कॉल",
    actualcalls: " वास्तविक कॉल",
    actualdate: " वास्तविक तिथि",
    actualduration(hhmm): " वास्तविक अवधि (एच एच"
};


This is the line on which i am getting an error:

actualduration(hhmm):" वास्तविक अवधि (एच एच"


I figured out when i use brackets its giving me an error , but not getting why?

I want to use brackets as per requirement.
Posted
Updated 12-Oct-15 1:08am
v2

1 solution

As the javascript object keys can not have brackets of any kind. So, you can change that key to:

JavaScript
"actualduration(hhmm)":" वास्तविक अवधि (एच एच"


using double quotes to resolve it.
 
Share this answer
 
Comments
Torakami 12-Oct-15 7:16am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900