1
我正在开发我的第一个jQuery移动Web应用程序,并试图了解与一个HTML文件中的多个页面有关的服务器端(PHP)代码的关系。JQuery移动多个页面与PHP
在这种情况下,我有一个单独的html文件,其中包含我所有的web应用程序的各种页面:索引,登录,注册,设置等(只是前端,所有的实际数据请求都通过PRG )。基于显示的任何一个#page,我是否可以将我的PHP代码嵌套在#page div中,以便只在调用#page div时运行,或者不管哪个页面div被调用,所有php都运行?
例如:
<div data-role="page" id="index" data-theme="b">
<?php $this is some thing that is pertinent only to elements within the #index page.?>
</div> <!--#index -->
<div data-role="page" id="login" data-theme="b">
<?php $this is something that is only pertinent to the login page, and will NOT play nice with the other php code in the page.?>
</div> <!-- #login -->
既能那些PHP项目的运行,或者只会在活动#page DIV运行的项目?
任何帮助或建议,非常感谢。
PHP有没有HTML的概念。这只是文字,真的。 php不会“看到”你的数据角色,它只会在''块内** ** ANYING **。如果只希望其中一个块“运行”,那么在页面构建在服务器上时,您将需要相应的“if()”类型逻辑。 – 2013-03-16 14:52:05