Comment by JohnP on Fixed position footer scrolls in iPhone X
Thanks man, but this approach doesn't work either. It appears that the body height appears to be larger than the viewport height. Trying a couple of other variations on this.
View ArticleComment by JohnP on Fixed position footer scrolls in iPhone X
I have the content wrapped in a div, but that didn't seem to work. I'm trying a few other variations of this now.
View ArticleComment by JohnP on php date format YYYY-MM-DD minus or add one week from now?
@hexYeah I don't think you're correct. The commenter is just adding a fixed number of seconds to the timestamp. DST is taken into consideration after the timestamp has been modified, it's got nothing...
View ArticleComment by JohnP on Use variable outside the success function from an...
Generally you'd show a loading indicator to the user and wait till the server response is received.
View ArticleComment by JohnP on Hide Database Login Information in PHP Code
The safest way to deal with is to have a mykeys.php.sample file that lists all of the keys that the app uses with all of the values empty. The values can either then be manually filled in by the user...
View ArticleComment by JohnP on Can't send call to client
If you're having trouble where even the console.log directive is not showing the correct output have you checked whether the file you're editing is being loaded? Maybe add an additional console.log in...
View ArticleComment by JohnP on Oauth error invalid_request: The redirect_uri is not...
You likely have a typo or something on your whitelist. Check out this github issue - github.com/Shopify/shopify_app/issues/486
View ArticleComment by JohnP on Get text of the selected option with jQuery
@B-shan Only replying to this because of the confusing downvote. The posted solution works just fine and only returns the HTML of the selected option, not all HTML associated with that ID (as you...
View ArticleComment by JohnP on Push files in a input of type file
Thanks, I updated the answer. It's almost a decade old now.
View ArticleComment by JohnP on jQuery: enable submit when min 1 checkbox is checked
@JanusBahsJacquet Answered almost a decade ago, I've added your comment, thanks!
View ArticleComment by JohnP on How to use a php result set from a query in JavaScript
@mickmackusa This answer is from 10 years ago, tbh I don't even remember why I added an unnecessary eval in there. Anyway, I've updated it, thanks.
View ArticleComment by JohnP on Use dynamic variable names in JavaScript
@BuSaeed Not sure I understand, if the variable is already local scope, can't you just refer it to it by name? You should probably ask a new question as this is an old question with a different meaning.
View ArticlePaginating data by last active when rows constantly change
I'm looking for pagination approaches to be used on data that is constantly changing (around 1 - 3 updates per minute). I have a conversation list with the following structure conversation : id,...
View ArticleAnswer by JohnP for How to Truncate Table using CakePHP?
NOTE: This answer is valid only up to CakePHP 1.3. I haven't used this on the never versions so I've no idea whether it works.deleteAll only deletes the data, it does not truncate the table.You'll need...
View ArticleAnswer by JohnP for Hammer.js breaks vertical scroll when horizontal pan
User patforna is correct. You need to adjust the touch-action property. This will fix scrolling not working when you have hammer bound on a big element in mobile.You create a Hammer instance like so...
View ArticleAnswer by JohnP for jQuery does not show content with setTimeout
You need to wrap your jQuery call in a function$.ajax({ url: 'content.php', data: '&go='+ tab, success: function (data) { setTimeout(pencil, 3250); //pass in a function reference preferably....
View ArticleAnswer by JohnP for Jquery find is not working
$('.popular_prd').find('.view-content')This will just return a jQuery object which never evaluates to falseYou need to check the length of itif(!$('.popular_prd').find('.view-content').length) { //no...
View ArticleAnswer by JohnP for Binding events in jquery (double event on click...)
Well, if you want to bind two methods to the same event you can simply put them in one method and call it. I've never bound two methods to the same so can't comment on why the dual binding is...
View ArticleAnswer by JohnP for Linking page in a div with html forms and php
Since you've tagged jQuery, I'll use a jQuery example$(document).ready(function(){ $('form').submit(function(){ $('#content').load('code.php'); return false; })})This makes a couple of assumptions...
View ArticleAnswer by JohnP for Error in creating a websocket connection within a hybrid app
The solution to this is to use the httpd module in Trigger.Setting up the httpd server makes the app be served with a http://localhost URL instead of the contents: or file: protocol. With this in...
View ArticleError in creating a websocket connection within a hybrid app
I have an app that uses socket.io (1.4.5) to establish a websocket connection. The app is available via a web URL and also as a packaged Android app using Trigger.io. The Android app is unable to...
View ArticleFixed position footer scrolls in iPhone X
I have a hybrid HTML5 app created using the Trigger.io framework. The app contains a fixed footer and a scrolling content area. The app works fine on all devices except the iPhone X. On the iPhone X...
View ArticleAnswer by JohnP for puppet-common (= 3.8.7-1puppetlabs1) Installling Error
Your mileage may vary but the only way I could get around this problem was deleting all the puppet related .list files in /etc/apt/sources.list.d.Files were...
View ArticleAnswer by JohnP for Configuring Envoy to use SRV records generated by AWS ECS...
Posting the solution I ended up going with. I setup Consul to work as a discovery service. Basically a Consul sidecar would run alongside every cluster/webservice I have. When the webservice comes...
View ArticleConfiguring Envoy to use SRV records generated by AWS ECS and Route53
I'm using AWS ECS to deploy multiple web services (via Docker images) that are behind an Envoy front proxy. Some of these docker images have multiple deployed instances.I'm currently using the service...
View ArticleDefer loading of images without the use of JS
I want to defer the loading of images in an HTML file until after all other assets have loaded or for a set amount of time. I would like to do this without JS. I already use a deferred image loading...
View ArticleAnswer by JohnP for RAW SQL Query with Zend Framework
If you're creating a Zend_DB object at the start you can create a query using that. Have a look at this entry in the manual : https://framework.zend.com/manual/1.12/en/zend.db.statement.html$stmt =...
View ArticleAnswer by JohnP for Run function after user has stopped typing
Here's a rough draft : http://jsfiddle.net/jomanlk/msmJp/Uses setTimeout and clearTimeoutvar timer = null; $('#text').keyup(function(){ clearTimeout(timer); timer = setTimeout(doStuff, 1000) });...
View Articlewindow.close() doesn't work on iOS
I open a new window with window.open() to redirect users to the oauth login page. However, after successful login when the user is redirected back to my app the previous window with the window.open...
View ArticleAnswer by JohnP for Getting Data from Node.js file and displaying it in...
You should start by setting up a server to serve requests. I use expressjs for this - http://expressjs.com/This will allow you to run nodejs as a web application.Setup a route in express JS to serve...
View ArticleAnswer by JohnP for how to stop retry HTTP call when server servers respond...
This test code seems to work fine for me. I created a request that just randomly spits out a number, which is used in the retry callback.I'm using PHP 7.3 and the latest version of Guzzle and the...
View ArticleCookies not being sent back and forth properly in Opera
First off, I'm not sure whether this is a problem in Opera 12.01 or not, but the problem only occurs in Opera. I've tested in FF14, Chrome 21, Safari 5 (Windows) and Safari Mac and Webkit browsers on...
View ArticleAnswer by JohnP for How do I refresh a page using JavaScript?
You're spoiled for choice; any of the following work:window.location.href = window.location.href;window.location.reload();history.go(0);
View ArticleAnswer by JohnP for Changing element style attribute dynamically using...
Assuming you have HTML like this:<div id='thediv'></div>If you want to modify the style attribute of this div, you'd usedocument.getElementById('thediv').style[ATTRIBUTE] = '[VALUE]'Replace...
View ArticleAnswer by JohnP for How do I run the system commands in JavaScript?
You can't run system commands on the client with JavaScript since it works inside a browser sandbox. You'd need to use some other client-side tech like Flash, ActiveX or maybe applets.
View ArticleSwiftkey keyboard on ios hides text input
I have a simple page with a text input at the bottom. On ios with the default keyboard selected, when the user clicks on the text input the input is pushed up and the user is able to enter text (see...
View ArticleSetting map language to English in Openstreetmap with LeafletJS
I'm using LeafletJS to add a map component to my app. Everything is fine and dandy except for the localization of the map. Some country names are shown in the local language (I'm assuming). Is there a...
View Article