Follow Me:

Sunday 30 November 2014

Contains() Property in javascript.,it is working fine in Mozila Firebox only.It will not support Chrome Browser,Internet Browser,Safari,Opera browser.


Mozila Browser :


  var ClearFilterValue  = 'family Schools';
    if(ClearFilterValue.contains("family")== true) {
   alert('Success');
    } 
  

Chorme & Mozila Firebox Browser :

    The below javascript index() properity will working for both chrome and mozile firbox.It is functionality similar to contains property.

var ClearFilterValue  = 'family Schools';
alert(ClearFilterValue.indexOf("family") != -1);

var n  =   str.indexOf("family"); 
if(n >= 0) { 
    alert(success); 
}


Monday 3 November 2014

JSON (Javascript Object Notation) is a convenient way to transport data between applications, especially when the destination is a Javascript application.

Example :
Here is a minimal example that uses JSON as the transport for the server response. The client makes an ajax request with the JQuery shorthand function $.getJSON. The server generates a hash, formats it as JSON and returns this to the client. The client formats this and puts it in a page element.

Server:
get '/json' do
 content_type :json
 content = { :response  => 'Sent via JSON',
            :timestamp => Time.now,
            :random    => rand(10000) }
 content.to_json
end

Client:
var url = host_prefix + '/json';
$.getJSON(url, function(json){
  $("#json-response").html(JSON.stringify(json, null, 2));
});
 
Output:
  {
   "response": "Sent via JSON",
   "timestamp": "2014-06-18 09:49:01 +0000",
   "random": 6074
  }

JSONP (JSON with Padding)

JSONP is a simple way to overcome browser restrictions when sending JSON responses from different domains from the client. The only change on the Client side with JSONP is to add a callback parameter to the URL.

Server:
get '/jsonp' do
 callback = params['callback']
 content_type :js
 content = { :response  => 'Sent via JSONP',
            :timestamp => Time.now,
            :random    => rand(10000) }
 "#{callback}(#{content.to_json})"
end

Client:
var url = host_prefix + '/jsonp?callback=?';
$.getJSON(url, function(jsonp){
  $("#jsonp-response").html(JSON.stringify(jsonp, null, 2));
});

Output:
 {
  "response": "Sent via JSONP",
  "timestamp": "2014-06-18 09:50:15 +0000",
  "random": 364
}

Friday 30 May 2014

How to blink text in html for various browsers

The blink() method is not standard, and may not work as expected in all browsers.
The blink() method is used to display a blinking string.
This method returns the string embedded in the <blink> tag, like this:

<blink>string</blink>



Note:  The blink() method only works in Opera. It is not supported in Internet Explorer, Firefox, Chrome, or Safari.

So alternatively we can try this below:

<span class="blink_text">India's Largest portal is Meetcity.in</span> 
<style type="text/css"> 
.blink_text { 

        -webkit-animation-name: blinker;
 -webkit-animation-duration: 1s;
 -webkit-animation-timing-function: linear;
 -webkit-animation-iteration-count: infinite;

 -moz-animation-name: blinker;
 -moz-animation-duration: 1s;
 -moz-animation-timing-function: linear;
 -moz-animation-iteration-count: infinite;
 animation-name: blinker;
 animation-duration: 1s;
 animation-timing-function: linear; 
    animation-iteration-count: infinite; color: red; 
} 

@-moz-keyframes blinker {
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; } 
}

@-webkit-keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; } 
} 

@keyframes blinker {  
    0% { opacity: 1.0; } 
    50% { opacity: 0.0; }      
    100% { opacity: 1.0; } 
} 
</style> 


Saturday 1 March 2014

Friday 28 February 2014

What is .frm, .myi, .myd. txt file in PhpMyadmin and MySQl?

When creating the table in database,that time 3 text file is generated in local.That files are 
 .FRM  =>  It has the table structure of your table or table definition

 .MYI  =>   It has the indexes of your table

 .MYD =>   It contains your data

Generally you can find the data directory of your file with your .my.cnf file. The physical structure of db is some thing like a directory structure, where each database is a subdirectory under the main directory and has some files in it. Each table has its own file. Bascially one can see three types of files .frm, .myi, .myd.. But they are not same for all tables and db. They differ based on the engines you use and sometimes even differ with the os. There are lots of other factors that is in the backend behind the type of files you see. We will  see some basic differences.

For ex: if your db name is school and tables called class and student. The Physical structure will have a directory called school and files class.frm, class.myi, class.myd, student.frm, student.myi, student.myd.

Thursday 13 February 2014

  To import csv files into the mysql table,for this removing the header of the csv files and then run the below script.It will be insert into our mysql table.

//Import csv files into mysql table

LOAD DATA LOCAL INFILE 'd:\\Site.csv' INTO TABLE `siteurl` 
FIELDS TERMINATED BY ',' ENCLOSED BY '"' 
LINES TERMINATED BY '\r\n';

//ends


Character Escape Sequence

\0 An ASCII NUL (0x00) character
\b A backspace character
\n A newline (linefeed) character
\r A carriage return character
\t A tab character
\Z ASCII 26 (Control+Z)
\N NULL

Note : Your File must be a Csv file.Then only it will be working.
  Csv File Name as Site.csv
  Table Name as siteurl

Csv Files import in MySql, Csv Files import in php, Import CSV Files into MySQL table

Monday 3 February 2014

    By using array_diff() function , we can remove the array values in php
    <?php

   <?php
       $arr_remove = array('Codingslover', 'webslessons', 'meetcity', 
       'eshopoffers','google'); $arr = array_diff($arr_remove, array('webslessons', 'google')); echo "<pre>";print_r($arr_remove); echo "<pre>";print_r($arr); ?>