- 0
[JS] display text file contents by getting name from "a" element
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Big John Studd · Posted
The sweet release of death has never looked more appealing. -
By MrElectrifyer · Posted
Meh, just another dongle-haven downgrade compared to my Surface Pro 7+. Whenever I decide to upgrade in the next decade or so, it certainly won't be another microslop Surface with this enshitification trend they've been having after the Surface Pro 7+. Hopefully a future generation of the Framework 12 will be a real upgrade... -
By hellowalkman · Posted
This could exactly be how our Sun ends but it's not as simple by Sayan Sen Image by Drew Rae via Pexels An international team led by Université de Montréal (University of Montreal) PhD student Érika Le Bourdais has found that the ancient white dwarf star LSPM J0207+3331 is still pulling in planetary debris, even though it has been cooling for about three billion years. White dwarfs are dense, Earth-sized stellar remnants left behind when Sun-like stars exhaust their nuclear fuel and shed their outer layers. The star, located 145 light-years away in the constellation Triangulum, is the oldest and coldest white dwarf known to have a surrounding disk of dust. The star was first spotted in 2019 by a citizen scientist through the Backyard Worlds: Planet 9 project. Its cool temperature immediately suggested that it was very old, since white dwarfs gradually lose heat over time. Using the W. M. Keck telescopes in Hawaii, astronomers later confirmed that the star shows infrared signals consistent with dust rings formed by asteroids breaking apart under its strong gravity. Such infrared excesses occur when a star emits more infrared light than expected, often because warm dust surrounding it absorbs and re-radiates energy. “This discovery challenges our understanding of planetary system evolution,” said Le Bourdais. “The fact that we still see planetary debris being accreted three billion years after the star became a white dwarf suggests that asteroids, comets, and even planets can remain in orbit around these stars for a very long time.” Spectroscopic analysis—a technique that studies light to identify the chemical elements present in an object—revealed thirteen heavy elements in the star’s atmosphere: sodium, magnesium, aluminium, silicon, calcium, titanium, chromium, manganese, iron, cobalt, nickel, copper, and strontium. Normally, heavy elements sink quickly in hydrogen-rich white dwarfs, making them hard to detect. “We expected to see only a few elements, but we found dozens!” explained Le Bourdais. The research paper adds more detail. The absence of carbon features suggests the debris came from a carbon-volatile-depleted source. The abundance pattern shows slight deficits of magnesium and silicon compared to iron but otherwise resembles Earth-like material. This points to a differentiated rocky body—one whose materials have separated into distinct layers such as a metallic core and rocky mantle—with a metallic core fraction higher than Earth’s. In other words, the star is accreting the remains of a large rocky object, similar in structure to Earth or the asteroid Vesta. “White dwarfs offer one of the only ways we can directly measure the composition of exoplanets,” said Patrick Dufour, co-author and professor at Université de Montréal. “When planetary debris come too close, they are torn apart by the star’s gravity and end up polluting its atmosphere, leaving a detailed chemical fingerprint of its composition.” The team also detected weak Ca II H & K line core emission, making this only the second known isolated polluted white dwarf to show this feature. These are specific spectral signatures produced by ionised calcium and can indicate unusual physical activity in a star’s upper atmosphere. The finding suggests that extra physical processes may be happening in or above the star’s upper atmosphere. The study stresses the importance of including heavy elements in model atmosphere calculations, since leaving them out can distort the inferred structure and lead to inaccurate stellar parameters. Earlier work suggested the star’s infrared excess came from two dust rings. The new analysis shows that a single silicate dust disk—a ring composed largely of rock-forming minerals rich in silicon and oxygen—can explain the observed signal at 11.6 μm, simplifying the picture of the system’s structure. The question of how debris ended up falling into the star so late remains open. One idea is that giant planets in the system slowly destabilised smaller bodies over billions of years. Another possibility is that a passing star disturbed the orbits of debris. “Future observations with the James Webb Space Telescope or archival data found in the European Space Agency’s Gaia mission could help distinguish between a planetary rearrangement and the gravitational effect of a close stellar encounter,” said John Debes, co-author and researcher at the Space Telescope Science Institute. Dufour noted that hydrogen-rich white dwarfs are the most common type, and the coolest among them are the oldest stars in the galaxy. “We didn't have the habit of looking for signs of accretion in them. This unique case motivates us to expand our search to more of these stars.” The findings show that even after billions of years, planetary systems can remain active and complex. Substantial accretion events—the gradual accumulation of surrounding material onto a celestial object—can still occur long after a star’s death, offering a rare window into the composition and fate of distant worlds. Source: University of Montreal, IOPScience This article was generated with some help from AI and reviewed by an editor. Under Section 107 of the Copyright Act 1976, this material is used for the purpose of news reporting. Fair use is a use permitted by copyright statute that might otherwise be infringing. -
-
By +Edouard · Posted
Given the hefty price tag this thing will likely have I doubt many everyday home users will be in the market for one especially given the current climate.
-
-
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