This idea is to improve the popups for webmaps so they can do anything a webpage could do.
For advanced users, have an option to create javascript/html5 coded popups that can draw in and use attribute fields and javascript libraries. Some use cases of why this is needed:
If a field has a missing attribute value, javascript code could do an if else statement and not display that attribute. If it is present then t would be displayed.
Custom formatting of fields on the fly could be done rather than altering the data beforehand. For example, changing text to uppercase, or pulling out only the street from an address field.
Ability to embed HTML5 video players
Use css style sheets