SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: open file .txt

  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open file .txt

    hello all
    i want use code javascript
    it can open 1 file .txt

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,686
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by zerow View Post
    hello all
    i want use code javascript
    it can open 1 file .txt
    You almost certainly can't do that with JavaScript.

    What are you wanting to do with that txt file?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want open file .txt
    i want read 1 message in file .txt
    because i know file .js can run by file wscript.exe of Windowxp

  4. #4
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Like Paul said with JavaScript alone its 100% not possible, the only way you can achieve this is by using a back end server side script that opens the file and returns it to your JavaScript code.

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can't use javascript

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,686
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    How about this code example, where the contents of a text file is read?
    http://bulletproofajax.com/code/chap...est/index.html
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank paul_wilkins
    !

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    How about this code example, where the contents of a text file is read?
    http://bulletproofajax.com/code/chap...est/index.html
    Can u body onload this function ? (grabFile(this.href); return false

  9. #9
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,686
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by vlbknl2 View Post
    Can u body onload this function ? (grabFile(this.href); return false
    You don't even need the onload. Just move the script from the link down to its own script section near the end of the body, and get rid of the link.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  10. #10
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i would like to studing javascript
    can you for me document about javascript
    i want write code javascript run by wscript.exe
    can you help me ?

  11. #11
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,686
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by zerow View Post
    i would like to studing javascript
    can you for me document about javascript
    i want write code javascript run by wscript.exe
    can you help me ?
    I can direct you to a large set of book resources from which you can learn from.
    http://www.sitepoint.com/forums/show...ipt-Books-Help
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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