views:

133

answers:

0

I am getting re-execution of imported js files upon a hitting a form button which calls a function to insert a DOM element into page ( in simulation to exe of an ajx callback function). The DOM insertion causes a page refresh which re-requests all files from server.

Nothing big on the function call:

var addFashionVideo = function() {

var nodeContainer = document.getElementById('vidList'); var mytitle = document.forms.addVideo.newVidName.value; var addTextNode = document.createTextNode(mytitle); var newLI = document.createElement('LI'); newLI.appendChild(addTextNode); nodeContainer.appendChild(newLI);

return this;

};

TARGET DIV for DOM update code is :

  • Watch Fashion Paris Video

  • I place an alert on this page and after the function attempts to insert the new LI [ oddly the LI appears for a split second then disappears ] a page refresh is triggered and my alert on the page re-executes.

    // Perhaps Maybe I have a browser issue on this computer or I am just to new of a scripter // to not see the problem...any comment appreciated.