Click here to Skip to main content
16,017,238 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
have one question, i trapped in a prob..The problem is like that --->I have to manipulate the css of inner html of iframe but the content of this iframe is not coming from same domain so how can it makes possible
live eg.-u can take ("tweets feed in our website ,it comes from another domain tweeter.com/bla....blaa but render on our web page encapsulate with iframe,so how can i style tweet section in our website")
i have tried by jQuery but its not working can u plz help me out in that ?
Thanks in advance :)
HTML
<head>
  <script>
$(document).ready(function() {
$('iframe').contents().find('body').css('background','red');
$('iframe').contents().find('#div_').css('color','green');});
  </script>
</head>
<body>
<div class="carol" height="" width="200px">
  <iframe width="500" heught="300" src="iframe.html">
        <html>
            <head></head>
            <body style="background:#ffffff">
                 <div id="div_" style="color:red">helllo dud</div>
            </body>
        </html>
  </iframe>
</div>
</body>

this is not working after that i have implement

$('iframe').load( function() {
$('iframe').contents().find("head")
.append($("<style type='text/css'> #div_{color:green;} </style>"));
});
it is also not working
Posted
Updated 22-Nov-13 17:12pm
v2
Comments
Sergey Alexandrovich Kryukov 22-Nov-13 15:30pm    
What do you mean by "manipulate", why? CSS styles of the iframe are separate; consider it as a separate document...
—SA
eshitagupta 22-Nov-13 23:17pm    
But we can not change on the css of tweeter.com,i am asking that the html and css of tweets is render in my website in between iframe so can i can the look or style of tweet feed on my web site section like its by default background white their borders alignment according to my site theme .. :)
Sergey Alexandrovich Kryukov 23-Nov-13 1:14am    
Of course you cannot...
—SA
I guess you can't do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900