[英]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.我正在编写一个基于 Wordpress/AJAX 的 SAP Web 应用程序,我有一个关于 URL 处理的问题。
My application (roughly) looks like this:我的应用程序(大致)如下所示:
index.php
file which basically contains a page container and the client-side code to handle ajax calls.index.php
文件,它基本上包含一个页面容器和用于处理 ajax 调用的客户端代码。get_about_page()
that prints/returns the HTML of the requested page) get_about_page()
的函数可以打印/返回请求页面的HTML ) The problem with this setup is handling URLs.此设置的问题在于处理 URL。
The question at hand is how do I handle requests to URLs like http://domain.com/about
, for example?手头的问题是如何处理对诸如
http://domain.com/about
URL 的请求?
Had I had an about.php
page, I could add a rewrite rule to direct all requests there.如果我有一个
about.php
页面,我可以添加一个重写规则来将所有请求定向到那里。
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.理论上,我也可以在客户端解析 URL,并决定触发哪个 ajax 调用,但这似乎是个坏主意。
使用预定义 wordpress api,它可以帮助你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.