- This topic has 3 replies, 2 voices, and was last updated 10 years, 5 months ago by support-octavio.
-
AuthorPosts
-
Pascal CurdyParticipantHi there,
I’m quite new in MobiOne development and I find it’s a cool IDE for rapid development.
I’m currently developing an hybrid app. As so, I use an HTML Container with an <iframe> pointing to
the url of the page I want to display.The content of the HTML Container (HTML Code) will vary, depending on the selected (clicked) MenuItem.
How can I change the content of the HTML Container from within the onClick event function located in the MYApp_custom.js module ?
Thanks in advance for your help
Best Regards.
support-octavioMemberHi pascal,
First of all, please note that we discourage the use of iframes, see the reasons here
Now, for changing the html content when combobox value is changed, something like this should works:
var cmbVal= $('select[name="combobox1"]').val(); if(cmbVal=="1"){ $('#m1-<project>-<htmlwidgetID>').html("<div>code for 1</div>"); }
Update: I realize you are not using a combobox, please specify what widget you are using so I can provide the correct snippet for that.
Pascal CurdyParticipantHi octavio,
Thanks for your answer.
I just want to change the whole html code of an HTML container dynamically,
depending on the selected page.$(‘#m1-<project>-<htmlwidgetID>’).html(“<full page code>”);
is exactly what I need.
Since I’d better not using <iframe> the only solution is to integrate the full HTML
code of the page instead of using <iframe>.This will increase the size of the App, so it will take a little longer to load at startup, but
it will decrease the response time when the user selects a particular page.This will also decrease the amount of communication data which is, to my opinion, not a bad thing…
Thanks again for your support
Best
support-octavioMemberHi pascal,
You can save the html code in independent files and get the data thru a http request, this example might be helpful for you: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=5738
-
AuthorPosts