Tag Archives: javascript

Drag and drop on mobile devices

Drag and drop on mobile devices I had a problem in the past with a draggable and droppable calendar with jQuery and ajax. When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, you obtain a problem. The dragging and dropping are intercepted by the phone

How to select all anchors with display block jquery


How to select all anchors with display block jquery Very often or not, you need to select all the elements from within the DOM, that have their display property set to “block”. Solution

Filter function from jQuery to the rescue. Description: Reduce the set of matched elements to those that match the selector or pass

How to redirect URL in Javascript or jQuery


How to redirect URL in Javascript or jQuery I will present some ways to redirect the user to another page from the client side using only plain javascript. 1) Using window.location.href you obtain a similar behavior  as an HTTP redirect

2) Using window.location.replace

window.location.href VS window.location.replace It is better than using window.location.href, because replace() does not put

Change value of selectbox in Zurb Foundation via JavaScript


Change value of selectbox in Zurb Foundation via JavaScript Some of us tried to change or will have to change via javascript a select-box that is generated from the custom forms of Zurb Foundation  framework. You noticed or you will notice that it is not as simple as changing a default html select-box. Why ?

PHP explode equivalent for javascript


PHP explode equivalent for javascript Very often you have to perform operations on strings to split them, to obtain only a desired piece of it. If the string is formatted in a way that allows you to split, eg. you know the delimiters, you can use the following way to do this. Problem Let’s say

jQuery DOM manipulation methods


jQuery DOM manipulation methods In today’s tutorial we will learn how to manipulate DOM elements. We can add elements one after another, replace one element with another one, get properties such as width or height or remove completely elements from the DOM. A few of these methods — such as .attr(), .html(), and .val() — also act as “getters”,

jQuery DOM Attributes tutorial


jQuery DOM Attributes In the previous chapters we talked about jquery selectors and we learned that they are coming from css world. We selected elements that were available in the DOM that can be manipulated in all kinds of ways. In this tutorial we will go further and we will talk about DOM attributes. We can manipulate

jQuery Selectors tutorial


jQuery selectors As I promised, I will write a series of jquery tutorials starting from beginner to advanced, so the first episode of these series will be about jquery selectors. What are jquery selectors ? jQuery selectors are one of the most important aspects of the jQuery library. These selectors use familiar CSS syntax to

Using Javascript eval function

Javascript eval function Long, long in the past, I was trying to obtain a logical expression from some different variables and concatenate them into one single variable, to use that further for a jQuery plugin. Everything looked great when running console.log(myVar), but then the problem came. In my mind, I didn’t thought that the result would

Converting strings to numbers in javascript


Converting strings to numbers in javascript There are some situations where you would want to take a string from a place, convert it to a number and put it in another place on the client side. This thing can be obtained by some helper function that are built-in in javascript. In this article we will

Request an article ←