我可以离线使用事件加载文本文件吗 [英] can I use event load offline with text file
本文介绍了我可以离线使用事件加载文本文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想加载一个保存为纯文本(文件)的div.我将此文件与HTML页面放在同一根目录中.在我的HTML页面上,我试图使用Jquery事件加载调用此文件,如下所示:
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");
它不起作用.是否有必要在服务器上在线进行此操作?我在将其另存为文本文件时做错了吗?我应该另存为html,代码中的外观如何?
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?
推荐答案
Load data from the server and place the returned HTML into the matched element.
ref: http://api.jquery.com/load/
是的,它必须在服务器上
yes it has to be on the server
这篇关于我可以离线使用事件加载文本文件吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文