Philoking.com

20 Sep, 2008

Code Snippet Example for Live Writer

Posted by: Jason Burns In: Web Authoring

   1: <script type="text/javascript">
   2:             
   3:             window.onload = function() {
   4:  
   5:                 //define message default
   6:                 document.getElementById('message').innerHTML = "(please press a button...)";
   7:  
   8:                 //setup events
   9:                 document.getElementById('btnStart').onclick = playIt;
  10:                 document.getElementById('btnStop').onclick = stopIt;
  11:  
  12:             }
  13:  
  14:             function playIt() {
  15:                 document.getElementById('message').innerHTML = "you pressed PLAY";
  16:                 document.getElementById('btnStart').style.backgroundColor = 'yellow';
  17:                 document.getElementById('btnStop').style.backgroundColor = '#ccc';
  18:             }
  19:  
  20:             function stopIt() {
  21:                 document.getElementById('message').innerHTML = "you pressed STOP";
  22:                 document.getElementById('btnStart').style.backgroundColor = '#ccc';
  23:                 document.getElementById('btnStop').style.backgroundColor = 'yellow';
  24:             }
  25:             
  26:  
  27:         </script>

Get the plugin here.

No Responses to "Code Snippet Example for Live Writer"

Comment Form


About

jbpic I am a software engineer, blogger, photographer, musician, technology enthusiast, father, husband, brother, son and obsessive compulsive weirdo. I enjoy riding bikes, watching movies, listening to music and reading like a mad man. If any of these topics interest you, you have come to the right place!

Flickr


Feeds

  • View in iTunes
  • Any Podcatcher
  • Any Feed Reader