Forcing jQuery Mobile to re-evaluate styles/theme on dynamically inserted content

前端 未结 7 988
感情败类
感情败类 2020-11-28 04:40

Objective: Load HTML content via $.ajax, insert it into the DOM, have jQuery Mobile apply theme styles to it.

Problem:

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 05:34

    $('.selector').trigger('create'); seems to be the best approach, see the official FAQ below:

    http://view.jquerymobile.com/master/demos/faq/injected-content-is-not-enhanced.php

提交回复
热议问题