Author Topic: iFRAME causes script error?  (Read 1684 times)

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
iFRAME causes script error?
« on: September 24, 2014, 06:20:31 AM »
So, I'm running this simple iFRAME code in an empty cell:

Code: [Select]
<p><b><u>Points Leaderboard - Top 25 Players</u></b></p>
<iframe src="https://docs.google.com/spreadsheets/d/17C1-_77cAJGq1izXzeq2wsq13pvugq9Q8Tj5XZLkTjs/pubhtml/sheet?headers=false&gid=1367889776&range=A1:D26" width="450" height="702"></iframe>

After hitting Apply on the Cell Properties dialog, it throws up this error dialog in the attachment.

The info still comes in from Google, all formatted correctly.  But the error makes me nervous.....

EDIT:
I will also point out that Google has changed their Spreadsheets starting earlier this year, and now all new sheets use this new format.  The new format also comes with with changes to the iframe code that was previously used (like the GID number for example).  So the above link go the sheet may look strange to some who are familiar to the old style.  Again, the data is being brought in fine, I wouldn't have known there was a problem unless I got the error dialog.
« Last Edit: September 24, 2014, 06:24:00 AM by SPO Director »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: iFRAME causes script error?
« Reply #1 on: September 24, 2014, 10:20:59 AM »
I wouldn't worry about the error.  It likely has something to do with HTML applications being stuck in IE7 mode, and the content being in an iframe, or both.  It's an annoyance, but that's probably all.  And unfortunately, there's nothing you can do about it.

But after reading this I did do a little work in the current version to suppress errors like this.  Seems to be working, so hopefully you won't see this error in the next version of the TD.

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
Re: iFRAME causes script error?
« Reply #2 on: September 24, 2014, 05:11:15 PM »
OK, thanks Corey.  Any idea when the next update will be?  

Annoying they are, and persistent!

EDIT: not sure if it's related. Just ran a tournament tonight and during the breaks, the clock was acting very strange. Each time the number would change it would appear on top of the previous number. And that would continue until the next screen in the set came in. Strange that it was only on my break screens, even though it uses the same clock as the rounds layout.
« Last Edit: September 25, 2014, 07:40:49 AM by SPO Director »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: iFRAME causes script error?
« Reply #3 on: September 26, 2014, 12:21:34 PM »
OK, thanks Corey.  Any idea when the next update will be?

Not yet.  It's going to be a while.  I work on it almost every day, 7 days a week, but there's a lot to be done.  The UI is being overhauled to be more resilient to IE quirks, easier development, and to allow for a variable font size on all of the configuration dialogs/screens.  Display resolutions are getting much higher and trying to read an 8pt font on a 4K display (3840 x 2160) is damn near impossible.  This requires me to change every single dialog in the application (of which, if I recall correctly, there are around 250), as well as each of the settings tabs, and a lot of other places, too.

Annoying they are, and persistent!

EDIT: not sure if it's related. Just ran a tournament tonight and during the breaks, the clock was acting very strange. Each time the number would change it would appear on top of the previous number. And that would continue until the next screen in the set came in. Strange that it was only on my break screens, even though it uses the same clock as the rounds layout.

Can't say for sure, but it sounds like an IE bug.  I ran into something similar when I created the Minimalist layout.  Several parts of the display were updated, but only some of them would actually change.  Querying the underlying contents showed that they had been updated, but IE just refused to render those parts of the screen.  Very weird.  I had to make a code change in the TD to work around that IE bug.

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
Re: iFRAME causes script error?
« Reply #4 on: September 26, 2014, 09:36:21 PM »
Quote
Not yet.  It's going to be a while.
Totally get it.  I was just curious if it was going to be a small incremental update in the near future, or wait until the next overhaul.  Love your work... no rush.

Quote
Can't say for sure, but it sounds like an IE bug.
Well, its not that it isn't updating the clock, as I see every number tick away that should be there.  Its not clearing the previous number after it adds the new one.  So they kind of pile up on top of each other.  Whats even stranger is that it only happens on the break screen.  Every other instance that uses the <clock>, it displays fine.  Screenshot attatched....

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: iFRAME causes script error?
« Reply #5 on: September 27, 2014, 07:33:57 PM »
Quote
Not yet.  It's going to be a while.
Totally get it.  I was just curious if it was going to be a small incremental update in the near future, or wait until the next overhaul.  Love your work... no rush.

No worries.  I just like to take the opportunity, when presented, to let people know that even though nothing appears to be happening, I am in fact hard at work on new stuff.  :)

Quote
Can't say for sure, but it sounds like an IE bug.
Well, its not that it isn't updating the clock, as I see every number tick away that should be there.  Its not clearing the previous number after it adds the new one.  So they kind of pile up on top of each other.  Whats even stranger is that it only happens on the break screen.  Every other instance that uses the <clock>, it displays fine.  Screenshot attatched....

I'm even more convinced it's an IE thing now.  The TD, when updating the clock, doesn't (for example) render a new clock and place it over the old one, then get rid of the old one.  It actually changes the underlying representation of the clock and IE is supposed to render it.  To make the numbers stack up like that would actually take extra work!  Would you mind posting your layout (or emailing it to me if you'd rather not post it)?  I'd like to take a look at it.

I went back and revisited my notes for the Minimalist layout and saw that it depended on a few things, like size of the screen, and the fact that layout scaling was enabled.  Making one of the floating icons (keyboard lock, screen lock, etc) appear would cause the bug to go away, but only when those icons were positioned in certain places (didn't affect anything if they were in the upper-left corner but did if I moved them to any of the other corners).  Strange stuff.  Even stranger, to work around the bug in code, I discovered all I had to do was measure the size of the screen.  Literally just querying the dimensions of the screen caused it to stop happening.  The embodiment of the Heisenberg uncertainty principal right here in the TD!  Ok not really, but kind of.  :)

And thanks to a quick Wikipedia search, I now understand it is actually just the "observer effect", and not the Heisenberg uncertainty principal.  boooo Wikipedia  :)

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
Re: iFRAME causes script error?
« Reply #6 on: September 27, 2014, 08:25:06 PM »
Here's the layout.  I've also tried to update everything having to do with Windows.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: iFRAME causes script error?
« Reply #7 on: September 28, 2014, 03:45:56 PM »
That's awesome.  Definitely an IE bug.  I played around with it and saw lots of weird stuff.  Sometimes, switching between screens (using the number keys) would do what you would expect and display the selected screen, and sometimes it would leave the current screen in place and display the selected screen on top of the previous screen (much like the stacking numbers).  Interestingly it seems the issue goes away when any text that does NOT have a shadow is displayed on the screen.   ???

So try this (I'm away from my office so I'm writing this from memory, so it may not be perfect):

- Create a new cell.  Don't change any of the cell's settings, just give it a name.
- For the contents of the cell, paste the following:

<div style="font-size: 0pt; width: 1px; overflow: hidden">Some text</div>

- Add the cell to any screen you're experiencing that issue

This will render some other text without a shadow on the screen, and for me anyway that cause the issue to completely stop happening.  The text will be so small you can barely see it, and you can then actually edit the cell and set the font color to the same color as the screen's background (or set it to transparent - maybe) so you won't even see it.  You can't set the text to just spaces or even &nbsp; (HTML for non-breaking space), or make it invisible or hidden or else the bug still happens.

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
Re: iFRAME causes script error?
« Reply #8 on: September 28, 2014, 05:52:25 PM »
Success!!!!  THanks for digging through this Corey, your work-around fixed the issue.

Now if only that annoying pop-up with the iFRAME error would stop coming up everytime that screen loads.....

 ;)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5380
    • View Profile
Re: iFRAME causes script error?
« Reply #9 on: September 29, 2014, 10:48:49 AM »
No problem.  And I did spend some time trying to suppress the error message, but I wasn't successful.  And IE is so dang inconsistent, it's really frustrating.  It works fine from within the TD application, and I applied the same method directly to a page with your iframe code, but it didn't work.  I have no idea why.  Just doesn't make any sense to me.

SPO Director

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Seattle Poker Open
Re: iFRAME causes script error?
« Reply #10 on: September 29, 2014, 04:04:49 PM »
I'm guessing that it has something to do with the new way Google is treating their Sheets.  With the new format roll-out starting back in March, this is the first time I've been 'forced' into the new format when creating a new spreadsheet.  I have several 'old format' iFRAMEs that work like a charm, and it wasn't until this one that I had any issues.  Maybe MS will roll out an update to compensate.

If I find anything in the future I'll report back here.