Changing permanently html values using javascript?
Is it possible to change a html value permanently via javascript? I'm accessing a local file.
These are my codes:
function switchPic(){
top.topPage.activeDef = top.topPage.document.getElementById('h1');
top.topPage.ac开发者_高级运维tiveDef.href = "pic2.html";
}
If by "permanently" you mean changing the HTML file (on the server), the answer is no, you cannot do that with client-side JavaScript.
No, this is not possible.
Javascript in the browser is insulated from the local file system (sandboxed) for security reasons.
精彩评论