M
M
msirsi2016-01-17 08:40:33
JavaScript
msirsi, 2016-01-17 08:40:33

How to set the path to the php file in the ajax script, which is located in the Wordpress theme folder?

How to set the path in the ajax script, which is located in the Wordpress theme folder?

ajax.js:
( (function($) {$(function() { $("#blockajax"). load("text-dlya-ajax.php") ;}) })(jQuery)

header.php:
script type='text/javascript' src=' ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.... '>
script type='text/javascript' src='ajax.js'>

Then there are relative paths like
Taken from here .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
msirsi, 2016-01-17
@msirsi

Thank you. For answers)
Turned off minification and everything worked.
There is also an implementation option.
Of the two received a worker.
For php it works:
script type="text/javascript" src="<?php bloginfo('template_url'); ?>/ajax.js"> Is there something similar for js? there are a lot of sites.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question