Find Jobs
Hire Freelancers

AJAX Query Post fileds

$10-30 USD

Terminado
Publicado hace alrededor de 9 años

$10-30 USD

Pagado a la entrega
I have the following code to produce a button with a unique ID of the related Wordpress post (there are several of these links); <div id="<?php echo $post->ID ;?>" class="button buy">Buy Now</div> When clicked, this needs to run an external PHP file and run a query based on the post id of the link. Ideally, something like this; <?php $post = get_post($post->ID);?> <a href="<?php the_field('itunes_link') ;?>">Buy Now</a> <?php wp_reset_query() ;?> I need someone to write the AJAX function to get the $post->ID of the clicked button, store as variable and use that to run the query. The returning data will be used within a popup. I had attempted this myself, but getting the $post->ID as a variable is something I do not know how to do! Here's my existing AJAX; jQuery(".buy").on('click', function(){ [login to view URL]({ url: '<?php echo get_stylesheet_directory_uri(); ?>/ajax/[login to view URL]', success: function (data) { [login to view URL]("popup").innerHTML = data; }, error: function (xhr, status, error) { if ([login to view URL] > 0) [login to view URL]("popup").innerHTML = ('Error: ' + status); } }); }); I hope that makes sense. Please ask if you have any questions.
ID del proyecto: 7195398

Información sobre el proyecto

5 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi. let's do it right now. The id is easy to get in the ajax. I will show you how to do it. . . I'll fix it in 10 minutes
$15 USD en 1 día
5,0 (1 comentario)
0,4
0,4
5 freelancers están ofertando un promedio de $25 USD por este trabajo
Avatar del usuario
A proposal has not yet been provided
$30 USD en 1 día
4,9 (3 comentarios)
3,4
3,4
Avatar del usuario
Hello I can help you to get it done quickly. I have 10+ years experience in php/mysql development. Thanks Guru Venkat
$25 USD en 1 día
4,8 (1 comentario)
1,0
1,0
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de THAILAND
Witney, Thailand
5,0
31
Forma de pago verificada
Miembro desde sept 10, 2013

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.