JavaScript - Smilie Fuction
The smilie fuction i write does not work, it does not has reaction when i click a smile image, could anyone help!!!
Code: function smilie (text) { var txtarea = document.post.body; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } <a href="javascript:smilie(':)')"> <img src="./images/smile.gif" alt="smile" title="smile" /></a> <a href="javascript:smilie(':D')"> <img src="./images/biggrin.gif" alt="big grin" title="big grin"/></a> <a href="javascript:smilie(':p')"> Similar Tutorialshow would you make a if that created a button with a function.... heres the make button function Code: var makeButton = function () { var e = document.getElementById('buttonhere'); var i = '<input type="button" value="Click me!" onclick="PickUpSword()" />'; e.innerHTML = i; } Hi i need to use an equivalent of the php function array_count_values() Any help with that please cheers ewire |