|
-
February 27th, 2006, 03:38 AM
#1
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 ?
-
February 27th, 2006, 08:04 AM
#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...)
-
February 27th, 2006, 01:02 PM
#3
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
-
February 27th, 2006, 02:24 PM
#4
Re: Is there a way to read plain text on server ?
 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.
-
February 27th, 2006, 02:56 PM
#5
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.
-
February 27th, 2006, 03:00 PM
#6
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
-
February 27th, 2006, 03:31 PM
#7
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 < > for < > and etc...
<xmldoccontent>
<table>
...
</table>
</xmldoccontent>
-
February 27th, 2006, 06:47 PM
#8
Re: Is there a way to read plain text on server ?
-
March 1st, 2006, 04:09 PM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|