external file content <textarea> - html

Is it possible in HTML/Javascript (NO PHP) to put for example the content of the file
file.txt in a <textarea> and how ?
I actually want to view the source code of the file in a <textarea>
THX
Evert
*EDIT*
file.txt was an example, actually the html is in a .sqlite file (with also a lot of other text) but my page just shows a specific html code in it (long story) but i wan to get that whole content of the .sqlite file in a text area

Related

i want to print content from a text file to html page

I have a text file which contains a number.
I need to read this text file and display this number on a html page in a link.
Have a look at PHP and the readfile(), fopen() or file_get_contents() functions to read data from a file on your server.

HTML file displays as text. Why?

I'm not using PHP. XAMPP finds my .html file just fine, BUT it doesn't process the HTML. Instead, it displays the file as text.
Why?
This could happen if you have saved the file with the option (SAVE as text FILE)
for example if you have saved your file as abc.html then it would become abc.html.txt
enter image description here
so it is supposed to be a html file but it will become text file

How to write html file with a text editor

I am trying to write my first html document.
Here is the link to the reference.
I am using TextEdit on Max OSX 10.6 and after I save it (as an html file) it is opened by the browser by double clicking on it. However the source script text is shown instead of the html structure.
What I am getting wrong?
You need to convert it to a plaintext document
Click Format and then 'Make Plain Text', then make sure to save as .html
Does the icon of the file has an "e". Usually these kind of files should have an icon as an e. Also make sure you are saving it as .html file. I think the actual extension of the file is hidden.

How to create a link to particular line in text file in html

I created a link in a html file to a text file (logcat.txt).
if i open this logcat.txt file via html link, need to open the file and pointed to specific line having keyword("Mylog").
How can i Do it?
You cannot link directly to a location inside a plain text file, even in a simple manner like by line number. There is nothing illogical with the idea; there are ways to link to a location in an HTML file, or in a PDF file, using a URL with a fragment identifier at the end (...#foo or ...#page=42 for example). And it would be possible to define a similar mechanism for plain text resources; but no such mechanism has been defined so far, still less implemented.
You might consider writing server-side code that converts the plain text file to an HTML document (possibly rendered with white-space: pre) so that you can link to specific locations there.

In a MediaWiki page, how do I include a link to both a file and the file's description page

In a MediaWiki page, I want to have a link to both the file and the file's description page. I've seen this done before, but I can't find it now... it looked something like
{{file|MyFileName|pdf|This is my PDF file}}
It ended up with the page showing "This is my PDF file" as a direct link, and a little PDF icon next to it that was actually a link to the description page. This worked with pdf, doc, docx, ppt, pptx, and more, I believe. The prefix at the beginning was always "file" and the 2nd option was where you put the file type.
Of course, I just tried this on my MediaWiki 1.19.0 installation and it doesn't work.
It looks like some kind of template transclusion, and either my configuration is wrong or I don't have the template or my MediaWiki version is too old. I have the File template, though because I can get half of it working like this:
[[:File:MyFileName.pdf|This is my PDF file]]
I even remember seeing a page describing these two formats as the "old" and "new" ways of linking to files, but I can't find that page now either.
To elaborate, the template would probably have a structure like this:
template:file
[[Media:{{{1|}}}.{{{2|}}}|{{{3|}}}]]<!--
-->[[File:{{{2|}}} icon.png|link=File:{{{1|}}}.{{{2|}}}]]
The go ahead and load an icon image for each file type you plan on using. (If the image isn't icon-sized, you'll want to add a width modifier in there as well.) With this template, {{file|MyFileName|pdf|This is my PDF file}} should generate exactly the output you describe: a direct link to MyFileName.pdf called "This is my PDF file", followed by an embedded image File:Pdf icon.png that is also a link to the description page for MyFileName.pdf.
You can create a simple version of such template like this:
[[Media:{{{1}}}.{{{2}}}|{{{3}}}]] [[:File:{{{1}}}.{{{2}}}|(description)]]
The Media namespace is used to directly link to the file; : specifies that you want to link to the description page and not show the file.
If you want to have an icon for each file type, you would need to {{#switch}} on the file types.