Here is my js fiddle and the text i been trying to escape so far the php code i tried to escape these characters
$datas[] = ['attributes' => [$colorId => ['id' => $child->getColor(),
'name' => $product->getName(),
'productId' => $product->getId(),
'price' => number_format($product->getSpecialPrice(),2),
'rrp' => number_format($product->getMsrp(), 2),
'was' => number_format($product->getPrice(), 2),
'image' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $child->getImage(),
'size' => $child->getSize(),
'description' =>Mage::helper('core')->quoteEscape(htmlspecialchars(json_encode($product->getDescription()), ENT_COMPAT, 'UTF-8', false)),
// Mage::helper('core')->quoteEscape($product->getDescription()),
'promo' => Mage::helper('core')->quoteEscape($product->getProductpromobox()),
'sku' => $product->getSku(),
'netsuite' => $product->getInternalId()
],
$sizeId => ['id' => $child->getSize(),
'name' => $product->getName(),
'productId' => $product->getId(),
'price' => number_format($product->getSpecialPrice(),2),
'rrp' => number_format($product->getMsrp(), 2),
'was' => number_format($product->getPrice(), 2),
'image' => Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $child->getImage(),
'color' => $child->getColor(),
'description' => Mage::helper('core')->quoteEscape(json_encode(utf8_encode($product->getDescription()), ENT_COMPAT, 'UTF-8', false)),
// Mage::helper('core')->quoteEscape($product->getDescription()),
'promo' => Mage::helper('core')->quoteEscape($product->getProductpromobox()),
'sku' => $product->getSku(),
'netsuite' => $product->getInternalId()]
]];
In my javascript file i did was
var productConfig = '<?php echo json_encode($datas);?>';
so this is the php code so error is only at description key while parsing https://jsfiddle.net/tsjfkwto/