javascript,mobile,browser-detectionRelated issues-Collection of common programming errors
Elisabeth
javascript iphone ipad orientation
I’m having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn’t seem to be an obvious solution – I’ve seen this question asked a couple of times on Stack Overflow and no one’s yet been able to answer it.When I start the app in portrait mode, it works fine. Then I rotate into landscape and it’s scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoo
Ulker Ibrahimova
javascript jquery file-get-contents
This question already has an answer here:Ways to circumvent the same-origin policy11 answersIs there any way to get full page source of snother different site? Example my site is example.com but i want to get facebook’s page source on example.com. I tired this one: http://phpjs.org/functions/file_get_contents/ And it gives me null. So anyone knows it?function file_get_contents (url, flags, context, offset, maxLen) {// Read the entire file into a string//// version: 906.111// discuss at: http://
shoriwa-shaun-benjamin
java javascript android cordova webview
I am trying to get my cordova webview to work with cordova 3.2 an use the phonegap Camera API to access the camera.Reference: Android WebViewsHere are some successful implementations of what I want to do, but these use Phonegap 1.9, i want to use Phonegap 3.2 (the latest one)Cordova WebView using AndroidAlso here’s a VideoWith the code below I am able to make the cordova webview display my index.html page without any issues but when I to access the camera by clicking on “Capture Photo” in my HTM
Inator
php javascript apache nosql couchdb
I’ve recently successfully installed CouchDB version 1.2.1 and as a test I can access it using the following Apache rewrite in CentOS 6:RewriteRule couchdb/(.*)$ http://127.0.0.1:5984/$1 [QSA,P]I have a PHP authentication class that I use across a home grown API to support my mobile apps. My API accepts and authenticates each request using an HMAC signature that is included in the URL like so:https://api.domain.com/endpoint/?timestamp=[timestamp]&signature=[signature]&id=[id]…etcEach
novicePrgrmr
java javascript ajax json jsp
I am sorry to ask this but i’ve been working on this for hours and I can’t figure it out on my own. I have to use json for part of a project and I was able to get it to work but now it’s not returning it back to the right jsp but instead just displaying the json jsp. I am pretty sure it is how I am receiving the json.here are screen shots of what is happening:this is the jsp that I need to use ajax on, I am wanting to populate the second dropdown using ajax:this is what is happening instead, (it
Andrew Whitaker
javascript regex
I am trying to build a regexp from static text plus a variable in javascript. Obviously I am missing something very basic, see comments in code below. Help is very much appreciated:var test_string = “goodweather”;// One regexp we just set: var regexp1 = /goodweather/;// The other regexp we built from a variable + static text: var regexp_part = “good”; var regexp2 = “\/” + regexp_part + “weather\/”;// These alerts now show the 2 regexp are completely identical: alert (regexp1); alert (regexp2);/
DOTang
javascript regex
I am searching for text inside of website resources (html and javascript), and need to identify 3 regular expressions that will locate this text under certain circumstances:some string of text when it is contained inside of a javascript single-quoted string some string of text when it is contained inside of a javascript double-quoted string some string of text when it is not contained inside of a javascript stringHere are some scenarios that are likely to occur (searching for the string “somestr
Andy E
javascript html
I’m building up a row to insert in a table using jQuery by creating a html string, i.e.var row = “”; row += “<tr>”; row += “<td>Name</td>”; row += “<td><input value='”+data.name+”‘/></td>”; row += “</tr>”;data.name is a string returned from an ajax call which could contain any characters. If it contains a single quote, ‘, it will break the HTML by defining the end of the attribute value. How can I ensure that the string is rendered correctly in the brow
sameer
javascript angularjs maven yeoman
I have recently integrated maven yeoman plugin with my app. I followed https://github.com/trecloux/yeoman-maven-plugin/blob/master/TUTORIAL.md My angular version is v1.2.3 . When I run the mvn clean install command, I get the following error . [email protected] node_modules\grunt-contrib-imagemin ?ö£?öÇ?öÇ [email protected] ?ö£?öÇ?öÇ [email protected] ([email protected], [email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ p
Ronald Yeung
javascript jquery ajax json cors
What I am trying to do is to have a page on the HTTP protocol sending an AJAX call to the same Web server but using HTTPS. Both the requesting page and the AJAX handler are on the same server, having the same domain and port. (I.e., only difference is the protocol.) To illustrate,Fromhttp://www.example.com/index.phpTriggers a jQuery AJAX call tohttps://www.example.com/authenticate.php?user=123&password=456(I am hoping to pass the password through HTTPS to make it encrypted over the Internet.
Anu0042
android git shell mobile touch
Hi I am trying to create a android native app in salesforce touch platform. I am trying to copy lib from sample project to my app. 1st i entered this commend in my cmdcd $TARGET_DIR $ANDROID_SDK_DIR/tools/android update project -p . -t 1the result was Updated project.propertiesUpdated local.propertiesUpdated file C:\Anu\SalesforceTouch\build.xmlUpdated file C:\Anu\SalesforceTouch\proguard-project.txtIt seems that there are sub-projects. If you want to update themplease use the –subprojects par
Sajin D.K.
android mobile apk forceclose
An Android App im working on in Eclipse , gets installed perfectly on an Android 2.3 and a 2.1 phone , the app is build for 2.2 but it directly goes into Force Close on running . Any ideas / help on what i should do ? And please inform me what i need to post so as to recieve help from the stackoverflow community .07-11 19:19:01.117: W/KeyCharacterMap(1477): No keyboard for id 0 07-11 19:19:01.117: W/KeyCharacterMap(1477): Using default keymap: /system/usr/keychars/qwerty.kcm.bin 07-11 19:19:01.
ThinkingStiff
android mobile nfc
Not sure whether my app is able to write the information I obtain from user of the app. The app keeps crashing when I press the write to tag button. I generally have 5 EditText for user input. Then I would use these values and make into a string to write into and NFC Tag. (This information would then be read using a separate app which will then break the strings into different components again).`@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);mNfcAdap
BPI
css wordpress mobile header logo
I am building an ecommerce site using this theme http://goo.gl/3BwG7RI have changed the header to black and and have a light logo. When viewed on mobile and tablet I need the header to be white (native) and the logo to be dark.I have failed to utilize the media queries to make this happen.The theme has 2 header files, the main file calls the other files to display stuff.*** MAIN HEADER ——————<div id=”logo” class=”positionleft”><?php if_logo(); // print the logo html ?>&l
jmans
android video mobile html5
According to:http://developer.android.com/sdk/android-2.0-highlights.htmlAndroid 2.0 should support the HTML5 video element. I haven’t been able to get this to work using a Motorola Droid, and haven’t been able to successfully view a video on any of the HTML5 video example pages out there. Since there currently isn’t support for QuickTime or Flash, this is the only other thing I can think of for embedding mp4 video in a web page. Has anyone had any luck with this?
nasroazro
java android mobile bluetooth
I am developing a desktop application using java to send a file to android devices. I followed this article sending-files-to-mobile-phone-using-bluetooth-and-obex to develop it. I tested it in mobile, java based and it works fine but in android mobile I get this exception:Exception: Failed to connect; [10051] Une opération a été tentée sur un réseau impossible à atteindre. javax.bluetooth.BluetoothConnectionException: Failed to connect; [10051] Une opération a été tentée sur un réseau im
Gillian Lo Wong
android iphone web-applications mobile user-agent
Many Mobile devices like my android phone have a ‘request desktop site’ option. I’m in the process of building mobile websites and want to make that native feature work.What is expected on our end as developers? Is there a GET request for example: leave_mobile=1 or is it the device itself changing the user-agent to trick the application thinking its just another desktop?
odedbd
jquery mobile
I am trying to write some jQuery code that should run on mobile browser, and I have ran into a problem with scrolling the viewport to an element. I have an element that is not visible, and I want to scroll (both X and Y) so that it’d become visible.I have tried using the excellent scrollTo jquery plugin (http://flesler.blogspot.com/2007/10/jqueryscrollto.html), and while it works wonderfully on all desktop browser I tried (FF,IE6+,Chrome) it failed for me on my Android browser (native for Androi
Invincible
javascript html5 phonegap mobile cross-platform
i have made Hello world test app for Android and iOS using PhoneGap Framework.I want to invoke Native Screens from the HTML page. How can i invoke native screen from HTML page? And vice versa.
ThinkingStiff
iphone mobile springboard spring-board
basically im making a springboard tweak and ive got a textfield with keyboard, when i click done on the keyboard i would like the keyboard to dismiss, ive tried- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; }-but i just get loads of errors when trying to compile ;L, any help would be appreciated lotsHere’s the error’Mahmood1s-Mac:sbhomesearch mahmood1$ makeBootstrapping CydiaSubstrate… Compiling iPhoneOS CydiaSubstrate stub… default tar
spike
javascript browser-detection
Feature detection is generally preferred over browser sniffing. What should I do in a case where certain browsers “support” the features I’m using but have javascript runtimes that are too slow?I’m using the d3 library for some complicated visualizations. The visualization is very smooth in chrome / firefox, acceptable in IE9, and slow yet working in IE8. I’d like to display a banner to IE8 users telling them to upgrade and a notice banner to IE9 users that it would be faster in chrome or FF. Is
Adam Stone
jquery internet-explorer browser-detection
Due to IE’s inability to fade transparent PNG’s I have decided to change my fucntion to simply show PNG’s if the user is using IE but to fade them if they are using any other browser. The function below works fine in IE and does what i expect it to but in any other browser i.e. Firefox, Safari it doesnt do anything, am i missing something or do I have a syntax error?$(‘#content2 a’).click(function(){if($.browser.msie){var toLoad = $(this).attr(‘href’)+’ #content’;$(‘#content’).show(loadContent);
splattne
javascript jquery opera browser-detection
Amazon.com recently updated their javascript, and it’s causing problems with some Opera browsers.Their browser detection code looks like so, but it’s faulty:function sitbReaderIsCompatibleBrowser() {if (typeof(jQuery) == ‘undefined’) {return false;} else {var version = jQuery.browser.version || “0”;var splitVersion = version.split(‘.’);return ((jQuery.browser.msie && splitVersion[0] >= 6) // IE 6 and higher|| (jQuery.browser.mozilla && ((splitVersion[0] == 1 && splitV
Kara
javascript html browser-detection
I found this code snippet when I followed a link here on Stackoverflow. It is exactly what I need, but I’m not sure how to implement it. I’d like to use it to run specific code depending on browser. For example, if Firefox, then simply use linked Javascript, if IE/Chrome, then I’d like to use alternate code (HTML and JS).How can this be done?var isOpera = !!window.opera || navigator.userAgent.indexOf(‘Opera’) >= 0; // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) var isFirefox
bazmegakapa
jquery browser-detection
Anyone knows of a good and reliable way to find out type & version of browser installed on client either using javascript/jquery or any other plugin? Looks like jquery has some built-in functions, but it is having problems in detecting chrome browser. Any other reliable way of doing it?
rds
javascript internet-explorer browser-detection conditional-comments
In order to detect IE most Javascript libaries do all sort of tricks.jQuery seem to add a temporary object into your pages’s DOM to detect some features, YUI2 does regex on the user agent in its YAHOO.env.ua = function() (file yahoo.js)After reading this answer it came in my mind that it’s true, in order to detect simply IE in Javascript we could simply add to our pages:<!–[if IE]><script type=”text/javascript”>window[‘isIE’] = true;</script><![endif]–><script type=”
gnarf
javascript jquery browser-detection feature-detection
In earlier versions, I used to test if I should be triggering popstate manually on page load, because Chrome triggers it right after load, and Firefox and IE do not.if ($.browser.mozilla || $.browser.msie) {$(window).trigger(‘popstate’); }Now that they dropped the browser object in 1.9, how should I test for these browsers? Or how do I figure if I need to popstate on page load or not?The code is:$(function(){$(window).on(‘popstate’, popState);// manual trigger loads template by URL in FF/IE.if (
Sven
javascript android iphone mobile browser-detection
I need to add a certain kind of support for touch devices on a current project. As this is the first time I have to do something like this, I took a look at the code of some “well made” websites to see how they do that. One page does something like this:if(document.querySelectorAll && (navigator.platform == “iPad” || navigator.platform.substring(0, 6) == “iPhone” || navigator.platform == “iPod” || navigator.userAgent.indexOf(‘Android’) > -1)) {…}I tested it on all the devices I hav
chobo2
jquery browser browser-detection
I have a website that I made and I am planning to redo it. The current version of the site used a jquery callout plugin that did not fully work in IE6. This got me thinking about browser detection.At first I was just going to put the supported browsers on the home page but then today on Digg I saw some post about some jquery plugins and wordpress and in the article there was a plugin for detecting IE.So I started to look around for some browser detection plugins. I found a few of them but they w
filmor
javascript mobile browser-detection
Is there a solid way to detect whether or not a user is using a mobile/handheld device in jQuery? Something similar to the css media attribute? I would like to run a different script if the browser is on a handheld device.The jQuery $.browser function is not what I am looking for.
Web site is in building