Quantcast
Browsing latest articles
Browse All 37 View Live

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 Article


Comment 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 Article


Comment 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 Article

Comment 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 Article

Comment 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 Article


Comment 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 Article

Comment 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 Article

Comment 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 Article


Comment by JohnP on Push files in a input of type file

Thanks, I updated the answer. It's almost a decade old now.

View Article


Comment 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 Article

Comment 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 Article

Comment 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 Article

Paginating 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Error 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 Article


Image may be NSFW.
Clik here to view.

Fixed 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 Article


Answer 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 Article

Answer 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 Article

Configuring 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 Article


Defer 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 Article

Answer 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 Article

Answer 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 Article

window.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 Article



Answer 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 Article

Answer 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 Article

Image may be NSFW.
Clik here to view.

Cookies 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Image may be NSFW.
Clik here to view.

Swiftkey 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 Article


Image may be NSFW.
Clik here to view.

Setting 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

Browsing latest articles
Browse All 37 View Live