HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 15th, 2000, 09:49 AM
cskoo cskoo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 49 cskoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
may i know how to reading the content of external file and displaying it in the body of html document?
my code is as below:

<head>
<script language="Javascript">

var success

function openfile(filename)
{
statements to open and reading the contents of external file
success=1;
}
</script>
</head>
<body>
<a href="javascript openfile('filename')">Click here</a>
<script>
if(success==1)
{
displaying the file content
}
</script>
</body>
</html>

thanks for your help.

Reply With Quote
  #2  
Old July 16th, 2000, 08:00 PM
gstrock gstrock is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 2 gstrock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
there is no file I/O in javascript.
check here for more info:
http://developer.irt.org/script/file.htm

[QUOTE]Originally posted by cskoo:
[B]may i know how to reading the content of external file and displaying it in the body of html document?

Reply With Quote
  #3  
Old July 17th, 2000, 11:07 PM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
gstrock is correct, JavaScript has no I/O. However, you can do some simple things by assigning text and simple HTML code to a variable in a .js file. For example:

myfile.js********************

var trivial

trivial="<body>this is my text</body>"

******************************

In your document, place this in the head:

<script src=myfile.js></script>

Place this at the appropriate point in your document or write it out to a popup:

<script>document.write(trivial);</script>

You cannot write a <script></script> tag in this fashion nor can you output anything to file (no I/O, remember?).

Russ

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > reading and displaying file content


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway