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)
-   -   [HELP!] how to change HTML into an iFrame? (https://gfy.com/showthread.php?t=914051)

Si 07-03-2009 09:20 AM

[HELP!] how to change HTML into an iFrame?
 
This may seem like a dumb fucking question but I can't figure out how to do it :(

Example of what I need to do;

Change this:
Code:

<a href="http://www.blahblah.com"><img src="http://www.blahblah.com/blah.jpg"></a>
Into something like this:
Code:

<iframe src="http://www.blahblah.com/?????????" border="0" width="728" height="90"  name="whatever" scrolling="no" frameborder="0"></iframe>
How do I do it?

It's probably something simple i've overlooked but I tried a few combinations and all have failed so far.

Any help would be greatly appreciated :thumbsup

Jakke PNG 07-03-2009 09:24 AM

You make a page that has your 'upper code' and nothing else.
Then you iframe that page.

Not sure why you'd want to do that though.

mrwilson 07-03-2009 09:30 AM

Or you can use a div and set the css to overflow: scroll; this way its all inside one page :thumbsup

Si 07-03-2009 10:04 AM

Thanks guys :thumbsup

I thought it would be something simple :)

SmokeyTheBear 07-03-2009 10:43 AM

heres a rather dirty way of doing it

Code:

<html>
<body>
<iframe id=adframe src="#" width=600 height=200></iframe>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>

<script type="text/javascript">
var s1 = "<a href=https://gfy.com>gfy</a>";
var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
adframe.document.write("<div id=stuff></div>");
</script>
</body>
</html>

what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script

SmokeyTheBear 07-03-2009 10:44 AM

depending on what your doing withit you might want to set it up differently but this way you can keep some content in the iframe that stays and just change part of the page within the iframe

seeandsee 07-03-2009 10:45 AM

is there posibility to tell frame what part of page to show exactly, not just margins

Si 07-03-2009 02:05 PM

Quote:

Originally Posted by SmokeyTheBear (Post 16027485)
heres a rather dirty way of doing it

Code:

<html>
<body>
<iframe id=adframe src="#" width=600 height=200></iframe>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
<button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>

<script type="text/javascript">
var s1 = "<a href=https://gfy.com>gfy</a>";
var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
adframe.document.write("<div id=stuff></div>");
</script>
</body>
</html>

what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script

That seems a bit long winded. but I'll remember that for the future. might come in handy elsewhere :thumbsup


All times are GMT -7. The time now is 11:49 PM.

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