PDA

View Full Version : Webcoding Question


swphreak
07-12-2007, 01:57 PM
This is for you coders out there:

My boss likes to post records on the website, and he puts them on like 5 different pages. So when I go to update a record, I have to edit and reupload 5 different pages. Does anyone know of a way to make things easier?

I tried looking for a way to put the records on a 6th page by itself, and then use some scripting language to recall the numbers on the 5 pages. The end result I was aiming for was to just update the 6th page and upload it, and the 5 pages would have the new numbers.

Did that make sense to anyone? Also, I have absoultely no control over what is running/installed on the web host.

tk102
07-12-2007, 03:41 PM
This is for you coders out there:

My boss likes to post records on the website, and he puts them on like 5 different pages. So when I go to update a record, I have to edit and reupload 5 different pages. Does anyone know of a way to make things easier?

I tried looking for a way to put the records on a 6th page by itself, and then use some scripting language to recall the numbers on the 5 pages. The end result I was aiming for was to just update the 6th page and upload it, and the 5 pages would have the new numbers.

Did that make sense to anyone? Also, I have absoultely no control over what is running/installed on the web host.

Assuming that all the files you have are static HTML files and not dynamic files(eg. PHP, ASP, JSP etc.), you could accomplish this through javascript.

Let's say you want the same bit of html to appear on each page. In a text editor, type the following:

var mystrings=new Array();
mystrings[0]="Hello World.<br>";
mystrings[1]="<b>Bang!</b>";
mystrings[2]="Current value is 14";

Save this as data.js and upload it.

Then in your HTML wherever you want these strings to be imported use the following code in <head> portion.
<script type="text/javascript" src="data.js"></script>
and in the <body> area wherever you want these strings use the following:
<script type="text/javascript">document.write(mystrings[0]);</script>
<script type="text/javascript">document.write(mystrings[1]);</script>
<script type="text/javascript">document.write(mystrings[2]);</script>

Now, whenever you need to make a change, you'll only need to upload the new version of data.js. (You may have to clear your cache to notice the effect of your change.)

swphreak
07-12-2007, 05:05 PM
That's exactly what I was thinking of. I just couldn't remember how to do it (haven't used JavaScript since High School). I knew it could be done. Thanks for the tip.


And no, I don't think they set up the webserver to use anything other than html. Maybe ASP, but nothing else.

tk102
07-12-2007, 06:00 PM
:) No problem SWP. It's easy to forget this stuff if you don't use it very often.

Astrotoy7
07-15-2007, 01:58 AM
glad you're around tk !! This type of stuff is beyond me.. Im very much hardware oriented when it comes to my compy powerz.. :D

mtfbwya

CLONECOMMANDER501
07-15-2007, 09:54 AM
Do Web-coding programs cost money or are there any good free ones?

Det. Bart Lasiter
07-17-2007, 10:25 PM
Notepad.

Lynk Former
07-18-2007, 05:29 AM
Notepad.
Lynk approves.

ChAiNz.2da
07-18-2007, 11:19 AM
Lynk approves.
ChAiNz.2da thirds it (http://www.notepad.org/) :D

I've got a link to this site on my homepage.. hehehe

Ray Jones
07-19-2007, 09:41 AM
This is why *I* am *not* geeky. I prefer some syntax highlighting for whatever language I code and proper project/file management.

That's why I use gedit (http://www.gnome.org/projects/gedit/).

Det. Bart Lasiter
07-22-2007, 02:43 AM
http://img.photobucket.com/albums/v93/RayJones/20070429.jpg

OH MAN RAY'S DA MAN

Ray Jones
07-22-2007, 06:58 AM
that's right