JQuery syntax

Please look at this JQuery tutorial

JSP page



<form method="post">
	Enter City :
<input id="cityName" name="cityName" size="30" type="text" />
<input id="getWeatherReport" name="getWeatherReport" type="button" value="Get Weather" />
</form>
<div id="weatherReport" class="outputTextArea"></div>


AJAX call


<script type="text/javascript">
	$(document).ready(function() {
		$("#getWeatherReport").click(function(){
			$cityName = document.getElementById("cityName").value;
			$.post("WeatherServlet", {cityName:$cityName}, function(xml) {
				$("#weatherReport").html( $([COLOR="Red"]"report"[/COLOR], xml).text() );
			});
		});
	});
</script>

what is “report” here . I don’t see this in the JSP page .

If I rename it say “myreport” . Will it still work ?

my question is : Is “report” a keyword in JQuery ? or Can I write anything in that place ? Or It some dependency elsewhere ?

No . You are mistaken . I don’t have any such XML.

Here is the tutorial:

http://veerasundar.com/blog/2008/12/implementing-ajax-in-java-web-application-using-jquery/

I’d request you to answer doubts

(i)what is “report” here . I don’t see this in the JSP page .

(2)If I rename it say “myreport” . Will it still work ?

(3)Is “report” a keyword in JQuery ? or Can I write anything in that place ? Or It some dependency elsewhere ?

Hi,
report refer to the xml node


<?xml version="1.0"?>
<mytest>
    <report>Report of the .....</report>
</mytest>

in this case


$("report", xml).text() 

give you

Report of the …

Bye