Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaving off another byte, with document.write #6

Closed
wants to merge 1 commit into from

Conversation

pci
Copy link

@pci pci commented Jun 18, 2012

By using document.write to write the ending score the body doesn't need an id, overall saving a byte. The canvas is removed because the document.write is called after the page is loaded, implicitly calling document.open and creating a new page.

@pci
Copy link
Author

pci commented Jun 18, 2012

Well it turns out Chrome keeps the timer attached and is happy to keep doing document,writes until the cows come home (i.e. it fills the screen)!

@pci pci closed this Jun 18, 2012
@alokmenghrajani
Copy link
Owner

very cool! Too bad it doesn't work in chrome. It does work in firefox.

@pci
Copy link
Author

pci commented Jun 18, 2012

Agreed, I'd even managed to get a rhyme in the commit message and everything :)

My guess would be that although it creates a new page that the setInterval is still attached and so continues to spew document.write's and for some reason in chrome each new message doesn't clear the older messages.

It's a great project though, and very surreal that this comment is longer than the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants