passing values between frames -> parsing error
Posted: Wed Nov 10, 2004 5:04 am
Hello
I have a window call A.html that contains an iframe called B.php
B.php determines what its content should be in HTML and it holds that info in a PHP variable called $content
That means that the value of $content is now something like:
Note that the code contains both " and '
Now in the iframe onload event I want to pass the content of the $content variable to the innerHTML value of some div in A.html
I do the following:
Now note that the single ' that enclouses the value of the innerHTML. They interfere with the ' and " that are part of the content of $content
How can I solve this problem and pass any arbitrary HTML content between pages by using JavaScript?
regards
Help would be appreciated
I have a window call A.html that contains an iframe called B.php
B.php determines what its content should be in HTML and it holds that info in a PHP variable called $content
That means that the value of $content is now something like:
Code: Select all
<table border="2" cellspacing="0" width="100%">
<tr>
<td>
<span style="font-family: 'Arial, Helvetica, sans-serif'>Hello</span>
</td>
</tr>
</table>Now in the iframe onload event I want to pass the content of the $content variable to the innerHTML value of some div in A.html
I do the following:
Code: Select all
function onLoad() {
var divElement = parent.document.getElementById('div');
divElement.innerHTML = '<?php print $content; ?>';
}How can I solve this problem and pass any arbitrary HTML content between pages by using JavaScript?
regards
Help would be appreciated