WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Ideas on how to make other plugins work with jQuery Mobile

[Resolved] Ideas on how to make other plugins work with jQuery Mobile

  • Hey there,

    Respect to Ramoonus for creating this.

    I’d really like to know if he or anyone else has any ideas how to solve the issue that almost any other wordpress plugin stops working when you use jQuery Mobile though?

    I have been posting on stackoverflow, and the jQuery Mobile site for weeks and am no further forward with a solution. ALL the solutions proposed seem to involve either rewriting the plugins manually or setting jQm to not load pages via ajax, which kind of defeats the purpose of using jQm at all since you then dont get the transitions and ‘app like’ feel.

    The major issue is getting scripts loaded into the head of ajax loaded pages to actually affect the content of the ajax loaded page.

    Without some solution to this it seems to me that jQm is really only an option for people who are writing their sites from scratch and not using any existing plugins- or for every plugin creator out there to rewrite their plugins to use pageInit rather than document.ready to initialise their code.

    This is a major obstacle to what could otherwise be a complete revolution to how sites in general could be.

    If anyone has any thoughts, comments or ideas, please share 😉

    http://wordpress.org/extend/plugins/jquery-mobile/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ramoonus

    @ramoonus

    it might be due javascript library incompatibilities between jquery versions

    Hi Ramoonus,

    I have found that its a bit more complex than that, its to do with the javascript that gets added by most plugins is a) added to the head and b) programmed to fire on document ready and not ‘pageCreate’ like jQm wants and c) is often written using ‘bind’ rather than ‘live’.

    So far I have had some degree of success hijacking some plugins enqueue actions and moving them to the footer. I am doing this in a separate plugin, so that hopefully what we can do is combine your plugin with a ‘jQuery Mobile Plugin Fixer’ plugin, that will contain a library of fixes for existing plugins so that they work with jQm 😉

    Will keep you updated 😉

    I am investigating this same problem. The issue is that there is no 1-size-fits-all solution to fixing this problem due to the fact that not ALL plugins should run every time pageCreate gets fired (ex. plugins which act upon the header and footer).

    The easiest solution is to single out the plugins which need to run after pageCreate, and update them so that…

    $(function(...
    $(document).ready(function(...

    is updated to …

    $(document).on('ready pageCreate', function(...

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Ideas on how to make other plugins work with jQuery Mobile’ is closed to new replies.