Javascript, submitting string to JSON file through server, line breaks not working -
having bit of issue. using firebase project , stores data in json file. when creating object push firebase in code this:
customers.child(uniqueid).set({ first_name: addcustomerdialogfirstname.value.tostring(), last_name: addcustomerdialoglastname.value.tostring(), email: addcustomerdialogemail.value.tostring(), organization: addcustomerdialogorganization.value.tostring(), address: addcustomerdialogaddressone.value.tostring() + ', ' + addcustomerdialogaddresstwo.value.tostring() + '\\n' + addcustomerdialogaddresscity.value.tostring() + ', ' + addcustomerdialogaddressstate.value.tostring() + ' - ' + addcustomerdialogzip.value.tostring(), phone: addcustomerdialogphonecountrycode.value.tostring() + addcustomerdialogphoneareacode.value.tostring() + addcustomerdialogphonerest.value.tostring() });
i'm confused how display in json file. when @ json file on firebase reads (value of address two)\\n(value of address - city)
, doesn't see \\n
isn't part of string. idea how display in json file? i've never worked json before i'm bit of noob. thanks!
why escaping new line character? should \n
.
Comments
Post a Comment