写的第一个较有意义Javascript程序
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript</title>
<script language="javascript">
document.onclick=function ()
{
var div=document.createElement("div");
div.style.width="600";
div.style.height="50";
div.innerHTML="Pleasure to meet you!";
div.style.backgroundColor="#fdadcc";
document.body.appendChild(div);
}
</script>
</head>
<body>
</body>
</html>
相关文档:
<mce:script language=javascript><!--
var a=0;
// --></mce:script>
<?php
function func1()
{
$t="a=a+1;";
return $t."alert(a)";
}
?>
<?php
echo "<input type=button value='Sure' onclick=\"".func1()."\">";
?> ......
在asp.net开发中,经常会用到后台和前台的交互,就此总结了一点c#和javascript相互操作的方法
1.在后台c#代码中调用jacascript的方法
javascript代码:
<script type="text/javascript" language="javascript">
function test()
{
alert("oec2003");
return false;
}
</s ......
JavaScript中有四种不同类型的循环,for循环、do-while循环和while循环。(第四种类型为for-in循环,用于迭代对象的属性,本文不予讨论。)代码如下:
var values = [1, 2, 3, 4, 5];
//for 循环
for(var i=0; i<values.length; i++){
process(values[i]);
}
//do-while 循环
var j=0;
do{
process(values[j++] ......
test1.htnl
<script type="text/javascript">
function get(){
var ifr1 = window.parent.document.getElementById('test2Frm');
var b1 = ifr1.contentWindow.document.get ......