Php xml文件的Iframe显示问题
某些分数在javascript中处理,然后通过以下方式发送:Php xml文件的Iframe显示问题,php,javascript,xml,iframe,Php,Javascript,Xml,Iframe,某些分数在javascript中处理,然后通过以下方式发送: window.location.href="scores.php?Result="+result+"&slain="+slain; 因此,接下来可以使用dom将它们调用到php中 $name_value = $xml->createTextNode($_GET['name']); 所有XML方面的编写和读取工作都正常进行 但问题是,试图将php文件显示到iframe中 当用户结束程序时,将显示分数,链接如下: sco
window.location.href="scores.php?Result="+result+"&slain="+slain;
因此,接下来可以使用dom将它们调用到php中
$name_value = $xml->createTextNode($_GET['name']);
所有XML方面的编写和读取工作都正常进行
但问题是,试图将php文件显示到iframe中
当用户结束程序时,将显示分数,链接如下:
scores.php?Result="1"&slain="5"
但是我如何在iframe中显示这样的内容,因为查询字符串总是随机的。
尽管最终用户始终可以看到整个分数表,但我们的想法是将整个表显示到iframe中
如何将此文件显示到iframe中
<iframe src ="functions.php" width="100%" height="100"/>
// gives errors at src declartion
//在src申报时给出错误
@Maelr:您可以动态创建iframe
--
//表格/分数的处理以及结果和删除变量的设置。。。
//创建iframe
var元素=document.createElement(“iframe”);
setAttribute('id','scoresframe');
document.body.appendChild(元素);
element.setAttribute('src','scores.php?Result='+Result+'&slain='+slain);
我希望我能理解您的意图。您只想在网页上显示functions.php(还是scores.php?)的结果?
<script type="text/javascript">
// processing of form / scores and setting of result and slain variables...
// create iframe
var element = document.createElement("iframe");
element.setAttribute('id', 'scoresframe');
document.body.appendChild(element);
element.setAttribute('src', 'scores.php?Result=' + result + '&slain=' + slain);
</script>