Web Analytics Made Easy -
StatCounter Can javascript edit and read *.txt ans *.ini files? - CodingForum

Announcement

Collapse
No announcement yet.

Can javascript edit and read *.txt ans *.ini files?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can javascript edit and read *.txt ans *.ini files?

    Hello, can javascript edit and read *.txt and *.ini files?

  • #2
    Maybe...

    I'm not sure if this would work, but try something like:
    Code:
     
    <iframe id="j" src="WHATEVERTHING.txt(or)ini" HIDDEN="true"></iframe>
    <script>
    <!-- 
    var it=document.getElementById('j').innerHTML;
    alert('It\'s  '+it+'  ')
    //-->
    </script>
    If it doesn't work, then you probably need value in place of innerHTML or server side scripting.
    Oh, was I supposed to put something here? ........

    Comment


    • #3
      It didnt work, but thank you for your help any way!
      I still learned some thing from though.

      Comment


      • #4
        Now why would you want to do a thing like that?

        Javascript cannot access or edit (= damage?) any file
        on the user's system with the exception of cookies.

        All the code given in this post has been tested and is intended to address the question asked.
        Unless stated otherwise it is not just a demonstration.

        Comment


        • #5
          For my game I'm making out of javascript.
          I want to save variables with *.txt or *.ini files.

          Comment


          • #6
            Use PHP.
            David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
            W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

            Comment


            • #7
              Originally posted by Philip M
              Now why would you want to do a thing like that?

              Javascript cannot access or edit (= damage?) any file
              on the user's system with the exception of cookies.
              How do you use cookies, then?
              Oh, was I supposed to put something here? ........

              Comment


              • #8
                You can read (but not write) an HTML page out of an IFRAME, but it must be a complete HTML page - you can't use a text file and expect it to have a DOM.
                "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

                Comment

                Working...
                X