facebook

Dynamically Assign HTML Widget Content?

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #342052 Reply

    Unknown Author
    Participant

    How do I set the content of an HTML widget using a JavaScript assignment?

    (I am using Google Feed API. The “content” attribute of the feed I’m interested in returns as HTML. I can assign it as text for the widget to display, but not interpretted HTML.)

    -1TC

    #342059

    support-michael
    Keymaster

    The HTML widget is implemented as a simple <div> that contains its custom html content. To replace the html widget’s content at runtime, lookup the html widget div by id and set its inner html. Below is a quick example I created. The src is attached at the bottom of this post. I used jquery syntax $(‘[id$=html1’) to lookup a div in the DOM with an ID that ends with ‘html1’.
    See attachment dynamic-htmlwidget-content.png

    Src File See attachment dynamic-html.mobi

    Attachments:
    You must be logged in to view attached files.
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Dynamically Assign HTML Widget Content?

You must be logged in to post in the forum log in