所以,我一直在用jsfiddle中的這個重定向生成器來擺弄一下,得到了我想要的東西。我試圖用它創建一個html頁面,但我無法使它工作。 http://jsfiddle.net/wVUhN/2/我在做什麼錯? JSFiddle中的工作不在我的HTML頁面中?
我還是相當新的jquery。 我的redirect.html頁面代碼。
<html>
<head>
<title>Redirect Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
<script type="text/javascript">
$("#submit").click(function(){
theurl = $("#theurl").val();
$("textarea#newvalue").val('<html><head><meta HTTP-EQUIV="Refresh" CONTENT="0; URL="'+theurl+'"></head><body>This page has been moved.<p><a href="'+theurl+'">IF YOU ARE NOT REDIRECTED, PLEASE CLICK HERE.</a></body></html>');
});
</script>
</head>
<body>
<input type="text" id="theurl" placeholder="enter URL" /><button id="submit">Create Redirect</button>
<br>
<textarea id="newvalue"></textarea>
</body>
</html>
LIVE網址:http://buildlinux.com/frontline/redirect.html
什麼不正確工作? – Kamil 2013-03-13 00:28:34
* How *不起作用?什麼在JS控制檯? – 2013-03-13 00:28:37
我添加了該帖子的實時網址,點擊按鈕時什麼也沒有發生。 – Vernard 2013-03-13 00:33:50