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

  • Home
  • SEARCH
  • 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 8403771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:25:59+00:00 2026-06-09T22:25:59+00:00

I am creating an application using javascript/HTML for windows 8 which basically displays text

  • 0

I am creating an application using javascript/HTML for windows 8 which basically displays text which is pulled from an html file.

I am using the data.js file to organise groups and items. One of the properties is the ‘url’ which stores the url of the html page which contains the main content for the application.

I came up with this code to retrieve the html code from the html page which contains the content to be displayed:

WinJS.UI.Fragments.renderCopy(url)
                  .done(function (fragment) {
                  return fragment;
});

How do I run this code for each item in the array in data.js and bind the data so that the content is from the HTML page, and the headings/titles are from the data.js file?

I apologise if I’m causing any confusion. I would appreciate any help.

Thanks.

  • 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-09T22:26:01+00:00Added an answer on June 9, 2026 at 10:26 pm

    Assuming you want to stick with the layout of data.js and not create your own data classes, I would use a custom renderer for the listview.

    Something like this…

    var customRender = WinJS.Utilities.markSupportedForProcessing(function (itemPromise) {
        var currentItem = {};
    
        return itemPromise.then(function (item) {
            currentItem = item;
            var myDiv = document.createElement("div");
            return WinJS.UI.Fragments.renderCopy("/html/1_BasicFragmentLoad_Fragment.html", myDiv)
        })
        .then(function (fragment) {
            var itemTemplate = WinJS.Utilities.query('.itemtemplate')[0];
            currentItem.data.title = fragment.innerHTML; 
    
            return itemTemplate.winControl.render(currentItem.data);
    
        });
    }
    

    );

    In this example, I am binding the content of a html fragment to the title of a given item from data.js. You will need to update the itemtemplate and bind the title element to innerHTML instead of textContent.

    <h4 class="item-title" data-win-bind="innerHTML: title"></h4>
    

    You will also need to assign the custom renderer to the listview. You can do this in the HTML markup or just change the template js in groupItems.js to this…

     listView.itemTemplate = customRender;
    

    If you were to create your own data classes, you may want to put the promise chain from the customer renderer into the class constructor, eliminating the need for a customer renderer.

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

Sidebar

Related Questions

I am creating a small application using HTML 5, Javascript and Google Maps API
I'm having issues with creating an AIR file from an Adobe AIR HTML/JavaScript project.
I am creating application in AIR using JavaScript. Many of my functions requires text
I am creating a web application based on data using javascript. This data is
I am creating an application using Core Data. But When I run my app
I'm creating a database application using ASP.NET and I want to make a Windows
I am creating a windows application using VB.Net and this application will take a
I'm creating a whiteboard application using SVG in HTML5, and javascript to manipulate the
I'm creating a web application which loads tabs using AJAX. My problem is that
I'm creating one application in android to rotate an image using angle in html

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.