HTML downloads page rather than content - html

I have been working on my website and when I tried to implement a download page, it didn't seem to work
Download as JSON file
Instead of downloading data.json, it downloaded the HTML download page. When I opened the file, rather than
{
"key":"value"
}
I found the HTML contents! How can I solve this?
Things I tried
Check for any spelling mistakes - none found
Checking syntax of entire page
Possible things that might affect whats going on
I am using Vue.js Server Side Rendering

No need to specify the argument in Download.
Try With only Download.

UPDATE
This is wrong. Keeping the answer for reference. See #tony19's comment.
The download attribute takes no argument, try
<a href="data.json" download>Download as JSON file</a>

Related

React - How to modify the html inside root?

Maybe its a stupid question but:
I have an external Typescript-React app implemented into my code, but in order to add some CSS into one particular DIV (which doesnt have .class or #id) i need to reach the HTML code thats its inside root, how can i reach this HTML code?
Obviously i am able to see the code via Dev-tools but these changes doesn’t get saved after refreshing the page, and also I don’t think that modifying the web page via dev-tools could be considered as a good practice…
I tried to find the HTML file but its not inside my files or neither inside node_modules,
Thank you in advance,
Best Regards.
React HTML is all in JavaScript. In the node_modules, look for index.js and see if you can find the className or id attribute.
Alternatively, you can go to the github repo of the component and browse the code files.

is there a place online to upload a json file and export it in html?

I have bookmarks downloaded from firefox and they are a json file.
I'm searching for a site where I can upload the json file and then download it in html format.
Does such a site exist?
THANK YOU for your kind assistance.
(Every time I do a search for this question, your site comes up.)
I don't know of a site that will do this online, but I do know of a few other ways:
You could restore them back into a Firefox profile and then export them as HTML from there, like this:
You could download and run a program like https://github.com/andreax79/json2html-bookmarks to convert them locally
You could use JavaScript to convert them in-browser, though not with an actual site, like this: Quick and dirty way to parse a mozilla firefox json file
If you need to display JSON, try with the firefox extension named jsonview.
Check out CodeBeautify, just paste and hit the Beautify button https://codebeautify.org/json-to-html-converter
There’s a lot of plugins and add ons for almost every browser out there; Firefox and especially chrome have great ones as others have mentioned, it’s worth checking out.
You are making it harder than it is. There is no JASON to HTML conversion required. Go to C:\Users\Username\AppData\Local\Google\Chrome\User Data\Default and find bookmark.file. Save it to your desktop. Uninstall the browser but also check the box that asks whether you want to keep history, etc.
Reinstall the browser, then add the bookmark.file to C:\Users\Username\AppData\Local\Google\Chrome\User Data\Default
It will overwrite the file and you have your bookmarks back. It takes about 10 minutes. No coding. No JASON to HTML conversion. Nothing.

HTML Link not working?

I'm running this jade-based app locally and I've been trying to include a ejs file in it but I was unsuccessful. So I tried to convert my ejs file to jade and again my several attempts failed.
So I thought about just creating a HTML link that takes me to the ejs page on click. Problem is when I click it, nothing happens.
Here's how I made the link:
My Link.
Linking to local resources is disabled in all modern browsers due to security restrictions.
See this answers for more details.
check if the link is really file:///
or you can use double dot notation in your link
example:
../views/account/el.js
Hope it helps

a link - force Chrome to save file instead of opening

Is it possible to force a Chrome (and maybe other browsers) to save "mpg" file link instead of trying to open it in build-in media player via html code (and not changing settings of the browser)? I could do that via PHP with additional headers, but those files are really huge sometimes, so sending them via php wouldn't be too wise.
Before getting millions of -1s, just wanted to say that I know this is really simple question, but couldn't find an answer anywhere. Maybe it's just impossible?
There seems to be a solution with HTML 5 (download attribute):
<a href="path/to/file" download>Download Now</a>

File:// link doing nothing in all browsers

I have a link being generated that looks like so:
<a target="_blank" title="Test" href="file:///c:/test.xls">Test</a>
This link is inside an iframe.
When I click on it (in any major browser), nothing happens. Fiddler records no traffic.
Pasting the URL into the nav bar works fine - the file download box comes up, and I can download the file no problem.
I've tried every variant of the URL structure (correct and incorrect, colons, slashes, backslashes, etc.) that I can think of.
I'm certain that it's some kind of security restriction, but I can't for the life of me find out what it is or how to get around it. I'm feeling pretty foolish at this point. Any simple explanations?
Sorry, if you are pulling this page off of a server (acessing it as http://), the security settings won't let you link to local content (acess links as file://). I've had this same problem accessing shared .doc files in a wiki. Never came up with a good solution.
Try a colon instead of a pipe ;)