Handling cookies in PhoneGap/Cordova

Friend, I’ve tried too without success to use cookies with phonegap. The solution was use localStorage. Key Quick Example: var keyName = window.localStorage.key(0); Set Item Quick Example: window.localStorage.setItem(“key”, “value”); Get Item Quick Example var value = window.localStorage.getItem(“key”); // value is now equal to “value” Remove Item Quick Example: window.localStorage.removeItem(“key”); Clear Quick Example: window.localStorage.clear(); If you … Read more

enabling cross-origin resource sharing on IIS7

It is likely a case of IIS 7 ‘handling’ the HTTP OPTIONS response instead of your application specifying it. To determine this, in IIS7, Go to your site’s Handler Mappings. Scroll down to ‘OPTIONSVerbHandler’. Change the ‘ProtocolSupportModule’ to ‘IsapiHandler’ Set the executable: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll Now, your config entries above should kick in when an HTTP OPTIONS … Read more

What do the different readystates in XMLHttpRequest mean, and how can I use them?

The full list of readyState values is: State Description 0 The request is not initialized 1 The request has been set up 2 The request has been sent 3 The request is in process 4 The request is complete (from https://www.w3schools.com/js/js_ajax_http_response.asp) In practice you almost never use any of them except for 4. Some XMLHttpRequest … Read more

What is the cleanest way to get the progress of JQuery ajax request?

Something like this for $.ajax (HTML5 only though): $.ajax({ xhr: function() { var xhr = new window.XMLHttpRequest(); xhr.upload.addEventListener(“progress”, function(evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; //Do something with upload progress here } }, false); xhr.addEventListener(“progress”, function(evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; //Do something with download progress … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)