avatasia
V2EX  ›  jQuery

为什么ajax不能使用response?

  •  
  •   avatasia · Jul 23, 2011 · 5571 views
    This topic created in 5588 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
    yyfearth
    yyfearth
    Jul 23, 2011
    2
    response就2种,一种responseText保存这文本,一种responseXml保存DOM,你excel的二进制放那哪啊?
    而且,responseText和responseXml也不会显示出来,怎么用需要你自己处理。
    icyflash
    icyflash
    Jul 23, 2011
    3
    生成 temp excel

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

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