0

I have no clue why this is happening. When I load a certain page on my site, my content loads twice. Basically, my content appears to flash once.

I can't figure out what's going on, but it seems to deal with the following code. The page calls urlCheck().

// display correct content
function chooseContent(num) {
	highlightButtons(num);
	obj = document.getElementById('portSample' + num);
	obj.style.display = 'block';
}

// highlight the correct buttons relating to content.
function highlightButtons(num) {	
		obj = eval('document.port' + num);
		obj.src = portThumbActive[num-1];
		obj.name = ('active');
		
		obj = eval('document.nav' + num);
		obj.src = navActive[num-1];
		obj.name = ('active');
}
function urlCheck() {
	// store url in a string
	url = window.location.href;
	
	// check url for #1, #2 etc
	for (var c=1; c<= portThumb.length; c++) {
		hashNum = url.search('#' + c);
		if (hashNum != -1) {
			obj =  document.getElementById('port' + c);
			strName = obj.name;
			
			// if correct content is already displayed, don't reload it.
			if (strName.search('active') == -1) {
				chooseContent(c);
			}
		}
	}
}

Let me know if you want more info. If a link to the page would be useful let me know.

3
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by alipica
0

Okay. Here is the url: http://alicepiccola.com/testSite/index.html

When I click from my homepage to the portfolio page is when it loads the content twice. Let me know if you need more info. I still have no clue what's happening! I've googled everything I could think of...

0

I forgot to mention that I haven't started testing my site in other browsers yet. I've been working in FF.

0

When I click from my homepage to the portfolio page is when it loads the content twice. Let me know if you need more info. I still have no clue what's happening! I've googled everything I could think of...

Hard to say why it does that double load thing. I see it in IE too so it's not just FF.

I would suspect hypehenator. Try commenting out the line Hyphenator.run(); and see if it still misbehaves.

Airshow

0

There's some javascript error when you click the portfolio link.
Stick this on your page, it might help:

function globalError() {
            var foo="\r\n" + arguments[0] + " in " + arguments[1] + " at line " + arguments[2];      
			alert(foo);
        }
        window.onerror = globalError;
0

Thank you guys! It seems to be the hyphenator script. I don't even need that script for the portfolio page, so it's not a problem to relocate the function call.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.