想要将angular js应用程序集成到第三方网站中。Iframes是一种可能的解决方案。想知道是否有更好的方法来集成angularjs应用程序。
在第三方应用程序中插入一个java脚本文件,并添加一个iframe插入代码
var finalEmbedCode = "<iframe src="https://www.example.com/home/?product=false&config=" + someConfig + "" n height="" + iframeHeight + " px"n width= "" + iframeWidth + " px"n frameborder="0"n style="border: 0;"></iframe>";
document.getElementById("insert-on-this-id").innerHTML = finalEmbedCode;
product和config是查询参数,您可能需要也可能不需要。
把上面的代码放在一个js文件中,"insert-on-this-id"
是一个html上的id元素,你可以通过js文件添加,也可以从party party应用程序中添加,如果你想使用它,任何网站或博客都很难找到。
干杯!!