Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
32
rated 0 times [  38] [ 6]  / answers: 1 / hits: 16544  / 11 Years ago, thu, december 26, 2013, 12:00:00

I know there are question have been asked around resembling to this one, but still I am not getting proper concept of this. I am currently loading an iframe through javascript in following manner:



jQuery('.out-div-login').html(<iframe id='parent' frameBorder='0' width='320' height='500' src='+_url+'></iframe>);  


Which is working fine. (its cross domain). After loading my application inside given iframe, I want to come back to original state where .out-div-login was loading iframe into parent html.

From outside of iframe I can do this by accessing iframe using its id attribute, but not from the inside. Is there any way I can reload the iframe by giving its src again ? or by above code but from inside the iframe ? Thanks.

Update

I have tried below code without any success as of now:



var ifr = $('iframe[id=parent]');  


from one of js file inside iframe with id parent. when I do console.log(ifr) it gives in firebug something like this Object[] instead of <iframe id=parent>


More From » jquery

 Answers
38

You should use location.href inside the iframe. That should work. set location.href in the iframe to your new location.


[#73534] Tuesday, December 24, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kevonmoisesf

Total Points: 693
Total Questions: 101
Total Answers: 128

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
kevonmoisesf questions
Sat, Jan 23, 21, 00:00, 3 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
Wed, Jun 12, 19, 00:00, 5 Years ago
;