P
pranny
Hi All,
I am trying to use AJAX in ColdFusion. It is very simple. I have a
'requesting page' and a 'responsive page'. The 'responsive page' sends
the data in JSON format. However, alongwith my JSON data are various
other technical debugging info attached. So i use a REGEX on the
response to find out my JSON data.
My JSON data looks something like
{"Unassigned_Instructors":[{"name":"Todd Anderson","id":133693},
{"name":"Instructor Default","id":4},{"name":"Prak Pran","id":133701},
{"name":"prakash Pranav","id":133699},{"name":"s m","id":
133700}],"Unassigned_Equipment":[],"Classrooms":
[],"Assigned_Equipment":[],"Assigned_Instructors":[]};
I am storing it in a vairbale myJSONOb
The issue is that after using REGEX, it seems to be that the JSOn is
converted to String object, so it is unusable.
alert(typeof(myJSONOb)) shows Object
alert(myJSONOb.Unassigned_Instructors[0].name) gives an undefined
error.
Where i might be going wrong. I am a newbie, not much into AJAX and
Javascript. Also please dont ask me to use ColdFusion AJAX libraries.
I need to implement this AJAX without any library.
KAny help would be great.
Thanks !!
I am trying to use AJAX in ColdFusion. It is very simple. I have a
'requesting page' and a 'responsive page'. The 'responsive page' sends
the data in JSON format. However, alongwith my JSON data are various
other technical debugging info attached. So i use a REGEX on the
response to find out my JSON data.
My JSON data looks something like
{"Unassigned_Instructors":[{"name":"Todd Anderson","id":133693},
{"name":"Instructor Default","id":4},{"name":"Prak Pran","id":133701},
{"name":"prakash Pranav","id":133699},{"name":"s m","id":
133700}],"Unassigned_Equipment":[],"Classrooms":
[],"Assigned_Equipment":[],"Assigned_Instructors":[]};
I am storing it in a vairbale myJSONOb
The issue is that after using REGEX, it seems to be that the JSOn is
converted to String object, so it is unusable.
alert(typeof(myJSONOb)) shows Object
alert(myJSONOb.Unassigned_Instructors[0].name) gives an undefined
error.
Where i might be going wrong. I am a newbie, not much into AJAX and
Javascript. Also please dont ask me to use ColdFusion AJAX libraries.
I need to implement this AJAX without any library.
KAny help would be great.
Thanks !!