ajax


Cannot return data using Typeahead/Bloodhound and ASMX


I'm trying to use Typeahead and Bloodhound and if I use a static JSON file the typeahead works great. However I'm trying to convert my code to use remote using an ASMX webservice. I found the following code but I can't get the ajax section to fire. It jumps right past it as if something is totally wrong but I don't have a clue.
var usersengine = new Bloodhound({
name: "users",
remote: {
url: "/admindataservice.asmx/load_All_Names_Data_AZ",
filter: function (parsedResponse) {
var dataset = [];
for (i = 0; i < parsedResponse.length; i++) {
dataset.push({
userID: parsedResponse[i].userID,
username: parsedResponse[i].username,
first: parsedResponse[i].first,
last: parsedResponse[i].last,
email: parsedResponse[i].email,
tokens: parsedResponse[i].tokens
});
}
return dataset;
},
},
datumTokenizer: function (d) { return d.tokens; },
queryTokenizer: Bloodhound.tokenizers.whitespace
});
usersengine.initialize();
$("#usersearch").typeahead({
highlight: true
},
{
displayKey: "username",
limit: 10,
source: usersengine.ttAdapter(),
templates: {
suggestion: Handlebars.compile('<p><i>{{username}}</i> - {{first}} {{last}}</p><p>{{email}}</p>')
}
});
I guess I could use a standard ajax call and write a json object as a static file but I would love to get the webservice to work. The reason to use remote is that it pulls names from a database and people working on the app may add new names. So I want the typeahead to be as current as possible. The JSON file will have less than 2000 items

Related Links

Edge AJAX calls fail to a domain with SSL pointing to localhost
Why do I sporadically receive a 400 (Bad Request) in my Bing News GET requests?
IE11 Ajax Request Only Made if Dev Tools Open
mvc ajax return partial view with model get the value of model in the success
enable ajax on datepicker prev/next
Execute only 1 POST function at a time
How Can I set $.ajax data the List<Entity> from Controller's ModelMap?
Use AJAX to update django if-else template
esp8266webserver evaluate get request parameter
Why does NGINX reverse proxy $.ajax post give “net::ERR_CONNECTION_REFUSED”
Rendering in AJAX
Django - reload div upon form submit
How to return the result using AJAX in CodeIgniter?
AjaxFileUpload, upload file error, any file over 32KB
How to pass Ajax Json object to the Controller Class in .Net Core?
I can't seem to generate content for dynamic content load

Categories

HOME
caching
jar
vb6
rotation
system-verilog
blockchain
backup
javamail
phonegap-cli
propertygrid
ng-admin
unity2d
hosts
cosmicmind
glpk
multiple-monitors
scala-native
sql-tuning
bootstrap-popover
python-unicode
ejbca
thingsboard
novnc
iis-10
web-frontend
cortex-m3
svnkit
smart-mobile-studio
backup-strategies
recurrence-relation
superpowered
service-locator
remote-server
redhat-datavirt
zero
xamarin.uitest
mongoexport
intellij-idea-2016
productivity
jrules
python-idle
context-free-language
rapidweaver
lirc
nstouchbar
rollback
component-pascal
google-maps-ios
info
castle-dynamicproxy
svn-merge
iostat
uistackview
try-finally
radians
amf
gherkin
com-interop
kendo-combobox
codesign
project-online
acm
hyperthreading
oai
twython
vine
graphical-logo
xaml-designer
hiera
low-level
pl-i
belongs-to
symfony-2.6
gyroscope-framework
author
adaptive-compression
ifft
android-json-rpc
bsod
cling
osx-snow-leopard
fogbugz-api
leptonica
client-side-scripting
shiva3d
database-permissions
fieldset
snapjs
trailing-slash
transitive-closure-table
tfs-power-tools
mpmovieplayer
parameterization
nintendo
selectonemenu
querystringparameter
selectmanycheckbox
datacontract
nagle
nvelocity
post-redirect-get
j-interop
surefire
delegatecommand
visual-c++-2008-express
grooveshark
webrat
multibyte-functions
visual-studio-dbpro

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App