Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Tuesday, June 3, 2014

How To Use contact Form & In Wordpress 3.5.1

The Contact Form plugiyn allows you to implement a feedback form to a web-page or a post in no time. It is an extremely easy form, that doesn’t require any additional settings, though there are some available options. All you need is just to activate the plugin and insert the shortcode [bestwebsoft_contact_form] into the text. There is also a premium version of the plugin with more useful features available.



How to fetch Rss Feed Using Google api


Displaying RSS feeds easily using Google Ajax Feed API

Displaying RSS feeds from other sites (ie: CNN or Digg) on your own is a nice way to show constantly updated content automatically. However, for the novice web developer, setting this up can be daunting, requiring both knowledge from you and your server's ability to host remote files. Google's Ajax Feed API changes all that, by basically enabling any webmaster to display RSS feeds on their sites using some JavaScript code. It hosts the desired RSS feeds on their servers for you, caches them, and returns the data in either JSON or XML format for you to utilize. All that's left is for you to use some JavaScript to parse this data and output it on your page.
In this tutorial, I'll show you how to harness Google Ajax Feed API to fetch a RSS feed and display it on your site. Here are a few examples:
                                                                                   
/*








<script>
google.load("feeds""1");

// Our callback function, for when a feed is loaded.
function feedLoaded(result{
  if (!result.error{
    // Grab the container we will put the results into
    var container document.getElementById("content");
    container.innerHTML '';

    // Loop through the feeds, putting the titles onto the page.
    // Check out the result object for a list of properties returned in each entry.
    // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
    for (var 0result.feed.entries.lengthi++{
      var entry result.feed.entries[i];
      var div document.createElement("div");
      div.appendChild(document.createTextNode(entry.title));
      container.appendChild(div);
    }
  }
}

function OnLoad({
  // Create a feed instance that will grab Digg's feed.
  var feed new google.feeds.Feed("http://www.digg.com/rss/index.xml");

  // Calling load sends the request off.  It requires a callback function.
  feed.load(feedLoaded);
}

google.setOnLoadCallback(OnLoad);
</script>

Saturday, May 17, 2014

How to display Recent post of your blogger to your website


<div id="bop">
<marquee direction=up scrollamount='3'>
<script style="text/javascript" src="https://sites.google.com/site/projectdigitaltomato/blogger/js/rpost-english.js"></script>
<script style="text/javascript">var numposts =5;var showpostdate = false;var showpostsummary = true;var numchars = 100;var standardstyling = true;</script>
<script src="http://bookofprogrammer.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentposts"></script>
</marquee>
</div>
<noscript>Your browser does not support JavaScript!</noscript>
<style type=text/css>

#rpdr, #rpdr a {color:#808080;}
#bop { border-bottom:1px #cccccc dotted; margin-top:-10px;font-size:14px; width:300px;}
.mtrpw a {font-weight:bold;color:#003366; text-decoration:none;font-style:italic; }
.mtrpwsumm {height:40px;width:280px;margin-bottom:20px;}
</style>

Wednesday, April 9, 2014

How to Fetch Data from RSS Using PHP


<style>
#data{
width:400px;

}
#data h2{
width:100%;
color:#1266ae;
padding:5px;
}
#data p{
border:1px solid #c6c6c6;
padding:5px;
}
#data p img{
width:100%;
}
</style>
<?php
// create a new DOMDocument object
$dom = new DOMDocument();
  //load a remote xml file
  $result = $dom->load("http://blog.lettersandlight.org/rss");
  //did the load work?
  if ($result) {
    //get an array of the items in the rss
    $items = $dom->getElementsByTagName('item');
    //loop through the array
    foreach($items as $item){
      //get the title of the current item
      $title = $item->getElementsByTagName('title')->item(0)->nodeValue;
      //get the description of the current item
      $desc = $item->getElementsByTagName('description')->item(0)->nodeValue;
      //output some of the collected data
 echo("<div id='data'>");
      echo "<h2> $title</h2><br>";
      echo "<p>$desc</p>";
 echo("</div>");
    }
  } else {
    echo "there was a problem reading the rss feed, bummer\n";
  }
?>

Monday, April 7, 2014

javascript code for mobile number verification

function phonenumber(inputtxt)
{
  var phoneno = /^\d{10}$/;
  if(inputtxt.value.match(phoneno))
        {
      return true;
        }
      else
        {
        alert("Not a valid Phone Number");
        return false;
        }
}

<form name="gqform">
<input type="text" name="phone" onblur="phonenumber(document.gqform.phone)" required/>
</form>

Saturday, March 1, 2014

How TO display Student Result Using Javascript


Source Code Of The Program
<html>
<head>
<script>
function mks()

{

var name1=document.form.name.value;
var roll1=document.form.roll.value;
var sc1=document.form.sc.value;
var math1=document.form.math.value;
var eng1=document.form.eng.value;

var marks=eval(parseInt(sc1)+parseInt(math1)+parseInt(eng1));
var per=eval((marks*100)/300);


/*document.getElementById('result').innerHTML="Name"+name1+"<br>Roll"+roll1+"<br>Science"+sc1+"<br>Math"+math1+"<br>English"+eng1+'<br>Marks Obtain'+marks+'<br>Percentage'+per;*/


//location.href='http://google.com';
document.getElementById('result').innerHTML='name:'+name1+"<br> Roll"+roll1+"<br>marks: "+marks+"<br>Percentage"+per;
}
</script>
</head>
<body>
<form name='form'>
name: <input type='text' name='name'><br>
Roll: <input type='text' name='roll'><br>
Science: <input type='text' name='sc'><br>
Math: <input type='text'name='math'><br>
English: <input type='text' name='eng'><br>

</form>
<div style="background:red; height:30px; width:80px;" onclick='javascript:mks()'>submit</div>
<div id='result'></div>
</body>
</html>





name:
Roll:
Science:
Math:
English:
submit

Monday, February 24, 2014

How to use a Autocomplete in Website Using Jquery

<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>






<script>




$(function() {




var availableTags = [




"ActionScript",




"AppleScript",




"Asp",




"BASIC",




"C",




"C++",




"Clojure",




"COBOL",




"ColdFusion",




"Erlang",




"Fortran",




"Groovy",




"Haskell",




"Java",




"JavaScript",




"Lisp",




"Perl",




"PHP",




"Python",




"Ruby",




"Scala",




"Scheme"




];




$( "#tags" ).autocomplete({




source: availableTags




});




});




</script>




<div class="ui-widget">





<label for="tags">Tags: </label>




<input id="tags">




</div>