CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2005
    Posts
    31

    Is there a way to read plain text on server ?

    Is there a way to read plain text on server and store it on string variable ?

  2. #2

    Re: Is there a way to read plain text on server ?

    Meaning read a text file in a seperate request and then use it? Yes - look at AJAX (you may want to visit the AJAX forum though it's still pretty new...)

  3. #3
    Join Date
    May 2005
    Posts
    31

    Re: Is there a way to read plain text on server ?

    Isn't AJAX is only read/write xml file with javascript ?

    I want just plain text to be read

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Is there a way to read plain text on server ?

    Quote Originally Posted by Jackyquah
    I want just plain text to be read
    Then you will have to use a server-side language such as PHP or ASP.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    May 2005
    Posts
    31

    Re: Is there a way to read plain text on server ?

    I wouldn't ask in Javascript Forum. if I want to used other languages.

    The Idea is the plain text contain part of html code like
    <table>
    ...
    </table>

    so when using javascript I can insert to the current HTML page
    Logical code :
    var String=GetPlainTextString(UrlFilename)
    [element].innerHTML=String

    I don't want to used IFrame cause I must specify width and height and still it's using scroll bar if the content is larger.

    I want it's fully show( as large as the content ) without using scrollbar.
    Last edited by Jackyquah; February 27th, 2006 at 03:24 PM.

  6. #6
    Join Date
    May 2004
    Location
    MN / NJ, United States
    Posts
    768

    Re: Is there a way to read plain text on server ?

    Cool down.
    You cannot read a file with just JavaScript. You'd have to use other technologies (AJAX) or other languages (PHP, ASP, etc). Both solution have been presented. To which forum would you like me to move this thread?
    *9-11-01* Never Forget; Never Forgive; Never Relent!
    "If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan

  7. #7
    Join Date
    May 2005
    Posts
    31

    Re: Is there a way to read plain text on server ?

    The reason I don't want used AJAX is because it's open in XML.

    It will be pain to write in XML since HTML code is similiar to XML
    i must using &lt &gt for < > and etc...
    <xmldoccontent>
    <table>
    ...
    </table>
    </xmldoccontent>

  8. #8

    Re: Is there a way to read plain text on server ?


  9. #9
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: Is there a way to read plain text on server ?

    Maybe the following trick will be good enough for you:
    HTML Code:
    <html> 
    <head> 
    <script src="html_inc.js" type=text/javascript></script> 
    </head> 
    <body> 
    <h1>Test</h1> 
    <script language=javascript> 
    document.write(more_html) 
    </script> 
    </body> 
    </html>
    with html_inc.js containing:
    HTML Code:
    var more_html = "<table>" 
    more_html += "<tr>" 
    more_html += "<td>foo</td><td>bar</td>" 
    more_html += "</tr>" 
    more_html += "</table>"

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured