What is the best way to escape HTML on ExtJS application generally?

前端 未结 3 1512
执念已碎
执念已碎 2021-02-13 22:33

I am developing a web application using ExtJS to build GUI and communicate with server via RESTful web-service (the returned data is formatted as JSON objects).
Now I am hav

3条回答
  •  执念已碎
    2021-02-13 23:05

    This link has a excellent answer by jack.slocum : https://www.sencha.com/forum/showthread.php?13913

    grid.on('validateedit', function(e){
       e.value = Ext.util.Format.stripTags(e.value);
    });

    Util method Ext.util.Format.stripTags() removes all the html/script tags.

提交回复
热议问题