Forum Moderators: open

Message Too Old, No Replies

HTML/Javascript problem

         

jp_css

11:28 pm on Feb 23, 2004 (gmt 0)

10+ Year Member



I have a javascript that produces html code. I was wondering if it was possible to process the javascript, take this html code that is produced by the said javascript, and place the html code on a page rather than having any javascript? I have tried various things with php, but with no success.

Philosopher

11:32 pm on Feb 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, the problem I see with that is that JavaScript is a client-side scripting technology, meaning that the browser is what actually runs the script.

Because of that, you must have the javascript on the page, the browser then downloads it and runs the script generating the output.

To do what you are wanting, you need something that would be done server-side.

Or am I just mis-understanding what you are trying to do?

jp_css

11:35 pm on Feb 23, 2004 (gmt 0)

10+ Year Member



I was thinking about a possibility of loading a seperate page or having a static page, then somehow copying that html that the viewer would see if he saw the page. But, of course, the source code is javascript. I need to find a way to get the html and copy that, then it shouldn't be too bad to put this into the other page.

jatar_k

11:52 pm on Feb 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld jp_css,

There is no way to get the js output and convert it to html. You will have to rewrite the js code to php and then have php create the html and serve it to the client as straight html.