/    Sign up×
Community /Pin to ProfileBookmark

Autoresize Function – breaking dir structure ?

So Ive been trying to find a way to autoresize a Iframe that works in IE for PC and Safari for Mac. I had a very good fuction that works great but doesnt on Safari. I found this fucntion that seems to work in both of them and does a good job. The problem is when I use it it seems to break my dir structures, links and image paths. If I try and view the page on my local testing server on the same machine all the images are broke caz its not putting one of the main directory folder in the path. If I upload the page to the web the images work ok since they dont need that folder for the live web. But all the links are also losing that main root folder so all the links are broke on testing server and live. Any idea how to fix this ?
Heres the function.

[CODE]function autoResize() {
var dest = document.getElementById(‘frame_main’);
var source = window.frames[0].document.body.innerHTML;
dest.innerHTML = source
}[/CODE]

And in the body in the Iframe tag is this

[CODE]<div id=”frame_main”>
<iframe onload=’autoResize();’>
</div>[/CODE]

Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@jtcarlsonauthorDec 01.2005 — Taking another look at this and basically it seems to make links or image paths not auto put the dir path folder they are located in. Example,

the link I normally use, located in a folder called arizona

href="az_course_index_rd.asp?Page=course_main"

Without the script like it always does it auto puts the /arizona/ in the link

but with this script its not putting the /arizona/

So all my images in in a folder dept and links are not working on the server. Is this something I am doing wrong with paths or the script is killing something ? I have been doing pages for a bit now and havent had problems like this before, just with this script that autosizes the Iframe.

Thanks
×

Success!

Help @jtcarlson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...