/    Sign up×
Community /Pin to ProfileBookmark

can a text field be set to display a *.txt file?

can a text field be set to display a *.txt file?

I’m using dreamweaver mx, no luck so far, can only input text direct into the code!

Any help would be great..

Thanks

Alan

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@ray326Feb 15.2005 — A text area + server side code is your best bet. An alternative is an iframe, Javascript and the DOM, a technique Netscape called "Inner Browsing."
Copy linkTweet thisAlerts:
@aebrooksauthorFeb 15.2005 — ok thanks, i'll post down in the php section and see if they can shed a bit more light on this then!

Thanks again
Copy linkTweet thisAlerts:
@TheBearMayFeb 15.2005 — [code=php]
<script type="text/javascript">
function getFile(fileName){
oxmlhttp = null;
try{
oxmlhttp = new XMLHttpRequest();
oxmlhttp.overrideMimeType("text/xml");
}
catch(e){
try{
oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
return null;
}
}
if(!oxmlhttp) return null;
try{
oxmlhttp.open("GET",fileName,false);
oxmlhttp.send(null);
}
catch(e){
return null;
}
return oxmlhttp.responseText;
}
...
<body onload="document.getElementById('fillMe').value=getFile('someFile.txt');">
...
<input type="text" id="fillMe" />
[/code]
×

Success!

Help @aebrooks spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...