/    Sign up×
Community /Pin to ProfileBookmark

probably something stupid…

lo all!!!

got a question…

WHAT IS WRONG WITH MY CODE??!!

[code]<SCRIPT LANGUAGE=”JavaScript” TYPE=”text/javascript”>

image1 = new Image();
image1.src = “Achtergrond – 1.jpg”;

image2 = new Image();
image2.src = “Achtergrond – 2.jpg”;

image3 = new Image();
image3.src = “Achtergrond – 3.jpg”;

image4 = new Image();
image4.src = “Achtergrond – 4.jpg”;

image5 = new Image();
image5.src = “Achtergrond – 5.jpg”;

image6 = new Image();
image6.src = “Achtergrond – 6.jpg”;

image7 = new Image();
image7.src = “Achtergrond – 7.jpg”;

image8 = new Image();
image8.src = “Achtergrond – 8.jpg”;

</SCRIPT>[/code]

Ok… thats my code… i have placed it in the HEAD from the topframe of my website… those images are used as backgrounds for another frame…

so… ones again… does anyone have an idea what’s wrong??

tnx anyway…

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 27.2003 — post the error that you are getting and/or what is it you expect it to do and what is it doing..help us out here to help you please.
Copy linkTweet thisAlerts:
@MasterTomauthorAug 27.2003 — ow!! sorry :o :o

uhm... i get no errors....

you see...

my site has got 3 frames... 1 on top... and 2 below...

i wanted to load 8 pictures to the client... <-- the code from above is positioned in the <HEAD> from frame 1...

why?

because when the visitor clicks a link in the 2nd frame....

i want to display the page where the link goes to WITH one of the 8 pictures on the background....

How do I select one of those 8 pictures? with a PHP-random-generator... which selects a number between 1 and 8....

thats it basically....

the images load on the background... BUT... they ARE NOT BEING PRELOADED.... or atleast the browser isnt using them... IF they ARE preloaded... thats why i THINK something is wrong with the preloading-part...

Hope to have cleared some.... and made my question better to understand... <-- sorry if i wasnt clear the first time...


tnx anyway... (again)... <--- ?
Copy linkTweet thisAlerts:
@MasterTomauthorAug 27.2003 — to see what i mean... visit [URL=http://www.baltussen.nl]www.baltussen.nl[/URL]...


If you dont understand the texts on the site... dont worry....

its DUTCH...?
Copy linkTweet thisAlerts:
@gcrowanAug 27.2003 — I believe your site does work but not as you expect. The images do preload but when the flash is completed and the status bar says "Done", the large background images are still loading. I think it's just that you don't realize you're still downloading the page.

Another thing you will want to adjust is the filenames on each background image. Netscape will not allow any spaces within filenames.

Personally I find the background images make it difficult to read however, why don't you try to implement a longer flash presentation to allow the images enough time to load.

One other option is to load these images into the top of the page above the embeded flash at height=1 width=1(so not to be seen). This should force the browser to load the images before displaying the flash. Also you can load the images with an absolute positioning outside of the viewable area(so not to be seen. - Netscape will use layers for this option).
Copy linkTweet thisAlerts:
@MasterTomauthorAug 27.2003 — hmm... tnx for the tips...

about this positioning....

how is it done??

or should i not even try and just put the images under the flash-thingie width and height set to 1... as you suggested too...

hoping to see your reply soon... (btw: THANKS AGIAN)

[b]Edit:[/b]

In the meantime... I have done the last suggestion... works fine... now i also see WHEN they are all downloaded...
Copy linkTweet thisAlerts:
@gcrowanAug 27.2003 — It just occured to me to hide the images by using visibility:hidden in the style. Here is a combination of both.


<layer visibility="hide">

<img src="image.gif" alt="" width="200" height="200" border="0" style="position: absolute; left: -1000px; top: -1000px; visibility: hidden;"></layer>
Copy linkTweet thisAlerts:
@gcrowanAug 28.2003 — Put the 1x1 images on main.php just after the body tag. This should delay the flash. Also you can use an image.onload command to begin the embeded flash. Then the flash would begin after the images were loaded. I would have suggested using setTimeout to delay the flash but you would only be guessing how long it will take for the user to load the backgrounds. I still think your best course is to lengthen the flash presentation on main.php or to use one background image. I have only played around with flash but, I believe you can incorporate the onload command within the flash, right?
Copy linkTweet thisAlerts:
@gcrowanAug 28.2003 — This is what I am talking about - main.php:

<html><head><title>Baltussen Konserven B.V.</title>

<LINK href='opmaak.css' REL="stylesheet">

</head><body><center>

<br>

<br>

<script>

<!--

function embed(){

document.write("<EMBED src='http://www.baltussen.nl/wereld.swf' loop='false' menu='false' quality='best' scale='noborder' bgcolor='#FFFFFF' WIDTH='500' HEIGHT='400' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>");

}

//-->

</script>

</center>

<img src='http://www.baltussen.nl/Achtergrond-1.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-2.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-3.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-4.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-5.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-6.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-7.jpg' width=1 height=1><img src='http://www.baltussen.nl/Achtergrond-8.jpg' width=1 height=1 onload="embed();">

<a href='edit_main.php' target='main'><font color='white'>Aanpassen</font></a>

</center>

</body></html>
Copy linkTweet thisAlerts:
@MasterTomauthorAug 28.2003 — hmm... yeah...

thats a way of doing it too...

but ehm... thanks but no thanks... i think i stick with what i said in my last post...

images are loaded onto the topframe...

with 'width' and 'height' set to 1...

I like it... it works fine...

thank you for the replies...

but ehm... i dont really LIKE 'javascript'... i prefer php and plain html...

k...tnx again...? ?
×

Success!

Help @MasterTom 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...