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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.