1

It's a cross domain iframe ( with no control on content of iframe.)

Here is fiddle url http://jsfiddle.net/biggenius/wH4p7/

But it is not working. I need to redirect user to google.com after clicking "Go" Button.

Thanks

1 Answer 1

1

The code for your Go button need to be on that iframe then not of the other page as the other page has no control over the content like you stated yourself. There is no way around it using iframe.

After if you loaded the content inside a div via ajax it would be very easy to achieve and if it's only the little search box it should work just fine.

Iframes are a nightmare and in 99% of the time they can be avoided.

You could however change the src attribute and that will make another page load inside the iframe.

Sign up to request clarification or add additional context in comments.

5 Comments

Care to give example of one fiddle? To do this similar stuff. Thanks. I have no idea, what you are saying.
Sure, your fiddle example is broken btw, the console is outputting errors.
Sorry actually can't, trying to use your example but too many errors are popping out but basically document.getElementsByTagName('iframe')[0].src = 'google.com'; should do the trick.
okay, thanks. It would be good if you give me working example.
Sorry I can't due to cross domain errors that would be generated by loading external content into the iframe on jsfiddle as seen here jsfiddle.net/bMS7D but at least you see from the error it is trying to load the content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.