简体   繁体   English

如何使用JavaScript从iframe小部件获取外汇数据

[英]How to get forex data from iframe widget using javascript

I'm working on forex programming. 我正在从事外汇编程。 My coding work find with demo datasource. 我的编码工作与演示数据源一起找到。 Anyway, I found free forex data widget (iframe) called by javascript as below. 无论如何,我发现由javascript调用的免费外汇数据小部件(iframe)如下。

<script src="https://1forge.com/widget-cdn/forex-ticker/main.js" type="text/javascript"></script>
<div id="forex-ticker"></div> 
<script>
    ForexTicker.init(
    {
        pairs: ["EURUSD", "USDJPY", "GBPUSD", "USDCHF", "EURCHF", "AUDUSD"],
        theme: "dark", //this can be "light" or "dark" 
        margin: "10px",
        width: "100%",
        height: "600px",
  });
</script>

My silly question, Is it possible to get these iframe's data using javascript?. 我的愚蠢问题:是否可以使用javascript获取这些iframe数据? Any advice or guidance on this would be greatly appreciated, Thanks 任何建议或指导对此将不胜感激,谢谢

If the iframe is on another domain, then by default you have no access to anything found inside. 如果iframe在另一个域上,则默认情况下您无权访问其中的任何内容。 You will need to see if ForexTicker offers some sort of API to access things from within. 您将需要查看ForexTicker提供某种API来从内部访问事物。

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

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