Jump to content

Grubler

Members
  • Posts

    4
  • Joined

  • Last visited

Grubler's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks, that looks like something I can use
  2. Yes of course if I would write to a db or txt that clearly is something else.But here I just want to get the info FROM a txt or db.Lets say I have a file description.txt on the server. This file contains something like[Lamp]This is description for the lamp.[Heater]This is the description for the heater Then how can I get this text and use it to fill the div in my html for the onclick event?
  3. Server side? Well, since it is the user clicking the item to get more info, it is client side.Earlier I have used the innerHTML to get the info text.Like this<html><body><li id="lst_head" class="header1">Items<ul class="txt_lst"><li id="id_lamp" onclick="lst_def_txt.innerHTML='Some text about lamp.'">Lamp</li><li id="id_heater" onclick="lst_def_txt.innerHTML='Some text about heater.'">Heater</li></ul></li><div id="lst_def_txt"></div></body></html> But it is a pain in the *** maintaining the description text. Therefore I would like to get the description text from a text file or from a database. /Jon
  4. Hello. I hope that someone can point me in the right direction. I'm designing a wesite and would like to have som dynamic content.I know how to use the js inside of the html with innerHTML. But I would like the JavaScript to get the description text from a text file or a mySql. This is much easier to maintain than have to edit the html every time I want to change the description text. The site contains a list of items and a field for description.Something like this: <li id="lst_head" class="header1">Items<ul class="txt_lst"><li id="id_lamp">Lamp</li><li id="id_heater">Heater</li></ul></li> Then i have a div where the description is supposed to "pop" up. <div class="lst_def_txt" id="></div> So, how to make a script that get some text form a file or database and place it in the div when I click an item in the list? Regards,Jon
×
×
  • Create New...