html - Writing to a file while file is open in a browser using JavaScript -
I was wondering if Javascript has the ability to write a file that is open in the browser. Developing a page of links I use (for fun, not required). Currently I'm trying to develop something where the user can type a link and a name in the text box, and the link can be saved in the HTML file itself, with a javascript link and a clear form to add a name to the page. Easier than, but explicitly once the session is over, the session will not be added, when the page will be reused. I want to do it this way because I do not have to find and load the file every time I want to add a new link. It will be very easy to use PHP and MySQL, but this file is not running on any server
So, in a nutshell, it is possible to save the file when it is modified from the current session?
My code is below:
& lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Add function (link, name) {htmlstring = "& lt; a href = '" + link + "'> & gt; + Name + "& lt; / a & gt;"; Document.getElementById ('urlsdiv'). InnerHTML + = htmlstring; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input type = "button" onclick = "validate (document.getElementById ('valid box'. Value)" value = "check"> input type = "text" id = "Addname" & gt; // Type to type new URL & lt; input type = "text" id = "addbox" & gt; // box & input; type = "value" Add new link to the value = "Add" & gt; // & lt; a href = "" "" add "http: //www.facebook.com" & gt; Facebook & lt; / a & gt; / These three links & lt; a href = "http://www.youtube.com" & gt; YouTube & lt; / a & gt; // have already been hard-coded & lt; a href = "Https://mail.google.com" & gt; Gmail & lt; / a & gt; // in the file &
Javascript in the browser is in a security sandbox, and does not have access to the file system outside of the fields contained in it, which allows it to access at present, even those Also for the API.
Note that due to the new implementation of Javascript, I have made a distinction between javascript inside browser, like
Comments
Post a Comment