Replace current page with ajax content

前端 未结 9 1259
南旧
南旧 2020-12-05 04:50

I have a page with a dialog window which sends ajax post data to server and receives a response. During development, there can be two responses - one regular (this is not th

9条回答
  •  -上瘾入骨i
    2020-12-05 05:05

    I don't think there's any way to do that. Iframes are meant for loading other pages and there's no other sandbox in which to dump a standalone page -- that's what frames were designed for.

    It might be difficult with the framework you're using, but it's probably worthwhile to have it generate different errors for your Ajax requests. My Ajax pages will only ever send

    {"exit": 1, "message": "As in the shell, a non-zero exit is an error and this is why..."}
    

提交回复
热议问题