| | |
the trouble with arguments
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 62
Reputation:
Solved Threads: 6
I am a Javascript newb, and I am haveing some trouble with my arguments.
This is the code i have, and it is working perfectly on the different menus at the top of my screen. The problem i have is with my table IDs, i get the ids from a database using php, and one of them has a space in the centre, so that one doesnt work. This is my php if anything can be changed in either language i would be grateful for any help.
javascript Syntax (Toggle Plain Text)
function openMenu(tableName) { document.getElementById(tableName).style.visibility="visible"; }
This is the code i have, and it is working perfectly on the different menus at the top of my screen. The problem i have is with my table IDs, i get the ids from a database using php, and one of them has a space in the centre, so that one doesnt work. This is my php if anything can be changed in either language i would be grateful for any help.
php Syntax (Toggle Plain Text)
while($row=mysql_fetch_array($query)) { echo ' <td class="bar" onmouseover=Javascript:openMenu("' . $row['category'] . '") onmouseout=Javascript:closeMenu("' . $row['category'] . '")> <a href="category.php?cat=' . $row['category'] . '" class="top_menu"><div>' . $row['category'] . '</div></a><div>';
•
•
•
•
I am a Javascript newb, and I am haveing some trouble with my arguments.
php Syntax (Toggle Plain Text)
while($row=mysql_fetch_array($query)) { echo ' <td class="bar" onmouseover=Javascript:openMenu("' . $row['category'] . '") onmouseout=Javascript:closeMenu("' . $row['category'] . '")> <a href="category.php?cat=' . $row['category'] . '" class="top_menu"><div>' . $row['category'] . '</div></a><div>';
name="hello" is right, name=hello is wrong.So your echo is breaking the script.
php Syntax (Toggle Plain Text)
echo "<td class='bar' onmouseover='openMenu(\"".$row['category']."\");' onmouseout=''closeMenu(\"".$row['category']."\");' > <a href='category.php?cat=".$row['category']."' class='top_menu'><div>".$row['category']."</div></a><div>\n";
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
![]() |
Similar Threads
- Having trouble ENCODING/DECODING ASSEMBLY (Assembly)
- constructor arguments with new (C++)
- I'm having trouble with nodes? (C++)
- trouble understanding widget commands (Python)
- trouble with counting letter from file, please help. (C++)
- Trouble getting code to compile (C++)
- knoppix or else (Getting Started and Choosing a Distro)
- trouble executing java archive (Java)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript image slider issue
- Next Thread: pass the value to the text box
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxcode ajaxhelp animate api automatically beta boarder box bug calendar captchaformproblem card checkbox child class column cookies createrange() css cursor dependent disablefirebug dom download dropdown editor element engine error events explorer ext file firehose flash form forms google gwt html htmlform ie8 iframe image() images internet java javascript jawascriptruntimeerror jquery jsf jsfile jump math matrixcaptcha microsoft mimic mp3 mysql object offline onmouseoutdivproblem onreadystatechange parent passing pdf php player post problem progressbar rated rating regex runtime scroll search select session shopping size sql star stars stretch text textarea twitter validation w3c web website window windowofwords windowsxp wysiwyg xml xspf \n






