I have a cart that’s graphically styled with a CSS file. However, when I update the cart through jQuery and AJAX, the reloaded version is not styled.
Is there any jQuery function to apply already loaded styles to a dynamically generated element?
I know I could use .css() function to add the style manually, but I’d rather avoid that and be able to load the existing properties automatically, so that it doesn’t become messy if I make changes.
Thanks, kind regards.
Sorry guy, I guess I’m a bit confused or something. It does work by itself and the css is automatically recognized without any special code. I’m not sure why it failed before, I’ve rewritten the code so I can’t tell, but I guess there was somewhere an error while declaring the class.
Anyway: while using correctly classes in css and html this is not a problem and it just works.