Is there an Aztec barcode generator library for JavaScript? - javascript

I'm looking for an open source image generation script for Aztec (2D) barcodes:
I can't seem to find any available scripts out there.
There is an Active-X control here that can be used only in IE and an image generator URL here, but these are not useful as it should be a pure javascript solution running under webkit-based browsers that can run in disconnected mode for mobile apps.
Anyone have some old code for this hanging around either written in javascript or that can be ported to javascript?
Thanks.

bwip-js runs in any browser that supports <canvas> – IE 9+, FF 2+, Chrome, Safari 3+, Opera 9+, and Android 2.1+. It also runs server-side in Node. (If you wanted downlevel IE support, try using a <canvas> emulation layer.)
Aztec is among the 83 barcode formats it can draw. Here's a demo of it in action.

Related

Trying to open the exe file in javascript without ActiveXObject

I am using Prime faces form and the exe was being launched on button click through Javascript using ActiveX Object.This functionality was working fine in IE(Internet Explorer) but Edge is not supporting ActiveX Object.
Anybody know the alternate of it?
Earlier We have tried with ActiveXObject and was working fine.
Except VGR's solution, I think there's no programmatical way to open exe file in a modern browser. But if you're using Edge, you can open that page in IE mode. Edge IE mode supports ActiveX controls.
Edge IE mode is designed for organizations that still need IE 11 for backward compatibility with existing websites but also need a modern browser. If you're in an organization, you can configure IE mode policies to make that page always open in IE mode. Or you can just use Edge settings to configure IE mode pages.

Does embedded webkit browser in El Capitan support localstorage?

I have a Microsoft Word 2016 Add-in that (like all Office.js Add-ins) uses Apple's WebKit as the embedded browser.
(On Microsoft Word 2016 for Windows the browser is IE11 of all things).
On El Capitan my Add-in is throwing an error - which is nearly impossible to debug...at least given what I know. Specifically 10.11.6.
Everything works fine on Sierra.
I've traced the issue to, potentially, my use of localstorage to keep and reuse a couple of values...
Does Apple WebKit embedded support the use of localstorage? Maybe there's some sort of permission or initialization required?
Is there any way to troubleshoot embedded webkit? The solution works fine on Safari/Chrome etc.
Are there any other differences between webkit on El Capitan and Sierra?
Yes, WebKit (at least for 10.11.6) supports localstorage.
I traced my problem to the use of 'const' while in 'use strict'...
I was using a code snippet from Firebase/Google (for authentication across all my apps/websites) that declared a variable using “const”.
In “use strict” this is not allowed in older versions of WebKit. It’s been fixed, which is why Sierra was okay (I guess).
See https://bugs.webkit.org/show_bug.cgi?id=161464.
But it threw an error on 10.11.6 and (I guess) earlier.
Here is the crucial bit of info: how to turn on debugging for WebKit (when used as an embedded browser):
Run the following command using terminal on your Mac:
defaults write com.Microsoft.OsfWebHost WebKitDeveloperExtras -bool true

Is there a way to detect iOS safari while filtering out iOS Chrome, Firefox and other browsers?

So for those who worked on iOS web applications probably know that due to Apple's policy, Chrome and other mobile browsers on iOS use a very ancient javascript engine. This is why we need to disable some of the rendering for Chrome and other none-safari browsers for iOS.
I had been reading this question and there is no useful answer there. Here are some of my approaches (failed):
Use is_iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) to detect if the browser is on iOS. And then use:
is_FF = navigator.userAgent.match(/(firefox)/g) and is_Chrome = navigator.userAgent.match(/(chrome)/g)
to kill off those firefox and chrome browsers.
I then realized all the browsers share identical user agent string with iOS safari. So I imagine the method should be running a javascript function that only Safari can run and then determine if the browser is Safari.
So, there's two schools of thought when choosing which native functionality you should use while working in browsers. One school of thought is checking the userAgent as you are doing here and using/removing features based on the userAgent.
The problem with checking userAgent is that it gets complicated really fast. You have already run into an interesting problem, but what will happen when you find that ie8 does not have the feature you are looking for?
A better solution may be to check if the feature exists in its current context without worrying about userAgent. A great example would be the new HTML5 audio element. Based on browser support, we can tell that it does not exist in ie8 nor Safari < 4.0. Instead of checking if the browser matches the ones mentioned here you can just check if the feature exists. As we know that the audio element is an instance of the Audio class. We can simply check:
if (window.Audio) {
//load and play the HTML5 audio element here
}
That is much simpler than checking the userAgent.

MPEG-DASH cross-browser play

I want to stream some video file and i've found interesting the DASH adaptive streaming capabilities, but i'cant find anything else but "dash.js" (which seems to work only for Chrome browsers) to implement client-side playback (integrated with html5 "video" tag). I know that dash.js works with chrome's mediasource APIs, but -if i'm not wrong- they should be standardized by W3C. Firefox says that MSE APIs are already avaliable on the recent versions, but dashif.org example video doesn't work, while an alert says that i should retry with chrome. So, what can a poor student at first experience with web development do to adaptive-stream video with html5???
Indeed, Firefox supports the standardized Media Source Extensions, but you also need to confirm that the content you are trying to play is supported in terms of video and audio codecs.
You can find the supported codecs for Firefox here. So, the key for cross-browser compatibility is to use the audio and video codecs supported by all browsers.
Also, there is a much newer version of the DASH.js player currently available, perhaps you want to give it a try: DASH.js 1.1.2
You can test the MSE implementation of Firefox already with the developer version of Firefox 36/37. Please not that you have to enable it via about:config. Currently it is planned to release it in version 37, to the best of my knowledge. Also the nightly build allows MSE testing.
According to your player request, I can recommend the player from www.dash-player.com. I tested it already on IE 11 (Win 8), Safari 8, Firefox 36 and Chrome (Windows, Linux, Android) of course. They have also an automatic fallback solution using Flash. And, perfectly for students - it's free.

How to make JS and CSS compatible with IE, Firefox, Chrome, Safari?

Our company develops ERP and CRM, and so far our products support IE and Firefox. Now we want to support Chrome, Safari and even Opera. Is there any comprehensive materials that introduce browser compatibility of JS and CSS? thks!
theres the mozilla dev-center that has a great CSS- and JavaScript-reference. Every entry has information about browser compatibility.
For a quick overview, you cauld also take a look at caniuse.com (CSS and JavaScript) that provides simple tabular lists for the different features.
I've been coding the front-end for over a decade and a half now, and things seem to get better over time in regards to cross-browser compatibility. I've found that if I write and test my code using Firefox, most everything will work flawlessly on Chrome, Opera, Safari and the only thing you'll end up having to debug would be MSIE. 10 years ago I would have told you to code and test using MSIE and debug your code in the end with Netscape.
But yeah, if you follow this, you'll find it easier to make all your scripting and markup fully cross-browser compatible with no bugs at all. Enter IE9, of course, a different monster altogether.
Is there any comprehensive materials that introduce browser
compatibility of JS and CSS?
http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(Cascading_Style_Sheets)
http://html5test.com/
http://caniuse.com/
"Comprehensive" can change overnight, but there is a great deal of information available.
If your products work for the latest version of Firefox, Chrome, Safari, and Opera will work without major flaws most of the time. If your markup is invalid, you are using many vendor-specific extensions, or you are using cutting-edge features, this may not be the case.

Categories