I have an app that uses jquery.mobile-1.0a4.1.js. The script has worked every time, but now when I try it there is a 1 in 3 chance that I will get this error:
$.mobile.pageContainer is undefined
[Break On This Error] $.mobile.pageContainer.addClass(className);
I have added the origional version and tried again, but I still get the error (line 2425)
Is there any JQuery Mobile version I get that will be error free? Again this error is in the mobile file, and not my code (jquery.mobile-1.0a4.1.js)
Edit I get the same issue when I use the min version as well jquery.mobile-1.0a4.1.min.js
"1 in 3 chance" to me sounds like you have a race condition based on the download times of your scripts. You may want to look at firing custom events when everything is downloaded and ready to go instead of having a downloaded script immediately executing.
Again this error is in the mobile file, and not my code
The error is being reported in the JQuery mobile code, but it could be caused by an error in your script. Try creating a simple test script that uses JQuery mobile to see if you still get the error.
Make sure you still link to the correct JQuery.js file and that's still up.
It's always best to download a working JQuery script and host it on your own server though. So no changes will ever be made to it.
As for your question if there are other JQuery Mobile versions, I'm sure there are.. But that's what Google will help you with.
Related
I am facing serious problems while developing an Angular 2 app and building it for iOS with Cordova. It kind of works when building and running it for Android (still there are some problems with routes on startup), but I can not get it running on iOS.
The app is developed with Angular 2.0.0-rc.1 and angular-cli.
Whenever I build the app with xcode for iOS, the app is stucked on Angular 2 loading - i guess it is a problem with the bootstrapping process, but I am not sure.
In console, I can see that it fails to load the component css files, like this error shows:
[Error] EXCEPTION: Failed to load file:///var/mobile/Containers/Bundle/Application/F325C057-2287-463A-ABF6-DB68944C63D9/Dooda.app/www/app/notifications/notifications.component.css
logError
logGroup
call
(anonyme Funktion)
invoke (zone.js:323)
onInvoke
invoke (zone.js:322)
run (zone.js:216)
(anonyme Funktion) (zone.js:571)
invokeTask (zone.js:356)
onInvokeTask
invokeTask (zone.js:355)
runTask (zone.js:256)
drainMicroTaskQueue (zone.js:474)
invoke (zone.js:426)
The path is correct, it just can not proceed to load the files. In my iindex.html, I can see that the Container is empty, thus the Angular 2 stuff is not loaded there.
I have set the base href in index as following:
<base href=".">
If you need further information or code, please ask.
Have anyone faced the same issue and can help me here? I am really clueless what to do now, I have no idea why the file loading fails here.
Any help would be highly appreciated!
Thanks in advance!
The solution is very simple, just use
<base href="./">
in index.html file. It will work
had the same problem with Cordova / Ionic on iOS. It was caused by an empty file.
I had a component without template markup, but only with SCSS for the :host-selector.
It seems like Safari doesn't recognize any empty files via XHR and encounters a 404-like error, which breaks the application. To fix that, I removed all empty files from my components. After that it did work for me on iOS-emulator and native iPhone 6.
I am not sure whether it is related with base url for you problem.
In the normal, we will build and package the app with angular-cli into www dir. And after that, you should not see separate css files anymore. Because all css files will be packed in one file, based on your webpack setting.
We are developing web app, that uses framework that uses indexedDB. All was going fine, but then we tested it on iPad and suddenly it didn't load the page at all. Thought it would be some minor issue, but after some tests we found out, that the app is crashing on:
TypeError: null is not an Object validating 'request'
It crashes on the line :
var request = indexedDB.open("FMVare",415);
This stores null in the request variable so then after that there is:
request.onerror(...)
Which will get us the error message, written above.
I spent one day looking for a fix, but only found that iOS implemetation of indexedDb is "buggy". But I cant even open a database, so there probably is problem somewhere else. My colleague also told me, that it was working fine like 1 month before, but the file with this implementation (according to git) didn't change... ever.
I tried using pollyfill to change it to the WebSQL, again it worked everywhere except iPad browsers (Safari, Chrome). This time it was throwing different error, which I only could google as far as some SQL syntax error, which obviously couldn't be the case, if it is working everywhere else.
I have tried some suggestions, which said to replace in that pollyfill indexedDB with _indexedDB etc. but again, it worked everywhere but iPad.
When I log the variable request, it returns null. If I log indexedDB or window.indexedDB, it returns IDBFactory object, so it's there, but the .open method is failing, without calling .onerror or .onsucess method.
Since I really found many people complaining about indexedDB bad implementation on iOS, it means they were able to use it. So what could be the problem in my iPad? I mean I can try update to iOS 9, but that's not exactly what are we trying to achieve.
I tried deleting cache, changing version number(greater and smaller), creating different database (different name), pollyfill... but still can't get it working, everytime i call indexedDB.open(databasename), it returns null and crashes.
Any ideas?
EDIT:
The error I'm getting with shim is
Error in sysdb transaction - when creating dbVersions.
Then I get the SQLError object with
"code: 5"
and
"message: could not prepare statement (1 not authorized)"
The error happens in createSysDB(success, failure) function of the shim.
UPDATE:
I tried an app on iPad called WebView Rendering so i could try if WKWebView would be capable of running my app. And it was! So the problem really was the UIWebView support of IndexedDB.
Seems very strange to me though, that you can't use IndexedDB on iOS Safari even after update on latest iOS version.
I have a strange situation with a project for iOS.
Its created using browserify and React for Cordova and aimed at iOS.
We have built the project for iOS using Cordova commands without any issues. It runs with no xcode errors or Javascript errors either however none of the JS ui appears on screen. We just get a blank white screen with the system bar at the top. See attached screen shot.
So far we have found out that if you add HTML to the index.html in WWW folder it prints that fine so I assume its the JS.
When we run in a browser it works as well as building for Android.
We have no problems with anything other than iOS (simulator and device build).
hopefully someone can help me out here because I'm stumped. Please let me know what files you need to look at and I'll make them available.
Thanks in advance.
IMAGES
The error screen: http://www.voidapplications.co.uk/errorScreen.png
What we expect to be shown: http://www.voidapplications.co.uk/whatWeExpect.png
If you are using internationalization component that's because you need to use the Intl polyfill:
Intl.js and FT Polyfill Service
Intl.js polyfill was recently added to the Polyfill service, which is developed and maintained by a community of contributors led by a team at the Financial Times. It is available thru cdn.polyfill.io domain, which routes traffic through Fastly, which makes it available with global high availability and superb performance no matter where your users are.
To use the Intl polyfill thru the Polyfill service just add one script tag in your page before you load or parse your own JavaScript:
<script src="https://cdn.polyfill.io/v1/polyfill.min.jsfeatures=Intl.~locale.en"></script>
When specifying the features to use thru the polyfill service, you have to specify what locale, or locales to load along with the Intl polyfill for the page to function, in the example above we are specifying Intl.~locale.en, which means only en, but you could do something like this:
<script src="https://cdn.polyfill.io/v1/polyfill.min.js?features=Intl.~locale.fr,Intl.~locale.pt"></script>
note: the example above will load the polyfill with two locale data set, fr and pt.
This is by far the best option to use the Intl polyfill since it will only load the polyfill code and the corresponding locale data when it is really needed (e.g.: safari will get the code and patch the runtime while chrome will get an empty script tag).
source & other ways to include Intl polyfill: https://github.com/andyearnshaw/Intl.js#getting-started
You can debug the UIWebView in the simulator with Safari http://moduscreate.com/enable-remote-web-inspector-in-ios-6/. You'll probably see a big error message in the console, if not you will have access to the debugger so you can step through and sort it out.
I have had this issue in the past, it turned out to be unsupported javascript features. for example, setting default parameters in the function. I.e:
function test( myvalue=0 ) { /* ... */ };
I had to initialise the value inside the function instead. You could also try removing any ecma script 2016 features you may have implemented.
Trouble shooting this type of issue was painful. I created a minimal version of the smallest part of my product compiled and ran it on ios emulator, added another chunk of the product, rinse and repeat.
Im sure there's a better way to detect these issues, but I do not know it.
I've just created a new project and installed the file and file-transfer api's via CLI. I have already created a working app previously so I know how to use phonegap and have been doing so for a few years now.
Here is the code:
window.resolveLocalFileSystemURL("file:///localhost/var/mobile/Applications/96B4705C-C70D-4340-9A42-HJ1F28355D43/tmp/cdv_photo_015.jpg", function(fileEntry){
console.log(fileEntry.name);
}, function(error){
console.log('about to resolve this files errors');
console.log(error.code);
});
Nothing ever gets outputted in the console debugging window ...and yes I have debug installed cause I have console.log() in other parts of my code that show up.
It seems like there is an issue when passing URL data from navigator.camera.getPicture() to the file API when using window.resolveLocalFileSystemURL()...any ideas anyone. I'm up to date on phonegap api and everything and I have this issue for the past few days now...I can't seem to solve it.
***EDIT***
Seems like when you use Camera.DestinationType.FILE_URI as a parameter for navigator.camera.getPicture(). When you choose a picture and the success call back for navigator.camera.getPicture() is triggered, trying to window.resolveLocalFileSystemURL from the URL that getPicture returns just fails. But if you set Camera.DestinationType.NATIVE_URI it at least returns something but it's in a format that can't be used with the file-transfer api exp: assets-library://asset/asset.JPG?id=220BCEAE-F1EA-4A6A-83B2-AB8833A90BF2&ext=JPG
Seems like this was a bug in the file api v1.0.0
https://issues.apache.org/jira/browse/CB-6116
Temp solution is there as well.
Seems like "/local/" was causing the issue. Remove it from incoming uri's if it exist and the resolve should work.
I'm getting a weird error while trying to click on a Capybara Element
I'm using find(:xpath,"//a[contains(text(),'Connect')]").click
(find(:xpath,"//a[contains(text(),'Connect')]").present? return true)
the error I get is:
Selenium::WebDriver::Error::MoveTargetOutOfBoundsError Exception: Element cannot be scrolled into view:javascript:void(0);
i did some research and the only solution i found is that setting the selenium version to 2.16 may fix this issue (i'm using 2.25).
anybody got an idea?
It may happen when the page being tested is not fit into the current window size. If you know such pages where usually these error happening, you may explicitly scroll down before doing the operation on such hidden elements(like click, clear etc). Here the code to explicitly scroll down the page.
In java,
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("javascript:window.scrollBy(250,350)");
From the times I used selenium webdriver to test .NET apps, I would get that error when the issue was exactly what it sounds like: It's looking for an object on the page that it cant scroll to for some reason. In my case it was because some dialogue boxes would appear without scrollbars and the driver had no way to "scroll the object into view"
Can you watch the execution of your test and see if that's the case? I had some luck rolling back to a previous version of firefox because 15+ was (as of about 2 months ago when I had the issue) unsupported by web driver and had this problem periodically. Rolling back selenium versions may help too.
First step though is definitely to watch the execution of the test and see whats happening though. And a good debugging idea may be to try to work through your steps manually yourself to make sure the test works by hand.
Its also worth noting that for the webdriver to be able to execute click the object actually has to be visible. IsPresent doesnt require that, it just searches the page files. Also an issue I ran into. IsPresent will still return true for objects that are not and cannot be made visible on the page (i.e. something at the bottom of the page that you cant see at the time)
Couple of tips here:
Webdriver should ideally be on the most recent update, it's what most use (Unless you're doing Ruby Automation)
Use css selectors, xpath (Whilst rendered), is almost always heavier on both resources and code.
Try defensive coding, first of all ascertain it exists. There are many ways to do that dependent on what package you are using. In ruby you would do page.has_css?('css_string')