techdog
techdog

Reputation: 1481

jquery mobile update innerHTML not rendering

I'm just beginning to use Jquery. I'm placing some jquery code that is generated dynamically by a javascript function into a div using innerHTML. It is not rendering the jquery look/style of it. I know the jquery code being generated is correct because it looks fine if I paste it in manually and restart the page.

Do I have to somehow update the page or refresh the rendering using a Jquery command after loading new content dynamically into innerHTML?

I also tried what I think is the jquery version of innerHTML but it does the same thing.

$("#propchoices").html(data);

Upvotes: 0

Views: 1807

Answers (1)

Sushanth --
Sushanth --

Reputation: 55750

You don't need to refresh the page after inserting into your document..

Make sure you enclose your code inside DOM Ready event

$(document).ready(function() {

    // Your Dynamic Data Here

    $("#propchoices").html(data);

});

Upvotes: 1

Related Questions