Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Friday, May 16 2008 @ 01:43 AM EDT
   

iframes SUCK objects SUCK the globe knows nothing?

AnnouncementsI've been searching for the last *"16Hrs"* hours for how to embed foriegn web pages into geeklog... The external pages plug in just doesn't cut it (its great but not for the job)... How in the world can I go about avoiding iframes completely... Please I need o repeat that (**HOW DO I AVOID IFRAMES!!!**) and yet still be able to embed a **whole** web page into geeklog???

It is so unprofessional and childish like to rant the way I am ranting and just for the record my frustrations have nothing to do with Geeklog itself (its great!) I am just dying between a rock and a hard place here!!! **"16Hrs"** and I am pulling up NOTHING!!!!

Please if you haven't the answer give me IDEAS!!, SUGGESTIONS!!, HYPOTHESIS!!, INPUT OF ANY KIND!!

Every time I get closer to solving it I find myself farther from the truth...

I am sorry for my B******* but I needed a place to vent my anger and frustration with iframes... I hope you understand... I feel a little better now... I'm sorry...

Story Options

iframes SUCK objects SUCK the globe knows nothing? | 14 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
iframes SUCK objects SUCK the globe knows nothing?
Authored by: Anonymous on Tuesday, February 11 2003 @ 04:05 PM EST
How many pages are you trying to insert into Geeklog? Why doesn't the external plugin meet your need?
iframes SUCK objects SUCK the globe knows nothing?
Authored by: tomw on Tuesday, February 11 2003 @ 04:06 PM EST
If you know any php this little code snippet should ease your pain.

// get a web page into a string
$fcontents = implode ('', file ('http://www.example.com/'));

TomW
iframes SUCK objects SUCK the globe knows nothing?
Authored by: tomw on Tuesday, February 11 2003 @ 04:11 PM EST
If that makes sense then all you have to do is suck in the page, remove the header and footer and replace them with the geeklog header and footer.

Viola -- any page enclosed in Geeklog.

But you loose session variables -- as good as it gets unless you want to do a lot of programming and capture those and try to keep the seperate from geeklogs and and and more trouble than its worth.

TomW
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Tuesday, February 11 2003 @ 04:51 PM EST
I figured out 80% of the problem... In fact 100% but one tiny bug I would really like to get some help on... I've managed in 2 days time to find a javascript which will resize an iframe to the documents height using the onLoad event...

The problem is going into the second document (through a link) it would inherit the size of the first initial document... That caused trouble because if the first documents initial size is 400 but the second is 4000 thats a lot of pain double scrolling up and down...

I managed to fix it with an onMouseMove event but it works only if I lose focus on the iframe itself...

If I was on the iframe and clicked from the 400 height into the 4000 height the page would stay at 400 but if I moved the mouse outside the iframe the iframe would resize... Cool and I can live with it but my question what is the event or closest to it that would function like the mouse events but do it based on time?

I would like to have some sort of extra function that constantly checks the document for changes... something like 60 billion times per nanosecond... Just kidding but I've seen two days on this...

I am not sharp with javascript nor am I fluent in it but here are body onload events I am using so far

<body onLoad="iFrameHeight();">
<body onReset="iFrameHeight();">
<body onMove="iFrameHeight();">
<body onResize="iFrameHeight();">
<body onUnload="iFrameHeight();">
<body onchange="iFrameHeight();">
<body onblur="iFrameHeight();">
<body onMouseOut="iFrameHeight();">
<body onMouseMove="iFrameHeight();">
<body onMouseClick="iFrameHeight();">
<body onMouseUp="iFrameHeight();">
<body onMouseOver="iFrameHeight();">

I know I dont even need them all but none of them seem to work the way I would like it too other wise just moving the mouse outside the iframe does the trick...

Can anyone help in solving how to check the script every millisecond for changes?

Thanks :)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Tuesday, February 11 2003 @ 10:59 PM EST
I'll tell you exactly whats happening... The javascript that I have is able to dynamically resize the iframe to its exact height when the onMouseMove event is triggered...

Can someone modify the below script and post back a way to trigger events **while the mouse is still inside the iframe**, instead of having to move the mouse over to the geeklog body for the event to trigger?

The trouble is the user has to move their mouse **outside** of the iframe for the event to trigger... This doesn't work well if the person is calm... clicks and then rest their mouse on the iframe...

I will post this script and hopefully it can be inserted into geeklogs code or plugin as something like this would sure prove an easy way to make almost any page look as if it is native to geeklog...

-----------start-snip-------------
<html>
<head><title>Container</title>
<script language="JavaScript">
function iFrameHeight() {
if(document.getElementById && !(document.all)) {
h = document.getElementById('iframename').contentDocument.body.scrollHeight;
document.getElementById('iframename').style.height = h;
}
else if(document.all) {
h = document.frames('iframename').document.body.scrollHeight;
document.all.iframename.style.height = h;
}
}
</script>
</head>
<body onLoad="iFrameHeight();">
<body onMouseMove="iFrameHeight();">
<iframe src="http://localhost/phpBB2" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>
</body>
</html>
-----------start-snip-------------

Can someone please modify and post back a possible solution that will resize the iframe dynamically everytime even a new link is clicked?

Perhaps something that monitors the iframe every millisecond? Perhaps giving the iframe an id or name and targeting the iframe?

I am not good with javascript so I can't code it though I did manage to add the <body onMouseMove="iFrameHeight();"> event all on my own;)

Someone please help as this could very well be the answer to Microsofts buggy height iframe...

Thank you for reading this far :)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: Creator on Wednesday, February 12 2003 @ 06:27 PM EST
Have you tried changing onMouseMove to onMouseOver? Or even make
it an onLoad event?

---
L. Whitworth
www.finiserv.com
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 06:42 PM EST
Yes, I have tried mouseover and it doesn't work... If it works for you I must be doing something wrong... If it does work for you would you be kind enough to share that code with me? I am not fair at javascript...

Thanks :)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: Anonymous on Wednesday, February 12 2003 @ 07:16 PM EST
I am working with your script but keep running into a problem:

The script is firing with my event calls, but every time it fires I get an Access is Denied script error. Are you getting this error too?

iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 07:23 PM EST
The only part im playing with on phpBB2 is this part

-------start--snip-----

</head>
<body onLoad="iFrameHeight();" onUnload="iFrameHeight();" onMouseClick="iFrameHeight();" onMouseDown="iFrameHeight();" onMouseUp="iFrameHeight();" onMouseOut="iFrameHeight();" onMouseOver="iFrameHeight();">
<iframe src="http://65.33.122.27:8000/community/boards" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>
</body>
</html>

-------start--snip-----

Its wierd how it wishes to work... Sometimes it works as planned and then sometimes it doesn't... But no matter what I do if I pull my mouse out of the iframes focus and onto the geeklog body the iframe resizes perfectly...

My only mission is to get it to resize while the mouse is on the iframe itself...

I am testing this script on loading my phpBB2 boards...

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: Creator on Wednesday, February 12 2003 @ 07:27 PM EST
Use onmouseenter. Call the event from within the iframe tag as follows:

<iframe onmouseenter="iFrameHeight" src= and so on forth.

I still can't get it to work. Was there code you had to put into phpBB as
well?

---
L. Whitworth
www.finiserv.com
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 07:40 PM EST
No and thats whats so cool about the script... I don't have to modify anything outside of that script... It works beautifully mousing out of the iframe...

I'll try your snippet now :) I'll let you know what happens ;)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 07:54 PM EST
Sorry, onMouseEnter="iFrameHeight" doesn't work placed after the iframe tag... Nor does it work inside the body tag... I also tried onMouseEnter="iFrameHeight();" but nothing seems to work...

I know theres a way to treat that iframe as if it were a button... I think you almost hit it on the head too but unfortunately no cigar...

I also tried placing other commands like hold up... I think I got it to work the way it should... I am so happy... try this

Thanks to your suggestion I think I might be on to something...

I placed mad event handlers inside the iframe tag... I even made one up which seems to be the answer... Ever heard of "onMouseIn"...

Anyway this script inside the iframe tag itself seems to do the trick...

<iframe onLoad="iFrameHeight();" onUnload="iFrameHeight();" onMouseIn="iFrameHeight();" onMouseOver="iFrameHeight();" onMouseClick="iFrameHeight();" onMouseDown="iFrameHeight();" onMouseUp="iFrameHeight();" src="http://localhost/boards" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>

I really think I am on it now... My only question is I know I don't need all those tage but am not sure if some are semi dependent...

Please get back to me and try it out :)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 08:02 PM EST
I got it!... HOLY COW!!!... Almost 3 days stuck on this... I confirm it now works under IE6 and Mozilla 1.2 with no problems what so ever...

The iframe resizes perfect for every new page loaded into the iframe... All thats left now is to figure out what events are safe to remove... Heres the script in its entirety for the people who don't want to go *3* days trying to figure this out :)

---------start--snip--------

<html>
<head><title>Container</title>
<script language="JavaScript">
function iFrameHeight() {
if(document.getElementById && !(document.all)) {
h = document.getElementById('iframename').contentDocument.body.scrollHeight;
document.getElementById('iframename').style.height = h;
}
else if(document.all) {
h = document.frames('iframename').document.body.scrollHeight;
document.all.iframename.style.height = h;
}
}
</script>
</head>
<body onLoad="iFrameHeight();">
<iframe onLoad="iFrameHeight();" onUnload="iFrameHeight();" onMouseIn="iFrameHeight();" onMouseOver="iFrameHeight();" onMouseClick="iFrameHeight();" onMouseDown="iFrameHeight();" onMouseUp="iFrameHeight();" src="http://localhost/" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>
</body>
</html>

---------start--snip--------

Major thanks goes out to Creator on this one... Thanks Creator as it was your idea and suggestion that led me in the right direction ;)

I hope it gets to work for you as it is a very cool script that helps in resizing iframes dynamically... Now I am off to figure out what events I don't need :)

Thanks again Creator :)

---
Victor B. Gonzalez
iframes SUCK objects SUCK the globe knows nothing?
Authored by: vbgunz on Wednesday, February 12 2003 @ 09:05 PM EST
As for the iframe tag... it only needs one event... the onLoad event... onLoad="iFrameHeight();"...

It should start looking like this and this is the only modification needed... <iframe onLoad="iFrameHeight();" src="http://0.0.0.0/" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>

Though this script is working great trying to access IP numbers for some odd reason on some addresses and especially web address the height shrinks to about 150 to 200 pixels...

I am currently active trying to solve it... Any one have an idea?


---
Victor B. Gonzalez