Jump to content

append HTML


unemployment

Recommended Posts

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']));

 

Link to comment
https://forums.phpfreaks.com/topic/238786-append-html/
Share on other sites

:psychic:

 

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; 
		}
	}

 

Link to comment
https://forums.phpfreaks.com/topic/238786-append-html/#findComment-1226983
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.