[wp-trac] [WordPress Trac] #11062: Front-end ajax handler

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 2 15:01:10 UTC 2009


#11062: Front-end ajax handler
-------------------------+--------------------------------------------------
 Reporter:  prettyboymp  |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  General      |     Version:  2.9       
 Severity:  normal       |    Keywords:            
-------------------------+--------------------------------------------------
 Just wanted to start a discussion on ajax handling for requests from the
 front-end (non-admin) of the site.  There are a couple of things I've come
 across with this:

 First is using admin-ajax.php causes problems if you have the admin
 running under a different domain than the front-end.  Using site_url
 instead of admin_url fixes the issue with cross site ajax posts, but you
 still may have to add some extra handling to keep the admin from
 redirecting to the admin's domain.  Extra steps that I think could be
 easily resolved.

 The second issue I've come across is when multiple plugins need a
 javascript variable to designate the url to admin-ajax.php.  They either
 need to share one variable (unsafe dependency), or each have their own
 variable set.

 I'm curious as to what other developers do, or if anyone feels we should
 add separate handling for front-end ajax along with a built in enqueueable
 script that sets the ajax url.  I'm

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11062>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list