Home  >  Article  >  Web Front-end  >  Some special usage of javascript_javascript skills

Some special usage of javascript_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:04:14908browse

, can be exchanged like:



Two functions can be exchanged, just like ordinary variables. <script> <BR> /*function update() <BR> { <BR> var name = dwr.util.getValue("demoName"); <BR> Demo.sayHello(name, function(data){ <BR> dwr.util.setValue("demoReply", data); <BR> dwr.util.setValue("demoReply2",data); <BR> }); <BR> }*/ <BR> /* <BR> function setData(data) <BR> { <BR> dwr.util.setValue("demoReply", data); <BR> dwr.util.setValue("demoReply2",data); <BR> } <BR> function update() <BR> { <BR> var name = dwr.util.getValue("demoName"); <BR> Demo.sayHello(name,setData); <BR> } <BR> */ <BR> function update() <BR> { <BR> var name = dwr.util.getValue("demoName"); <BR> var name2 = $("demoName").value; <BR> var name3 = document.getElementById("demoName").value; <BR> alert(name2+name3+name); <BR> Demo.sayHello(name,{ <BR> callback:function(data) <BR> { <BR> dwr.util.setValue("demoReply",data); <BR> dwr.util.setValue("demoReply2",data); <BR> } <BR> }); <BR> } <BR> hot = function hot(){ alert("Sweat.");} <BR> cold = function cold(){ alert("Shiver.");} <BR> function swap() <BR> { <BR> temp = hot; <BR> hot = cold; <BR> cold = temp; <BR> alert("Swap."); <BR> } <BR> </script>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn