GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Is it possible to inject a background color into someone else's iframe? (https://gfy.com/showthread.php?t=979849)

DWB 07-27-2010 11:21 AM

Is it possible to inject a background color into someone else's iframe?
 
I need to turn a iframe with a white bg into a black bg.

Is there anyway to do this?


<IFRAME SRC="http://www.xxxxxx.com/table/xxxxxx/xxxxxx.html?affiliate_id=XXXXXX" width=950 height=1710 frameborder="no" scrolling="no"></IFRAME>

CDSmith 07-27-2010 11:32 AM

Simplest way I know is just ask the owner of the Iframe to make a second version of their page/image, with a black background, and issue you a new iframe for it.

:D

fuzebox 07-27-2010 11:34 AM

You can attach a stylesheet via javascript on the parent page.

Code:

var cssLink = document.createElement("link")
cssLink.href = "style.css";
cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['frame1'].document.body.appendChild(cssLink);


ottopottomouse 07-27-2010 11:41 AM

http://www.webmasterworld.com/forum21/11217.htm

DWB 07-27-2010 03:42 PM

None of that worked. I think when it calls their page it overwrites what I make.

No worries, thank for trying to help. I will contact them to try to get a different one.

Varius 07-27-2010 04:31 PM

If you use any programming language, you can do that easily.

Example, with PHP:

- Fetch the iframe page, for example with cURL
- Replace the background color white part with black
- Output

You can also use some jQuery/javascript to do the replacing as soon as the iframe loads, though this may cause a flicker if your user is on a slow connection.

CaptainHowdy 07-27-2010 05:44 PM

That sounds like a pain in the ass...

JD 07-28-2010 12:14 AM

Quote:

Originally Posted by fuzebox (Post 17366990)
You can attach a stylesheet via javascript on the parent page.

Code:

var cssLink = document.createElement("link")
cssLink.href = "style.css";
cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['frame1'].document.body.appendChild(cssLink);


last i knew, IE blocks changing of iframes with js

Chosen 07-28-2010 03:24 AM

Not sure if it's possible at all...

munki 07-28-2010 03:27 AM

Quote:

Originally Posted by Varius (Post 17367780)
If you use any programming language, you can do that easily.

Example, with PHP:

- Fetch the iframe page, for example with cURL
- Replace the background color white part with black
- Output

You can also use some jQuery/javascript to do the replacing as soon as the iframe loads, though this may cause a flicker if your user is on a slow connection.

:thumbsup:thumbsup


All times are GMT -7. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123