I am building some html in a php script in order to send it back to a page via Ajax.
$other_content = Model_Db::dbSelect($query);
$div_center .= "<table>";
for($i = 0;$i<sizeof($other_content);$i++) {
$div_center .= "<tr>";
$div_center .= "<td><a href='#' onclick='changediv('test','0')'>".$other_content[$i]->content_name."</a></td>";
$temp = "<td><a href='#' onclick='changediv('test','0')'>".$other_content[$i]->content_name."</a></td>";
die($temp);
$div_center .= "</tr>";
}
$div_center .= "</table>";
As you can see I am doing a die() to see the created string.
My ouput should be something like: <a href="#" onclick="changediv(" test','0')'>Content Name</a>
But instead I get: <a href="#" onclick="changediv(" test','0')'="">Content Name</a>
I do not understand where this ="" comes from after my onclick declaration...
Can anybody see what's wrong here? I am a bit puzzled as I really don't see where it could come from!
Cheers