Progress #4

Currently doing JavaScript30. It’s a free course. 1 JavaScript project per day for 30 days.

Doing project number 11 – Custom HTML5 Video Player
In Chrome (ver 58), it doesn’t display the play, pause and etc buttons. It show’s weird characters instead of a play button.
play

Tried to getElementById but got really messy.

document.getElementById('A1').value = '►';
document.getElementById('A1').value = '❚❚';

JS30 Tutorial:
In the scripts.js file. Under the function..

function updateButton() {

const icon = this.paused ? '►' : '❚❚';

Solution:

const icon = this.paused ? '\u25ba' : '\u275A\u275A';

But then again, I changed it back to ascii form ► and now I can see it. Very odd bug!!
Maybe, it’s Chrome first time not seeing it. Changed the symbol with a different source code and changed it back again now works.

Rookie Mistake:
Syntax error. Missed the word “All”. Haha!!

player.querySelector
meant to be:
player.querySelectorAll

 

Via http://stackoverflow.com/questions/16930905/why-does-the-html-symbol-for-%E2%96%B6-not-work-in-document-title

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s