Answered by:
possible to handle separate DOMs?

Question
-
Hello,
I would like to know if it is possible to handle a DOM that is independent from the main page DOM. I mean: if the preferred techoology to develop W8 Metro Apps is HTML5/Javascript, the UI is made of HTML5 CSS and handled by Javascript code. I want to know if this HTML5/CSS/Javascript application is able, for example to handle an embedded WebView with its DOM and perform some Javascript processing on it. (Could "split application" or "html fragments" concepts be relevant here?)
Thanks in advance
Saturday, February 18, 2012 11:02 AM
Answers
-
I think that iFrames are suitable for this.
- Marked as answer by P5music Monday, April 2, 2012 5:11 PM
Monday, April 2, 2012 4:50 PM
All replies
-
Hi P,
First, this statement is incorrect: " if the preferred techoology to develop W8 Metro Apps is HTML5/Javascript,". You can develop Metro style applications in the language you are most comfortable. C#, VB, and C++ are your other options. HTML5 and Javascript is no more preferred than any other language.
If you decide to use HTML5 and Javascript for your application Fragments are the way to go for separation of your app UI into managable and distinct UI and code combinations. For an example of this see how the Grid or SplitView templates create fragments to separate the two different views. Here is a sample: http://code.msdn.microsoft.com/windowsapps/Fragments-91f66b07. Also see this article about fragments: http://msdn.microsoft.com/en-us/library/windows/apps/hh452768.aspx
-Jeff
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Monday, February 20, 2012 7:38 PM
Monday, February 20, 2012 7:38 PMModerator -
Hi, thanks for your response.
I know that HTML5/CSS/JS technology is not "preferred", I meant "if one likes it...".
Say, one likes it and wants to create an app that embeds a sort of WebView in a rich UI with other controls and views. He/She cannot, according to the documentation at the linked pages, because the DOM is the same, the scripts act on the entire DOM, the CSS files act on the entire DOM, so, for example, if I write a script like "document.body.style.zoom=0.5" all the HTML is affected. So, if I am not wrong, the answer to my question is no. It's unfortunately, because at present time for Developer's Preview Release, WebView's DOM is not accessible from c# code, as answered in another thread. Am I wrong?
Monday, February 20, 2012 8:27 PM -
I think that iFrames are suitable for this.
- Marked as answer by P5music Monday, April 2, 2012 5:11 PM
Monday, April 2, 2012 4:50 PM