'document.getElementById("someid").innerHTML' print out an unknown object

Hi guys!

When I wanted to give an alert message to my users, it printed out an unknown object like this:

How to delete it?

My javascript:

 	else{
 		
 		 var msg = '请确认订单信息是否正确!'
 		 + '\n' + '\n' +'您希望咨询的顾问是:'+'\xa0'+ document.getElementById("AdviserName").innerHTML
 		 + '\n' +'您希望预约的日期是:'+'\xa0'+ $('#ConsulationDate').val()
		 + '\n' + '\n' +'您希望开始咨询的时间是:'+'\xa0'+ $('#ConsulationTime').val()
 		 + '\xa0'+ '\n' +'您希望咨询的时长是:'+'\xa0'+ $("select[id='ConsultationHours']").val() + '小时';
 		
 		  if (confirm(msg)==true){

My html (with php):

<tr>
	<td width="180" align="right">顾问名称</td>
	<td width="auto" align="left" id="AdviserName"><?php echo $ResultUserInfo1[0]["RealLastName"];
        if($ResultUserInfo1[0]["Sex"]== 1){echo '先生';}
		else if($ResultUserInfo1[0]["Sex"]== 2){echo '女士';}
		else{echo '';}
		?>
		</td></tr>

Just guessing here. What is the output if you substitute with English characters?

if($ResultUserInfo1[0]["Sex"]== 1){echo 'Mr';}
else if($ResultUserInfo1[0]["Sex"]== 2){echo 'Ms';}

This thread might be helpful?

Finally, I did this:

+ '\n' + '\n' +'something:'+'\xa0'+ document.getElementById("AdviserName").innerHTML.trim()

The UFO disapeared

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.