| | |
javascript:show('newsmsgid');
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2006
Posts: 20
Reputation:
Solved Threads: 0
On a website I remeber seeing a news feature where the news would be a bar with a title and you clicked it and it would expand showing the message and other information and the code used was javascript:show but I don't understand how it works (as the news was got from a mysql database) how would this be done?
•
•
Join Date: Apr 2006
Posts: 20
Reputation:
Solved Threads: 0
So it would be?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<a href="javascript:show('news1');">Welcome</a><br> <div id="news1"> welcome to the site </div>
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
•
•
•
•
Originally Posted by Ries
So it would be?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<a href="javascript:show('news1');">Welcome</a><br> <div id="news1"> welcome to the site </div>
Then, you'll need CSS assigned to the DIV in order to make it initially invisible.
You'll need to write a JavaScript function named "show", which accepts the ID of the div and changes the style to "visible".
You'll need the server-side code to retrieve "welcome to the site" from a database and write the above output.
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
•
•
•
•
Originally Posted by havilah
You said the result should be rendered in a Div, what I replace the "Div" with a "tr" tag?
![]() |
Similar Threads
- Need help in design and javascript code for Dynamic form (JavaScript / DHTML / AJAX)
- Showing results of a form in new window (HTML and CSS)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: AJAX techniques...
- Next Thread: javascript code not working in mozillafirefox
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array beta browser captchaformproblem cart checkbox child class close codes column css date debugger decimal dependent design disablefirebug dom download editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html ie7 ie8 iframe 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 prototype redirect runtime safari scale scriptlets scroll search security select shopping size software toggle unicode w3c web windowofwords wysiwyg \n






