Why doesn't JQuery mobile do anything in IE6? - jquery-mobile

Quickly looking through the code it seems most of it has been designed with IE6 in mind but it seems none of the script runs in IE6.
I'm not looking for full functionality. Just some of the styles you get once the script has attached class names. I want to provide support for IE6 users through a simplified mobile site.
Thanks for any advice.

Why so old ie6 you are thinking about?
jQuery Mobile cant work well with IE6.
because it uses css3 and html5 which is not supported on ie6.

Related

Polymer in Chrome for iOS - it is not working, right?

I was all excited over Polymer and starting developing a web app. I soon found out that Firefox fails loading the site correctly, see this SO post for details:
Polymer: Layout screwed up in Firefox, fine in Chrome
Then, I downloaded the latest version of Chrome on an iPhone 4 (iOS7) and the same thing for iPhone 6 (iOS8) and tried the website. I see the same errors as I see on Firefix (please see the link above).
In other words - going to my Polymer based website using Chrome for iOS fails just as bad as Firefox fails.
So, I'd just like to confirm that this is the case: Polymer does not work on iOS (no support in Safari, no support in Chrome for iOS). Correct?
As I also noted in my other SO question linked above, I was expecting it to work in all browser due to "polyfill", but that doesnt seem to help.
Am I missing something? =)
Note: Using Chrome for Android works fine, no errors there.
As I mentioned in the other thread, it's impossible to polyfill CSS scoping. Chrome on iOS is not actually Chrome, it's built using the iOS WebView (an old one at that), meaning there's no native Shadow DOM and no CSS scoping. The Shadow DOM polyfill does properly wrap DOM API methods like querySelector and getElementById, so you do get limited encapsulation, in that respect. But for CSS, the only thing the polyfill can do is rename your selectors, so :host .blah gets renamed to x-foo .blah and appended to a style tag in the head. It means you need to still write defensive CSS (as you do today) and avoid very loose selectors because they will be applied.
I experienced something very weird today and maybe it might help you.
My firefox was rendering as if polyfills didn't existed.So i went back to false on about:config dom.webcomponents.enabled and it came back to life.
Why? no clue.It worked, so, if you have dom.webcomponents.enabled true on firefox about:config might as well give it a try. IMHO looks like a polyfill bug on capable (yet buggy and poorly supported) web components browsers. worth a try.

Check browser version using Dart rather than JS?

Is there an "Angular/Dart" way to detect older unsupported browsers and prevent to continue with an elegant message (there are plenty of examples using javascript) rather than continue and show a weird layout with code that doesn't work?
Even the angulardart.org/demo site should do this IMO to stop IE8 (I know, but some enterprise customers still have those old browsers installed - and set as default - for legacy apps) from showing content that doesn't even work.
If Dart code cannot be executed the test has to be done in Js. I'm not aware of a library that makes this test.
The test should follow What browsers do you support as JavaScript compilation targets?.

Does PhoneGap require JQM or is that a coincidence?

The PhoneGap examples that I'm seeing use jQuery Mobile, but I'm wondering if PhoneGap requires it, or if people are using JQM because they're (obviously) writing a mobile app?
In fact, does PhoneGap require jQuery at all?
Let me Google that for you:
http://wiki.phonegap.com/w/page/16494778/Getting%20Started%20with%20PhoneGap%20(iOS)%20-%20Xcode%203#Requirements
That is for iOS but no PhoneGap does not require jQuery.
People are most likely using jQuery mobile since they are trying to target multiple devices and JQM supports that fairly well out of the box.
http://wiki.phonegap.com/w/page/36868306/UI%20Development%20using%20jQueryMobile
Phonegap does not require jQuery at all.
It's basically just an empty browser window without all the fluff. You can use whatever HTML, CSS, and Javascript tricks you want as long as they're compatible with an HTML5 capable browser.
I like http://zeptojs.com/ for handling the javascript. Much more lightweight (although you lose a lot of the animations and stuff that JQuery has)

What is the value of HTML5 Boilerplate for a Rails application?

There are several application templates (and a Rails gem) that add HTML5 Boilerplate to a Rails application. So I investigated and put together an analysis of HTML5 Boilerplate for Rails. It seems HTML5 Boilerplate doesn't add much that isn't already there in a new Rails app. What's useful:
sample humans.txt file
example index.html file for a default application layout
viewport metatag
Google Analytics snippet
There's some CSS help like CSS normalization, placeholder CSS Media Queries, and CSS helper classes but it seems you'd get all of them and more with a CSS toolkit such as Skeleton, Twitter Bootstrap or Zurb Foundation.
Finally, HTML5 Boilerplate has lots of components for websites that need to support IE6, 7, and 8 such as IE conditional comments, Modernizr, and Chrome Frame. But if I'm not supporting IE6 and I'm using Twitter Bootstrap or Zurb Foundation I don't think I need these.
HTML5 Boilerplate is a good project that has lots of community input. There's a lot of good advice on its website. But for a Rails project?
Am I missing something? What is the value of HTML5 Boilerplate for a Rails application?
HTML5 Boilerplate has a few different features, typically borrowed from other projects.
A server config file for setting timeouts, turning sendfile on, gzipping, server expiration, etc. I believe their repo has a few different versions of these files for a few different servers (apache, nginx, node, lighttpd). You can find those config files here: https://github.com/h5bp/server-configs. From my understanding Rails doesn't have any type of equivalent for this.
It also comes with a custom build of Modernizr that checks for HTML5 and CSS3 features within the browser and then adds classes to your <html> tag so that you can utilize them within your stylesheets or javascripts. This allows you to target browsers with a fallback style or interaction if it didn't support the feature you were trying to use. One example for CSS may be something like border-image which doesn't have widespread support. You could apply border-image: for the browsers that can use it and for the others you would use the class that HTML5Boilerplate provides (html.no-borderimage) to provide a backup style. You could also check for these classes from your JavaScript to be sure you weren't targeting browsers with code they didn't need (or couldn't respond to). Rails doesn't have anything internally that would do this out of the box.
Respond.js is also packaged with Modernizr which gives you media queries support in browsers that don't already have it. You mentioned you weren't targeting IE6 but IE7 & IE8 don't support Media Queries (nor do a good amount of mobile browsers) and Respond.js would give you that support. Rails also doesn't have anything built in to handle this.
Modernizr relies on yepnope.js to load externals so that would be available to you as well. This library allows you to test for features and load certain scripts/styles based on the result of that test. This is helpful if you are bringing in files that only some browsers need. Rails doesn't do this.
PNG fixes. You probably don't need this if you aren't supporting IE6 but it does come packaged with some png fixes for legacy browsers (cough IE6). Rails doesn't really handle this type of thing on the front end on it's own.
Ultimately you could grab the pieces that you need and bring them into your application without bringing in the entire HTML5 Boilerplate (and fwiw, that's what I typically do as well). That said, your question is "what value does HTML5 Boilerplate bring to a Rails application?" and the answer is "a lot", depending on if these tools are useful based on what you are doing. HTML5 Boilerplate doesn't necessarily overlap Rails in any way.
You can get a full list of features, coding style recommendations at the HTML5 Boilerplate Docs
You'll also probably be interested in HTML5 Boilerplate for Rails Developers

Is there a dojo or a Jquery just for Firefox add on development?

Started working on Firefox add ons, which is done with JavaScript and XUL, and I find myself sorely wanting to use Dojo or someother kind of JavaScript like library, but I can't find one that exists. So I was thinking of starting a library by porting Dojo over to a Firefox add on specific fork. Get rid off the cross browser stuff, use array comprehension and other nice stuff available in Firefox's JavaScript engine. I worry about whether or not there's enough of a userbase who'd take advantage of this, but more than that I guess I'm wondering if there's already something like this? Google finds nothing.
Mozilla Corp developed a JavaScript library for this purpose: FUEL.
it is developed by John Resig the creator of jQuery.
To know how to use jQuery inside FF extension look at this similar question
jQuery, at least, functions perfectly well when embedded in a Firefox addon. I can't quote you names, but I've heard that several popular addons are already using jQuery.
Here's an article discussing using jQuery within XUL and some of the hoops you may need to jump through.
It is fairly common to embed jQuery in firefox extensions.

Resources