Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:22:02+00:00 2026-06-10T11:22:02+00:00

I am just starting out with Windows 8 development using HTML/JS. I’ve spent the

  • 0

I am just starting out with Windows 8 development using HTML/JS. I’ve spent the last few months immersed in jQuery development for apps targeting vehicle head-units and televisions.

Jumping into this, I thought the transition would be simple. I have the design and structure of my site all figured out for the most part and was hoping to follow some of the practices I had been using for my previous work.

That is, I want to essentially create a single page app. The main default.html file will house the top navigation/title and one other div. The other div will be used to load in all the other pages, all separate HTML files within the project.

All of the global functions and major functionality will reside in a javascript file, application.js. Then any page-specific javascript will reside at the top of each HTML file.

I’m quickly realizing that this is a problem. Using jQuery.load() to load in my pages causes security errors in my app.

JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement.

I was really hoping to avoid having to learn a bunch of Microsoft-specific stuff. I think it’s great that they’ve provided a lot of tools and what not, and maybe I just haven’t used them enough, but everything just feels too rigid for me and for what I’m trying to do or can already be accomplished with jQuery. I’m one who likes to know EXACTLY what is happening and have full control over it.

Also looking through the templates and sample projects, I really don’t like all the repeated code. For instance, every single HTML file declaring all the same references. I want to write my references and sections like my title bar just once, and not have to copy/paste that code all over my project.

Is there a way to do things the way I was hoping, and create a single page app? Do they have their own substitute for jQuery’s .load()?

Any help pointing me in the right direction would be much appreciated!

EDIT 8/14/2012:

I have tried using the fix from this question:
Using jQuery with Windows 8 Metro JavaScript App causes security error

This gets rid of the security warning and I can load in HTML using jQuery.load(). However, looking at DOM explorer, my HTML is being stripped of my scripts.

I have also tried wrapping my .load() call inside of MSApp.execUnsafeLocalFunction(), but yet again my file still gets stripped of all scripts. What gives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:22:04+00:00Added an answer on June 10, 2026 at 11:22 am

    There is a “formal” way to do what you are seeking.
    WinJS.Navigation is provided to support “single page apps”. For example, the default.html would contain a markup that would represent where the dynamically loaded page content would go:

    <div id="contenthost" 
        data-win-control="Application.PageControlNavigator" 
        data-win-options="{home: '/pages/home/home.html'}">
    </div>
    

    In the example above, the actual content page loaded is at /pages/home/home.html

    In event handlers, you can simply do the following to load or navigate to another page:

    WinJS.Navigation.nav("/pages/other/page.html");
    

    True, it is not jQuery, but it works great 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting out on a cross-platform (Windows, Linux, OS X) C++ project, and
I'm just starting out using Lua, and I was wondering (because I can't find
I'm just starting out with using Core Data on the iPhone SDK and I'm
I am just starting out with git on the Windows platform. I have mysygit
I am just starting out on Silverlight using version 2.0. I wanted to show
I am just starting out with driver development, and am trying to initialize a
I'm just starting to learn Objective-C using GNUstep on Windows and I'm wondering what
Just starting out in python on a pendrive 12.04 Kubuntu environment. I had to
Just starting out with subversion, have set up repos for 3 current projects and
Just starting out, this should be a simple one but I haven't been able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.