Why does this jQuery Mobile form not properly AJAX? - ajax

I am under the (perhaps mistaken?) impression that you can test jQuery Mobile applications during development using Safari rather than having to use a mobile device.
When I
load Safari in Windows,
change the User Agent to Safari iOS 4.3.3 — iPhone in the Developer menu,
hit this URL: http://jquerymobile.com/test/docs/forms/forms-sample.html, and
click Submit on the Default Ajax form example
it does not AJAX. Instead it loads a new URL:
http://jquerymobile.com/test/docs/forms/forms-sample-response.php?shipping=Standard+shipping&submit=submit-value
Are my expectations wrong, am I doing it wrong, or is there something wrong with jQuery Mobile?

I don't think anything is wrong, I think you're just being fooled by jQuery Mobile.
It may appear as though a whole-page-refresh is occuring but it isn't. If you watch the Network tab in your developer tools you can see the XHR request for the PHP page.
Then jquery Mobile is changing the URL in the address bar with it's pushState plugin: http://jquerymobile.com/test/docs/pages/page-navmodel.html
In a general sense, yes, you can use a desktop browser for development but be ready for issues when you move to testing on a device. Sometimes you don't get any, but there are some frustrating bugs in the current mobile browsers.

Related

How to make an app ready for 'ovrweb' protocol (to be viewed in Gear VR)?

I have a web app that uses ThreeJS. I am currently trying to include WebVR to be used with Gear VR.
I am aware that I need to link to that web app using the ovrweb protocol in order to open it in Gear VR. My problem is that it does not.
Whenever I use window.location.href = "ovrweb:http://my-app-url", I am asked to attach the device to Gear VR. But once I do so, the screen remains black. I noticed that the same thing happens whenever I use some non-VR webpage as the URL (like ovrweb:https://www.google.com).
However the ovrweb protocol works fine as expected with certain URLs - such as ovrweb:https://playcanv.as/p/VNTAx5Eu/.
I am not sure what I am missing. My app has a VR button, on clicking which the display.requestPresent API call gets fired & the screen splits into two (works in Chrome Canary). Is that any list of requirements that my app needs to satisfy to be recognized via ovrweb protocol? If so, what are those?
I went through the Oculus docs, but did not find anything that could help me. How do I make my app run via ovrweb protocol?
Update: I found that ThreeJS example links (such as https://threejs.org/examples/webvr_rollercoaster.html) are not working over ovrweb protocol either.
Okay, found the solution myself.
Whenever we try to use ovrweb protocol, the device will try to open the URL provided in its Carmel Developer Preview browser (different from the "internet browser" one can use when inside Oculus Home experience).
Now the Carmel Developer Preview supports only "3D" websites. Navigating to 2D websites is not currently supported in Carmel Developer Preview. (https://developer.oculus.com/documentation/vrweb/latest/concepts/carmel-launching-content/). That's why my own web app, as well as links such as google.com, appeared black.
So all that I had to do was simply trigger display.requestPresent at the very start - thereby differentiating it from a 2D website.
Now display.requestPresent does not work without some kind of user interaction (such as click of a button). Same is the case with other JS APIs (such as fullscreen), for security concerns.
However it seems like navigating to a link over ovrweb protocol and thereby viewing it in Carmel Developer Preview also satisfies the user interaction condition. Hence now my VR scene is perfectly visible in Gear VR.
This solution should also work in the ThreeJS webvr examples (including the rollercoaster example linked in OP).
All one needs to do is trigger this snippet on page load.
display.requestPresent( [ { source: canvas } ] )
.then(function() {
// Presenting to WebVR display
}, function(e) {
// On error
});

Landing page in Joomla with problems on iOS

Can someone help me here?
I cannot understand why ONLY in iOS the "Autenticar" button does not work! :(
http://www.select.pt.la/
It works on "ALL" browsers in Windows and Android, but in iOS... nothing!
Can't figure this out.
EDIT:
Since this is a test platform, you can login with
User: demo
Pass: demo
You have some serious issues on that site which could be having all kinds of strange effects. You are running javascripts that need jquery, and jquery is not loaded
Why not use this free plugin to see if it stops the errors, and as a secondary function fixes your button
JQuery Easy

Joomla mobile template testing

Joomla automagically recognises the mobile template and displays it on the mobile devices. but sometimes it does not display(very rarely) and also sometimes the behaviour is different(like logo disappearing).
Question:
1) Is there a way we can test the mobile template on the desktop computers (like m.mobilesite.com) so that we can debug the issue?
Yes You can,
The http://www.browserstack.com sites Provide a real machine for testing the device and browser compactability.(It a remote machine so the result is 100%).This required signup.
Also you can check iphone and ipad compactabilty with safari Developer option.
From Settings->Preference ->Advanced ->check the Show Develop menu option.
Now you will get a new menu in the browser Developer there you can choose the user agent.
You can also find several sites that provide mobile testing but those are not 100% sure
like iphone4simulator.com, iphonetester.com
Hope this may help you..
I also found that - If you decrease your browser width and height - it will display mobile format. I am not sure if this is a feature of later versions of joomla. Also on Chrome - developer tools, there is an option to choose the mobile device to test the webpage.

Cross domain ajax does not work with redirect in mobile safari

I'm experiencing this issue that's mentioned in this WebKit bug:
https://bugs.webkit.org/show_bug.cgi?id=57600
The issue is with mobile Safari, it works with Google Chrome and Firefox. The same code where I redirect a cross domain ajax request works with Google Chrome and Firefox, but doesn't with mobile Safari.
As I understand the bug was filed in WebKit version 525:
https://bugs.webkit.org/show_bug.cgi?id=57600
And solved in WebKit version 528 (I figured this since a different regression bug was opened on the same issue):
https://lists.webkit.org/pipermail/webkit-unassigned/2012-April/429252.html
But with my mobile Safari on an iPhone device, the redirect is denied, even though I have mobile Safari with WebKit version 534 (a much later version).
Has anyone experienced this behavior, and is there a solution to this?
Note: I do have the cross domain (CORS) headers defined (since it is working in Google Chrome and Firefox).
Edit: The same issue with Safari for Windows.
I've encountered the same issue with several mobile browsers (Safari, Chrome/Dolphin on Android).
I've no solution for the 302, but I found a workaround:
the Java framework we use can either redirect or forward POST responses, so we changed it to forwards mode.
Using forwards result in a 200, so the AJAX success handler (we use jQuery) can retrieve the data properly.
Hope this helps.

AJAX not working in IE7

We have a lot of AJAX in our pages. Mostly it's been in our internal systems, so we haven't tested it with a lot of browsers. But at the moment we're developing a major feature, that will use AJAX, for our customers and we testing it more thoroughly. One of the tests have been in IE9 running IE7 mode, which worked just fine. But when we took a machine running a real IE7 browser, we discovered that AJAX only works once on any of our pages. It seems that after a part of the page is re-rendered with ajax, all javascript events in the part of the HTML that was re-rendered stops working. It's impossible to get even a javascript alert() box to appear.
Since we only have one machine with IE7, we would like to know if anyone can verify that this is a real problem, and not just a problem with this one machine of ours?
And if it is a real problem, what did you do to fix it? 10 % of our users still use IE7, so cutting that browser just isn't a workable solution.
UPDATE / SOLVED:
We decided to get a new server and set it up with Windows XP. Even though we don't support it, we tested it in IE6 and it worked. Then we installed IE7 and it worked too. Guess our old test server is all messed up some how. So all works in IE7 after all.
Thank you for the suggestions all.
Personally I intend to forget about older browsers, but I usually use the jQuery library for my AJAX requests since I usually use jQuery anyway for specific animations etc.
jQuery supports these browsers:
Firefox 3.6, 5.0.x, 6.0.x
Internet Explorer 6+
Safari 5.0.x Opera Current - 1
version Chrome Current - 1 version
source
Because jQuery AJAX is very much part of the jQuery library as anything else, I assume that the jQuery AJAX is supported by these browsers as well.
jQuery AJAX API
AJAX calls are cached in IE. Use "cache: false" in the ajax call options.

Resources