Asaf
Asaf

Reputation: 2035

How to handle URL with parameters in a SAP AJAX Webapp?

I'm writing a Wordpress/AJAX based SAP web application, and I have a question about URL handling.

My application (roughly) looks like this:

  1. There is an index.php file which basically contains a page container and the client-side code to handle ajax calls.
  2. The client-side code is responsible for switching the pages according to user clicks. It does that by calling the registered action, which is mapped to a server-side function that returns the html for that page. (So there is a function named get_about_page() that prints/returns the HTML of the requested page)

The problem with this setup is handling URLs.
The question at hand is how do I handle requests to URLs like http://domain.com/about, for example?

Had I had an about.php page, I could add a rewrite rule to direct all requests there.
I could also, theoretically, parse the URL on the client-side, and decide which ajax call to fire, but that seems like a bad idea.

Upvotes: 2

Views: 254

Answers (1)

Vikas Kumar
Vikas Kumar

Reputation: 110

Use pre define wordpress api, it may help you

Upvotes: 2

Related Questions