php


jQuery Autocomplete returns data, but not outputting it using JSONP


Before I added dataType: "jsonp" my autocomplete was working. Now I need to make it cross domain compatible, thus using jsonp
I've added dataType: "jsonp" and ?callback= at the end of the URL.
But I still keep getting this error message:
Notice: Undefined index: callback in /var/www/storelocator/wp-content/themes/storelocator/classes/jquery.class.php on line 101
On line 101 I have the following code:
echo $_GET['callback'] . '('.json_encode($data).')';
My javascript looks like this:
jQuery('.autocomplete_brand').autocomplete({
source: siteURL +"/wp-content/themes/storelocator/include/jquery.php?instance=search_brand&limit=25?callback=",
dataType: "jsonp",
minLength: 2,
search: function(event, ui) { jQuery(this).toggleClass( "autocomplete_loading" ); },
open: function(event, ui) { jQuery(this).toggleClass( "autocomplete_loading" ); },
select: function(event, ui) { jQuery('#ID').val(ui.item.id); }
}).data( "autocomplete" )._renderItem = function( ul, item ) {
return jQuery( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>"+ item.value + "</a>" )
.appendTo( ul );
jQuery(this).toggleClass( "autocomplete_loading" );
}
jquery.php?instance=search_brand&limit=25?callback="
You have ? instead of & preceding the callback. Thus 'callback' is undefined in GET.

Related Links

Efficient flat file searching in PHP
Form Builder GUI for PHP
$_SESSION difficulties
How do Python and PHP compare for ecommerce?
Wordpress PHP If else help
Changing upload_max_filesize on PHP
php session and path setting
php script Config settings
PHP SOAP client that understands multi-part messages?
php check if domain equals value, then perform action
How can I implement RSS 2 in Code Igniter?
Error with MySQL syntax using REPLACE INTO
how to store chechbox value in php
mysql muliple queries in one statement
PHP Static Variables
php code analysis

Categories

HOME
svn
eclipse-plugin
scroll
embedded-resource
ios-simulator
histogram
mongoid
liferay-7
greasemonkey
material-components
hyperledger
navigation
elastic-load-balancer
log4j2
c#-7.0
jqxgrid
data-type-conversion
weex
el
multi-upload
ava
perfino
web-push
clipboard
hevc
acrobat
dnsmasq
audit
intune
location-services
reporting
sca
nest
amazon-kms
oauth2
netapp
uipickerview
cloudera-sentry
coverage.py
pyttsx
git-tfs
return-type
ol3-google-maps
karabiner
skip-lists
gapi
elastic4s
tablespace
mathjs
jtag
wolfram-language
simian
facebook-ios-sdk
cortana
gdl
nastran
libz
ampersand
erlog
famo.us
dc
dmake
screwturn
oxygene
property-injection
jomsocial
typesafe-stack
revmob
void-pointers
oembed
linkbutton
idispatch
nsmutablestring
websphere-6.1
trialware
monocross
multidrop-bus
differentiation
servercontrol
net-use
filelock
firefly-mv
uipasteboard
sql-parametrized-query
css-friendly
regression-testing
gaelyk
uninstaller
processors
external-sorting
gui-designer
code-camp

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