简体   繁体   中英

using jQuery to load a php file and the php file includes

This may be a "stupid" question but ...

If I use JQuery .load(); etc to load a page into a is there a way that I can pass a php config file data to it without having to redeclare it? At the moment I am having to load the config files etc into the loaded page as well as on the page it loads into.

eg

In the head of page1.php - require('config.php'); then if I load page2.php into a on page1 I have to call config.php on page2.php aswell but is there a way that I don't have to?

不,你在谈论客户端请求获取页面的一部分,加载可能具有服务器端变量的初始页面的一部分实际上不是.load()的设计目的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM