•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,095 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,299 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1067 | Replies: 7
![]() |
•
•
Join Date: Apr 2006
Posts: 14
Reputation:
Rep Power: 3
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: 14
Reputation:
Rep Power: 3
Solved Threads: 0
So it would be?
<a href="javascript:show('news1');">Welcome</a><br>
<div id="news1">
welcome to the site
</div>•
•
Join Date: May 2006
Location: Nigeria, West Africa
Posts: 20
Reputation:
Rep Power: 3
Solved Threads: 0
•
•
•
•
Originally Posted by Ries
So it would be?
<a href="javascript:show('news1');">Welcome</a><br> <div id="news1"> welcome to the site </div>
That would be the HTML part of it, yes.
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.
•
•
•
•
Originally Posted by havilah
You said the result should be rendered in a Div, what I replace the "Div" with a "tr" tag?
Then you would get a badly broken HTML fragment. You really don't want elements that will have their display and/or visibility properties dynamically changed, within a table.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- 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



Linear Mode