Topic: Ajax

Back to Top Button using jQuery and CSS – Scroll to Top Example 0

Back to Top Button using jQuery and CSS - Scroll to Top Example

Back to Top Button using jQuery and CSS – Scroll to Top Example

In this Post We Will Explain About is Back to Top Button using jQuery and CSS – Scroll to Top Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to jQuery Back to top Plugins Example

In this post we will show you Best way to implement CSS and jQuery Back to top, hear for How To Create a Scroll Back To Top Button with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Creating a Back to Top Button with CSS & jQuery

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

Include External libs

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

index.html

<body>
<div class="container"> 
<a href="javascript:void(0);" id="live_scroll" title="Scroll to Top" style="display: none;">Top<span></span></a>

	<div class="well">
	<h1>How To Create a Scroll Back To Top Button</h1>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.<hr/>
	<br/>Hello! I am angular Web-devloper and live24u is my web technologies blog. My specialities are Vuejs,API,angularjs,Vuejs,PHP, API, jQuery,Earn money,HTML,CSS eCommerce,JS,Laravel, CMS and bespoke web application development.
	</div>
</div>
</body>

index.js

$(document).ready(function(){ 
    $(window).scroll(function(){ 
        if ($(this).scrollTop() > 100) { 
            $('#live_scroll').fadeIn(); 
        } else { 
            $('#live_scroll').fadeOut(); 
        } 
    }); 
    $('#live_scroll').click(function(){ 
        $("html, body").animate({ scrollTop: 0 }, 600); 
        return false; 
    }); 
});

style.css

#live_scroll {
    position:fixed;
    right:10px;
    bottom:10px;
    cursor:pointer;
    width:50px;
    height:50px;
    background-color:#1565c0;
    text-indent:-9999px;
    display:none;
    -webkit-border-radius:60px;
    -moz-border-radius:60px;
    border-radius:60px
}
#live_scroll span {
    position:absolute;
    top:50%;
    left:50%;
    margin-left:-8px;
    margin-top:-12px;
    height:0;
    width:0;
    border:8px solid transparent;
    border-bottom-color:#ffffff
}
#live_scroll:hover {
    background-color:#000;
    opacity:1;filter:"alpha(opacity=100)";
    -ms-filter:"alpha(opacity=100)";
}

You are Most welcome in my youtube Channel Please shubscibe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is How To Create a Scroll Back To Top Button And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

PHP Ajax Form Validation without page refresh 0

PHP Ajax Form Validation without page refresh

PHP Ajax Form Validation without page refresh

In this Post We Will Explain About is PHP Ajax Form Validation without page refresh With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to submit form using ajax without page refresh Example

In this post we will show you Best way to implement ajax contact form with validation, hear for php form validation example code download with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Simple PHP Ajax Form Validation Example from scratch

Here, We will make PHP simple contact us form submit using html with php ajax source code bootstrap framework. When We simple click on “Send Comments” button it will simple call php file fire ajax post jquery send request and check check some validation and show display it as now on simple bellow source code preview. We will make two simple file following files for index.php, and do_submit.php and include scripts this example:

index.php

<!DOCTYPE html>
<html>
<head>
	<title>Pakainfo.com Php Ajax Form simple Validation Example</title>
	<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="script.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>

<div class="container">
  <h1>Step By Step Php Ajax Form simple Validation Example</h1>
  <form role="form" id="contactForm" class="contact-form" data-toggle="validator" class="shake">
    <div class="alert alert-danger display-live-error" style="display: none">
    </div>
    <div class="form-group">
      <div class="controls">
        <input type="text" id="name" class="form-control" placeholder="Enter your Name">
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <input type="email" class="email form-control" id="email" placeholder="Enter your Email" >
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <input type="text" id="mail_sub" class="form-control" placeholder="Enter your Subject" >
      </div>
    </div>
    <div class="form-group">
      <div class="controls">
        <textarea id="comments" rows="7" placeholder="Enter your Massage" class="form-control"></textarea>
      </div>  
    </div>
    <button type="submit" id="submit" class="btn btn-success"><i class="fa fa-check"></i> Send Comments</button>
  </form>
</div>
</body>
</html>

script.js

<script type="text/javascript">
  $(document).ready(function() {
	//form submit live
      $('#submit').click(function(e){
        e.preventDefault();

        var name = $("#name").val();
        var email = $("#email").val();
        var mail_sub = $("#mail_sub").val();
        var comments = $("#comments").val();

        $.ajax({
            type: "POST",
            url: "/do_submit.php",
            dataType: "json",
            data: {name:name, email:email, mail_sub:mail_sub, comments:comments},
            success : function(data){
                if (data.code == "200"){
                    alert("Success: " +data.msg);
                } else {
                    $(".display-live-error").html("<ul>"+data.msg+"</ul>");
                    $(".display-live-error").css("display","block");
                }
            }
        });

      });
  });
</script>

do_submit.php

<?php

$live_comments_error = "";

/* Devloped by Pakainfo.com NAME */
if (empty($_POST["name"])) {
    $live_comments_error = "<li>Your Name is required</<li>";
} else {
    $name = $_POST["name"];
}

/* Devloped by Pakainfo.com EMAIL */
if (empty($_POST["email"])) {
    $live_comments_error .= "<li>Your Email is required</li>";
} else if(!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {
    $live_comments_error .= "<li>Invalid email format</li>";
}else {
    $email = $_POST["email"];
}

/*Devloped by Pakainfo.com MSG SUBJECT */
if (empty($_POST["mail_sub"])) {
    $live_comments_error .= "<li>Your Subject is required</li>";
} else {
    $mail_sub = $_POST["mail_sub"];
}

/*Devloped by Pakainfo.com MESSAGE */
if (empty($_POST["comments"])) {
    $live_comments_error .= "<li>Your Comments is required</li>";
} else {
    $comments = $_POST["comments"];
}

if(empty($live_comments_error)){
	$msg = "Your Name: ".$name.", Your Email: ".$email.", Your Subject: ".$mail_sub.", Your Comments:".$comments;
	echo json_encode(['code'=>200, 'msg'=>$msg]);
	exit;
}
//return form message 
echo json_encode(['code'=>404, 'msg'=>$live_comments_error]);

?>

You are Most welcome in my youtube Channel Please shubscibe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Simple PHP Ajax Form Validation Example from scratch And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Upload Multiple Images With Image Preview Using jQuery,Ajax And PHP 0

Upload Multiple Images With Image Preview Using jQuery,Ajax And PHP

Upload Multiple Images With Image Preview Using jQuery,Ajax And PHP

In this Post We Will Explain About is Upload Multiple Images With Image Preview Using jQuery,Ajax And PHP With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to Upload multiple images jQuery Ajax using PHP Example

In this post we will show you Best way to implement multiple image upload with preview and delete jquery, hear for Upload Multiple Images using jQuery, PHP & MySQL with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How to Upload multiple images jQuery Ajax using PHP

In this Example,First of all Add or Inluce External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priorty set.After that Include your relavant CSS Class.

How to Upload multiple images jQuery Ajax using PHP

index.php

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="css/uploadfilemulti.css" rel="stylesheet">
<!-- Devloped by Pakainfo.com free download examples -->
<script src="js/jquery-1.8.0.min.js"></script>
<script src="js/jquery.fileuploadmulti.min.js"></script>
</head>
<body>
<!-- Devloped by Pakainfo.com free download examples -->
<div id="liveMultipleFileupload">Upload</div>

<div id="data_status"></div>
<script>

$(document).ready(function()
{

var settings = {
	//send url to all images
	url: "upload.php",
	method: "POST",
	allowedTypes:"jpg,png,gif,doc,pdf,zip",
	fileName: "liveuploadFile",
	multiple: true,
	onSuccess:function(files,data,xhr)
	{
		$("#data_status").html("<font color='green'>Upload is success</font>");
        },
        afterUploadAll:function()
        {
                alert("Good Luck all images uploaded!!");
        },
	onError: function(files,data_status,errMsg)
	{		
		$("#data_status").html("<font color='red'>Your Upload is Failed</font>");
	}
}
$("#liveMultipleFileupload").uploadFile(settings);

});
</script>
</body>

upload.php

simple File contains post upload all the files process as well as move all files in uploads Folder.

<?php
$output_dir = "uploads/";

if(isset($_FILES["liveuploadFile"]))
{
	$results = array();

	$error =$_FILES["liveuploadFile"]["error"];
   {

    	if(!is_array($_FILES["liveuploadFile"]['name'])) //get here single file
    	{
            $get_randomNo   = time();

            $LiveImgName      = str_replace(' ','-',strtolower($_FILES['liveuploadFile']['name']));
            $ImageType      = $_FILES['liveuploadFile']['type']; 

            $LiveImgExt = substr($LiveImgName, strrpos($LiveImgName, '.'));
            $LiveImgExt       = str_replace('.','',$LiveImgExt);
            $LiveImgName      = preg_replace("/\.[^.\s]{3,4}$/", "", $LiveImgName);
            $NewLiveImgName = $LiveImgName.'-'.$get_randomNo.'.'.$LiveImgExt;

       	 	move_uploaded_file($_FILES["liveuploadFile"]["tmp_name"],$output_dir. $NewLiveImgName);
       	 	 //echo "<br> Error: ".$_FILES["liveuploadFile"]["error"];

	       	 	 $results[$fileName]= $output_dir.$NewLiveImgName;
    	}
    	else
    	{
            $fileCount = count($_FILES["liveuploadFile"]['name']);
    		for($i=0; $i < $fileCount; $i++)
    		{
                $get_randomNo   = time();

                $LiveImgName      = str_replace(' ','-',strtolower($_FILES['liveuploadFile']['name'][$i]));
                $ImageType      = $_FILES['liveuploadFile']['type'][$i]; //"image/png", image/jpeg etc.

                $LiveImgExt = substr($LiveImgName, strrpos($LiveImgName, '.'));
                $LiveImgExt       = str_replace('.','',$LiveImgExt);
                $LiveImgName      = preg_replace("/\.[^.\s]{3,4}$/", "", $LiveImgName);
                $NewLiveImgName = $LiveImgName.'-'.$get_randomNo.'.'.$LiveImgExt;

                $results[$NewLiveImgName]= $output_dir.$NewLiveImgName;
    		    move_uploaded_file($_FILES["liveuploadFile"]["tmp_name"][$i],$output_dir.$NewLiveImgName );
    		}
    	}
    }
    echo json_encode($results);

}

?>

First of all check Folder and get some error and then check if create single file coming then simple process separate if all the multiple files handle in php loop.

$get_randomNo   = time();

$LiveImgName      = str_replace(' ','-',strtolower($_FILES['liveuploadFile']['name'][$i]));
$ImageType      = $_FILES['liveuploadFile']['type'][$i]; //"image/png", image/jpeg etc.

$LiveImgExt       = substr($LiveImgName, strrpos($LiveImgName, '.'));
$LiveImgExt       = str_replace('.','',$LiveImgExt);
$LiveImgName      = preg_replace("/\.[^.\s]{3,4}$/", "", $LiveImgName);
$NewLiveImgName   = $LiveImgName.'-'.$get_randomNo.'.'.$LiveImgExt;

Add simple using PHP UNIX time stamp with create image name to generated unique name.

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is How to Upload multiple images jQuery Ajax using PHP And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

How to Implement Sweet Alert in Laravel Application 0

How to Implement Sweet Alert in Laravel Application

How to Implement Sweet Alert in Laravel Application

In this Post We Will Explain About is How to Implement Sweet Alert in Laravel Application With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to use Sweet Alert to replace standard confirm dialog Example

In this post we will show you Best way to implement Sweet Alert Messages using laravel, hear for Laravel 5 – confirmation box for delete a member from database example with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Phase 1: Install uxweb/sweet-alert Package

composer require uxweb/sweet-alert

And then successfully this install package, after that open simple path config/app.php file and pur some service provider and alias source code.config/app.php

'providers' => [
	....
	UxWeb\SweetAlert\SweetAlertServiceProvider::class,
],
'aliases' => [
	....
	'Alert' => UxWeb\SweetAlert\SweetAlert::class,
]

As above We put simple “Alert” facade We can Display, but we do not any external libs require in this best example, so And then We just put for demo.

Phase 2: Add Route

routes/web.php

Route::get('my-livetoaster/{type}', '[email protected]');

Phase 3: Create Controller Method

so open your app/Http/Controllers/LiveController.phpfile and add following route.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class LiveController extends Controller
{
    /**
     * make a new controller instance.
     *
     * devloped by Pakainfo.com @return view
     */
    public function myLivetoaster($type)
    {
        switch ($type) {
            case 'message':
                alert()->message('live Sweet Alert with message Good Luck.');
                break;
            case 'basic':
                alert()->basic('live Sweet Alert with basic Good Luck.','Basic');
                break;
            case 'info':
                alert()->info('live Sweet Alert with info Good Luck.');
                break;
            case 'success':
                alert()->success('some Sweet Alert with success Good Luck.','Welcome to ItSolutionStuff.com')->autoclose(4000);
                break;
            case 'error':
                alert()->error('some Sweet Alert with error Good Luck.');
                break;
            case 'warning':
                alert()->warning('some Sweet Alert with warning Good Luck.');
                break;
            default:
                # your code...
                break;
        }

        return view('my-livetoaster');
    }
}

Phase 4: create Blade File

so open your resources/views/my-livetoaster.blade.phpfile and add following route.

<!DOCTYPE html>
<html>
<head>
	<title>Pakainfo.com Laravel Sweet Alert Notification</title>
	<link rel="stylesheet" href="bootstrap-3.min.css">
	<script src="plugin/jquery.js"></script>
	<link rel="stylesheet" href="sweetalert/1.1.3/sweetalert.min.css" />
	<script src="sweetalert/1.1.3/sweetalert.min.js"></script>
</head>
<body>

<h1 class="text-center">Laravel Sweet Alert Notification step by step</h1>
@include('sweet::alert')
<p>Live24u is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.</p>
</body>
</html>

And then We are ready to some run our best example therefor run bellow some command run:

php artisan serve

And then We can open some bellow url on our browser:

https://pakainfo.com/my-livetoaster/success
https://pakainfo.com/my-livetoaster/basic
https://pakainfo.com/my-livetoaster/message

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Laravel 5 – confirmation box for delete a member from database example And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

What is the difference between let and var in Typescript 0

What is the difference between let and var in Typescript

What is the difference between let and var in Typescript

In this Post We Will Explain About is What is the difference between let and var in Typescript With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to What are let, const, var and the data types in TypeScript Example

In this post we will show you Best way to implement What are let, const, var and the data types in TypeScript, hear for TypeScript: Difference between Var, Let, and Const keyword with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

‘let and ‘var’ are the same in Typescript

make a file main.tsmain.ts

function SimpleDataPrint(){
	for(var i=0; i<5; i++){
		console.log(i);
	}

	console.log('Live last value:' + i);
}
SimpleDataPrint();

And then compile and simple step to run the compiled source code like:

tsc main.ts | node main.js

Output will be:

0
1
2
3
4
Live last value: 5

here value of print display i at the end is 5.

This is the major issue of declaring a simple variable with var data keyword. we have to simple declared value of like as a i inside the for data block so it is also new created var available outside the for some block or it is here available inside block the whole some function body.

if We declare or init the simple variable with let Like keyword.like:

function SimpleDataPrint(){
	for(let i=0; i<5; i++){
	console.log(i);
	}

	console.log('last value:' + i);
}

SimpleDataPrint();

It will immediately give a compilation error say ‘can not find name i’ as well as you will catch this error at some compile time. This is the more beauty of simple Typescript.

After then if We still some compile this file:

tsc main.ts

It will some give the error : Like as a ‘can not find name i’.

Therefor it will still some generate dir like as the file main.js with the javascript source code.

function SimpleDataPrint(){
	for(var i=0; i<10; i++){
	console.log(i);
	}

	console.log('last value:' + i);
}

So this javascript source code is perfectly syntex valid javascript source code so now if you output run this simple like:

node main.js

it will give the same output:

0
1
2
3
4
5
6
7
8
9
last value: 10

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is TypeScript: Difference between Var, Let, and Const keywords And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Http Post and Get Web Api Calls using Angularjs 0

Http Post and Get Web Api Calls using Angularjs

Http Post and Get Web Api Calls using Angularjs

In this Post We Will Explain About is Http Post and Get Web Api Calls using Angularjs With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to angularjs – how to call API in angular controller Example

In this post we will show you Best way to implement How To Consume WebAPI Using AngularJS, hear for Interacting With RESTful APIs Using $http in AngularJS with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

What is WEBAPI

API stands for simple Application programming interface.and it’s The main purpose of simple angular webapi is to make restful web-services.

Web API is simple consumed by a large of broad range of some clients like as a

  • 1.IOT (Internet of Things)
  • 2.Mobile Apps
  • 3.Web based Apps and
  • 4.Desktop Apps

app.factory("user_services", ['$http', function($http) {
var LiveServiceBase = 'live24u/api/';
var LiveObj = {};
LiveObj.getStudents = function(){
return $http.get(LiveServiceBase + 'students');
};
LiveObj.getCustomer = function(studentID){
return $http.get(LiveServiceBase + 'student?id=' + studentID);
};
LiveObj.InsertStudent = function (student) {
return $http.post(LiveServiceBase + 'InsertStudent', student).then(function (results) {
return results;
});
};LiveObj.updateStudent = function (id,student) {
return $http.post(LiveServiceBase + 'updateStudent', {id:id, student:student}).then(function (isActive) {
return isActive.data;
});
};
LiveObj.removeStudent = function (id) {
return $http.delete(LiveServiceBase + 'removeStudent?id=' + id).then(function (isActive) {
return isActive.data;
});
};
return LiveObj;
}]);

Angularjs – how to call API in angular controller

varliveApp = angular  
    .module("LiveModule", [])  
    .controller("myCtrl", function($scope, $http) {  
        $http.get('https://pakainfo.com/api/home/getstudents').then(function(results) {  
            $scope.students = results.data;  
        });  
    });  

Get Requests : Http Post and Get Web Api Calls using Angularjs

var liveApp = angular.module('liveApp', []);

liveApp.controller('liveACtrl' , function ($scope, $http) {
    $scope.home = "Welcome to Pakainfo.com";
    
    $scope.getStudents = function () {
        console.log("I've been pressed!");  
        $http.get("https://pakainfo.com/get?name=jaydeep")
            .then(function successCallback(results){
                $scope.results = results;
            }, function errorCallback(results){
                console.log("Unable to perform get request");
            });
    };
    
});

Post Requests : Http Post and Get Web Api Calls using Angularjs

var liveApp = angular.module('liveApp', []);

liveApp.controller('liveACtrl' , function ($scope, $http) {
    $scope.home = "Welcome to Pakainfo.com";
    
    
// Live24u Example Our GET request function
    $scope.getStudents = function () {
        console.log("I've been pressed Good Luck!");  
        $http.get("https://pakainfo.com/get?name=jaydeep")
            .then(function successCallback(results){
                $scope.results = results;
            }, function errorCallback(results){
                console.log("Unable to perform get request");
            });
    };
    
// Live24u Example  Our angularjs POST request function
    $scope.postRequest = function () {
        $http.post("https://pakainfo.com/", data)
            .then(function successCallback(results){
                console.log("Good Luck Successfully POST-ed data");
            }, function errorCallback(results){
                console.log("Your most POST-ing of simple data failed");
            });
    };
    
});

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Making API Calls in AngularJS using Angular’s $http service And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Http Post and Get Web Api Calls using Vuejs 0

Http Post and Get Web Api Calls using Vuejs

Http Post and Get Web Api Calls using Vuejs

In this Post We Will Explain About is Http Post and Get Web Api Calls using Vuejs With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Vuejs Restful Http Post and Get Web Api Calls Example

In this post we will show you Best way to implement Making API Calls in Vuejs using $http service, hear for Fetching Data from a Third-Party API with Vue.js and Axios with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Vuejs web service call example

Include External Libs

//cdnjs.cloudflare.com/ajax/libs/vue/1.0.4/vue.min.js
//cdnjs.cloudflare.com/ajax/libs/vue-resource/0.1.16/vue-resource.min.js
//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css

index.html

<div id="liveapp">
  <div class="container">
    
    <div class="row">
      <div class="col-md-12">
        <h3>
          Vuejs - Posting Data

        </h3>
      </div>
    </div> <!-- / row -->
    
    <div class="row">
      <div class="col-md-12">
        <div class="form-group">
          <label for="your_domain">Live Domain</label>
          <input type="text" class="form-control" value="" v-model="your_domain" />
        </div>
      </div>
      <div class="col-sm-12">
        <a href="#" class="btn btn-primary" @click="checkWebsite">Check Website</a>
        <span v-if="liveAjax_res">Please Wait ...</span>
      </div>
    </div> <!-- / row -->
    
    <div>Vue.js REST API Consumption with Axios</div>
    
    <div class="row" v-if="checksite">
      <div class="col-sm-12">
        <pre>{{ $data | json }}</pre>
      </div>
    </div>
  
  </div>
  
<p>Live24u is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.</p>
</div>

index.js

Vue.http.options.emulateJSON = true; //simple send as 

new Vue({
    el: '#liveapp',
    data: {
        checksite: true,
        your_domain: '',
        liveAjax_res: false,
        postResults: []
    },
    methods: {
      checkWebsite: function() {
        this.liveAjax_res = true;
        this.$http.post('https://pakainfo.com/post/check', {
              your_domain: this.your_domain
            }, function (data, status, request) {
                this.postResults = data;

                this.liveAjax_res = false;
            });
      }}
});

//options get methods
    methods: {
      checkWebsite: function() {
        this.liveAjax_res = true;
        this.$http.get('https://pakainfo.com/get/check', {
              your_domain: this.your_domain
            }, function (data, status, request) {
                this.postResults = data;
                this.liveAjax_res = false;
            });
      }}

Vuejs web service call

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Vuejs Restful Http Post and Get Web Api Calls

I hope you have Got What is Vuejs Restful Http Post and Get Web Api Calls And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Ajax Image Upload using PHP and jQuery 0

Ajax Image Upload using PHP and jQuery

Ajax Image Upload using PHP and jQuery

In this Post We Will Explain About is Ajax Image Upload using PHP and jQuery With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to upload image ajax jquery php mysql Example

In this post we will show you Best way to implement ajax image upload jquery php , hear for ajax image upload without refreshing page using jquery with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Step 1 : Create Image From

first of all simple create the HTML form to simple select and upload the any format image.Basic Note : For here in this example, Design we are using simple version of bootstrap.css

Create file upload-ajax-image.php

<div class="col-md-12"><div id="uploadedimage"></div>
<form role="form"  id="liveUploadImgFunForm" enctype= "multipart/form-data"  action="javascript:void(0)" onsubmit="liveUploadImgFun(this);">
	<div class="form-group">
		<label for="file">Select Image</label>
		<input type="file" name="liveUploadImgFun" class="form-control" id="liveUploadImgFun"
		placeholder="select file">
	</div>
	<button type="submit" class="btn btn-primary">Upload</button>
</form>
</div>

Step 2: Create Js File

here simple Create imageupload.js

function liveUploadImgFun(this){
	$.ajax({
		url: "liveUploadImgFunajax.php",
		type: "POST",
		data: new FormData(this),
		contentType: false,
		cache: false,
		processData:false,
		success: function(data){
		$("#uploadedimage").html(data);
		}
	});
}

Step 3 : Create upload php file

Which will all the image upload the posted any format image by the simple using jquery and ajax and will upload or move in a Directory ie. target Directory in which We want to upload or store all the images on the any server side.Create liveUploadImgFun.php

$des_path = "imagesupload/";// upload directory
$upload = 1;
$des_file = $des_path . basename($_FILES["liveUploadImgFun"]["name"]);
$uploadOk = 1;
 // get uploaded file's extension
$check_img_FileTp = pathinfo($des_file,PATHINFO_EXTENSION);

 // check's valid format

if($check_img_FileTp != "jpg" && $check_img_FileTp != "png" && $check_img_FileTp != "jpeg"
&& $check_img_FileTp != "gif" ) {
	echo "Invalid images Format.Only simple JPG, or JPEG, or PNG or GIF files are data allowed.";
	$upload = 0;
	exit;


}if ($_FILES["liveUploadImgFun"]["size"] > 200000) {
	echo "Sorry, your file is very large.";
	$upload = 0;

	exit;
}
	if($upload == '1'){
	$data_str = '';
	if (move_uploaded_file($_FILES["liveUploadImgFun"]["tmp_name"], $des_file)) {
	$data_str .= "The file ". basename( $_FILES["liveUploadImgFun"]["name"]). " has been uploaded. Good Luck!!";
	$data_str .= "<img src='imagesupload/".$_FILES["liveUploadImgFun"]["name"]."'>";
} else {
	echo "Sorry,Your file not uploaded. there was some an error uploading your this file.";
}
}

You are Most welcome in my you tube Channel Please subscribe my channel. and give me Feed Back.
More Details……
Angularjs Example

Example

I hope you have Got What is ajax image upload without refreshing page using jquery And how it works.I would Like to have Feed Back From My Blog(Pakainfo.com) readers.Your Valuable Feed Back,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

jQuery AJAX Loading Overlay Example 0

jQuery AJAX Loading Overlay Example

jQuery AJAX Loading Overlay Example

In this Post We Will Explain About is jQuery AJAX Loading Overlay Example With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to css loading overlay entire page Example

In this post we will show you Best way to implement jQuery Ajax Loading Overlay , hear for Overlay div block with the image while AJAX loading with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include External jQuery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

Ajax Source Code(index.js)

$(document).ready(function(){
	$("#loading").hide();
		 $('.mynodeurl').on('click', function(e){
			 var rowid = $(this).attr('data-id');
			// alert(rowid)
			$("#myModal").show();
			$("#loading").show();
			$('.fetched-data').html('');
			 $.ajax({
				type : 'post',
				url : 'fetch_node_details.php', //Here you will fetch records 
				data :  'rowid='+ rowid, //Pass $id
				success : function(data){
			    $("#loading").hide();
				$('.fetched-data').html(data);//Show fetched data from database
				
				}
			});			
        });
});

index.html

<div class="modal-body">
	<div style="position: relative;" align="center">
		<img id="loading" src="img/3.gif" /> </div><!-- Loading Image -->
		<div class="fetched-data"></div>
    </div>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is loading overlay bootstrap And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.