我有這樣的HTML頁面:把一個變量的鏈接裏面jQuery函數
<!doctype html>
<html>
<head>
<title>Parsing</title>
<script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
<link rel="stylesheet" href="css/index.css" type="text/css" />
</head>
<script>
$.getJSON(
var fin = "SAT000000002574";
"http://sat3.altervista.org/index.php?id="+fin , { get_param: 'value' },
function(data) {
for(var i=0; i<data.length; i++) {
var lin = data[i]["Nr SAT"];
$('body').append($('<p>').html('Numero Sat: <a href ="http://sat3.altervista.org/NuovoFile.html?id=' + lin + '">'+ data[i]["Nr SAT"] + '</a>'));
$('body').append($('<p>').html('Data Apertura: '+ data[i]["Data Apertura"]));
}
});
</script>
<body>
<header>
<img id="logo" src="img/img2.png" alt="logo_chiave_inglese" />
</header>
</body>
</html>
在編寫的代碼下面我試圖把可變尾翼的價值在PHP頁面的鏈接部分。此代碼不起作用,因爲鏈接不正確。有人可以告訴我如何編寫鏈接放在他的變量裏面?
$.getJSON(
var fin = "SAT000000002574";
"http://sat3.altervista.org/index.php?id="+fin , { get_param: 'value' },
嗯,http://stackoverflow.com/questions/23611490/how-put-a-variable-in-a-link –