我正在尝试设置隐藏值,结果是所有NULL。但是当我调试它时,它们正在获得正确的值。
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var name="campaign";
var url=document.URL;
var campaign= decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]);
name="source";
var source=decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]);
name="medium";
var medium=decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]);
$('#campaign').val(campaign);
$('#source').val(source);
$('#medium').val(medium);
});
</script>
<input type="hidden" id="campaign" name="campaign" value="null">
<input type="hidden" id="medium" name="medium" value="null">
<input type="hidden" id="source" name="source" value="null">
答案 0 :(得分:0)