can I use event load offline with text file

Deadly 提交于 2019-12-24 21:04:20

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/7100462/can-i-use-event-load-offline-with-text-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!