external jquery mobile not implementing jquery mobile style

31 views Asked by At

I'm creating few jquery elements on a external js, I use $.getScript("page.js") and these external elemets are append to the main HTML, that's ok.

The problem is: these elements are not getting the JQUERY MOBILE style with data-role attr.

Do I have to so something else to add the roles to each element?

1

There are 1 answers

0
Dionisio Barboza On

To solve this problem I implement .enhanceWithin().

First you use the container where new tags will be added and apply the previous function.

For instance: $("#containerForNewElements").enhanceWithin()

Inner elements of "#containerForNewElements" will be transformed to jquery mobile elements

Cheers.