JavaScript调用SVG
程序每秒钟产生一个随机数,同时用曲线图把随机数表示出来,为什么后面的时候程序一次表示了多个随机数,而不是一个随机数
SVG文件代码:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-flat-20030114.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
height="100%" onload="changeTemp()">
<script type="text/javascript" xlink:href="test.js"> </script>
<g id="group">
<rect id="rect1" x="40" y="35" width="50" height="20" style="fill:red"> </rect>
<text id="txt" x="50" y="50">1 </text>
</g>
</svg>
test.js代码:
var x1 = -10;
var y1 = 100;
var x2;
var y2;
var i = 1;
var temperature;
function changeTemp(){
var node=document.getElementById("txt");
temperature=Math.random();
temperature=temperature.toFixed(2);
相关问答:
如何实现当鼠标悬停控件上时,出现该控件的尾部显示对应的层,鼠标移动到该层上进行相应的操作,当鼠标移除时(不在控件上也不在层上)层隐藏,
HTML code:
<html>
<head>
<meta http-equiv= ......
我的源文件如下:
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
{
  ......
我手边有csdn论坛弹出信息窗口的代码(可以从http://www.codefans.net下载),但它显示的只是固定的信息,现在想改造一下以便能通过后台调用Sql Server 2000数据库自动将数据表中的信息作为弹出窗口显示的信息。csdn论 ......
void CWEHelperDlg::OnOK(){
CString code;
//调用VBSCRIPT,能弹出消息框,也能正确返回 hello
code = "function main()\r\n\tMsgBox \"ok\"\r\n\tmain=\"hello\"\r\nend functio ......