How to solve a problem with base tag?

大憨熊 提交于 2019-12-01 20:38:27

How can I solve it?

Want my opinion? Don't use base. Exactly for the reason presented here: It creates confusion, and influences other parts of the system in a way that is extremely difficult to debug. (Although I didn't know it even influences relative AJAX calls.)

I would define a web root in Smarty, and prepend that for every image URL in the document. Changing the web root remains easy, but the browser is given absolute URLs.

You could, however, also solve this by providing an absolute URL in the Ajax request and leave the base in place.

$.get("http://domain.com/application/soft/calendar_month_change.php", ...)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!