0

I am doing ajax call from a javascript file in my plugin to a php file in my plugin itself. Calling like this :

I passed this variable into the js file

plugin_dir_url(FILE);

In the js file, I am doing ajax call using this url :

thatvariable+"myphp.php"

'thatvariable' refers to the plugin_dir_url(FILE) that is passed to js file from php file .

In my local wordpress , its working, but , in the original website with domain, it is processing the destination php file, but returning error saying that file is not found . Also, the console showing the url saying that its not found, but if I click that url , its working . Did I miss any permissions ? What is the solution for this ?

4

1 回答 1

0

作为一个在黑暗中的镜头,它听起来可能是一个跨域问题http://en.wikipedia.org/wiki/Same_origin_policy检查 ajax 调用是否与您的网站所基于的域相同。

于 2012-09-14T10:18:20.350 回答