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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Write() code saves to that page?

    Is there anyway that when I use the "Write()" and write some information to another page, that the page it is written to will keep that information until I delete it? I am not sure if this can be accomplished with Javascript or if I will need PHP. I hope it can with Javascript. One example of this could be used for is have a form for writing a comment about the page. Whatever was typed into the comment text box would be saved as a variable and that written to another page that has a Prompt box that asks for a password so only the person with the password could view it. Is this possible with Javascript? Thanks in advance! Also if this is, I'm kinda new to the Write() command so if someone could clarify on how to use it (i.e. when it can and can't be used, what must be done before hand [such as do you have to open the page before you can write to it] and that sort of thing. Thanks!)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    No its not possible with javascript. You'll need to do it serverside.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,611
    Thanks
    0
    Thanked 645 Times in 635 Posts
    The write() command in JavaScript is the old way of writing content into a web page. It only works for HTML and not XHTML and only if run before the page finishes loading (otherwise it starts creating a new page.

    It has been superceded by innerHTML and the various DOM commands and no longer needs to be used at all.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I think if you are going for some type of comment system then look for a premade one. Don't try to reinvent the wheel especially if you barely even know php. www.hotscripts.com has some good ones.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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