通过Javascript或Jquery处理文件 [英] File handling through Javascript or Jquery

查看:64
本文介绍了通过Javascript或Jquery处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个本地网页来玩井字游戏.游戏是用Java脚本编写的.它工作正常.现在,我想将乐谱保存到XML文件(或文本或任何其他文件类型)中.谁能帮我做到这一点?我已经尝试了一些脚本,但无法正常工作.
在此先感谢.

Hi,
I have a local web page to play game of Tic Tac Toe. The game is written in Javascript. it is working fine. Now i want to save the score to an XML file (or text or any other file type). Can anyone help me doing this? I have already tried some scripts but not working fine.
Thanks in advance.

推荐答案

在网络浏览器中运行时,JavaScript在沙盒环境中执行.您将无法在不使用Web服务调用,ActiveX组件或其他一些软件的情况下将分数保存到cookie以外的任何内容.
When run in a web browser, JavaScript executes in a sandboxed environment. you won''t be able to save the score to anything other than a cookie without using a web service call, activex component or some other extra bit of software.


JavaScript没有写访问权到您的文件系统.您为什么不将其写在Cookie中?

另一个选择是使用ActiveX控制.
Javascript has no write access to your file system. Why dont you write it in a cookie?

Another option would be to go for an ActiveX contol.


这篇关于通过Javascript或Jquery处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆