How do I find out what browsers support 'disabled' property? - dom

Basically, I want to have a good understanding on what browsers support element.disabled = true as opposed to element.setAttribute('disabled', 'disabled').
I can solve things with the latter syntax or with jQuery or with something else, but I am just interested about where to look when I get the same question next time.

the correct syntax for disabled is disabled='disabled' all modern browsers should behave correctly given this.

Related

Is there a way to end styleformat on Enter in TinyMCE

Working with a indirect implementation of style_formats through Optimizely. What I want to achieve is a way of getting the chosen style to be ended on a line-break (Enter). This works by default on headers, but not when added own formats.
I've read through the documentation: https://www.tiny.cloud/docs/configure/content-formatting/ with no result (as far as I can understand) but guess its possible due to the natural behaviour of headers.
Anyone with experience on this issue?

Provide Pattern for Tesseract

I'm using go and tesseract together. I have something like
2^3 or 22^55
And Tesseract is still sometimes wrong with a white list so I'm looking for a way to provide pattern I read through the FaQ and tried the suggested option with the bazaar.
My Pattern file looks like this:
\d\d^\d\d
\d^\d\d
\d^\d
\d^\d\d
But somehow It still doesnt work. Are there any tips to get it working or is the only way to realize this to generate a new language file.
Not a developer so forgive me.
I was looking into a similar issue a while ago and found that the description in the source code is confusing as tesseract by default needs 4+ constant characters in front of the pattern. It even provides examples that would not work under default conditions.
However this is configurable as is described in:
The trie.h code
kSaneNumConcreteChars I am pretty sure was the parameter you are after.
Hope this helps.

Accurate browser detection/redirect possible using JavaScript?

Please forgive me if this answer is somewhere else on this site or online. If it is, I sure haven't found it in the past several days of searching.
What I am hoping to find is an "accurate" method of detecting a browser and redirecting to a simple, static page if not a recent browser.
The samples I have found until now often have not provided an accurate representation of the actual browser being used. For instance:
When testing with Navigator 9, I'll get a message that I'm using Firefox 2
When testing with Maxthon 3, it reports I'm using IE 9.
My site displays correctly in all the current browsers I've been testing it with. But I wish I could have a basic static page for those .01% who still are using an old browser for whatever reason. They could still get some basic information from my site, as well as encouraged to update to a more current browser.
If anyone has any useful suggestions, I'd greatly appreciate them.
Thanks so much.
Cheers,
David
Browser detection is never perfect, for a variery of reasons. If you are using jQuery, you should look into jQuery.browser.
I'd try to detect the browser on the server side and do an HTTP redirect if the browser is something non-standard. Most decent frameworks have functionality to detect the browser from the user agent string. Again, this is not perfect, mainly because of the data browsers report. Also, if Maxthon reports it's IE, that's because it is based on IE and therefore the layout engine should be the same.
So you either
support a small number of browsers and cater for their quirks, sending all other browsers to a basic page (this sucks for future versions of browsers because they might be standards-compliant but they will still display your very basic page), or
you have a standards-compliant page for all browsers and then you define alternatives for the ones that give you problems.
I'd go for the second option. It usually all boils down to one version for all browsers, and a number of hacks for various versions of IE. Also, remember to avoid padding in your CSS and use margins instead.
In the end, you probably shouldn't be testing for browsers and version numbers, but supported features. Try using Modernizr.
The $.browser property is deprecated in jQuery 1.3. On jQuery support site, they strongly recommend to use the detection feature (JQuery.support) instead of the jQuery.browser property.
Actually, this has been answered already in another question, please check here How can you detect the version of a browser?

Create a classList substitute for the browsers that haven't implemented it yet

There's a question that looks like this one here:
Create my own classList object when the browser does not implement it itself
The problem is that the answer works in some browsers but does not work in IE7 and in flock (at least).
So I'd like to have an alternative that works with these browsers.
What I want is simple but I believe it's not simple to implement.
I want to be able to apply this code to any browser build from the time that IE7 or FF 3.0 was build:
var select = document.createElement('select');
select.classList.add('guestSelect');
How can I accomplish that?
Note that I don't want to use any frameworks or any libraries. I want to be the one to write the code!
I'd like to do it this way specially because I want to learn how to accomplish these kinds of things.
Maybe you don't need this answer anymore, but other may still be looking for it.
Since IE7 doesn't implement the Element class, you can't extend its prototype. The best you can do is to create your own element class that wraps DOM elements, and use it everywhere. That's what most frameworks do, by the way.
Mind you, this could dramatically change the code you've already written.
That's why it's better (simpler?) to rely on global functions like addClass(element, "foo");.

Google like autosuggest with Solr

I'm currently using Solr with Terms Component and Jquery Autosuggest which works quiet good. However, this construct is limited to one autosuggest word (it autocompletes only the first word). Is it possible to implement a Google like autosuggest with multiple words/terms so i can autocomplete multiple words?
I just wrote a blog post about different ways to make auto complete suggestions with Solr. It's basically a comparison of some different strategies, check it out, it might help.
If you want to make multiple terms suggestions, it turns out you should use, as already mentioned in the other answer you got, the Suggester component available in Solr starting from the 3.1 version. Since it has some limitations, you can also have a look at the ShingleFilterFactory, which generates token NGrams. It creates combination of tokens as a single token, that's useful to suggest multiple words.
You can also use SpellCheckComponent for better auto complete suggests.
See http://wiki.apache.org/solr/Suggester for details.
Edit:
Refer here for solr5 and above
Check this out, it might help
http://www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-queries-using-edgengrams/
I worked out the same task, finally got solved using TermsComponent with multiple fields. check this link. http://lucene.472066.n3.nabble.com/auto-completion-search-with-solr-using-NGrams-in-SOLR-td3998559i20.html