从.load()页面访问变量

时间:2013-12-18 14:32:35

标签: php jquery variables load return

我有我的index.php和load让“content.php”和.load()进入窗口onload的div。 如何在index.php中使用content.php中的变量

例如:
假设我的content.php中有一个名为$ something的变量。我想在index.php中使用该变量

在我的index.php中:

<head>
$(function Loadcontent() {
    $("#content").load("content.php")
});
window.onLoad = Loadcontent();
</head>
<body>
<div id="content"></div>
</body>

在我的content.php文件中,我现在声明一个变量:

$something = 1;

我现在想在index.php中使用$ something

1 个答案:

答案 0 :(得分:0)

相关问题