PDA

View Full Version : Javascript...



Dannz
28-03-2006, 09:24 PM
Hi Everyone,

I am looking for some javascript to do the following

I want to have some html that changes regulary in a seperate file from the main html pages and i want some javascript that will include the html into the main page.

I would use php or some other dynamic language but i cant do that as it is for a school project and we dont have a web server at school :(

Thanks
Daniel

gcarmich
29-03-2006, 12:03 AM
Before I can point you in the right direction I will need some more information, where does the main html page come from if not a web server, if it is some sort of webserver then what can you run on the server if not php then perhaps perl or something else.

dolby digital
29-03-2006, 12:09 AM
Hi Everyone,

I would use php or some other dynamic language but i cant do that as it is for a school project and we dont have a web server at school :(

Thanks
Daniel

Couldn't you convince the powers at be at school to allow a low spec Linux local web server on your network for internal use.

Rob99
29-03-2006, 12:09 AM
You could use an include inside an iframe that refreshes.

Kame
29-03-2006, 12:26 AM
How is this seperate HTML file created and how would you make the changes?

If you're thinking Javascript, forget it, clientside scripts should never be allowed to write files, there's so much security concern with this, that I think it's best not to even attempt to do it unless you know what you're doing, it's also possible your school computers may not allow this, and that is how it should be.

As for outputting the HTML from a file into a main page, that can be achieved in many ways to accomplish this, though content changes must be made manually or get yourself a server with serverside scripting.

This is quite a bit to do, and considering it's for a school project, I can't really hand feed you the script to use, so I'll just give you a few keywords that could help you in your search:

XMLHttpRequest, AJAX, InnerHTML, W3C DOM API, EMCAScript 262, Iframe

Because of the lack of serverside scripting though, some methods may not be possible.


Cheers,


KK

Greg
29-03-2006, 12:26 AM
Would dhtml solve it?