jquery4u.com - Archives (janvier 2017)

1 jQuery Fan Blog for your Daily News, Plugins, Tuts/Tips & Code Snippets.

Le: 09 01 2017 à 20:00 Auteur: James Hibbard

This is the editorial from our latest JavaScript newsletter, you can subscribe here.

Hey everyone, welcome to a brand new year on SitePoint JavaScript. I hope you had a great break (for those of you that took one) and are ready to start off 2017 with a bang.

2016 was a crazy year for JavaScript! We saw an ever increasing adoption of ES6 and the rise of progressive web apps. Also, Yarn emerged as a competitor to npm and JavaScript fatigue fatigue became a thing. In case you missed any of this, or you’d simply like to reminisce on the year just passed, we've got you covered. Craig Buckler looks at these events and more in his post JavaScript: 2016 in Review. It’s well worth a read.

Looking forward to 2017 I wonder two things. Will this year be as crazy as the last? And where should I focus my learning efforts in the coming 365 days? The answer to the first question is “almost definitely”, but the answer to the second is somewhat more complicated. Knowing what to learn depends rather a lot on your situation, for example are you looking for a new job? Do you want to become more productive in your current one? Or do you want to check out a couple of new technologies to get a feel for how they stack up against those you already know?

If you’re in that last group, we’ve got you covered there, too. Tim Severien started 2017 by taking a look at three libraries that are worth keeping an eye on in this coming year. I’d encourage you to give that post a read and let Tim know if you agree with his choices (spoiler: one of them is Vue.js).

As for me, I decided that one of my goals for 2017 would be to cut back on my use of jQuery. This isn’t because I’ve suddenly jumped on the anti-jQuery bandwagon. I haven’t. Rather because jQuery was so awesome when it first came on the scene, that today I often use it without thinking. I don't stop and consider what browsers can do natively.

Continue reading %Editorial: What Do You Want to Learn in 2017?%

Le: 03 01 2017 à 22:00 Auteur: Simon Codrington

An interesting thing you might not know is that you can dynamically control the print preview UI on your site. By default the browser will choose what to print (most likely the whole window itself), however there are several jQuery plugins out there that will give you control over what is printed.

While print plugins might not be the most exciting plugins out there, here are some you might want to look into. We'll also touch on how you can build this functionality yourself if you're adventurous.

Note: Ancient browsers (I'm looking at you IE8) might behave strangely when using some of these plugins. However all modern browsers handle print previewing in a consistent way so keep that in mind if you need full comparability.

jQuery Print Preview

jQuery Print Preview

This small jQuery plugin lets you open a new browser window to display specific parts of your site for printing. Unlike some of the other plugins on this list, this plugin doesn't directly trigger the browser's print functionality, it simply opens up a minimal window (which is perfect as you can now print it directly).

The plugin's usefulness is for when you have sections of data you want to print e.g a card of information or a row in a table. You can open it up in a new window (providing configuration options to the plugin) and then print from there. This ensures that you're only printing the content you need.

Its browser support seems pretty comprehensive and worked well across my modern browsers.

It's unfortunately not on GitHub so it's hard to know if this is being actively supported. However that shouldn't deter you, You should see if it works for you and then use it 'as is'.

Website
Demo

jQuery Print Plugin

jQuery Print Plugin

Don't let the ugly demo fool you. The jQuery Print Plugin works well and offers a range of settings for you to customize your printing needs. For example, you can set if the popup will take place in the current widow (via an iFrame), set the time to wait before the print display renders and place content before / after the popup.

To get up and running just pass it a jQuery object or selector and off you go, the plugin does the rest.

The author has pushed out a few commits in 2016 to improve the plugin. While there aren't many commits, it still looks like it will continue to grow.

Website
Github
Demo

Continue reading %5 jQuery Print Page Options%