• Hello. I am trying to use the most simple example of ajax in word press

    this is the most simple code possable. I am using it in a javascript function connected to an onclick=”” on a button for testing it

    this is the code

    $.ajax({
    url: “https://www.google.com”,
    success: function( data ) {
    alert( ‘hi!’);
    }
    });

    That wont work. I dont know why. Do i need a plugin to run ajax? thanks

Viewing 4 replies - 16 through 19 (of 19 total)
  • I have no idea, but one thing I see weird is the wp-admin/login.php file which does not exist I think.. site.ext/wp-login.php ?

    Sorry my friend, my jQuery Ajax knowledge is very limited, you might want to post in these forums again and wordpress.stackexchange.com ..

    Thread Starter johnboyman

    (@johnboyman)

    oh no i made, that login.php file my self and put it next to admin-ajax.php

    I just wanted to basically call a php file from ajax in wordpress but it wont work, and i tried admin-ajax.php
    wihch workds except i dont wana put my login code there, i checked permissions theres no difference

    anything else thanks?

    Thread Starter johnboyman

    (@johnboyman)

    acutallty i figured it out thanks

    Thanks!! and what was the fix you figured out?

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘How to use ajax in wordpress’ is closed to new replies.