Download example file : example.c
Compiled on : Borland Turbo C++ 3.0
Tuesday, 27 November 2012
Wednesday, 31 October 2012
how to refresh particular div tag content without reloading page using jquery?
// Note : First include jquery.js file.....
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#load_div').load('load.php').fadeIn("slow");
}, 100000); // refresh every 10000 milliseconds
</script>
//index.php
<div id="load_div">
</div>
//load.php
In this page you can write your code.
like load randam user,image etc....
Tuesday, 23 October 2012
How to pass data from one domain to another domain(cross domain) using json?
//Javascript code
<script type="text/javascript">
$(document).ready(function()
{
var surl = "http://www.example.com/json.php";
email_id=document.getElementById("email").value;
$.ajax({
url: surl,
data: {email:email_id},
dataType: "jsonp",
jsonp : "callback",
jsonpCallback: "jsonpcallback"
});
});
function jsonpcallback(rtndata)
{
document.getElementById("disp_data").innerHTML=rtndata.message;
}
</script>
//json.php file code
<?php
$display="<b>HI Json</b>";
$display.="<p>HI This is testing json.</p>";
$rtnjsonobj->message = $display;
echo $_GET['callback']. '('. json_encode($rtnjsonobj) . ')';
?>
<script type="text/javascript">
$(document).ready(function()
{
var surl = "http://www.example.com/json.php";
email_id=document.getElementById("email").value;
$.ajax({
url: surl,
data: {email:email_id},
dataType: "jsonp",
jsonp : "callback",
jsonpCallback: "jsonpcallback"
});
});
function jsonpcallback(rtndata)
{
document.getElementById("disp_data").innerHTML=rtndata.message;
}
</script>
//json.php file code
<?php
$display="<b>HI Json</b>";
$display.="<p>HI This is testing json.</p>";
$rtnjsonobj->message = $display;
echo $_GET['callback']. '('. json_encode($rtnjsonobj) . ')';
?>
Tuesday, 16 October 2012
error page using htaccess file
first create .htaccess file and save it.
then write below code
ErrorDocument 404 /404.html
here
404 means when page not found then it occurs
404.html means that page which you want to display.
then write below code
ErrorDocument 404 /404.html
here
404 means when page not found then it occurs
404.html means that page which you want to display.
Thursday, 6 September 2012
How to convert timestamp to date in MYSQL with where clause?
SELECT * , DATE( FROM_UNIXTIME( `time_stamp` ) ) AS sBdat
FROM phpfox_feed
WHERE DATE( FROM_UNIXTIME( `time_stamp` ) ) = '2012-09-05'
FROM phpfox_feed
WHERE DATE( FROM_UNIXTIME( `time_stamp` ) ) = '2012-09-05'
How to convert timestamp to date in MYSQL?
MYSQL:
SELECT DATE( FROM_UNIXTIME( `time_stamp` ) ) AS sBdat FROM users
OUTPUT:
2012-09-06
SELECT DATE( FROM_UNIXTIME( `time_stamp` ) ) AS sBdat FROM users
OUTPUT:
2012-09-06
Tuesday, 24 July 2012
how to check element visibility in jquery?
example of element exists and it’s not visible
<div id="test">
<div id="test_1" style="display:none">
Hello World!
</div>
</div>
jQuery code:
if ($('#test_1:visible').length > 0)
{
alert('the element is visible');
}
else
{
alert('the element is not visible');
}
Subscribe to:
Posts (Atom)