0

So I created a form and and attached a Drupal library to it. From there I created a route that uses that form. Last a added a link that uses ajax to render that form.

For some reason when I look at the context that is rendered from that ajax request the /core/misc/vertical-tabs.js?v=8.2.6 gets loaded onto the page along with the form content, but my attached custom library does not.

If I visit the page without using the ajax request both the /core/misc/vertical-tabs.js?v=8.2.6 and my custom library load fine.

How can I get my custom library to load with ajax?

0

So after playing with this for a while I figured out that Drupal only pulls in the js Assets through ajax, not the css. I guess this make sense on some level. But I figured I can easily pull in the necessary css in using js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.