【发布时间】:2013-01-31 14:24:23
【问题描述】:
我有两个站点,站点 A 只是 html 和 javascript,站点 B 有 php。我需要的是从站点 A 中的站点 B 获取变量。
前:
站点 A 是这样的
<html>
<head>
<script>
//this script has to get the values from siteB
</script>
</head>
<body>
<div><!-- here i will do something with the data of site B --></div>
</body>
</html>
站点 b 是这样的:
<?php
var1= "something";
var2= "somethingElse";
?>
我正在考虑使用 JSON 或 Ajax,但我不明白具体如何。
【问题讨论】:
-
好的,感谢所有回答的人。对不起,如果它是重复的,我似乎无法让自己理解堆栈溢出搜索引擎。我设法用 ajax 做我需要的事情。
标签: php javascript ajax json