sublime默认打开的html文件使用的是file协议。
SublimeServer可以为我们启动静态服务器,这样就可以发送ajax请求,当然也可以直接打开我们html文件。
Content-type:application/octet-stream
{ "attempts": 5, "autorun": false, "defaultExtension": ".html", "interval": 500, "mimetypes": { "": "application/octet-stream", ".c": "text/plain", ".h": "text/plain", ".json": "application/json", // 增加支持json文件的打开方式 ".py": "text/plain" }, "port": 8080 //端口号 }
{ "default_browser": "chrome" }
- 在index.html文件中右击选择 view in SublimeServer
原文:https://www.cnblogs.com/yimiflh/p/9280655.html