Category Covered

How to show-hide or Read more-less article using a simple javascript  

How to show/hide or Read more/less article using a simple javascript
 Here I have given a simple example of read more text using simple javascript code.
    <div class="text">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an un  
By: mimosa  |   Total Read: 1003  |   Read more..

Read two xml file using javascript  

I have two xml file products.xml and categories.xml file. So i am going two make a tree that will show category and its related products.   $(document).ready(function(){ $.get('xml/categories.xml',function(data){ var _html="<ul>"; $(data).find('Categories').each(function(key,value){ _html+="<li>"+$(this).find('CategoryName').text(); catId = $(this).find("CategoryID").  
By: Tech writer  |   Total Read: 2119  |   Read more..

Javascript function not working without alert  

I have a javascript function but without alert why its not working? I am confused. I used the delay/ sleep function but still now no success.   $(document).ready(function(){ $.get('xml/categories.xml',function(data){ var _html="<ul>"; $(data).find('Categories').each(function(key,value){ _html+="<li><a href='#'>"+$(this).find('CategoryName').text()+"</a>";  
By: Tech writer  |   Total Read: 2374  |   Read more..

Javascript email validation  

To validate email using javascript or email validation using jquery you can use the code of snipet x = $('#email1').val();
            var atpos=x.indexOf("@");
            var dotpos=x.lastIndexOf(".");
            if(atpos<1 || dotpos<atpos+2 || dotpos+2>=x.leng  
By: Tech writer  |   Total Read: 1459  |   Read more..

How to close window  

Use the code <script type="text/javascript"> window.close(); </script> You can also use  $.fancybox.close(); if you use fancy box window

By: mimosa  |   Total Read: 1115  |   Read more..

display screen resolution  

how to get the screen resolution of my pc browser? Use the following line on you jquery code. $(window).width();
By: Tech writer  |   Total Read: 2036  |   Read more..

Javascript reset form after submit  

You can reset form using javascript or ajax on several way such as  
$.ajax({type: "POST",
        url: _baseurl + "/index.php/",       
        data: str,       
        success: function (results)  {
By: Tech writer  |   Total Read: 1519  |   Read more..

How to open pop up window at the centre of a screen  

function open_popwin(url) {
         var width = 690;
        var height = 630;
        var bgc = '#ffffff';
        var left = parseInt((screen.availWidth/2) - (width/2));
        var top = parseInt((screen.availHeight/2) - (height/2));
By: Tech writer  |   Total Read: 1119  |   Read more..
Top 15 Posts