refresh dynamic contents on common popup jQuery mobile

refresh dynamic contents on common popup jQuery mobile

I am working on a web app where, I have a Common popup as a direct child of , it contains few popups created dynamically from the JSON. There are two separate pages having user input form. JSON file is updated using the form data.

I am updating the contents of the popups using the updated JSON in the form submit function. I am facing the problem to refresh the popup contents on form submit. I have to restart the APP to see the changes on popups.

I tried triggering 'refresh' and 'create' events on popups in form submit function, but still no result.

Moreover even if I set the contents of popup div to be empty using $('#popup-div').empty() in submit function, I can still see the popup. Don't know if this is the caching problem.

Please advice for some solution, Thanks

jsfiddle Example: http://jsfiddle.net/bhavik89/49QwL/1/