Nginx proxy_pass response truncated – Server Fault

The best answers to the question “Nginx proxy_pass response truncated” in the category Server Fault. QUESTION: I use nginx to proxy https request to my application server (currently running on 8443). This app server serves dynamic pages, some of them including jquery minified. The pages are in error as it seems jquery is truncated… is … Read more

blank page example.com/phpmyadmin with errors in browser's console – Server Fault

The best answers to the question “blank page example.com/phpmyadmin with errors in browser's console” in the category Server Fault. QUESTION: I have installed phpmyadmin and symlinked it on my LEMP server(php 7).But when i goto hostname/phpmyadmin it returns a blank page with phpmyadmin icon on titlebar. And 3 errors in browser’s console: Failed to load … Read more

Chrome S3 Cloudfront: No 'Access-Control-Allow-Origin' header on initial XHR request – Server Fault

The best answers to the question “Chrome S3 Cloudfront: No 'Access-Control-Allow-Origin' header on initial XHR request” in the category Server Fault. QUESTION: I have a webpage (https://smartystreets.com/contact) that uses jQuery to load some SVG files from S3 through the CloudFront CDN. In Chrome I will open an Incognito window as well as the console. Then … Read more

dataset vs .data – Difference? – Dev

The best answers to the question “dataset vs .data – Difference?” in the category Dev. QUESTION: I am reading some values in data attribute fields. I have seen two easy ways to read the data as shown below: var webappData = document.getElementById(‘web-app-data’), rating = webappData.dataset.rating; OR var effectData = $(‘.effects-list li’), creative = effectData.filter(‘[data-creative]’).data(“creative”); My … Read more

How to get ID of clicked element with jQuery – Dev

The best answers to the question “How to get ID of clicked element with jQuery” in the category Dev. QUESTION: I have the following html: <a href=”#” id=”#1″ class=”pagerlink” >link</a> <a href=”#” id=”#3″ class=”pagerlink” >link</a> <a href=”#” id=”#2″ class=”pagerlink” >link</a> /*etc…. */ and the following jQuery script: $(document).ready(function() { var $container = $(‘.gallery_r’).cycle({ fx: ‘scrollHorz’, … Read more

jQuery selector value escaping – Dev

The best answers to the question “jQuery selector value escaping” in the category Dev. QUESTION: I have a dropdown list that contains a series of options: <select id=SomeDropdown> <option value=”a’b]&lt;p>”>a’b]&lt;p></option> <option value=”easy”>easy</option> <select> Notice that the option value/text contains some nasty stuff: single quotes closing square bracket escaped html I need to remove the a’b]<p> … Read more

Add jQuery function to specific elements – Dev

The best answers to the question “Add jQuery function to specific elements” in the category Dev. QUESTION: I know that you can add new jQuery functions by $.fn.someFunction = function() However, I want to add functions to specific elements only. I tried this syntax and it doesn’t work $(‘.someElements’).fn.someFunction = function() I want to do … Read more

Is it possible to use multiple variables instead of selectors in jQuery – Dev

The best answers to the question “Is it possible to use multiple variables instead of selectors in jQuery” in the category Dev. QUESTION: I know that it’s faster to do the following: var $header = $(“#header”); $header.css({color:”#ff0000″}); $header.find(“a”).addClass(“foo”); Instead of: $(“#header”).css({color:”#ff0000″}); $(“#header a”).addClass(“foo”); Because jQuery doesn’t need to find the elements again in the DOM … Read more

how does jquery chaining work? – Dev

The best answers to the question “how does jquery chaining work?” in the category Dev. QUESTION: I am not asking what is the appropriate syntax for chaining, I know it could be something like: $(‘myDiv’).removeClass(‘off’).addClass(‘on’); However I’m really curious to understand the inner working of it, as far as I know chaining is one of … Read more