Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have to build a WordPress plugin which gives out HTML for an AJAX call. However, because of the server environment I cannot use the traditional admin-ajax.php.

Someone told me that I could build a custom page using url-rewrite ex: /my-ajax-calls/

So when I send a request to that page it would be:

jQuery.get("/my-ajax-calls/param1/param2/",...);

Then I could use param1 & param2 and give the appropriate HTML.

I know how to build plugins, how do I rewrite the URL to connect it with a method that generates the HTML?

share|improve this question
2  
Please reformat your Q (you have wysiwyg editor buttons on top). And also please don't use dialect words like "becoz". This is a public page and not private chat. –  kaiser Jan 13 '12 at 19:53
add comment

1 Answer 1

You can simply target to a custom file when using wp_localize_script(). Just - in the third argument-array - set ajax_url to whatever file you want to target.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.