今天研究下 html 的js脚本,如何再html里调用js脚本里的函数。
以下是html的内容。
<!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" />
<link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css" />
<script type="text/javascript" src="../ext-all.js"></script>
<script type="text/javascript" src="windows.js"></script>
<script type="text/javascript">
Ext.onReady(main);
function main()
{
now_windows();
};
</script>
</head>
<body>
</body>
</html>
以下是js脚本的内容
now_windows=function(){
Ext.create('Ext.panel.Panel', {
title: 'Hello',
width: 200,
html: '<p>World!</p>',
renderTo: Ext.getBody()
});
};