if (data.match(/^[0-9]+$/)

there is an error in this line