I am creating one web application. It has one print link on it which calls
window.print();
function of javascript. It works fine in Chrome and Safari. But its not working in the Samsung Stock browsers in android. Please suggest how to initiate print in these browsers.
As indicated in the window.print() documentation, the command is not supported on Android devices. You can use the Google Cloud Print Web Element to add print functionality. You will need to implement a browser sniffer to determine which device is being used.
An online search will most likely provide you with options utilizing NavigatorID.userAgent property, however, this has been deprecated and may not work in the near future. Feature testing is probably your best option.
Hopefully this will help you get pointed in the right direction.
I am trying to find a way to detect a user's java version using javascript. I have tried both PluginDetect and deployJava.js. Both work on Firefox but return null on Chrome. Not getting any warning about blocked plugins, and no console messages, so I'm not entirely sure what the problem is. Anyone know?
Chrome no longer supports NPAPI (technology required for Java applets) or check also if javascript is enable on chrome.
But i found some sites maybe this can help u to detect browser and browser version:
Using jquery api
2nd site
jsfiddle demo browser detect
css-trick.com
Javascript detect what Chrome version STACKOVERFLOW
And This last
actually this is something that I have no idea what to do actually, what I need to do is that I need to check my site for mobile friendliness on different mobile browsers on their different versions.
like this
android browser
version 1 ok
version 2 ok
version 3 not ok
ext....
similarly on different mobile browsers
what I have till now. I tested for this on browser stack but I can only find limited no. of browsers and their versions.
If it happens that anyone knows any particular site or url that relates to my concern please comment or answer.
links that I know are: browser stack.com
and http://webtrends.about.com/od/mobileweb20/tp/list_of_mobile_web_browsers.htm
and test mobile etc.
but i need a detailed analysis..
https://www.google.com/webmasters/tools/mobile-friendly/
You can use this to test mobile friendliness.
Here are a few more websites to help:
https://validator.w3.org/mobile/
https://validator.w3.org/mobile/
http://mobiletest.me/ - This one lets you choose a device to emulate the browser
I need to detect the browser type and version from where a Angular app is being accessed. I know there are a few JS libraries out there but don't know which one to use.
The web app is supposed to be supported on the latest editions of Chrome, Safari, Firefox, and Internet Explorer.
I've found this answer but I don't know if is the right way to go, so any advice around this? How I can achieve this?
If browser not support JavaScript then you can not display that message using JavaScript you need to use
<noscript> Message that has to display </noscript>
and you can apply css to it
if support and you want to check version using ng-device-detector is not possible because it only detect device types, OS types and browser name not version. I found this article which may help. If you still wanna use ng-device-detector here is GitHub source and this is plunker.
I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582