How to encode a string in JavaScript

{0 Comments}

In article how to encode URL I have listed some JavaScript encoding built-in function which will help you to encode a string using JavaScript and all the limitation and possibilities are listed there. All you have to keep in mind that   in place of URL you place your string and you will get the desire …

Read More…

How to encode URL in JavaScript

{0 Comments}

To safety encode URL in JavaScript so that it can be used in Get string. In JavaScript there are some built-in functions which can be used to encode URL. Which are follows? encodeURIComponent(str) encodeURI(str) escape() But something which you must know about this function, there some value which they not encode. For example in escape() …

Read More…

How to enable checkbox in JavaScript

{0 Comments}

To enable checkbox in JavaScript you can the same script which you can use to disable checkbox but only thing which you change it the Boolean value to false as show in the following function.  To do this the value is get the element id of checkbox first then apply following syntax.   Javascript |  copy code |? 1function enable() {2 …

Read More…

How to enable button in JavaScript

{0 Comments}

To enable button in JavaScript you can the same script which you can use to disable button but only thing which you change it the Boolean value to false as show in the following function.  To do this the value is get the element id of button first then apply following syntax.   Javascript |  copy code |? 1function enable() {2 …

Read More…

How to enable text box in JavaScript

{0 Comments}

To enable textbox in JavaScript you can the same script which you can use to disable textbox but only thing which you change it the Boolean value to false as show in the following function.   Javascript |  copy code |? 1function enable() {2 document.getElementById( "Text1" ).disabled = ‘false’;3 }4

Read More…

How to declare function in JavaScript

{0 Comments}

To declare a function in JavaScript you can use following syntax, this is the standard way to declare function. First write a keyword “function” then write function name then braces. As shown below  Javascript |  copy code |? 1function functionname()2 {3 }4

Read More…

How to declare integer variable in JavaScript

{0 Comments}

As you want to declare integer variable in JavaScript then you can declare this in default manner.  var varname=  1; like that. But when this is need to sure that the variable declared here is integer or not then you can use following syntax have declare integer variable in JavaScript.  Javascript |  copy code |? 1var a = arg;2 3 var …

Read More…

How to declare static variable in JavaScript

{0 Comments}

Declaration of a variable in JavaScript is describer in earlier post. But when it comes to declaration of static variable in JavaScript you can use following syntax. Here you can declare a static variable inside a function this will hold the value during the function calls.  Javascript |  copy code |? 1function somefun(arg)2 {3 var a = arg;4 5 }6

Read More…

How to declare Boolean in JavaScript

{0 Comments}

As we know Boolean value is 1 and 0, or true and false. But in this scenario when you declare var a=1 here JavaScript take as a integer value so. To declare Boolean in JavaScript all you have to write true and false to declare it as Boolean.  C# |  copy code |? 1var variablename=true;

Read More…

How to declare string in JavaScript

{0 Comments}

You can declare string in JavaScript like a variable declared. Because here you don’t have to declare data type as a string all you have to declare or assign the string value to  default variable and it will considered as a string value.  You can read following article how to declare variable in JavaScript. How …

Read More…