Get Etherpad Pad contents in Javascript

function getElementByIdInFrames(id, base) {
  var el;
  if(el = base.document.getElementById(id)) {
    return el;

  for(var i = 0, len = base.frames.length; i < len; i++) {
    if(el = getElementByIdInFrames(id, base.frames[i])) {
      return el;
getElementByIdInFrames("innerdocbody", window).innerHTML;

This means you can also do…

getElementByIdInFrames("innerdocbody", window).innerHTML = "Superducky";

And if you want to use jQuery a one liner will sort you out..


NOTE: Due to a change in the jQuery API a . after iframe was removed — 10/02/2013

Means you can do..


Thanks to Mark Fisher for the jQuery example

Ajax CSV upload to a Table with jQuery and PHP

So I had to write a new user importer for School Email and I was looking for a simple plugin in solution but didn’t find one so here is a simple way of uploading a csv file that is uploaded to a file and rendered to a table..

Projects used: CsvToTable & jQuery File Upload & Editable Grid *optional for live edits.

Grab those two projects, grab the below files and put them in a /js folder then put the .js files into your head..

Put the jQuery-File-Upload folder in your root, we will be uploading files to here.. You may want to add a layer of security in front of the upload function.

<script src="/js/csvToTable.js"></script>
<script src="/js/jquery.iframe-transport.js"></script>
<script src="/js/jquery.fileupload.js"></script>

At the bottom of your body add..

<div id="csvToTable"></div>
<div id="fileupload"></div>
var loggedIn = 1; // you will want to modify this if you require auth
$(function () {
  if(loggedIn == "1"){
      dataType: 'json',
      acceptFileTypes: '/(csv)$/i',
      url: '/jQuery-File-Upload/php/index.php',
      done: function (e, data, Users) {
        $.each(data.result, function(index, file){
          $('#csvToTable').CSVToTable(file.url).bind("loadComplete",function() {
            console.log("Loaded data into table");

            Call functions to manipulate data here


Want to make your table editor like the rest of the cool kids? Check out this jQuery plugin