<a href="http://192.168.1.88/hw/default.php?json=http://192.168.1.88/hw/default.php?json={"user_id":8008000098,"password":"123456"}">
<input id="confirm_download_img" type="image" value="confirm_download" src="image/none.png" style="width:100%; height:100%" onFocus="setfocus(this)" onBlur="lostfocus(this)" onClick="chkName();menu2_item_act(this)">
</a>
我这样写后在default.php页面的地址栏上显示的是:
http://192.168.1.88/hw/default.php?json={请问是不是我在html页面里写的json格式有问题呢?很费解哎,望各位帮忙解决下。O(∩_∩)O谢谢

解决方案 »

  1.   

    <a href="http://192.168.1.88/hw/default.php?json=http://192.168.1.88/hw/default.php?json={\"user_id\":8008000098,\"password\":\"123456\"}">
      

  2.   


    这样写了后输出后是    http://192.168.1.88/hw/default.php?json={\   这个样子的
      

  3.   

    属性边界引号换用单引号,因为你的属性值里有双引号,这样浏览器解析就到第一个双引号地方截止了href='xx,json={"user_id":8008000098,"password":"123456"}"'
      

  4.   

    麻烦再问个问题,如果说
    href='xx,json={"user_id":8008000098,"password":"123456"}"'
    这里的8008000098为从网页上获取的一个参数呢,比如说就是用户登录的ID吧,
    href='xx,json={"user_id":document.getElementById('newName').value ,"password":"123456"}"'
    我写成这样提交后并没显示他的值是多少,请问为什么呢?
      

  5.   


    我现在单独写了一个js,
    function sendParams(){
    var username = document.getElementById('newName').value;
    var userpass = document.getElementById('newPwd').value;
    location.href = 'http://192.168.1.88/hw/default.php?json={"user_id":username,"password":"123456"}';
    }可还是不行- -。有木有高手帮忙指点下
      

  6.   

    location.href = 'http://192.168.1.88/hw/default.php?json={"user_id":'+username+',"password":"123456"}';
     这样试试