View Full Version : iframe.src and other js error...
06-17-2007, 01:48 PM
I've been learning JS for about 6 months now, but for some reason I'm getting two error that I have no idea how to fix...
Firstly, I have a function called resize which is called onload and onresize, but when called onload, it says that the Iframe (id="spare") has no properties, and the onresize doesn't even work.
Secondly, the search function gets the value of the selected option in the dropdown list, and adds the text input value to the end and sets it as the iframes src.
This does not work either.
Please give me as much help as you can, thank you.
06-17-2007, 05:07 PM
when you set an event handler with a function you do not include ()
= resize(); //mean you want to execute the code right now on the spot
= resize; //means you want to store a 'reference' to this method
so it should be:
06-17-2007, 07:37 PM
Ok, but it still doesn't work, even with that changed.
06-18-2007, 12:03 AM
How do you expect us to help you if your link doesn't work?
06-18-2007, 10:33 AM
Sorry, the host is terrible, and decided that it was potentially a virus...
When I get home I'll put it on a different server.
06-18-2007, 12:03 PM
window.resize=resize;I believe that the above code should read window.onresize=resize. Just thought I’d point that out in case Jacka copied and pasted it.
06-18-2007, 02:14 PM
I found one of my mistakes, not putting "px" after the css width and height, but the search still doesn't work.
06-19-2007, 03:21 PM
06-19-2007, 07:00 PM
You will also need to change search() in your onsubmit to searchit()
06-19-2007, 07:03 PM
Ah, thanks a lot Aero, it's very much appreciated!
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.