Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Writing into one file from another

    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.

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could you provide some additional detail on what you are trying to do? Is this dynamic content you are trying to achieve?

  • #3
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sure

    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??

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Why not do it on the server side?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't since it's not on my server. the Invision free forum is hosted on a server I can't touch


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •