https://wangdoc.com/javascript/oop/new.html
export 和export default
使用export
导出的接口,在 其他页面import 需要时候需要{}
引入,使用export default
导出的接口,对象不需要使用{}
引入,export default
为模块导出接口。
xmlhtprequest在ie11中出现缓存问题。
解决:在xmlhttprequset.open()
后面加xmlhttprequset.setRequestHeader("If-Modified-Since","0")
XmlHttpRequest跨域的问题
本地tomcat的config-》web.xml目录的445行左右添加
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.headers</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.exposed.headers</param-name>
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>