我可以使用文本文件离线加载事件吗
我想加载一个我保存为纯文本(文件)的 div。我将此文件与 HTML 页面放在同一根目录中。在我的 HTML 页面上,我尝试使用 Jquery 事件加载来调用此文件,如下所示:
$("#tab2").load("textfile");
它不起作用。是否有必要在服务器上在线执行此操作?我把它保存为文本文件是不是做错了什么?我应该保存为 html,这在代码中会是什么样子?
I want to load a div which I have saved as plain text(file). I have this file in the same root as my HTML page. On my HTML page I'm trying to call this file with Jquery event load, like this:
$("#tab2").load("textfile");
It doesn't work. Is it necessary to do this online, on a server? I'm I doing something wrong saving it as a text file? Should I save as html, how would this look like in the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ref: http://api.jquery.com/load/
是的,它必须位于服务器上
ref: http://api.jquery.com/load/
yes it has to be on the server