V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
avatasia
V2EX  ›  jQuery

为什么ajax不能使用response?

  •  
  •   avatasia · Jul 23, 2011 · 5179 views
    This topic created in 5394 days ago, the information mentioned may be changed or developed.
    我用response产生一个excel,这个action,如果用ajax来调用就不能正常弹出下载的对话框,ajax的post参数 是html,为什么呢? 对ajax的机制不太了解,有知道的麻烦指点一下。
    3 replies    1970-01-01 08:00:00 +08:00
    chone
        1
    chone  
       Jul 23, 2011
    yyfearth
        2
    yyfearth  
       Jul 23, 2011
    response就2种,一种responseText保存这文本,一种responseXml保存DOM,你excel的二进制放那哪啊?
    而且,responseText和responseXml也不会显示出来,怎么用需要你自己处理。
    icyflash
        3
    icyflash  
       Jul 23, 2011
    生成 temp excel

    ajax返回temp excel的地址,JS打开这个地址

    我想这应该是你想要的效果了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4919 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 05:42 · PVG 13:42 · LAX 22:42 · JFK 01:42
    ♥ Do have faith in what you're doing.