javascript - Passing HTML through JSON (PHP and DOJO) -
i have datastore querying database , outputting json... this:
$data[] = array('id' => $i, 'prod_id' => $product_id, 'link' => $link);
i'm wondering how can pass link using $link variable. if had example:
$link = "<a href=\"google.com\"> clicky </a>";
the datagrid display clicky , not actual html link... there anyway pass html?
i suggest passing link url , link text separately, reconstructing them anchor link in javascript on client-side.
you try escaping html, unescaping on client-side.
i have no idea why won't send links- perhaps browser trying parse sent html early?
Comments
Post a Comment