简体   繁体   English

跨域JavaScript

[英]cross-domain javascript

I am producing a javascript-based widget. 我正在生产一个基于JavaScript的小部件。 Nothing complex just a few document.writes... 没有什么复杂的只是几个document.writes ...

When I place it inline in the page it renders fine in all browsers. 当我将其内嵌在页面中时,它在所有浏览器中都可以正常显示。 When I place it externally and load it via <script src="http://example.com/path/to/site"/> it fails to render in Firefox and IE but not Chrome. 当我将其放置在外部并通过<script src="http://example.com/path/to/site"/>加载时,它无法在Firefox和IE中呈现,但不能在Chrome中呈现。

Anyone know why and a possible workaround? 有人知道原因以及可能的解决方法吗?

也许您应该使用</script>而不是XML样式将其关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM