Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
07-28-2010, 09:17 PM #1
- Join Date
- Jan 2009
- Thanked 0 Times in 0 Posts
Hi, I can't get this to work, but I'm trying to update the text into an iframe on the same page with a button, for a game I'm making, the battle messages when you attack. Please any help greatly appreciated.
here is the html file with the button and onClick
07-28-2010, 10:10 PM #2
Is there a reason you are using an <iframe> instead of just a <div>???
Anyway, clearly it makes no sense to use the same function when creating the <iframe> as you do when later adding to it.
It might help if you'd show a more real example of what you are after.
For example, *WHERE* in the <iframe> do you want the text which is added via the button to appear???Be yourself. No one else is as qualified.
07-29-2010, 02:26 AM #3
- Join Date
- Jul 2005
- New York, NY
- Thanked 19 Times in 19 Posts
If you're going to use an iframe and it's going to load a page, you're best bet is to define a function on that page that makes the change you want, then name the iframe, then in the parent window call frameName.thatFunctionYouDefinedInThePageInTheIFrame();
That way, the button will always work as long as the function is defined, and you can make different functions per page in the iframe.