Using javascript to add a new row in a google docs spreadsheet

I would like to be able to have a web page that when a button is pressed it adds a row to a google spreadsheet.
I’ve been reading evrything but havnt quite got there.
Here is my current code can anyone help me to get this working:

function addScore(varName, varScore){
    var spreadSheet = SpreadsheetApp.openById("idhere");
    var sheet = ss.getSheetByName("Sheet1");
    var lastRowIndex = sheet.getLastRow();

  // add a new row
  sheet.getRange("B" + lastRowIndex).setValue(varName);
  sheet.getRange("C" + lastRowIndex).setValue(varScore);

function init(){
    addScore("Lee", 778);

<script src=""></script>