မီႇတီႇယႃႇဝီႇၶီႇ:Gadget-LegacyScriptsNewNode.js

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး

မၢႆတွင်း: ဝၢႆးသေသိမ်းပၼ်ယဝ်ႉ၊ တွၼ်ႈတႃႇ ၸဝ်ႈၵဝ်ႇ တေႁၼ်လႆႈ လွင်ႈလႅၵ်ႈလၢႆႈၼၼ်ႉ ၸဝ်ႈၵဝ်ႇတေၸၢင်ႈလႆႈလတ်းၶၢမ်ႈ ၶႅတ်ႉၶျ် တူဝ်ပိုတ်ႇဝႅပ်ႉၸဝ်ႈၵဝ်ႇယဝ်ႉ။

  • ၽွင်းမိူဝ်ႈတိုၵ်ႉၼဵၵ်း Reload တီႈ Firefox / Safari: ၼၼ်ႉ ၼဵၵ်းဝႆႉပႃး Shift ၊ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5 ဢမ်ႇၼၼ် Ctrl-R (တီႈၼႂ်း Mac ၼႆ ၼဵၵ်းပၼ်⌘-R)
  • တီႈၼႂ်း Google Chrome: ၼဵၵ်းပၼ် Ctrl-Shift-R (တီႈၼႂ်း Mac ၼႆႉ ၼဵၵ်းပၼ်⌘-Shift-R )
  • ၽွင်းမိူဝ်ႈ တိုၵ်ႉၼဵၵ်း Refreshတီႈ Internet Explorer/ Edge: ၼဵၵ်းဝႆႉပၼ် Ctrl ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5
  • တီႈၼႂ်း Opera: ၵႂႃႇၸူးတီႈ Menu → Settings (ပေႃးပဵၼ်တီႈၼႂ်း Mac ၸိုင် Opera → Preferences ) သေ သိုပ်ႇၵႂႃႇ Privacy & security → Clear browsing data → Cached images and files ၼၼ်ႉလႄႈ။
// this script is deprecated do not use newNode function! use jQuery instead

/**
 * Create a new DOM node for the current document.
 *    Basic usage:
 *        var mySpan = newNode('span', "Hello World!")
 *    Supports attributes and event handlers:
 *        var mySpan = newNode('span', {style:"color: red", focus: function(){alert(this)}, id:"hello"}, "World, Hello!")
 *    Also allows nesting to create trees:
 *        var myPar = newNode('p', newNode('b',{style:"color: blue"},"Hello"), mySpan)
 **/

var newNode = window.newNode = function newNode(tagname) {
	var node = document.createElement(tagname);

	for (var i = 1; i < arguments.length; i++) {
		var argument = arguments[i];
		if (typeof argument == 'string') { //Text
			node.appendChild(document.createTextNode(argument));
		} else if (typeof argument == 'object') {
			if (argument instanceof Node) { // If it is a DOM Node
				node.appendChild(argument);
			} else { // Attributes (hopefully)
				for (var j in argument) {
					if (j === 'class') { // Classname different because...
						node.className = argument[j];
					} else if (j == 'style') { // Style is special
						node.style.cssText = argument[j];
					} else if (typeof argument[j] == 'function') { // Basic event handlers
						node.addEventListener(j, argument[j], false);
					} else {
						node.setAttribute(j, argument[j]); //Normal attributes
					}
				}
			}
		}
	}
 
	return node;
};