...

View Full Version : Javascript Loading Issue



Jason7
09-24-2005, 06:22 PM
Hi codingforms.com,

I hope you're well.

I'm having a javascript problem. My web site has a drop down navigation bar and it's essential that it loads; preferrably first. However, I also have some javascript ads (Google ads, my own ads, and some pop unders). When I add some InVue ads, it stops my navigation bar from loading at all.

Is there any way that I can insert some coding to make my navigation bar resolve first? I don't understand why it resolves last and I obviously can't have it not show up at all.

I've searched the archives for this answer, but I couldn't find it. I found a couple of answers to remotely similar questions and I implemented them, but no luck. Any help will be greatly appreciated.

Have a great day.

Sincerely,
Jason

Vladdy
09-24-2005, 07:00 PM
My web site has a drop down navigation bar and it's essential that it loads; preferrably first.
Then do not use javascript to power it - unordered list of links does the job just fine. There are plenty users without scripting that will not be able to navigate your site, and your most important visitiors - SE bots - are among them.

Jason7
09-24-2005, 07:08 PM
Thanks for your reply, Vlady.

So, are you suggesting I just code it in html? Right now, it's a drop down box with numerous links in it.

Regards,
Jason

Jason7
09-24-2005, 10:19 PM
Please forgive my ignorance, but this seems like an issue that a javascript coder should know quite well. I simply need my navigation bar to load first. Is there a way to make it do that?

Any help or input will be greatly appreciated.

Sincerely,
Jason

felgall
09-24-2005, 11:37 PM
A browser starts downloading files in the order that they are referenced in your page. As different files download at different speeds and the priority given to the different downloads may change from one access to the next it is impossible to predict what files will finish downloading first.

Provided that there is no conflict between variable and function names between different scripts they should work correctly regardless of the order they download in. If there is a conflict then one or both wont work correctly regardless of the order that they are downloaded and the only difference the download order might make is which of them gives the error.

Jason7
09-25-2005, 12:16 AM
Thanks for your explanation, Stephen.

Does anyone have a suggestion or a solution for me? I'm open to anything.

Regards,
Jason

Jason7
09-25-2005, 05:33 PM
:: friendly bump ::

rm-f
09-25-2005, 05:49 PM
you can do something like:

function loadRest() {
document.write(rest of html contents);
}


<div onload="loadRest();">dropdown navigation bar</div>

Jason7
09-26-2005, 01:21 AM
Thanks for your suggestion. Can you or someone else dumb it down a little? You mean all of my page should be where it says "html contents"? Will this make my navigation bar load first? It looks like it will make it load last. Please excuse my ignorance and thanks, again.

Regards,
Jason

rm-f
09-26-2005, 09:18 PM
Will this make my navigation bar load first? It looks like it will make it load last.
Did you get this kind of result when you tested the example?

Jason7
09-27-2005, 03:16 AM
Well, since I couldn't figure it out or get enough help, I've decided to give up trying to make it load first. What I did do is make it load in a window that slides in from the left.

See here:

Old: http://jcsm.org/Wisdom.htm
New: http://jcsm.org/Wisdom2.htm

Any feedback may be beneficial.

Thanks,
Jason

rm-f
09-27-2005, 12:41 PM
proof of concept
sequencial load based on onload event:


<html>
<head>
<script language="Javascript">
function loadRest() {
alert('Click OK to continue');
var s = '';
s += '<fieldset style="width:10px;">';
s += '<legend style="border-style:solid; border-width:thin;"> load rest </legend>';
s += '<img src="http://www.google.ca/intl/en_ca/images/logo.gif">';
s += '</fieldset>';
document.getElementById('putHere').innerHTML = s;
}
</script>
</head>
<body>
<div id="putHere"></div>
<fieldset style="width:10px;">
<legend style="border-style:solid; border-width:thin;"> load first </legend>
<img src="http://us.a1.yimg.com/us.yimg.com/i/ww/beta/y3.gif" onload="loadRest()">
</fieldset>
</body>
</html>

Vladdy
09-27-2005, 01:04 PM
It would be beneficial for both you and your visitors if you familiarized yourself with the following document: http://www.w3.org/TR/WCAG10/
That actually applies to both the OP and the last poster....

... Also, IE is not the only browser that is used to browse the web...

rm-f
09-27-2005, 02:52 PM
The world does not revolve around a theory. Providing the solution could be beneficial.

Jason7
10-01-2005, 07:31 AM
So, is it just a crapshoot regarding which javascript code resolves first?

I need my ads to run after my navigation bar loads. Can someone help?

Sincerely,
Jason



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum