Expand|Select|Wrap|Line Numbers
- document.getElementById("results").innerHTML=xmlHttp.responseText;
I am copying down the code for better understanding
Expand|Select|Wrap|Line Numbers
- Result.jsp
- <div id ="results" style="position: absolute; left: 10px; width: 540px; z-index: 24;"><%
- out.print("category_id is " + session.getAttribute("categoryId"));
- if(session.getAttribute("list_full_detail_real_estate")!=null){
- List<RealEstateVo> list_full_detail_real_estate = (List)session.getAttribute("list_full_detail_real_estate");
- List<RealEstateVo> list_full_detail_real_estate1 = (List)session.getAttribute("list_full_detail_real_estate");
- int size = list_full_detail_real_estate.size();
- %><%
- for(int j = 0;j<size;j++){
- %>
- <!-- Start of News Box 4 -->
- <div class="newsbox">
- <div class="newsbox_header">
- <!-- News Title -->
- Summary : <a href="detailsummary.do?summary_id=<%=list_full_detail_real_estate.get(j).getSummaryid()%>" style='color:#009900; font-size:18px;' title = ''><%=list_full_detail_real_estate.get(j).getSummary()%><br></a>
- <!-- News Date -->
- <strong>Date : <%=list_full_detail_real_estate.get(j).getDate()%></strong>
- <div class="clearthis"> </div>
- </div>
- <div class="newsbox_content">
- <%String swapvalue = list_full_detail_real_estate.get(j).getSwap();
- if(swapvalue!=null){ %><br><%}%>
- <!-- News Text -->
- <img alt="VERY NICE FLAT AT CHOICE GARDENS,TOC-H ROAD" src=" style="top: 207px; height: 47px; left: 500px; width: 110px;">
- <br><b>Category: </b><%=list_full_detail_real_estate.get(j).getCategory() %>
- <br><b>Sub Category: </b><%=list_full_detail_real_estate.get(j).getSubcategory()%>
- <br><b>Type of property: </b><%=list_full_detail_real_estate.get(j).getType() %>
- <br><b>Price: </b><%=list_full_detail_real_estate.get(j).getBudget() %>
- <br><b>Area of property: </b><%=list_full_detail_real_estate.get(j).getArea() %>
- <br><b>No. of rooms: </b><%=list_full_detail_real_estate.get(j).getNoofrooms() %>
- <br><b>Ownership type: </b><%=list_full_detail_real_estate.get(j).getOwnership() %>
- <br><b>Name: </b><%=list_full_detail_real_estate.get(j).getUsername() %>
- <br><b>City : </b><%= list_full_detail_real_estate.get(j).getLocation()%><br>
- <b>Sub Location : </b><%=list_full_detail_real_estate.get(j).getSublocation()%>
- <p>
- Description : <%=list_full_detail_real_estate.get(j).getDescription()%> </p>
- <br />
- </div>
Expand|Select|Wrap|Line Numbers
- var xmlHttp
- function frombudget(str)
- {
- xmlHttp=GetXmlHttpObject();
- if (xmlHttp==null)
- {
- alert ("Your browser does not support AJAX!");
- return;
- }
- var frombudget = document.getElementById("frombudgetreal").value;
- var tobudget = document.getElementById("tobudgetreal").value;
- //var category_id = document.getElementById("category_id");
- // get selected continent from dropdown list
- // var selectedContinent = category_id.options[category_id.selectedIndex].value;
- var param = "frombudget=" + frombudget +"&tobudget="+tobudget;
- // url of page that will send xml data back to client browser
- var requestUrl;
- // use the following line if using asp
- requestUrl = "refinerealestateresults.jsp?" + param
- xmlHttp.onreadystatechange=stateChanged;
- xmlHttp.open("GET",requestUrl,true);
- xmlHttp.send(null);
- }
- function stateChanged()
- {
- if (xmlHttp.readyState==4)
- {
- document.getElementById("results").innerHTML=xmlHttp.responseText;
- }
- }
- function GetXmlHttpObject()
- {
- var xmlHttp=null;
- try
- {
- // Firefox, Opera 8.0+, Safari
- xmlHttp=new XMLHttpRequest();
- }
- catch (e)
- {
- // Internet Explorer
- try
- {
- xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e)
- {
- xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- }
- return xmlHttp;
- }
But i don't want to replace the innerHTML of my results div. I just want to my div to get refresh with new refined list.
Expand|Select|Wrap|Line Numbers
- refinerealestateresults.jsp
- <%@ page language="java" import="java.sql.*,com.project.db.*,java.util.*,com.project.web.*,com.project.vo.*" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <script src="refinefilter.js"></script>
- </head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Ajax Call Test</title>
- <body>
- <%
- try
- {
- String frombudget=request.getParameter("frombudget");
- String tobudget=request.getParameter("tobudget");
- out.println("frombudget" + frombudget);
- out.println("tobudget" + tobudget);
- List<RealEstateVo> list_full_detail_real_estate = (List)session.getAttribute("list_full_detail_real_estate");
- Iterator iterator = list_full_detail_real_estate.iterator();
- iterator.next();
- iterator.next();
- iterator.remove();
- session.setAttribute("new_list_full_detail_real_estate",list_full_detail_real_estate);
- }
- catch(Exception e)
- {
- out.println("The General Exception: "+e);
- } %>
- <br>
- </body>
- </html>
I hope you guys understand my problem. Please try to help me out. Thanks in advance.