The is a javascript function that takes an argument called "str".
This code will clear the value of an html element called "txtHint" and return if the argument is empty:
if (str=="") {
document.getElementById("txtHint").innerHTML="";
return;
}
Otherwise, the second part of the code is passing this argument as query string to a server-side script called "add-more-items-code.php" using Ajax method. The response from this server-side script will be displayed in "txtHint". You can learn about Ajax by going through this tutorial:
http://www.w3schools.com/ajax/default.asp[
^]
The last line of code reload your browser, this will also clear the value in the "txtHint". If that is not what you want, then comment it out like this: