douwei7203 2010-12-24 11:55
浏览 322

iframe显示xml文件的问题

Certain scores get processed in javascript and then being send trough:

window.location.href="scores.php?Result="+result+"&slain="+slain;

So next they can be called into php with dom trough GET

$name_value = $xml->createTextNode($_GET['name']);

All the writing and reading XML wise is working as it should.

But the problem is trying do display the php file into a iframe.

When the user ends the program the scores will get displayed and the link will be something like this:

scores.php?Result="1"&slain="5"

But how can i display something like that in a iframe, since that query string will always be random. Although the entire score table is always visible to the user at the end, the idea would just be to display this entire table into a iframe.

How would i be able to show this file into a iframe?

<iframe src ="functions.php" width="100%" height="100"/>
// gives errors at src declartion
  • 写回答

1条回答 默认 最新

  • dro60731 2010-12-24 17:26
    关注

    @Maelr: You could dynamically create the iframe --

    <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>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器