Is it possible to dynamically inject a Visualforce component into a visualforce page? I don't necessarily want the Visualforce component to be loaded with the rest of the page on the initial page load. Since I am placing the component in a popup. I want to inject it into my page and load it when the user clicks the button to open the popup.
I so far have not found a way to do this. It works if I just place the <c:MyComponent />
in my popup html from the get go.
And attempting to replace the content of the popup with <c:MyComponent />
in my Javascript just stops the page from loading altogether without any error.
I do not believe a lightning component will work for me. I have been trying to migrate it to one but am having all kinds of issues just getting JQuery and the third party js libaray I am using to simply load correctly in the Lightning component. So, I would like to find a solution with Visualforce components.