我最近开始学习围棋。我得到了一个像 web 应用程序一样的示例。我有:
/* tick-tock.go */
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
// Content for the main html page..
var page = `<html>
<head>
<script type="text/javascript"
src="http://localhost:8081/jquery.min.js">
</script>
<style>
div {
font-family: "Times New Roman", Georgia, Serif;
font-size: 1em;
width: 13.3em;
padding: 8px 8px;
border: 2px solid #2B1B17;
color: #2B1B17;
text-shadow: 1px 1px #E5E4E2;
background: #FFFFFF;
}
</style>
</head>
<body>
<h2 align=center>Go Timer </h2>
<div id="output" style="width: 30%; height: 63%; overflow-y: scroll; float:left;"></div>
<div id="v1" style="width: 50%; height: 30%; overflow-y: scroll; float:left;"></div>
<div id="v2" style="width: 50%; height: 30%; overflow-y: scroll; float:left;"></div>
<input id="sett" type="submit" name="sett" value="Settings" onclick="changeUrl()">
<script type="text/javascript">
var myDelay;
$(document).ready(function ()
{
$("#output").append("Waiting for system time..");
myDelay = setInterval("delayedPost()", 1000);
});
function delayedPost()
{
$.post("http://localhost:9999/dev", "", function(data, status)
{
//$("#output").empty();
$("#output").prepend(data);
});
我无法加载本地jquery.min.js. 我写的src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"时候已经加载了。如何加载本地js文件?我不擅长用 Go 编写代码,也没有编写完整的代码。所以请尽量解释得很简单。提前致谢!
catspeake
相关分类