今天做一个项目,先用C# 代码编辑href
<a href='showWebUpDown.aspx?firstTitle=新闻动态&secondTitle=" + xinwenList [i]+ "&total=3'>"
- xinwenList[i] + " 这一步很正常,点击这个链接后跳转到另一个页面,那个页面在页面刚加载的时候执行一个jQuery 代码,就是获取其中一个参数 代码如下: function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; //返回参数值 } $(window).load(function () { var sectitle = getUrlParam("secondTitle"); alert(sectitle); $('.rightIframe').attr('src', 'thridListPage.aspx?secondTitle=' + 6);
});
一开始执行还是很正常的 但是后来我再修改Css的过程中不知道怎么的,js获得的sectitle就变成了乱码 ,怎么办啊 ?这是什么原因?其他页面怎么就好好的呢?