简体   繁体   English

HTML页面被添加到iFrame中

[英]HTML page gets added inside an iFrame

I have created an iFrame in a gwt. 我已经在gwt中创建了一个iFrame。 I need to plot some SVG in that IFrame. 我需要在该IFrame中绘制一些SVG。 Here is what I am doing 1. create an IFrame 2. make a call to jsp file which calls to several other js files. 这是我在做什么1.创建一个IFrame 2.调用jsp文件,该文件将调用其他几个js文件。 3. the graphics gets plotted 3.图形被绘制

Problem- I am expecting all the graphic to be on the iFrame while, it is actually creating a new HTML page itself inside the iFrame. 问题-我期望所有图形都在iFrame上,而实际上它是在iFrame内自己创建一个新的HTML页面。 How can I stop this. 我该如何制止。 As well, the new HTML page does not show me the scroll bar, how can i add that, because all my graphics is flowing out and not visible to me. 同样,新的HTML页面没有显示滚动条,我该如何添加呢,因为我所有的图形都流出了,并且对我不可见。 Is there a way to do so. 有没有办法做到这一点。 Please help me with some pointers. 请给我一些指导。

I am not sure how to copy the code, so I have not done so. 我不确定如何复制代码,所以我没有这样做。

Thanks! 谢谢!

  <html>
  <head>
  <script type="text/javascript">
   alert("Inside the jsp file");
   var criticalPath = window.top.criticalPath;

   </script>
   </head>
   <body>
   <script type="text/javascript" src="./js/flow.js"></script>          
   </body>
   </html>

Consider the above code where flow.js is plotting the pie chart. 考虑上面的代码,其中flow.js正在绘制饼图。 Now all this code is written in a jsp file. 现在,所有这些代码都写在一个jsp文件中。 This jsp code is called from a gwt code from an iframe. 从iframe的gwt代码调用此jsp代码。 Now i wanted this pie chart to be in iFrame but instead it is creating new HTML page inside the iFrame as 现在,我希望此饼图位于iFrame中,但它正在iFrame中创建新的HTML页面,如下所示:

     <iFrame>
     <html>
             ..........
     </html>
     </iFrame>

I dont want this to happen. 我不希望这种情况发生。 As well the new html that is created inside the iFrame does not have the scroll bar as my piechart is loosing its focus. 同样,在iFrame中创建的新html没有滚动条,因为我的饼图失去了焦点。 Why is this happening? 为什么会这样呢? Any reason? 任何原因?

iFrame always contains an HTML document. iFrame始终包含HTML文档。 This what iFrame tag was created for. 这就是为iFrame标签创建的。 Your jsp file renders as an HTML document inside of this iFrame. 您的jsp文件在此iFrame中呈现为HTML文档。

To add scrollbars, add CSS to your jsp file. 要添加滚动条,请将CSS添加到您的jsp文件中。 Set overflow: auto on an element that contains your svg image. 在包含您的SVG图片的元素上设置溢出:自动。

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

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