0

I want to use iframe to display advertize of any product. this iframe width design(css) is not suitable according to my webpage so i want change css inside iframe. i tried some asked question solution but i could not do this ----------

My Iframe Is-

<iframe  src = 'http://www.flipkart.com/affiliate/displayWidget?affrid=WRID-137890638151453431' frameborder = 0 height=250 width = 262 > </iframe>

*****After the load this iframe have some div's the id, and class i want to change their css only.

Please Help me

Thanks all,

user2743387
  • 27
  • 1
  • 1
  • 2
  • 4
    if the `iFrame` src is from a different domain than yours, then you simply cannot do that. – Nick Andriopoulos Sep 12 '13 at 10:20
  • @hexblot you can still proxify it but you are right! – A. Wolff Sep 12 '13 at 10:22
  • In theory – biziclop Sep 12 '13 at 10:22
  • @hexblot, Yes iframe src is from different domain(flipkart.com). please give me alternative for this – user2743387 Sep 12 '13 at 10:27
  • There isn't an alternative to this. The content belongs with flipkart. Flipkart control it. You do not. – Quentin Sep 12 '13 at 10:30
  • @quentin, but what is this link trying to understand me or us http://stackoverflow.com/questions/6960406/add-css-to-iframe – user2743387 Sep 12 '13 at 10:35
  • @user2743387 — It isn't dealing with code on a different domain and all the comments suggest that it doesn't work properly anyway. – Quentin Sep 12 '13 at 10:38
  • @user2743387: It is not your page to control, and using data harvesting methods is more than likely against the terms of use of that page. The best option would be to talk to them and get a different way to access that data. – Nick Andriopoulos Sep 12 '13 at 11:23

1 Answers1

0

Depending on your server's capabilities and the terms of use with your ad distributor you could fetch the page with PHP or some equivalent server side program and then just extract the needed content from the page and display it inline however you'd like. I'm sure you could also do a very similar thing using javascript as well but it wouldn't be as seamless and easier for ad blockers to circumvent.

rfoo
  • 1,100
  • 1
  • 12
  • 27
  • Given the use of an affiliate id in the URL, that would almost certainly defeat the purpose of including the content in the first place. The Same Origin Policy would prevent any such attempt that involved client side JavaScript. – Quentin Sep 12 '13 at 11:13
  • Yeah I didn't think about that. In that case, you could use the server side script to pull the ad to give you the ability to include it in your original mark up and then display the iframe as well styled to be invisible. Admittedly this falls under the class of "dirty hacks" and almost certainly against the terms of use but it would get the job down. – rfoo Sep 12 '13 at 11:26