how to write local file via javascript using firefox [duplicate] - javascript

This question already has answers here:
In Firefox, Write to a File using Javascript?
(4 answers)
Closed 7 years ago.
May I ask, is it possible to write local file via javascript using firefox.
Something like ActiveXObject("Scripting.FileSystemObject") in IE.
Thank you very much

Easy way is to send the file to Firefox as a download. So user can choose where to store this file.
Navigators can not act directly on local file system because of security implications!

Related

Loading json data from file, using js locally [duplicate]

This question already has answers here:
jQuery how to load some json records into a form fields?
(4 answers)
Loading local JSON file
(26 answers)
Closed 4 years ago.
I have 3 files: formData.json, myForm.html, and form.js.
How can I take data from .json using JavaScript, and load it to my HTML form without any kind of server, just using Chrome? Is it even possible? Thanks.
Yes, it is possible, but probably requires an entire tutorial rather than a simple answer, and many choices to be made depending on your requirements and experience.
See if this other answer helps.

protecting selenium from detection [duplicate]

This question already has answers here:
Can a website detect when you are using Selenium with chromedriver?
(25 answers)
Chrome browser initiated through ChromeDriver gets detected
(2 answers)
Closed 4 years ago.
I am trying to crawl a couple of website pages to use their information and I can only use things like selenium that has chromium to do that
Now I am trying to hide it from the website owners because I don't want to get banned. some people are talking about changing some variable names called cdc_ inside of chromdriver and I can't understand how to do it
Also I am using python for this
EDIT : My problem is that I can't change the variable of cdc_ or any other variables in chrome driver because I don't know how
any method so I can hide the fact that I am using selenium!
Please help me here
Thank you for your time

Copy data to clipboard with js / jquery [duplicate]

This question already has answers here:
How do I copy to the clipboard in JavaScript?
(27 answers)
Closed 8 years ago.
I'm writing a code and I display to the user a table with data from DB.
The user can copy all the data manually, but I want to add a button that copy automatically the data to clipboard.
How can I do this?
Thanks!
You cannot do this with javascript.
There is no browser that can allow that. It's a security issue.
If you are good with JQuery, use this Library
P.S Although it raise a security concern, most of the browsers doesn't allow it.

Why are there numbers after the question mark in some JS/CSS URLs? [duplicate]

This question already has answers here:
CSS: What does the question mark at the end of css do?
(7 answers)
What does "styles.css?=121" mean in this html code? [duplicate]
(2 answers)
Closed 8 years ago.
Why do use like this filename.css?2 or filename.js?4
What are those numbers after question mark?
I did research online but I didn't find any answer.
Thanks!
These are called cache busters.
Usually, when a browser downloads a file (CSS, JS, etc.) it caches it so that it doesn't have to download it later.
However, this is a problem when you decide to update your file, because the browser thinks it already has the latest version. To work around it, we use the cache busters. When you make a change to the file, you also change the number after the question marks, which tricks the browser into thinking this is a different file for which it doesn't have a cache it, and forces a re-download.
Sometimes JS scripts are created on the fly using server side technologies other times it is simply a version number to help with browser caching issues

Javascript: How to load JSON object as a file without jQuery or AJAX? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to parse JSON using NodeJS?
I am running a server. The code is run on the server with Node.js -- never run in a browser.
How can I load a JSON file ("data.json") into javascript code as a javascript object? Should I just use jQuery/AJAX to do this? Is there a simple way with plain js? Thanks in advance! BTW I searched for this on both Google and this website without any clear answers.
Have a look at this
Read the whole contents of the file, and then just parse it.
Have a look at this question.

Categories

Resources