unemployment Posted June 8, 2011 Share Posted June 8, 2011 The HTML code in my array is being appended as <a href=\"../u/ldgbug\">Sam Sangs</a> has updated her location. When I want the actual html included on the page. Any idea how I can fix this? I am using this to generate it... news_text[i].appendChild(document.createTextNode(feed[0][i]['message'])); Quote Link to comment https://forums.phpfreaks.com/topic/238786-append-html/ Share on other sites More sharing options...
KevinM1 Posted June 8, 2011 Share Posted June 8, 2011 We're not mind readers. Code and context is required. Quote Link to comment https://forums.phpfreaks.com/topic/238786-append-html/#findComment-1226981 Share on other sites More sharing options...
unemployment Posted June 8, 2011 Author Share Posted June 8, 2011 We're not mind readers. Code and context is required. Well I have a json encoded array that has this in it <a href=\\\"..\/u\/lodfgdug\\\">Sam Sangs<\/a> has updated her location. So i'm assuming it is an encoding issue. That array value is generated by this.. if (($r['feedid'] != $user_info['uid']) && ($r['action_id'] == 'usercountry')) { $data[0][$k]['message'] = '<a href=\"../u/' .$r['feedusername']. '\">' .ucwords($r['feedfirstname'].' '.$r['feedlastname']). '</a> has updated ' .($r['gender'] == 1 ? 'his': 'her'); if (show_info($users_viewer_user_lvl, $users_privacy['location'])) { $location = " location to "; $location.= country($r['details']).'.'; $data[0][$k]['message'].= $location; } else { $location = " location."; $data[0][$k]['message'].= $location; } } Quote Link to comment https://forums.phpfreaks.com/topic/238786-append-html/#findComment-1226983 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.