Main usaged of modernizr & HTML5shiv library - modernizr

I've never used HTML5 or CSS3. I am just learning and planning to use them later in a web project. If we just include modernizr js file in page that does not help us to detect which feature works or not rather we need to write code for modernizr fallback system and from there we take decision how to handle situation if any HTML5 feature is not supported by the browser. Here is one modernizr fallback example
Modernizr.load({
test: Modernizr.canvas,
nope: 'http://flashcanvas.net/bin/flashcanvas.js'
});
If Modernizr can handle for any browser then why should i use HTML5shiv library?
Why HTML5shiv needs to be included when Modernizr is already used on the page?
How HTML5shiv library works? does it solve all IE issues just by including it?
Does HTML5shiv provide any fallback system?
How to conditionally load HTML5shiv library if the browser is IE?
Please provide your answer with code samples.
looking forward for discussion. thanks

If Modernizr can handle for any browser then why should i use HTML5shiv library?
Why HTML5shiv needs to be included when Modernizr is already used on the page?
You don't need to separately include html5shiv, because Modernizr includes it. As of Modernizr 1.5, this script is identical to what is used in the popular html5shim/html5shiv library
How HTML5shiv library works? does it solve all IE issues just by including it?
html5shiv only allows IE to recognize and style HTML5 elements. Nothing more.
Does HTML5shiv provide any fallback system?
No, feature detection is only supported by Modernizr. Note that Modernizr by itself doesn't give you fallbacks. You could use yep/nope to provide polyfills or fallbacks to the feature you want to support
How to conditionally load HTML5shiv library if the browser is IE?
using conditional HTML comments, this will load html5shim on IE versions below 9
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Related

Use CKEditor 4 without jQuery?

Is it possible to use CKEditor 4 without jQuery? I've noticed it seems to "integrate" with jQuery through an adapter, but I don't want to use jQuery on my site, so I'd prefer to use CKEditor without the adapter. I don't see anything in the CKEditor documentation, GitHub issues, builder config files, or Stack Overflow questions about using CKEditor without jQuery, so I'm guessing it's probably not possible? I'm mostly just surprised that the question has never been asked, so here I am asking it. If it turns out that it is indeed possible to use CKEditor without jQuery I would be thrilled.
EDIT: I don't see jQuery in the dependencies of the npm package, so it shouldn't be required, but I've found no instructions on how to build it without the jQuery adapter.
Of course, possible use CKEditor without jQuery.
jQuery adapter used only for treat CKEditor as jQuery object via $.
All basic CKEditor plugins(components) not used jQuery too.
However, a few extented CKEditor plugin as "Accessibility Checker" demand of jQuery.
OK, after some investigation it looks like it can work without the adapter, and the adapter is not included in the build. The issue appears to be with certain plugins requiring jQuery (the autosave plugin is the one I was having issues with).

Susy 2 IE8 Fallback

I need to add support for IE8 and possible previous versions using Susy 2 but there is very limited documentation that described how to do this.
I know in Susy 1 there was a lt-ie9 fallback tag to use against breakpoint declarations but that doesn't seem to work for Susy 2.
Is there any documentation for IE8 support or other way this can be achieved?
Susy doesn't exactly "support" specific browsers — since that would be determined feature-by-feature. I think media-queries are the only place you may need a fallback for IE8, and fallback options still exist for that. You can find all the docs inline with other information about media handling. We have some basic media-query tools built in, and additional support for the Breakpoint plugin. The built-in mixin is now called susy-breakpoint() and accepts a $no-query argument for managing your fallback.

Advise on resolving pseudo-class compatibility for IE8

I have used pseudo-classes in the project, that i am currently working on, and since it is already javascript heavy I am trying to avoid using selectivizr. Is there are way making psedoclass compatible with IE8? Is it possible to use Modernizr to resolve this issue?
Any advise would be much appreciated.
You could check for css-lastchild with Modernizr (you'll find it in the Non-core detects section) and customize your styles if the browser doesn't support css-lastchild - which would mean it doesn't support any other of the CSS3 selectors either, which are:
:root
:nth-child()
:nth-last-child()
nth-of-type
nth-last-of-type()
:last-child
:first-of-type
:last-of-type
:only-child
:only-of-type
:empty
:target
:enabled
:disabled
:checked
:not().

What are the plugins to insert code snippets in website?

It wld be best if the plugins have syntax highlighting function for html,css and javascript
Most websites I know use Alex Gorbatchev's famous SyntaxHighlighter javascript library. This is a very popular library and it supports CSS, JavaScript, HTML out of the box (see the available "brushes").

npapi - javascript doesnt load the content of a plugin

I wrote a firefox plugin using C++ and used the <EMBED> to load it to html.
In javascript I got the embedded plugin by using document.getElementByID,
but when I tried to call a plugin function, the function was undefined. Moreover,
plugins constructors did not run while loading the page.
The same html file and plugin seems to work on some computers, while it doesnt work on others.
Does anyone have an idea what might by wrong?
How can I debug such an issue?
Can you reproduce it on your computer at first? If not, then try to figure out what systems, browsers, architecture, versions, they are using.
I recall, there are many GECKOSDK's, and each one has a specific version it works for. https://developer.mozilla.org/en/gecko_sdk For example, different SDK's for Firefox 1.5-2.0, FireFox 3.0, Firefox 3.5, and Firefox 3.5
For different browers, make sure you are exposing the right DLL Exports, browsers can vary: http://git.webvm.net/?p=npsimple is a good starting point. You can use firebreath.googlecode.com too as an alternative.
My suggestion would be to use an object tag instead of <embed>. In my experience, doesn't seem to work as reliably.
If I had more information on how your plugin is structured (are you using XPCOM or npruntime?), I might be able to help more.

Resources