That is correct. JavaScript isn't available for OOTB InfoPath. However, my company has a way of running a JavaScript file with an InfoPath form when publishing to a SharePoint site so in this case, JavaScript is available.
On demand = Ability to switch views on the click of a button when the form is rendered in a web page (SharePoint)
Normally, this would be done using the InfoPath Button, but we do not support that control as of yet. I am just exploring other ways to achieve this result.