If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

How to Physically change html doc text from outside

I have an html5 doc (webpage) that has a series of list items, each li has an image and descriptive text. lets say i have 20 of them. if i need to replace one, it is awkward to go searching for it, and then change the text relating to the new image and new description (and prone to mis-typing).

what i would like to be able to do is edit the text from another program, or by inserting some temporary javascript or jQuery into the doc.

i have successfully changed it using innerHTML, but that is a temporary change. when i re-open the document, there is the old information.

I wouldn't do this with javascript because your page will fall over in browsers that don't support or have javascript turned off.

A much better way is to do this server side. Whether you use PHP or some other language, the concept is exactly the same.

Generally you would use a CMS (Content Management System), which uses a database to store the website content and other stuff. It would be fairly straight forward to create your own CMS, in PHP, for editing your lists. But since you're not keen on learning MySQL, plan B could be to have a 2D array at the top of your web page to store all your lists' content and then use PHP to create the html for the lists by looping through the 2D array. So effectively, the 2D array basically replaces the database.

So whenever you want to change the content of the lists, you simply just edit the 2D array's content at the top of the web page.