winjs

passing some argument to the callback function of WinJs xhr

假装没事ソ 提交于 2020-01-07 02:29:11
问题 In Windows 8, I am using WinJs.xhr in a loop to download some content, and as it arrives afterward to the "done callback", I would like to pass an argument to retrieve the element who call xhr. for (var k = 0 ; k < 9; k++) { var title = dataArray[k].name; if (title != null) url = monUrl+ title; WinJS.xhr({ url: url, responseType: "responseXML" }) .done(function complete(result) { //I would like to retrieve the right title here for example var dataArray = new Array(); var xml = result

how to print 2 alerts consecutives WinJS

坚强是说给别人听的谎言 提交于 2020-01-05 01:35:44
问题 I want to print two alerts on my app, one to show an application and after pressing close button on first alert to show the second alert Windows.UI.Popups.MessageDialog("Hello Welcome").showAsync(); Windows.UI.Popups.MessageDialog("Welcome to my app").showAsync(); if I just print an alert, everything works good but on the other scenary (two alerts) the code stops with an error, how to fix that?? 回答1: You can't have multiple MessageDialog s open at the same time. Since the showAsync returns

how to print 2 alerts consecutives WinJS

 ̄綄美尐妖づ 提交于 2020-01-05 01:34:01
问题 I want to print two alerts on my app, one to show an application and after pressing close button on first alert to show the second alert Windows.UI.Popups.MessageDialog("Hello Welcome").showAsync(); Windows.UI.Popups.MessageDialog("Welcome to my app").showAsync(); if I just print an alert, everything works good but on the other scenary (two alerts) the code stops with an error, how to fix that?? 回答1: You can't have multiple MessageDialog s open at the same time. Since the showAsync returns

how to print 2 alerts consecutives WinJS

自古美人都是妖i 提交于 2020-01-05 01:33:24
问题 I want to print two alerts on my app, one to show an application and after pressing close button on first alert to show the second alert Windows.UI.Popups.MessageDialog("Hello Welcome").showAsync(); Windows.UI.Popups.MessageDialog("Welcome to my app").showAsync(); if I just print an alert, everything works good but on the other scenary (two alerts) the code stops with an error, how to fix that?? 回答1: You can't have multiple MessageDialog s open at the same time. Since the showAsync returns

Using AppendTo/jquery-win8 in Win8 apps

≡放荡痞女 提交于 2020-01-04 03:38:12
问题 I am tempting to look at the ToDoMVC samples and have tried porting them to a Win8 JS app by just copying and pasting the code but also having the relevant WinJS libs referenced. Due to MS security principals around InnerHTML etc I have referenced jQuery-Win8 which attempts to get around the issue however in the Angular and Backbone examples when I run the app I get an exception on appendChild I've read in some places you should be able to continue running the app but if I do press Continue

Display a 'loading' image till loading original images in 'image gallery app' - metro style

情到浓时终转凉″ 提交于 2020-01-02 13:31:58
问题 I am developing an image gallery application .. Its loading images from the internet.. What i am doing is collecting image url into an array and bind it into a list view .. Its works fine.. But my problem is the images shows a cross mark ( 'X') till loading the images. What i am expecting is Display a loading image for each emage untill loads the original image if 1 is not possible, how can i remove the cross mark? 回答1: You cannot remove the 'X' mark as that is a browser-specific feature. You

How to wait for result of two promises, then do something?

佐手、 提交于 2019-12-31 03:46:47
问题 Well, subject. Can't figure out... Condition: both promises start asynchronously and not one after another. Like this: spashGoing.then(doSomethingForItself()); writingGoing.then(doSomethingForItself2()); DoSomethingAfterBothPromises() P. S. I use promises from WinJS, not the ES2015/ES2016, but they don't have big defferences. 回答1: If WinJS promises are Promise/A+ promises Promise.all([ spashGoing.then(doSomethingForItself), writingGoing.then(doSomethingForItself2) ]).then(function(results) {

Exception when trying to read null string in C# WinRT component from WinJS

核能气质少年 提交于 2019-12-29 06:45:14
问题 I have the following scenario: Data lib in C# compiled as a Windows Runtime component. One of its classes is looks like this: public sealed class MyData { string TheGoods { get; private set;} } The UI is in WinJS, and I have the following: var b = dataInstance.theGoods; The problem is that I get an exception and property has the following in it: System.ArgumentNullException at System.StubHelpers.HStringMarshaler.ConvertToNative(String managed) Looking at the implementation of HStringMarshaler

CSS to centralise a HTML5 div at the bottom of the screen

主宰稳场 提交于 2019-12-25 09:34:05
问题 I have the following HTML5 document: <canvas id="myCanvas"> </canvas> <img id="logo" src="/images/logo.png" style="visibility:collapse" /> <div id="adControl" style="width: 728px; height: 90px; border: solid 1px red; visibility:visible;" data-win-control="MicrosoftNSJS.Advertising.AdControl" data-win-options="{applicationId: 'xyz', adUnitId: '123'}"> </div> I'm trying to make the adcontrol appear in the centre at the bottom of the screen, beneath the canvas. Here's my CSS: #adControl { float

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:31
问题 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",