时间:2021-07-01 10:21:17 帮助过:30人阅读
header('Content-type:text/html');
include'test.html';
?>
test.html
<html><head><metahttp-equiv="Content-Type"content="text/html; charset=GB18030"><scripttype ="text/javascript">functioncubeme(incomingNum){if(incomingNum ==1){
return"what are you doing ?";
}else{
returnMath.pow(incomingNum,3);
}
}
script><title>JavaScript Testtitle>head><body><scripttype ="text/javascript">var theNum =2;
var finalNum =cubeme(theNum);
if(isNaN(finalNum)){
alert("You should know that 1 to any power is 1.");
}
else{
alert("when cubed ," + theNum + "is" + finalNum);
}
script>body>html>
运行结果如下:
以上就介绍了php开发之javascript第一个程序,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。