Tag Archives | Javascript

Flash detect by Javascript

How to detect flash by Javascript

Read full story Comments { 0 }

RC4 implementation in PHP and Javascript

In cryptography, RC4 (Rivest Cipher 4 also known as ARC4 or ARCFOUR meaning Alleged RC4, see below) is a stream cipher. We provide some function RC4 in PHP and Javascript PHP: JS: Example: Result: Try it yourself Some RC4 variants RC4A cipher implement in PHP and Javascript VMPC stream cipher implement in PHP and Javascript […]

Read full story Comments { 0 }

How to create a download button in Jwplayer

Step 1: First, we need to use a download image: here Step 2: Setup jwplayer HTML: JS: Step 3: add download button Here is the online demo: http://demo.tutorialspots.com/jwplayer/jw1.html But, if we use playerInstance.getPlaylistItem()[‘file’], we only download the first source file in the currently playing playlist. How to download the current video? Here is the solution: […]

Read full story Comments { 0 }

PHP: ActionScript Array.slice method

In ActionScript, to slice an array, we use Array.slice method: Returns a new array that consists of a range of elements from the original array, without modifying the original array. The returned array includes the startIndex element and all elements up to, but not including, the endIndex element. Now, we make the similar method in […]

Read full story Comments { 0 }
HTML5 audio Tag: use with javascript

HTML5 audio Tag: use with javascript

In the previous tutorial, we can know the audio file types which HTML audio tag supports and some attributes of the audio tag. We have many questions. First: how to detect which format the browser supports? We can use the library Modernizr to detect this. Example: Javascript (Note: use external resource: Modernizr) Result: http://jsfiddle.net/sans_amour/csxy3tLa/ Second […]

Read full story Comments { 0 }

Using Colorbox JQuery plugin to autoload a Lightbox

Here the sample code using Colorbox JQuery plugin: We receive the result: Problem with Colorbox JQuery plugin However, when we use Colorbox with other JS library or older JQuery, like the example below: We get the Error: Error: $(“.inline”).colorbox is not a function We must use $.noConflict() method:

Read full story Comments { 0 }
Google Maps JavaScript API v3: how to get the center lat & lon of a polygon

Google Maps JavaScript API v3: how to get the center lat & lon of a polygon

How to get the center lat & lon of a polygon? We can do it just by calling polygon.getBounds().getCenter() Note: in Google Maps JavaScript API v2, Polygon had a getBounds() method, but that doesn’t exist for v3 Polygon. You can find that method in this article.

Read full story Comments { 0 }
Google Maps JavaScript API v3: method Polygon.getBounds

Google Maps JavaScript API v3: method Polygon.getBounds

In Google Maps JavaScript API v2, Polygon had a getBounds() method, but that doesn’t exist for v3 Polygon. Here’s the solution: Here, we present a simplified method: Image copyright: Google maps

Read full story Comments { 0 }
Google Maps JavaScript API v3: method Polyline.getBounds

Google Maps JavaScript API v3: method Polyline.getBounds

In Google Maps JavaScript API v2, Polyline had a getBounds() method, but that doesn’t exist for v3 Polyline. I wrote some methods below: Method 1: Method 2: Method 3 is the shortest method. Image copyright: Google Maps

Read full story Comments { 0 }