I've looked over a lot of similar questions about this and haven't gotten it to do anything, in spite of 'judiciously imitating' a lot of different implementations, so I figured I'd go ahead and bite the bullet and ask here before I waste any more time.
The page is meant to be a hybrid design, with both AJAX and non-JS functionality in place to send a form to a PHP file. The regular non-AJAX version works fine. With JS enabled, it uses <script> to pull up a script file with the following contents:
window.onload = newButton();
function newButton(){
var button = document.createElement('button');
button.innerHTML = 'jButton';
button.onclick = process();
document.getElementById('sro').appendChild(button);
// sro being the id of the form.
};
function process() {
// php form handling stuff
}
The button is supposed to send data to the PHP file, but instead, it just refreshes the page.