ada's profileAda的自由共享空间PhotosBlogListsMore Tools Help

Blog


    May 20

    不是bug的bug

    之所以这么说,是因为原以为bug是我造成的,但经过再次测试,才发现,bug是浏览器的问题,之所以这样确定,也是由于我换了触发事件测试得到的结果,onberforeload   对firefox  来说,返回的值早已跑到了前一个页面上,所以才提示xmlhttp无定义,所以即使有值也得不到。而IE则好些,等返回值回来了,再跳转页面。
    ie readystate  响应顺序为 1234  而 ff 响应的顺序 为2341   我单步测试时有返回值出现,但最终的结论就是如上所说 页面重新被加载,xmlhttp对象丢失
    所以提示无定义,而事实上在同一页面就OKL
    关于ajax的 传值问题, 以前一直用get, 今天试了下post  
    没什么大区别,把url和 post  param  分开 最后send(param) open url 既可。
    最重要的两句话,也可以说是一句
    xmlHttp.setRequestHeader("content-length",postdata.length);//post提交设置项
    xmlHttp.setrequestheader("content-type","application/x-www-form-urlencoded");//post提交设置项
    因为我测试 只有红色的语句就OKL  否则服务器端接不到参数的。。。。
    看来没get简单哦。。。。
    关于js的一点小经验,在ff显示而IE不显示,多半是js语法结构的问题,IE就是要求严格些,还有 触发事件的不相应,有时可能是上下标记语法的错误,maybe,only me so careless,哈

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://ll-lizi.spaces.live.com/blog/cns!C130D3132972F3ED!404.trak
    Weblogs that reference this entry
    • None