Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

jQueryMobile and WebWorks - doesn't seem to work if HTML generated from javascript

Hello,

 

I was looking for a forum that will be development for the PlayBook with WebWorks, but coudn't find one.  If you know of one, please point me to it.

 

My question has to do with using jQueryMobile and HTML generated from javascript - specifically on PlayBook.  I've successfully used jQueryMobile in the static HTML part, but if I have it dynamically generated from the javascript, it doesn't seem to work (UI looks just like if none of the CSS from jQueryMobile was applied to it).

 

Here's roughly an example of what I have:

 

index.html:

 

<div data-role="page">
    <div data-role="header" data-position="inline" data-backbtn="false">
        <h1>My title</h1>
        <a href="index.html" data-icon="gear" class="ui-btn-right">Options</a>
    </div>
    <div data-role="content">

            <!-- the following works fine -->

            <a HREF="#" data-role="button" data-inline="true" onclick="addMessage()">A Button</a>

            <div id="contents"></div>

     </div>

      ...

</div>

 

in my javascript i have:

   var ele = document.getElementById("contents");
   var output = "";

   ...

   output += "<a HREF=\"#\" data-role=\"button\" data-inline=\"true\" onclick=\"doSomething()\">Does NOT work</a>";

   ...

   ele.innerHTML = output;

   ...

 

Am I doing something wrong? or has anyone ran into this problem?

 

thank you!

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: jQueryMobile and WebWorks - doesn't seem to work if HTML generated from javascript

hey totem,

 

sorry im not much of a WebWorks expert, but here is the forum that is specific to the WebWorks platform:

 

http://supportforums.blackberry.com/t5/Web-Development/bd-p/browser_dev

 

Good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Highlighted
Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

Re: jQueryMobile and WebWorks - doesn't seem to work if HTML generated from javascript

Thanks JRab!