| | |
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 |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming progressbar prototype redirect runtime safari scale scriptlets scroll search security shopping size software toggle unicode w3c web wysiwyg \n






