Asynchronous JavaScript and XML (AJAX) is a group of interrelated Web development techniques used on the client-side to create asynchronous Web applications. With AJAX, web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. HTML and CSS can be used in combination to mark up and style information. The Document Object Model (DOM) is accessed with JavaScript to dynamically display and allow interaction with the information presented.

Share tech news, updates, or what's on your mind.

Sign up to Post

I need help in how to call my web method from ajax while using dnn. I can post the ajax method, but the function isn't called. I need to know what my ajax url needs to be to find the web method within my dnn module. Example of what I am talking about is below:

var result = $.ajax({
                    type: "POST",
                    url: ???????/SaveImage",
                    data: dataurl,
                    contentType: "text/plain; charset=UTF-8",
                    dataType: "text",
                    success: succeeded,
                    failure: function (msg) {
                    error: function (xhr, err) {
            function succeeded(msg) {

AND codebehind

Public Class test
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
    Public Shared Function SaveImage(dataurl As String) As String
        Return dataurl
    End Function
End Class
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I want to parse the JSON Data in to grid

I want to make a ajax call and get the json values and display in to  grid

could you please help me  the pseudo code
Hello, want to change the current notification with SignalR notification. The current code is like below in javascript:

this.poll = function(){

             url: _getmessage,  //This is controller and function where it hits database and get message status and message
             cache: false,
             success: function (data){
                //Send message to the client

             //setup next poll recursively every 30 seconds
             setTimeout(poll, 30000);
          dataType: "json"

Please help
We have a production and staging website. Both running on IIS. The production website is running on http and staging we recently installed a SSL certificate to test https. Allw as working fine till, we hit a roadblock with one of the function giving the error 500 for type xhr.

It is an event registration form which upon submitting gives the error.
I want to track page links by saving them in a json file in the background with out user noticing. I am using jquery .ajax for the front end and trying to send the link value to a php page for insertion into the json file. I can get the value of the link fine on the front end and am using the right code to add to a json file on the back end in php. I just can't seem to get the value of the link to transfer to php and be saved in the json file. I'm also not sure I have the right if condition in the php to start the php code running. http://webdevcei.com/app/track.html
I have a Live chart page that contains multiple Dundas charts and the page is refreshed every few minutes, depending on the setting. Normally, it runs fine. But when the chart is run 24x7, only sometimes the following error occurs and the further refreshing of the page/charts fails.

The target 'myCTL$mSnap5$zj4kzq2zcmbfipjchti4ylg_1656564000_Chart_5' for the callback could not befound or did not implement ICallbackEventHandler

I am creating the chart control in page_load event. Below is the code for Page_Load, chart's callback event handler 'AllCharts_Callback', and code of control LC02_LiveChartControl.ascx.

            //check if user has the right to start
        if (!Page.IsCallback && !Page.IsPostBack &&
            (string.IsNullOrEmpty(Request.QueryString[QLR.QC.ParamMenuKey]) ||
             !QLR.Rights.DB.UserHasRightsToStart(UserID, Request.QueryString[QLR.QC.ParamMenuKey])))
            //user (rolid) has not the right to start
            RealtimeCharts_Panel.Visible = false;
            NoRights_Panel.Visible = true;
            if (!cbFavLoad.IsCallback &&
         //If the chart has not been started using Favorites tab

We have one PHP (Cake Framework) page with no. of records with Paging. We are showing paging 1,2,3 in web page.
Now requirement is that
1) Web page should show as showing
2) Mobile version should use lazy loading means if customer uses thumb to up the page then then next set of records will pull and show.

Please suggest the best way to do so.
I  have validation.php?ID=<?php echo htmlentities($row['id']);?> page. I want redirect this page using ajax and jquery.
Here is my ajax code:

        var formdata=new FormData($('#product_detail')[0]);		
                url:'validation.php?ID=<?php echo htmlentities($row['id']);?>',
                method: "POST",
                async: false,
                cache: false,
                contentType: false,
                processData: false,
                data : formdata,
                if(answer_from_actionpage == 1){
                    $('.error').html("<div class='alert alert-success'>Successfully Product Deleted</div>");

Open in new window

How can i redirect.
I have an c# asp.net webform which uses a master page. I have coded a simple example to prove that I can use  javascript to check for changes made to an AjaxControlToolkit ComboBox1. The example works perfectly and each time I select a new drop down item the selected item display in the textbox. Because it uses a master page  the javascript has to reference the ComboBox1 as 'MainContent_ComboBox1' and the TextBox1 as '#MainContent_TextBox1'.

Now I need to make this work without a master page. I modified the default.aspx to remove MasterPageFile="~/Site.Master"  and remove the "<asp:Content.." and added in <head> and <scriptmanager> and changed the javascript from 'MainContent_ComboBox1 to ComboBox1 and #MainContent_TextBox1 to #TextBox1 but the Javascript is returning Null for $find('ComboBox1_ComboBox1').add_propertyChanged(function (sender, event) {

I have tried ComboBox1, ComboBox1_ComboBox1, 'ComboBox1', 'ComboBox1_ComboBox1', "ComboBox1", "ComboBox1_ComboBox1" and other variations without success. I don't understand why I am unable to reference  ComboBox1 when there is no master page. Any advice would be welcome !!!


Original default.aspx with Master Page (Working correctly)
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication13._Default" %>

Open in new window

Good Morning,

I hope someone will be of great help :)

I Just want to know how i will write the JavaScript :)

I currently have text field, and a button, but i want the button to send the message box info to an email address onclick, but im not quite sure how to do the JavaScript part, i want to know how i can call my Java Class in the JS and then then do the onclick function to send the Email.

Thanks so much in advance

public class SendMailTLS {

public static void main(String[] args) {

    final String username = "diamantengoud@gmail.com";
    final String password = "********";

    Properties props = new Properties();
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.port", "587");

    Session session = Session.getInstance(props,
            new javax.mail.Authenticator() {
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(username, password);

    try {

        Message message = new MimeMessage(session);
        message.setFrom(new InternetAddress("diamantengoud@gmail.com"));
        message.setSubject("Testing Subject");
        message.setText("Dear Mail Crawler,"
                + "\n\n No spam to my email, please!");


Open in new window

The 14th Annual Expert Award Winners
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Hi, I'm creating some charts and some of them will take a few seconds to be displayed. What I'd like to do is to show a 'loading' .gif while the data is been collected.
The chart is created when I select a value from a dropdownlist: 'ddlExam'. This dropdown is outside the update panel.
This is what I have so far but the .gif wont appear although the chart loads fine.

Any suggestions??


<div class="row">
            <div class="col-md-6">
                <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional" >
                        <asp:Chart ID="Chart1" runat="server" Width="750px" Height="400px" Visible="false" EnableViewState="true">
                                <asp:Series Name="Markings" ChartType="Column" BorderWidth="1" MarkerBorderWidth="1" Font="Verdana, 8pt, style=Bold"></asp:Series>
                                <asp:Series Name="Avg" ChartType="Line" BorderWidth="2" Color="Orange"></asp:Series>

                                <asp:ChartArea Name="ChartArea1">
                                <asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="true" 

Open in new window

Where i can download a sample or demo application which has the following..Any link would be useful

1. Source code
2. Sample SQL file to populate the data in mysql table or json to populate NoSQL
3. Uses Ajax in the front-end to send and receive responses
This is a spin-off of another thread: I am needing a way to add markers to Google Map, based-on geo-coordinates from an external JSON file.  The JSON file is stored locally on my web server and is being called to display information within a map window.   Additionally, I am looking for a similar method for calling a url to display a custom marker for each location.  The URL would also be stored in the same JSON file.

Below, is my code:

function initMap() {
        var hc = {lat: 40.466442, lng: -85.362709};
        var map = new google.maps.Map(document.getElementById('map'), {
            zoom: 12,
            center: hc

        var infowindow = new google.maps.InfoWindow({
            content: obj

        var iconBase = "http://icons.wxug.com/i/c/k/cloudy.gif";
            var marker = new google.maps.Marker({
                position: hc,
                map: map,
                title: 'Hartford City',
                icon: iconBase

        marker.addListener('click', function() {
            infowindow.open(map, marker);

    var downloadJSON = function() {
        $.getJSON( "ajax/GeoObs.json?_="+new Date().getTime(), function( data ) {
            var items = [];
            items.push( "<li id='Weather'>Station: " + 

Open in new window



Please go through the above link

1. Don't type any name and hit search button - Bad Request - It Comes to Error Function of Ajax - User Can't be Empty - Form Validation. Ajax response is error in this case.

2. Type "Somu" in name field and hit search button - Business Error - Returned with Success Function. Ajax response is success in this case.

3. Assume i have thrown a run time exception in getSearchResultViaAjax() as below

AjaxResponseBody result = new AjaxResponseBody();
        if(1==1) {
              throw new RuntimeException();

The same Ajax error block is getting called.

error: function (e) {

            var json = "<h4>Ajax Response Error </h4><pre>"
                + e.responseText + "</pre>";

            console.log("ERROR pp : ", e);
            $("#btn-search").prop("disabled", false);


So for Bad Request and Any Exception which comes Out side the box comes in error block

Which one is the right approach in the follow ? If both of them is incorrect, help me with the best practice

1. Throw form validation errors as as Ajax Response is ERROR with failure message to display
2. Throw Business validation errors as Ajax Response is SUCCESS with failure message to display
3. Throw any other exception as Ajax Response…
Below code I want to make  $('form#wrapped').attr('action', 'Plans'); to be dynamic from the url name.
If url.contain ("ABC") then
 $('form#wrapped').attr('action', 'Plans');
else if url.contain("XML") then
 $('form#wrapped').attr('action', 'Plansasdfasfasdfd');

How can I do that?

	/*  Wizard */
jQuery(function ($) {     
        "use strict";

        $('form#wrapped').attr('action', 'Plans');

			stepsWrapper: "#wrapped",
			submit: ".submit",
			beforeSelect: function (event, state) {
				if ($('input#website').val().length != 0) {
					return false;
				if (!state.isMovingForward)
					return true;
				var inputs = $(this).wizard('state').step.find(':input');
				return !inputs.length || !!inputs.valid();
			errorPlacement: function (error, element) {
				if (element.is(':radio') || element.is(':checkbox')) {
				} else {

		transitions: {
			branchtype: function ($step, action) {
				var branch = $step.find(":checked").val();
				if (!branch) {
				return branch;

Open in new window

can you please show me how to upload file using ajax? i have been successifully submitting data using ajax but when i try to upload file, the entire code stop working. please see my code below:
this is the html
<form method="POST"  id="form8" name="form8"  class='sform' action="">

        <!-- /.portlet-header -->

        <div class="portlet-content">

<div class="form-group">

<div id="result10"></div>
<div id="result9"></div>
<div class="col-sm-4">
 <div class="row">  
              <div class="fileupload fileupload-new" data-provides="fileupload">
                <div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
                  <span class="btn btn-default btn-file"><span class="fileupload-new">Select image</span><span class="fileupload-exists">Change</span><input type="file" id="fupload" name="fupload" /></span>
                  <a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">Remove</a>
<div class="col-sm-4">
			<p>First Name</p>
             <input type="text" class="form-control" id="sfname" name="sfname" placeholder="First Name" onblur="this.value=this.value.toUpperCase()">
		 <div id="result"></div> 
			<div class="col-sm-4">
			<p>Middle Name</p>
             <input type="text" class="form-control" id="smname" name="smname" placeholder="Last 

Open in new window

I had this question after viewing clearInterval not working ajax jQuery.
I'm using a form building script, using Ajax Autocomplete, the include file looks like this
$array = ['Mildred', 'Louise', 'Frances'];

Search 20 results
$max_results = 20;
$found = 0;
$results = [];
for ($i=0; $i < count($array); $i++) {
    if (preg_match('`' . addslashes($_GET['term']) . '`i', $array[$i])) {
        array_push($results, $array[$i]);
        $found += 1;
        if ($found == $max_results) {
            $i = count($array); // end loop if we reached max_results

if (count($results) > 0) {
    $out = '[';
    for ($i=0; $i < $found; $i++) { // returns only firs 20 results
        $out .= '"' . $results[$i] . '"';
        if ($i + 1 < $found) {
            $out .= ',';
    $out .= ']';
    echo $out;

Open in new window

Problem is I want the array data from a MySQL query, I have tried using an include to an external page that returns the results but fails:

 $db = mysqli_connect('******','****','*****','*********s')
 or die('Error connecting to MySQL server.');


$query = "SELECT * FROM templates_client_search";
mysqli_query($db, $query) or die('Error querying database.');

$result = mysqli_query($db, $query);
$row = mysqli_fetch_array($result);

while ($row = mysqli_fetch_array($result)) {
 echo "'" . $row['ContName'] . " - " . $row['ContAddress'] . "', ";

Open in new window

Any ideas or pointers please?
i have a problem
i just want to pass a variable in javascript to another php file here is my ajax code:
var gID=window.gorevid;
                  data: "a=" + gID,
                        alert('ID iletildi.');
                        window.location = "index.php?page=gorevYorumEkle";

Open in new window

and i retrieve it in another php file with it

$gID = $_POST["a"];

but always get an error :Notice: Undefined index: a in

please Help me:)
Free Tool: ZipGrep
LVL 12
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I am using SharePoint 2013.  

I am using Handlebars to display my SharePoint list into a table, which works.  But when I try to turn it into a dataTable, it does not transform into a dataTable.  I was able to do it in jsFiddle and it works.  Can you see what I am doing wrong?  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Handlebar Js Template Starts Here --> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.10/handlebars.min.js"></script>   
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://understandsp.com/spdev/SiteAssets/siteAdmins.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/css/jquery.dataTables.css" />
<script id="siteadmin-template" type="text/x-handlebars-template">
<table border=1 width="100%" id="example" class="display"> 
		<th>First Name</th>
		<th>Last Name</th>

Open in new window

I got hundreds of small rectangle image pictures of a words that I cut open from a letter-page.
Question is  how to allow User to rearrange images visually to reconstruct a original or alternative story?  

All kind of extras as game-like % to see how near constructed is to original would be good also, with print out option of final work.  

First i can just copy them all in to Word-Blog and start re-arrange in there, but this ended up with a freezed session.

Also was thinking about some image gallery scripts that would randomize images  and would fill a page by adding  the rectangle images after each other in flat view (there would be no option to re-arrange but at least would be able to display the output some-kind in readable format).

(image rearrange platform, web-script, flash puzzle like game where people can randomize images and then one by one order them up and down, after each other.  )
I have a search results & edit details set of pages that use an Ajax Form to populate results of a search without reloading the entire page. That works fine and looks nice for the user.

Each of the search results is linked to an edit page (using standard HTML "A" tag) - again, that works OK.

What doesn't work is coming back from the edit page, as I end up back at the search page but with no results.

I tried using JavaScript to go back one page in history,

<a href="javascript:history.back();">[Go Back]</a>

Open in new window

which works but doesn't retain the search results.

Is it possible to return to the previous search results list, in the place (on the page) I came from, or is Ajax the wrong solution for that?

I am using MVC 5 & C#.
I have a list in Flexigrid and the edit form in a different page. Problem is after edit process is completed I would like to return the same page number from which row is edited. Instead it always goes to the first page of the list.

All of the this done in Codeigniter., after searching for a while I got below solution but still I am not sure how to get to the history page from the edit is clicked.

$('#MyFlex') .flexOptions({ url: urlAction, newp: 1 }).flexReload();

Open in new window


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"


package in.aftershoot.www.websitetoapplication;

        import android.graphics.Bitmap;
        import android.support.v7.app.AppCompatActivity;
        import android.os.Bundle;
        import android.webkit.WebView;
        import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    private WebView webView;
    protected void onCreate(Bundle savedInstanceState) {

        webView = (WebView) findViewById(R.id.webView);
        webView.setWebViewClient(new myWebClient());
I need to show loader when ajax calls in mailchimp.

My coding like,

<form action="Myactionname" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="result" target="_blank" novalidate onsubmit="thirdpart();">
          <div class="mc-field-group">
            <!--<label for="mce-EMAIL" class="labelemail">Email Address <span class="asterisk">*</span> </label>-->
            <input type="email" value="" name="EMAIL" class="required email textinputbox" id="mce-EMAIL"
             placeholder="Email Address *" onfocus="this.placeholder=''" onblur="this.placeholder='Email Address *'">
            <input type="submit" value="Sign up" name="signup" id="mc-embedded-subscribe" class="btn_brd" >
          <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
          <div style="position: absolute; left: -5000px;" aria-hidden="true">
            <input type="text" name="b_bc66e7d3354ff8ce99f71a04d_3831086bec" tabindex="-1" value="">
        <div id="mce-responses" class="clear">
          <div class="response" id="mce-error-response" style="display:none"></div>
          <div class="response" id="mce-success-response" style="display:none"></div>

<script src="https://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script>

My form validate and submit showing error …






Asynchronous JavaScript and XML (AJAX) is a group of interrelated Web development techniques used on the client-side to create asynchronous Web applications. With AJAX, web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. HTML and CSS can be used in combination to mark up and style information. The Document Object Model (DOM) is accessed with JavaScript to dynamically display and allow interaction with the information presented.