...

View Full Version : Writing into one file from another



xcom923
02-10-2004, 05:03 PM
Hey, I was just wondering if it would be possible to use something like the document.write command to wite HTML into one file from another.

I have a forum that I work on and I wanted to add more pages to that without putting that actually on the server, but it had cookies that I need to use so it needs to be on the server at the same time. So if anyone could help me that would be great.

rsci
02-10-2004, 06:58 PM
Could you provide some additional detail on what you are trying to do? Is this dynamic content you are trying to achieve?

xcom923
02-10-2004, 11:29 PM
OK I have a forum on InvisionFree.com I'm being introduced to some javascript and I've created some scripts that do some usefull things (if you want to check if out compared to other invisionfree forum and tell me about it go to ja2.web1000.com).

What I've been working on as of late is making a way to write into a blank page (by adding in the rules section with nothing in it) and depending on variables I send the page will call on code to write in (i.e. HTML) from an external file. That way I can make different webpages on the same page depending on the script.

I want to do this because of another script I have on the forum that changes the style of the entire forum itself. The forum saves the chosen "skin" into a cookie so I can't run the other pages on a different server since it won't have the cookie information. So I came up with this idea.

--------------------------------------

I just thought of a way I could do it. I'd like to know if there is a better way though.

OK what I can do is depending on whatever variable I send to this I can make it write another javascript command:

document.write('<script src=htm.js>"

I know that's not the correct way to call an external script but you get the idea. Anyway inside that code would be an HTML file with a documet.write(" at the top and a ") at the end. Would that work?? does the write method allow enters??

glenngv
02-11-2004, 04:28 AM
Why not do it on the server side?

xcom923
02-11-2004, 07:36 PM
I can't since it's not on my server. the Invision free forum is hosted on a server I can't touch



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum