By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,826 Members | 2,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,826 IT Pros & Developers. It's quick & easy.

iframe in firefox

P: n/a
__________________________________________________ __________________________
I have this code:
===================================
<html>
<body>
<a href="javascript:additem('P37L5001')">P37L5001</a>
<iframe id="items" height="97%" width="100%"></iframe>
</body>
<script>

var thing = document.getElementById('items')

function additem(itemcode)
{
thing.document.write(itemcode)
}
</script>
</html>
======================================
And I get this error:

items.document has no properties

but in internet exploder, it works fine.....
i highly perfer firefox (please no comments on that) and cannot use IE
anyway.

I am having a brain fart, so can someone please help me?

TYVM in advance

Feb 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
No offense implied, but yours didn't work. BootNics did. I just changed
the additem() function to getelementnyid first then
thing.document.write to thing.contentwindow.document.write().
Thanksalot for the speedy answers and thanks for making the script
work. Kudos, l8r g9r

Feb 1 '06 #2

P: n/a
oops, that was supposed to be l8r g8r lol. the contentwindow thing
causes constant "loading", so am tweaking it a bit. (lets see if i can
get it right this time ☺) l8r g8rs

Feb 1 '06 #3

P: n/a
> "microchip" <ve***********@gmail.com> wrote:
news:11**********************@g44g2000cwa.googlegr oups.com....

oops, that was supposed to be l8r g8r lol. the contentwindow thing
causes constant "loading", so am tweaking it a bit. (lets see if i
can get it right this time ☺) l8r g8rs


I should have added: thing.contentWindow.document.close();

<script type="text/javascript">
var thing;
function additem(itemcode){
thing = document.getElementById('items');
thing.contentWindow.document.write(itemcode);
thing.contentWindow.document.close();
}
</script>

--
BootNic Tuesday, January 31, 2006 10:44 PM

A person without a sense of humor is like a wagon without springs,
jolted by every pebble in the road.
*Henry Ward Beecher*

Feb 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.