Browsed by
Tag: ajax

JSP Servlet with AJAX Example

JSP Servlet with AJAX Example

JSP Servlet with AJAX Example Ajax is a great feature implemented almost in all the websites in some way. It gives really a very good user interface, since things are loading/populating without refresh. It is commonly used in username availability checking, register/login page db level/business level validations etc. We are going to use Ajax with JSP and servlet to calculate the EMI payable amount by giving amount, month and interest rate in single screen(without refreshing). Requirements: 1. Include jQuery library…

Read More Read More

1,077 total views, no views today

Alexa website rank script using PHP, jQuery, Bootstrap and Ajax

Alexa website rank script using PHP, jQuery, Bootstrap and Ajax

Alexa website rank script using PHP, jQuery, Bootstrap and Ajax: Alexa is a very popular and trusted site to give the rank for all the websites. It is a successful website ranking product of amazon. They are having many developer API to display every websites country and world rank. You can make use of this API to display any websites rank in your websites/mobile apps. Today we are sharing here the readymade Alexa website rank script using PHP, jQuery, Bootstrap and Ajax….

Read More Read More

2,531 total views, 1 views today

PNR Status Script using PHP, jQuery and Ajax

PNR Status Script using PHP, jQuery and Ajax

PNR Status Script: Update: Demo may not work as expected, because the testing key provided by the “railwayapi.com” got expired.   You can create your own key and substitute that in the script and run to get the expected results / PNR status.   Are you planning to develop any PNR alert, status website or any mobile apps ? (or) planning to integrate the PNR status script to your existing website. ?   We have provided here how to get…

Read More Read More

6,257 total views, 1 views today

JSON in Servlet with Ajax call

JSON in Servlet with Ajax call

JSON in Servlet with Ajax call: JSON is a amazing alternate for XML to pass/transfer the informations. It is required to know how to handle JSON in servlet. In servlet it can be handled like this, [plain] request.setCharacterEncoding("utf8"); response.setContentType("application/json"); // json is the JSON object. response.getWriter().print(json); [/plain] But if you want to call your servlet through ajax, then we should handle the JSON response in JS also to display JSON in jsp page, else only object object will be printed…

Read More Read More

1,356 total views, 1 views today

Dynamically add/remove jsf components example

Dynamically add/remove jsf components example

Program:   dynamic.xhtml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> </h:head> <h:body> <h:form> <h:dataTable value="#{dynBean.dynList}" var="myListElement"> <h:column> <h:panelGrid> <h:outputText value="www.ngdeveloper.com"></h:outputText> </h:panelGrid> </h:column> </h:dataTable> <h:commandButton value="Add" action="#{dynBean.addToMyList}" /> <h:commandButton value="Remove" action="#{dynBean.removeFromMyList}" /> </h:form> </h:body> </html> DynamicBean.java: import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.CustomScoped; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.bean.ViewScoped; @ManagedBean(name = "dynBean") @ViewScoped @SessionScoped public class DynamicBean implements Serializable { /** * */ private static final long serialVersionUID = 1L; private…

Read More Read More

2,108 total views, no views today

Session Validation in Ajax

Session Validation in Ajax

Session validation in servlet: Usually if it is a servlet we can simply check if(session != null ){ // Business code }else{ // Redirection code }   Session validation in ajax: If you call the servlet from ajax then the above steps won’t work, since ajax gets everything as response, so the code which you have written in the else block (Redirection code) will also be sent as response, so expected redirection will not happen. So what can we do…

Read More Read More

936 total views, 2 views today

jQuery Bubble Popup onclick event sample program

jQuery Bubble Popup onclick event sample program

Step 1: Javadomain-jquery-bubble-popup.html <!DOCTYPE HTML> <html> <head> <title>jQuery Bubble Popup – Javadomain</title> <link href="jquery-bubble-popup-v3.css" rel="stylesheet" type="text/css" /> <script src="jquery-1.7.2.min.js" type="text/javascript"></script> <script src="jquery-bubble-popup-v3.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('.mButton').click(function() { var button_id = this.id.replace('link', 'button'); var button = $('#' + button_id); if ($('.mButton').HasBubblePopup()) { alert('Bubble popup already opened'); return false; } $('.mButton').CreateBubblePopup(); // bubble popup created var button_click = $(this); // clicked button value assigned to button_click var bubble_popup_id = button_click.GetBubblePopupID(); // getting the bubble popup id the clicked button button_click.ShowBubblePopup({ selectable…

Read More Read More

1,773 total views, no views today

Ajax Calling in jQuery

Ajax Calling in jQuery

Step 1:  Callingajax.html <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″> <title>Javadomain example</title> </head> <script src=”scripts/jquery-1.9.0.min.js” type=”text/javascript”></script> <script type=”text/javascript”> $(document).ready(function() { $(‘.button’).click(function() { $.ajax({ url : “sample.html”, type : “GET”, error : function() { alert(“failure”); }, success : function(data) { $(‘#cm’).html(data); // to display the sample.html file content. } }); }); }); </script> <body> <h1 align=”center”>Ajax Call Using Jquery</h1> <div class=”content”> <br /> <div class=”button” id=”cm” align=”center”>click me</div> <br /> </div> </body> </html>  …

Read More Read More

1,033 total views, 1 views today

Ajax tutorials with examples

Ajax tutorials with examples

Ajax (Asynchronous javascript and xml) Ajax is used to refresh the partial page instead of refreshing the whole page. Ajax is used to achieve the more interaction. 3 pillers 1. javascript 2. xml 3. xhr object(XmlHttpRequest object) Ajax process: 1. Calling ajax function (its like normal javascript calling) 2. Creating xhr object.(based on the browser types) xhr object is created based on browsers, If IE browser then xhr object shoule be created using ACTIVEX method.And for other browsers it should be…

Read More Read More

992 total views, 2 views today