Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  10] [ 5]  / answers: 1 / hits: 27519  / 13 Years ago, sat, february 11, 2012, 12:00:00

I noticed that all the Facebook applications that running inside an iframe hiding their iframe SRC, instead of the real src there is a javascript:.
How can i do that? I want that my iframe will hide the original src



thanks!


More From » jquery

 Answers
11

Facebook applications are loaded dynamically, which means the SRC is changed after the HTML is loaded. That is why you can only see javascript:;. The src is not hidden though, it is still there and can be obtained using javascript.



If you are using jQuery, you could use something like this:



<iframe src=javascript:; id=myframe></iframe>
<script>
$(document).ready(function() {
$('#myframe').attr('src', 'http://facebook.com');
});
</script>


With this, the iframe will have javascript:; as src in the HTML, but will load facebook.com


[#87532] Thursday, February 9, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adrianobeds

Total Points: 558
Total Questions: 118
Total Answers: 116

Location: Luxembourg
Member since Tue, Jan 25, 2022
2 Years ago
;