Monday, 2 May 2016

     Usually we will two values from dropdown list one is option value and option text, but in some situation we need to get more values from dropdown options.


Example Program:- (Editor)


Editor is Loading...

Advertisement

     In the following code will get the image or any types of files from input type="file" html tag and convert the selected file into 64bit data url. The data url can use directly in the browser address bar.

Note:
The speed vary depending on the selected file size.



Example Program:- (Editor)


Editor is Loading...

Advertisement

Saturday, 16 April 2016

     Big numbers can write using the below format in javascript.




Example Program:- (Editor)


Editor is Loading...

Advertisement

Wednesday, 13 April 2016

     In javascript we can easy to convert any numbers to corespoinding hexadecimal, octal or binary value using toString() method.

Syntax

   variable.toString()      //convert to String
   variable.toString(2)    //convert to Binary
   variable.toString(8)    //convert to Octal
   variable.toString(16)  //convert to Hexadecimal

Example

   var num=66;
   num.toString();     //return "66"
   num.toString(2);   //return "1000010"
   num.toString(8);   //return "102"
   num.toString(16); //return "42"


Example Program:- (Editor)


Editor is Loading...

Advertisement

Tuesday, 12 April 2016

     If you have many messages for delete from facebook, it is very difficult to select all the messages, because facebook don't have the option for select all the message at once and delete in a click. But we have the solution for this we will give a small script for selecting all the message at once and delete in a single click.

Step 1:
   Login to your facebook account and go to message section.

go to the facebook message section

Step 2:
     Select whose message you want to delete.

select the person message from facebook

Step 3:
     Scroll up all the messages will load.

Load all facebook messages for scroll up


Step 4:
     Click Action(gear icon) and click Delete Messages... button like the below image.

delete message in facebook


Step 5:
     After press the Delete Messages... button you can see some check box on righside of the messages.

Show check box in facebook

Step 5:
     Now Right click anywhere of the facebook page and click Inspect and on that window press Console (or simply press ctrl+shift+j ), copy the below code and paste it to the console window finally press the enter key like the below image.

code
var _0x4d48=["\x69\x6E\x70\x75\x74\x5B\x74\x79\x70\x65\x3D\x63\x68\x65\x63\x6B\x62\x6F\x78\x5D","\x71\x75\x65\x72\x79\x53\x65\x6C\x65\x63\x74\x6F\x72\x41\x6C\x6C","\x6C\x65\x6E\x67\x74\x68","\x63\x6C\x69\x63\x6B"];var tt=document[_0x4d48[1]](_0x4d48[0]);for(i=0;i<tt[_0x4d48[2]];i++){tt[i][_0x4d48[3]]()}

Script for select all the facebook delete message checkbox


Step 6:
     Wow nice all check box are checked without manually selection all checkbox, now you can just simply press delete button to delete all messages.




Monday, 11 April 2016

     The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).

Syntax

   parseInt(string, radix);

string
     The value to parse. If string is not a string, then it is converted to a string (using the ToString abstract operation). Leading whitespace in the string is ignored.

radix
     An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the above mentioned string. Specify 10 for the decimal numeral system commonly used by humans. Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.

Description
     The parseInt function converts its first argument to a string, parses it, and returns an integer or NaN. If not NaN, the returned value will be the decimal integer representation of the first argument taken as a number in the specified radix (base). For example, a radix of 10 indicates to convert from a decimal number, 8 octal, 16 hexadecimal, and so on. For radices above 10, the letters of the alphabet indicate numerals greater than 9. For example, for hexadecimal numbers (base 16), A through F are used.

     If parseInt encounters a character that is not a numeral in the specified radix, it ignores it and all succeeding characters and returns the integer value parsed up to that point. parseInt truncates numbers to integer values. Leading and trailing spaces are allowed.


  1. If radix is undefined or 0 (or absent), JavaScript assumes the following:
  2. If the input string begins with "0x" or "0X", radix is 16 (hexadecimal) and the remainder of the string is parsed.
  3. If the input string begins with "0", radix is eight (octal) or 10 (decimal).  Exactly which radix is chosen is implementation-dependent.  ECMAScript 5 specifies that 10 (decimal) is used, but not all browsers support this yet.  For this reason always specify a radix when using parseInt.
  4. If the input string begins with any other value, the radix is 10 (decimal).
  5. If the first character cannot be converted to a number, parseInt returns NaN.


For arithmetic purposes, the NaN value is not a number in any radix. You can call the isNaN function to determine if the result of parseInt is NaN. If NaN is passed on to arithmetic operations, the operation results will also be NaN.

To convert number to its string literal in a particular radix use intValue.toString(radix).

The following example return 15.
Example

   parseInt(" 0xF", 16);
   parseInt(" F", 16);
   parseInt("17", 8);
   parseInt(021, 8);
   parseInt("015", 10);
   parseInt(15.99, 10);
   parseInt("15,123", 10);
   parseInt("FXX123", 16);
   parseInt("1111", 2);
   parseInt("15*3", 10);
   parseInt("15e2", 10);
   parseInt("15px", 10);
   parseInt("12", 13);

The following example return NaN.
Example

   parseInt("Hello", 8); // Not a number at all
   parseInt("546", 2);   // Digits are not valid for binary representations

The following example return -15.
Example

   parseInt("-F", 16);
   parseInt("-0F", 16);
   parseInt("-0XF", 16);
   parseInt(-15.1, 10);
   parseInt(" -17", 8);
   parseInt(" -15", 10);
   parseInt("-1111", 2);
   parseInt("-15e1", 10);
   parseInt("-12", 13);

The following example return 224.
Example

   parseInt("0e0", 16);


Example Program:- (Editor)


Editor is Loading...

Advertisement

     The parseFloat() function parses a string argument and returns a floating point number. parseFloat is a top-level function and is not associated with any object.

     parseFloat parses its argument, a string, and returns a floating point number. If it encounters a character other than a sign (+ or -), numeral (0-9), a decimal point, or an exponent, it returns the value up to that point and ignores that character and all succeeding characters. Leading and trailing spaces are allowed.

     If the first character cannot be converted to a number, parseFloat returns NaN.

     For arithmetic purposes, the NaN value is not a number in any radix. You can call the isNaN function to determine if the result of parseFloat is NaN. If NaN is passed on to arithmetic operations, the operation results will also be NaN.

     parseFloat can also parse and return the value Infinity. You can use the isFinite function to determine if the result is a finite number (not Infinity, -Infinity, or NaN).

Syntax

   parseFloat(string);
The following all examples are return 3.14
Example

   parseFloat("3.14");
   parseFloat("314e-2");
   parseFloat("0.0314E+2");
   parseFloat("3.14more non-digit characters");


Example Program:- (Editor)


Editor is Loading...

Advertisement