iOS will only let you start playing sound with the Web Audio API as a result of a user action.
Try putting that code inside of some kind of event handler.
var elem = document.getElementById('play'),
audioContext = new (window.AudioContext || window.webkitAudioContext),
osc = audioContext.createOscillator();
osc.connect(audioContext.destination);
if (osc.noteOn) osc.start = osc.noteOn
osc.frequency.value = 440;
play.addEventListener('click', function() {
osc.start(0);
}, false);