Zdravicko...Preco mi pri vytvoreni tlacitka a kliknuti nan reloadne stranku a aj v pripade ak som si uz onclick alokoval pre inu cinnost?
<pre>
function set_alarm() {
var hours = new String();
var mins = new String();
var secs = new String();
var day = new String();
hours = document.getElementById('hour_id').value;
mins = document.getElementById('min_id').value;
secs = document.getElementById('sec_id').value;
day = document.getElementById('day_id').value;
var result = new String('Budik : '+ day + ' ' + hours + ':' + mins + ':' + secs);
var time_button = document.createElement("BUTTON");
var time_result = document.createTextNode(result);
time_button.appendChild(time_result);
document.getElementById('result_cloack_area').appendChild(time_button);
var len = document.getElementById('result_cloack_area');
for(var x = 0 ; x<len.childNodes.length;x++)
{
len.childNodes[x].setAttribute('onclick' , 'nieco()');
}
}
function nieco() {
alert("aaa");
}
</pre>
Treba potlačiť štandartné správanie onclick="return false; nieco();", alebo naopak, onclick="nieco(); return false;" to si vyskúšaj. Teda prehoď si to do toho svojho javascriptu v tejto logike.