Offset a html page with a iframe

Asked by rockyIII

Offset

Is there a way to work with iframes in oder to get an offset of an HTML page?

I just tried to embedded the html code:

<body onload=Pos100()>
<div id=xx style="position:absolute; top:-300px; left:-300px;">
<iframe src="http://www.test.com" width="1024" height="1024" name="SELFHTML_in_a_box" scrolling="no" frameborder=0
border=0>
</div>
</body>

but I just get a blinking page… any idea??

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Solved by:
rockyIII
Solved:
Last query:
Last reply:
Revision history for this message
Alex Harrington (alexharrington) said :
#1

Your onLoad event will never be called. Put your javascript code in the provided script box below the HTML box. You'll need to put the actual code for the Pos100() function in there too - unless it's some builtin function I've not come across before.

Cheers

Alex

Revision history for this message
rockyIII (rockyiii) said :
#2

It’s all about the css / div code I’m interested in order to get an offset of an html page.

when I put the html code into a extra page (like: www.xy.com/extra-page.html) and than insert this extra-page.html in to xibo all works fine…

With out this work around it just blinks – I thought because xibo can’t really handle iframes…

Revision history for this message
Alex Harrington (alexharrington) said :
#3

Xibo doesn't handle iframes at all - Internet Explorer does.

All that happens when you embed html is we fire up an instance of Internet Explorer that is the size of the region you've drawn, and tell it never to display the scroll bars.

Alex

Revision history for this message
Alex Harrington (alexharrington) said :
#4

I'm just trying your exact code out now and get the same flicking, although the offset seems to be handled correctly.

I'll get back to you.

a

Revision history for this message
rockyIII (rockyiii) said :
#5

Hmmmm… so way do I need the work around?

Revision history for this message
Alex Harrington (alexharrington) said :
#6

Don't know. It could be a IE security thing (loading iframes from a page served from the HDD)?

We'll take a look and get back to you.

Revision history for this message
Alex Harrington (alexharrington) said :
#7

OK. Putting the following code in c:\test.html:

<html>
<body>
<div id="xx" style="position:absolute; top:-50px; left:-50px;">
<iframe src="http://www.microsoft.com" width="640" height="480" name="SELFHTML_in_a_box" scrolling="no" frameborder="0" border="0">
</div>
</body>
</html>

And then loading from IE gives me a cream bar at the top warning about active content in the page.

I killed that off by ticking "Allow Active Content to run from files on My Computer" in the advanced options, however when run from inside Xibo it still seems to be refreshing every half second or so.

I'm out of ideas for now. Your work around should get things running for you today.

Dan - any ideas?

Alex

Revision history for this message
rockyIII (rockyiii) said :
#8

"Your work around should get things running for you today."

sure it does...

thanks!!!!!!!

Revision history for this message
Dan Garner (dangarner) said :
#9

After having a look I think the short answer is that we do not currently support iframes in embedded HTML... When it gets added to the InnerHTML of the webbrowser document it is not correctly loaded.

I can see a potential way to make this work by re-engineering the way embedded HTML works... basically construct the document first and save it to a locally stored web page in the Xibo library - then navigate to that document in one hit. This would have the added benefit of making onload work.

Thoughts Alex?

Revision history for this message
Alex Harrington (alexharrington) said :
#10

Makes sense to me...

--- original message ---
From: "Dan Garner" <email address hidden>
Subject: Re: [Question #82973]: Offset a html page with a iframe
Date: 16th September 2009
Time: 7:37:31 pm

Question #82973 on Xibo changed:
https://answers.launchpad.net/xibo/+question/82973

Dan Garner posted a new comment:
After having a look I think the short answer is that we do not currently
support iframes in embedded HTML... When it gets added to the InnerHTML
of the webbrowser document it is not correctly loaded.

I can see a potential way to make this work by re-engineering the way
embedded HTML works... basically construct the document first and save
it to a locally stored web page in the Xibo library - then navigate to
that document in one hit. This would have the added benefit of making
onload work.

Thoughts Alex?

--
You received this question notification because you are a member of Xibo
Developers, which is an answer contact for Xibo.

Revision history for this message
Dan Garner (dangarner) said :
#11

OK, I have created a bug report for this... it will get implemented in 1.0.4 and will support IFRAME's