开发者

Iframe display issue with xml file

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, si开发者_如何学运维nce 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


@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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜