Best Practice: Legitimate Cross-Site Scripting

前端 未结 5 1430
攒了一身酷
攒了一身酷 2020-12-24 13:46

While cross-site scripting is generally regarded as negative, I\'ve run into several situations where it\'s necessary.

I was recently working within the confines of

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-24 14:21

    You've got three choices:

    1. Create a server side proxy script.
    2. Create a remote script to read in remote dynamic HTML. Use a library like jQuery to make this easier. You can use the load function to inject HTML where needed. EDIT What I originally meant for example # 2 was utilizing JSONP, which requires the server side script to recognize the "callback=?" param.

    3. Use a client side Flash proxy and setup a crossdomain.xml file on your server's web root.

提交回复
热议问题