Created
March 12, 2012 08:17
-
-
Save 65/2020679 to your computer and use it in GitHub Desktop.
Ajax suggest - bash your SQL server!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set property timer to zero initially | |
var propertyTimerID = 0; | |
function timeProperty() { | |
// if property timer is set | |
if(propertyTimerID) { | |
// clear it | |
clearTimeout(propertyTimerID); | |
} | |
// set it to fire a second from now | |
propertyTimerID = self.setTimeout('getPropertyHelper()', 1000); | |
} | |
function getPropertyHelper() { | |
var thisStreetNo = $('pro_streetNo').value; | |
var thisAddress = $('pro_fullStreetName').value; | |
if(thisAddress.length > 2 || thisStreetNo > 2){ | |
DWRUtil.useLoadingMessage('Data Loading...'); | |
//DWRUtil.useLoadingImage(); | |
DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'getProperty', thisStreetNo, thisAddress, printPropertyResults); | |
} | |
} | |
$('searchAid').style.display = "none"; | |
function printPropertyResults(r){ | |
$('propertyResults').innerHTML = ''; | |
$('searchAid').style.display = ""; | |
$('propertyResults').innerHTML = r; | |
//alert($('propertyResults').innerHTML); | |
} | |
$('searchAid').style.display = "none"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment