winjs

How to make two Winjs.xhr call one for retrieving the Captca from a website and another to submit data back

和自甴很熟 提交于 2019-12-25 06:05:05
问题 I 'm making a windows app using HTML5/JAVASCRIPT . What actually i want is to retrieve a captcha from a website and then submitting the captcha along with other form field to the website(.aspx) back and getting the response back.I think that i have to handle cookies for this purpose ,but i do not know how to do this . 100 times salute to the person who will show interest in this . Here is what i did . // Retrieving the Captcha. WinJS.xhr({ url: "http://example.in/main.aspx", type: "get",

What is the simplest way to pull a local xml file and apply it to the windows 8 java script grid layout template data.js file?

与世无争的帅哥 提交于 2019-12-25 05:23:15
问题 My apologies if the question is overly simple or asking for a bit too much but I feel like I am very close to a simple answer and still too far. All I am trying to do is use the grid layout template in Visual Studio 2012 express to integrate xml data into the grid layout template. I've been really stumped with the winjs.xhr as a means of pulling the xml data. My xml file has nodes to match the group titles, item titles and page content. My partially edited data.js file is below: (function ()

MobileServices.web.js unauthorized api call

早过忘川 提交于 2019-12-25 04:08:20
问题 When I leave my WinJS app dormant for a while and then come back to it, and i click on a button, for some reason my calls to my backend aren't working. I get an "Unauthorized" error from the server. How do I modify the invokeApi so that it reauthenticates the user or something? Does anybody have any experience using mobileservices.web.js and how to keep the end user perpetually logged in without having to reauthenticate themselves? Thankyou. client.invokeApi("getTopForumsTotal", { method:

Internet connection error message - Windows 8 Application with Javascript

让人想犯罪 __ 提交于 2019-12-25 03:28:15
问题 I am trying to add a basic detection script for my application to allow it to display an error message when a call to WinJS.xhr fails. I have every WinHS.xhr call the following function onerror (using the 2nd param of .done() ) and that part is working great. function connectionError() { var msg = new Windows.UI.Popups.MessageDialog("There was a connection error while trying to access online content. Please check your internet connection."); // Add commands and set their CommandIds msg

Deploy files in the localState folder during installation of a store app

落爺英雄遲暮 提交于 2019-12-25 03:26:10
问题 I am building an app for windows store and I need some default and example data to be in the localstate folder ( Windows.Storage.ApplicationData.current.localFolder ) when the app run the first time. The folder and files structure is a bit complex and I tryed to copy the files at the start of the application, but I can't manage that way. Is it possible to have files being copied automatically from the installation folder to the localstate folder during the store app installation? 回答1:

How can I add a button at the end of a listView?

瘦欲@ 提交于 2019-12-25 02:00:15
问题 Iwould like to add a button at the end of a listView in the same way as the bing apps do (see picture for example). I looked for hours in google and in the microsoft documentation but canøt find anything that can give me an idea of how to do this. Did anyone achieved this? thanks 回答1: If you run that app (Health & Fitness), then run Visual Studio and use Debug > Attach to Process, you can open the DOM Explorer and examine how that UI is implemented. What you'll see in this case is that it's

Saving a Canvas as an image in UWP

眉间皱痕 提交于 2019-12-24 19:40:29
问题 I found this documentation for exporting and saving a Canvas as a png. It gives the following code: var Imaging = Windows.Graphics.Imaging; var picker = new Windows.Storage.Pickers.FileSavePicker(); picker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary; picker.fileTypeChoices.insert("PNG file", [".png"]); var imgData, fileStream = null; picker.pickSaveFileAsync().then(function (file) { if (file) { return file.openAsync(Windows.Storage.FileAccessMode

return a promise from inside a for loop

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 19:14:42
问题 I have a recursive function and I am trying to make it run in sequence, returning the promise every time. The code is recursive and works well but works only for the first item in the for loop. Example: folder: 1 - OK folder: 11 - OK folder: 111 - OK folder: 111 - OK folder: 2 - NOT OK folder: 12 - NOT OK All asynchronous downloads completed in sequence. I think it is because when I return the promise from inside, then the for loop gets interrupted. function CopySubFolders(folder, destFolder)

Navigating to another html in Windows store app

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 13:19:47
问题 I am trying to find a way to navigate to another html in my app. I tried window.location and WinJS.Navigation.navigate but none works. 回答1: Although you can get document.location and navigation to work (and note that it's document.location, not window.location), the recommended approach is to implement the app like a single-page web application, meaning that you "navigate" by dong DOM replacement inside default.html/index.html. That is, you're page context is always the default HTML page, so

Binding listview on a page control using template in Windows 8

点点圈 提交于 2019-12-24 08:59:08
问题 For some reason, my template is not getting used in the binding of data. I'm using Visual Studio's "Navigation App" project type for Windows 8 app. When I run it, each item just gets filled with the full json string. Similar to binding without using any templates at all. home.js : var dataList = new WinJS.Binding.List(); var publicMembers = { itemList: dataList }; WinJS.Namespace.define("VideosData", publicMembers); (function () { "use strict"; WinJS.UI.Pages.define("/pages/home/home.html", {