문제

For example, I used Modernizr which fallback to jqueryUI 's datepicker if HTML5's date input type is not supported (sadly true in general )

It is implemented like this post

Besides full-blown browser-automation test / manual starting up my safari, are there simple mechanism that we can mock up Modernizr to test against these fallbacks?

as this scenario the fallback solution jqueryui does actually function in most and my development browser (Chrome)

도움이 되었습니까?

해결책

Wy not just comment out the if statement?

If you have more than 1 of those, I guess you could simply overwrite the value of Modernizr.inputtypes.date to false at the beginning of your JS:

Modernizr.inputtypes.date = false;
if(!Modernizr.inputtypes.date){
    //fallback here
}

다른 팁

You should not be trying to disable the test in chrome, you should test in the browsers it fails in. A polyfill may work wonderfully in chrome, but fail in IE. At that point, you have just confirmed that a polyfill works in a browser that will never need it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top