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

php code for uploading/changing Image for an existed user from android after logging in
MongoDB PHP Driver Error when doing updateOne
Reading URL in PHP/HTACCESS
Sending a file via ajax
conditional statement if is_page for multiple pages in wordpress
Error in UNION and WITH [duplicate]
Show a record and change next in the same form (next/previous record)
Laravel/Composer: adding seeds programmatically
Zend: RegisterManager::sendActivationMail() is undefined
How to limit user actions with Laravel Passport Scopes + Password Grant Type
$_FILE is empty when the size file is bigger, Codeigniter
List records grouped by category name
Send attachment optional - Phpmailer
How to stop react router executing itself for universal react?
How to Calculate Derived rate and order user passed on it using php/mysql
Mysql with Php 7

Categories

HOME
nam
ionic2
orientdb
powerbi
memory
class
matrix
verification
openxml
activemq
message-queue
theano
adobe
iverilog
autocomplete
mathematical-optimization
implicit-conversion
dji-sdk
gprs
msmq
fireloop
game-maker
rangy
grocery-crud
powermock
phonegap-build
c#-7.0
neo4j.rb
mime-types
web-config-transform
tracing
sap-lumira
fusion
mdns
guice
source-insight
argv
commonsware-cwac
nsmutablearray
caesar-cipher
shapeless
android-collapsingtoolbar
adminer
spring-rabbitmq
buildforge
eclipse-gmf
assemblies
oauth2
right-click
uipickerview
web-inspector
transparency
phppgadmin
openstack-glance
extjs4.1
simple-schema
freshdesk
patternlab.io
clrs
glassfish-4.1
front-camera
hmmlearn
google-shopping-api
petsc
streamwriter
msbuild-4.0
nsdata
right-to-left
yii2-model
timestamping
jsr363
wikimedia-commons
bayesglm
miniconda
android-mapview
espresso
fantom
whitespace-language
deque
kognitio-wx2
ildasm
tabris
jini
windows-taskbar
compiler-flags
sql-view
insertion
blobstorage
itunes-sdk
xalan
multiscaleimage
workflow-manager-1.x
image-formats
telerik-ajax
uipangesturerecognizer
nsfont
exponent
type-safety
affinetransform
multidrop-bus
servercontrol
office-automation
regression-testing
raw-data
rational-unified-process
google-translator-toolkit
source-code-protection
wmd-editor
community-server

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App