andyrr1
asked on
unterminated string constant javascript error and line wrapping in html
Hi,
I have a problem with some javascript - I have some PHP which prints out a number of links with an onMouseOver event as below.....where for some records, the description seems to start on a new line and generates an unterminated string constant error.
Is there any way of managing where the source wraps - I've tried putting \n charachters part way through the description but the "As systems accountant" bit always seems to start on the next line. I'm pretty sure that text doesn't have any strange starting characters.
HTML source produced
<a class="article_link" alt="Click to view or edit" href="editarticle.php?type =9&id=61" onMouseOut="HideHelp('desc 61');" onMouseOver="ShowHelp('des c61', '','
As Systems Accountant you will be responsible for developing this legal firm’s primary reporting system and implementing other accounting syst...');">
SYSTEMS ACCOUNTANT</a>
The PHP code if it helps is.....
$text = substr(strip_tags($desc_qu ery_data[$ query_data ["fieldnam e"]]), 0, 150);
$text = str_replace("'", "", $text);
print " <td valign=\"top\" class=\"".$row_type."\">\n <a class=\"article_link\"\n alt=\"Click to view or edit\" href=\"editarticle.php?typ e=".$type. "&id=".$re c_id."\" onMouseOut=\"HideHelp('des c".$rec_id ."');\"\n onMouseOver=\"ShowHelp('de sc".$rec_i d."', '','".$text."...');\">\n". $field_val ues[$field s_to_displ ay[$counte r]]."</a>< div style=\"display:none\" id=\"desc".$rec_id."\"></d iv></td>\n ";
I have a problem with some javascript - I have some PHP which prints out a number of links with an onMouseOver event as below.....where for some records, the description seems to start on a new line and generates an unterminated string constant error.
Is there any way of managing where the source wraps - I've tried putting \n charachters part way through the description but the "As systems accountant" bit always seems to start on the next line. I'm pretty sure that text doesn't have any strange starting characters.
HTML source produced
<a class="article_link" alt="Click to view or edit" href="editarticle.php?type
As Systems Accountant you will be responsible for developing this legal firm’s primary reporting system and implementing other accounting syst...');">
SYSTEMS ACCOUNTANT</a>
The PHP code if it helps is.....
$text = substr(strip_tags($desc_qu
$text = str_replace("'", "", $text);
print " <td valign=\"top\" class=\"".$row_type."\">\n
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window