Ajaxurl not defined

I’m using xtheme, and on my site, in the custom JS bit I have

function OnClick()
{
jQuery.get({
url: ajaxurl,
data: { ‘action’: ‘test_function’},
});
};

This function deals with a button click and passes an AJAX request to the server. However, using Chrome’s inspector tells me that ajaxurl is not defined. I’ve tried deactivating all plugins, resetting my plugin folder and changing to the default theme to no avail.

Hi There,

If those steps did not work, would you mind providing us with login credentials so we can take a closer look? Please provide following information:

Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

All the best!