Category: HTML

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/

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/

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/

Loading Javascript dynamically using jquery

If you are creating a web application, then your web pages may have all possibilities of being overwhelmed with a number of JavaScript files. Including large number of JavaScript files may slow down your web page. So its a good idea to load JavaScript dynamically to your web page, i.e load them only when these …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/06/loading-javascript-dynamically-using-jquery/

Clearing Floats with Overflow using CSS

One of the common problems we face when coding with float based layouts is that the wrapper container doesn’t expand to the height of the child floating elements. The typical solution to fix this is by adding an element with clear float after the floating elements or adding a clearfix to the wrapper. But did …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/05/clearing-floats-with-overflow-using-css/

What is the difference between padding and margins?

Margins and padding can be confusing to the web designer. After all, in some ways, they seem like the same thing white space around an image or object. Padding is the space inside the border between the border and the actual image or cell contents. In the image, the padding is the yellow area around …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/04/what-is-the-difference-between-padding-and-margins/

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/

Warning before navigate away from a page

In some cases, if you are in between any work of editing or typing a content, and you wont let the visitor to navigate away from the page without particular condition, say the document is not saved yet, you can block the navigation (even the closing of the browser window) with Javascript. Code: window.onbeforeunload = …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/02/warning-before-navigate-away-from-a-page/