dynamic onMouseover troubles
Posted: Thu Dec 04, 2003 3:44 pm
i have a MYSQL driven site. I am trying to revamp it from perl to php. I am trying to get this to work but i have not had any success.
I have a bunch a queries that return data and is then "echoed" based on that data.
This is how the code looks
Now here is the problem. Everything is generated fine as it should be generated. The only problem is that the java script does not work not even with static content. Now if i but double quotes around onmouseover"whatever('xxx')" everything works fine.
I do not know how to echo double quotes. I tried manythings and none of them have worked. I knwo that this is a stupid question and probably extreamly easy, but right now i am running on 3 hours of sleep and can n ot think.
Thanks
I have a bunch a queries that return data and is then "echoed" based on that data.
This is how the code looks
Code: Select all
while($section_data = mysql_fetch_array($results))
{
echo "
<td>
<a onmouseover='showM('$section_data[id]')' href='#'>";
if($section_data['id'] == getSectionID())
{
echo"
<img src='http://localhost/assets/menubar/at/$section_data[id]-hi.gif' alt='$section_data[section]' name='$section_data[id]' id='$section_data[id]' height='25' width='100' border='0' />";
}
else
{
echo"
<img src='http://localhost/assets/menubar/blue/$section_data[id].gif' alt='$section_data[section]' name='$section_data[id]' id='$section_data[id]' height='25' width='100' border='0' />";
}
echo"
</a>
</td>";
}Now here is the problem. Everything is generated fine as it should be generated. The only problem is that the java script does not work not even with static content. Now if i but double quotes around onmouseover"whatever('xxx')" everything works fine.
I do not know how to echo double quotes. I tried manythings and none of them have worked. I knwo that this is a stupid question and probably extreamly easy, but right now i am running on 3 hours of sleep and can n ot think.
Thanks