jQuery.parseJSON of an array not working
Six Months ago I started another
thread about json_encoded arrays, because I was having trouble grabbing data.
That thread did give me some solutions, and until just a couple days ago I had no problems. However, now I am having problems with characters like slashes and commas. Following are the details:
Php script encoding the array
- echo "<td class='e'><input type='checkbox' class='Record_Chk' value='". json_encode($row_array) ."'></td>";
jQuery Script
- $('.Record_Chk').click(function() {
- var check = $(this).is(':checked');
- var catch_array = $(this).val();
- var data_row = jQuery.parseJSON(catch_array);
- console.log("test: " + catch_array);
- });
For the most part output from catch_array is great. But yesterday I uploaded some contacts with job titles that have characters which are causing problems. For instance:
- Job title: Special Assistant to the BOS & TM/Human Resource Director returns as
- Assistant to the BOS & TM\/Human Resource Director
..... using the jQuery.parseJSON(catch_array) above.
Also ...
- Job Title: Veteran's District Director returns as
- Veteran
... using the jQuery.parseJSON(catch_array)
In addition - the code stops executing altogether when it runs into a '
Any assistance with this problem would be greatly appreciated.
Thanks in advance:
Pavilion