- 0
[JS] display text file contents by getting name from "a" element
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Copernic · Posted
ESET 19.1.14 by Razvan Serea NOD32 for Windows is the best choice for protection of your personal computer. Almost 20 years of technological development enabled ESET to create state-of-the-art antivirus system able to protect you from all sorts of Internet threats. ESET Internet Security boasts a large array of security features, usability enhancements and scanning technology improvements in defense of your your online life. ESET Internet Security ESET Internet Security keeps your computer or laptop safe with intelligent multi-layered protection combining proven antivirus, antispyware, firewall, anti-rootkit and antispam capabilities. Based on ESET NOD32 Antivirus, it protects you from viruses, worms, spyware, and all Internet threats. It conserves resources and improves computer speed. You are protected at the highest level while you work, social network, play online games or plug in removable media. ESET NOD32 Antivirus Your best defense against viruses, trojans and other forms of malware—and the top choice for IT professionals. Powered by the ThreatSense® engine with advanced heuristics, which blocks far more unknown threats than the competition. The latest generation of the legendary ESET NOD32 Antivirus takes your security to a whole new level. Built for a low footprint, fast scanning, it packs security features and customization options for consistent and personalized security online or off. ESET Smart Security Ultimate protection for everyday web users, thanks to ESET’s trademark best balance of detection, speed and usability. Stay safe from viruses and spyware. Stay protected from ransomware - Blocks malware that tries to lock you out of your own data. Receive free support by email or telephone in your local language, wherever you are. Bank and shop online more safely - automatically secures transactions on internet banking sites, and helps to protect you on online payment gateways. Stop hackers from accessing your PC - Personal Firewall prevents hackers from gaining access to your computer and keeps you invisible when you use public Wi-Fi. Keep your kids safe online - block unwanted internet content by categories or individual websites and keep your kids safe online with Parental Control. Safer webcam and home router - Get an alert when anyone tries to access your webcam, and check your home router for vulnerabilities. Safely store passwords, and encrypt your data. Safely store, generate and prefill your passwords, and encrypt your files and removable media (USB keys). Includes protection for smartphones and tablets. Protect all of your devices - mix and match security protection for up to 3 or 5 devices. ESET Security Ultimate ESET Security Ultimate offers all-in-one protection with antivirus, anti-malware, and anti-phishing features. It includes a personal firewall, secure online banking, and a password manager for enhanced security. Parental controls and data encryption keep family and sensitive information safe. It also provides regular updates to ensure you're always protected against the latest threats. It's user-friendly and ensures comprehensive digital security, perfect for those seeking reliable protection without complexity. ESET 19.1.14.0 changelog: Fixed: GUI crahes Fixed: IPM issues Download: ESET NOD32 Antivirus 64-bit | NOD32 Antivirus 32-bit | ARM 64 | ~ 80.0 MB (Free Trial) Download: ESET Internet Security 64-bit | ESET Internet Security 32-bit Download: Eset Smart Security Premium 64-bit | Eset Smart Security Premium 32-bit Download: ESET Security Ultimate 64-bit | ESET Security Ultimate 32-bit ARM64: Antivirus | Internet Security | Smart Security | ESET Security Ultimate Link: ESET Home Page Get alerted to all of our Software updates on Twitter at @NeowinSoftware -
By o0o.paw · Posted
+1 for Rufus. I bought NTLite a few years ago to scrape all the bloat out of Windows 11. It is not a perfect solution as there is a steep learning curve if you don't really know what you are doing (me included). I have finally got a Windows install that just works. I only keep things I use and nothing else. -
By Som · Posted
Personally ive been using searxng, self hosted, although there are public instances out there too (https://searx.space). Its shocking when I occasionally go into google or bing and see how bad they've become in the last year -
-
By PeterTHX · Posted
You guys claim everyone you don't like is Hitler, so you've already ruined that. Boy who cried wolf and all that.
-
-
Recent Achievements
-
MadMung0 earned a badge
One Year In
-
jefred earned a badge
Week One Done
-
JoeyNeo went up a rank
Apprentice
-
oliviaexpo earned a badge
Week One Done
-
eurospharma62 earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
sonicspike41
What I wanted to do was create a text file with a name like 19-06-2009.txt and then have Javascript read the contents to display on another section in the page. I would also like to combine this with an onclick for links on the right of the page. So that the latest news would display on the left by default, but when the user clicked a link on the right it would change the news content.
I was hoping for a simple way of doing it. Something like an onclick event for the "a" element on the right that would read the link's name (which will be the same as the file's name) and use that to grab the file from the site and set the conents to a variable, which will display in the left column. The reason I wanted to try something like this was so that I would only have to change the a tags around instead of doing it all manually and changing the whole page every time there is a new post.
I'm hoping to learn Javascript and figured this would be a good trial and error thing for me.
<html> <head> <title>title</title> <script type="text/javascript"> function getNewsFile () { XMLHttpRequest something something something... I get lost here. } var NewsPost = something something something... document.getElementById('leftcontent').innerHTML= document.write(NewsPost) </script> </head> <body> <div id="leftcontent"> </div> <div id="rightcontent><a href="news/06-19-2009.txt" onclick="getNewsFile()">06-19-2009</a></div> </body> </html>I will control the text files that get uploaded so if it would be easier to add a variable inside the text file that's fine. Just looking for an easy solution here that keeps the page nice and clean. If possible an external .js file I could link to in the head would also be welcome. I'm trying to keep this as xhtml 1.0 strict friendly as possible and don't want any script tags in the body.
Link to comment
https://www.neowin.net/forum/topic/818794-js-display-text-file-contents-by-getting-name-from-a-element/Share on other sites
7 answers to this question
Recommended Posts