JAVA servlets - open message popup

前端 未结 4 529
名媛妹妹
名媛妹妹 2021-01-13 15:13

I want to user HttpServletResponse object to compose a response that will tell the browser client to open a popup with some message - how can i do that?

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 16:04

    Generally speaking, you can't.

    Thanks to their popularity for annoying adverts, most browsers reject attempts to open popups that aren't a response to something the user does within a page.

    If you just want to display messaging, you could just include it in a page, or output a script element with an alert statement in it.

提交回复
热议问题