Category: JavaScript

JS or Js may stand for JavaScript The filename extension .js is used for JavaScript and JScript files

Node.js on Express Framework Installation with mysql(UBUNTU)

Step1: Download the node setup: curl -sL https://deb.nodesource.com/setup | sudo bash – Step2: Install Node.js sudo apt-get install -y nodejs Step3: Install npm and essential Add ons: Note: npm is the default package manager for Node.js. As of Node.js version 0.6.3, npm is bundled and installed automatically with the environment. npm runs through the command …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/11/node-js-on-express-framework-installation-with-mysql/

Create URL Slug from Post Title using PHP

The following functions will helps to create search engine optimization url for the website. This will strip all the special characters and punctuation away from the URL and place hyphen in between each words. For acheving the required results, used regular expression function that replaces spaces between words with hyphens and its remove the special …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/create-url-slug-from-post-title-using-php/

How to save an image of the highcharts on the server?

Highcharts have a built-in option to export the current chart, it have the option to save the chart as PNG, JPEG, PDF or SVG. It doesn’t have option to save the image on the server, instead of downloading in browser (clinet). To save an image of the highcharts on the server, follow the steps: Step …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/08/how-to-save-an-image-of-the-highcharts-on-the-server/

How to use Jsonp method in JQuery

JSONP is JQuery(JavaScript) method used to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy. JSONP takes advantage of the fact that browsers do not enforce the same-origin policy on<script> tags. JSONP is a viable solution for cross-domain Ajax. JSONP does not work with …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/06/how-to-use-jsonp-method-in-jquery/

Use Number() instead of parseInt() in javascript

Recently I came across the issue in converting string to integer in Javascript(JS). I was used parseInt() method to convert string value into integer value. unfortunately, I was faced issue in chrome browser but all other browsers like firefox, ie and safari are worked fine. Its too hard time for me to find out the …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/01/use-number-instead-of-parseint-in-javascript/

How to remove special characters using jQuery ?

jQuery code can be used to remove special characters. [js] <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#input_field_name").keyup(function(event) { original_val = jQuery("#input_field_name").val(); rep_value = name.replace(/[^a-zA-Z 0-9.]+/g,”); jQuery("#input_field_name").val(rep_value); }); }); </script> [/js]

Permanent link to this article: https://blog.openshell.in/2013/12/how-to-remove-special-characters-using-jquery/

Submitting a form using jQuery AJAX

HTML form, that’s to be submitted by jQuery AJAX. [html] <form id=”employee” action=”employee.php” method=”POST” name=”contact”> <div>Name: <input id=”name” type=”text” name=”name” size=”30″ value=”" /></div> <div>Email: <input id=”email” type=”text” name=”email” size=”30″ value=”" /></div> <div>Phone: <input id=”phone” type=”text” name=”phone” size=”30″ value=”" /></div> <div><input id=”submit_btn” type=”submit” name=”submit” value=”Send” /></div> </form> <div id=”result”></div> [/html] Java Script code using jQuery AJAX …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/12/submit-form-using-jquery-ajax/

Dynamically create form in javascript on fly

To create a form dynamically using JavaScript on fly of the webpage. This which helps to create form and input controls dynamically. [javascript] /* To create form with javascript */ var form = document.createElement("form"); form.setAttribute(‘method’,"post"); // form method form.setAttribute(‘action’,"test.php"); // form action url form.setAttribute(‘name’,"frmName"); // form name form.setAttribute(‘id’,"frmId"); // form ID form.setAttribute(‘target’,"_blank"); // form target …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/12/dynamically-create-form-in-javascript-on-fly/

Window.open Not Working In IE

If you use window.open to open custom windows with JavaScript, you might encounter problems in Internet Explorer. Even though you can open new windows in other browsers, it doesn’t work in IE. The reason to this is it depends on how you name your JavaScript windows. IE doesn’t allow space here. window.open takes three parameters …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/07/window-open-not-working-in-ie/

PNG transparency problem in Internet Explorer 5.5 & 6

hi friends This plugin will fix the missing PNG-Transparency in Microsoft Internet Explorer 5.5 & 6. 1. download 2. Add jQuery and pngFix to the HEAD-Section of your HTML … <head>  …  <script type=”text/javascript” src=”jquery-latest.pack.js”></script>  <script type=”text/javascript” src=”jquery.pngFix.js”></script>  …  </head> 3. Activate pngFix on document.ready <head>  …  <script type=”text/javascript”>      $(document).ready(function(){          $(document).pngFix();      });  </script>  …  </head>

Permanent link to this article: https://blog.openshell.in/2011/03/pngfix-internet-explorer-5-5-6/