Friday 28 June 2019

javascript - In Ext JS, how to attach events to dynamic html elements?

Suppose I have some Ext JS code that attaches an event handler to all elements with class "myclass". For example:



Ext.onReady(function(){
Ext.select('a[class*=myclass]').on('click', function(event, elm){
// do something
});

});


And my html might be as follows:



test1
test2
test3



That works with no problem. However, consider if the "myclass" elements were written to the page at some future time.



For example:



create link dynamically

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...