Calculate the Screen Height on a Mobile Device

This drives me crazy. Lots of times I have carousels and such where I need to reset the screen height with JavaScript responsively. The issue is that with mobile devices, the screen height includes the little URL window at the top, so the height o...
more »

2017-01-16 23:01 (2) Answers

How make reusable code in jQuery?

I have code on the link below, and I need to use it several times for any places. I set different value for bars, of course it works wrong. So, the bad answer is set id to each span and copy code for them several times. Please, give me a tip how to ...
more »

2017-01-16 22:01 (2) Answers

AngularJS: How to ng-repeat from specific value

I am trying to create a template that will repeat based on certain value. For example if the total number of pages are 3 and total records are 15 then each page will have 5 records. So essentially it would be a nested ng-repreat. I create a sample ...
more »

2017-01-16 21:01 (1) Answers

Better way to write a reptitive function?

I have code that looks like this: $('.item-one').mouseover(function() { $('.img-one').addClass('fit-img'); }); $('.item-two').mouseenter(function() { $('.img-two').addClass('fit-img'); }); $('.item-three').mouseenter(function() { $('.i...
more »

2017-01-16 13:01 (1) Answers

Remap JSON object to other JSON structure

I'm trying to remap the following JSON structure that is formatted by categories and then per category can contain multiple locations. A location contains a lon/lat and an area code: { "cat1":[ {"location":{ "latitude":51.38, "lon...
more »

2017-01-16 12:01 (2) Answers

How to make html table columns resizable?

I have a fairly standard bootstrap-styled <table>. I want to make columns of this table resizable, e.g. by click-and-dragging right border of <th> element. I can't use any jQuery plugins as I'm using Angular and jQuery dependency is not a...
more »

2017-01-16 11:01 (3) Answers

Get JSON url from textbox?

My script is to get JSON file from url entered in textbox I IDed textbox as txtr and use jquery to get value var txtbval = $("#txtr").val(); and this in json parsing script url: txtbval, But when I clicked on button nothing happen I don't know what...
more »

2017-01-16 06:01 (2) Answers

Just CANNOT get form to send email

I'll probably get a duplicate on this but I've searched and searched and I can't find someone experiencing the same issue with the same syntax, so hopefully someone can see something I'm missing. PHP is not my strong suit, but I have gone through sev...
more »

2017-01-16 05:01 (2) Answers

Get innerHTML from selection

I have the following divs in an HTML page: <div class="foo">Bar</div> <div class="foo">Baz</div> I'd like to get an array with the text contained in the two divs: ['Bar', 'Baz'] I can do this using d3.nodes but it seems ...
more »

2017-01-15 21:01 (4) Answers

Click in Angularjs using Casperjs

I would like to click in angularjs using casperjs. However, i cant achieve this. The webpage populates a dialogbox everytime i run so this is why i need to click. This is what i try to click <button class="ng-scope" trans="" ng-click="closeDialo...
more »

2017-01-15 21:01 (2) Answers

Replace a paragraph with a city name from JSON

While building a weather app I faced a problem. It has to automatically detect where we based and provide with appropriate temperature and location e.g city name. I'm trying to replace p with a data from JSON. In particular I'm trying to replace para...
more »

2017-01-15 21:01 (2) Answers

Unable to print Json object

The code below get's Json object from a URL in a loop. Problem is I cannot seem to display returned Json data. I want to display the Temperature and Humidity from the object. Valid Json objects are returned OK, but i cannot display it in HTML div....
more »

2017-01-15 13:01 (2) Answers

Array and Objects in javascript

If length is passed in square bracket notation of an array. It returns first element. What is the underlying logic here? var foo= []; foo['0'] = 'hello'; foo[2] = {'fun': true}; foo[length]; ...
more »

2017-01-15 10:01 (1) Answers