Troubleshooting DHTML and Javascript

B

bbcrock

I am testing in IE7.

I display one of several spans when the user mouses over some code.
Inside the span are several tabs. Clicking on the tab triggers a JS
function that hides the "current" text for the span, then shows the
"new Current" box. It's a constantly revolving door- turn off old,
turn on new. Switch from one span to another and reset the fields.

When I switch between different "spans" then switch back, there are
ghost form elements on the screen (a text area, a blank button) that
appear near where they should be. The section that I was last on does
not display. This occurs when switching between different spans.
HOWEVER, when I set a javascript alert to display what the old visible
and new visible divs are within each span, none of these problems
occur- everything displays correctly. It's as if the alerts "reset"
the javascript display in some fashion. The errors only happen when
the alerts are not on.

Does anyone know why this might happen or if it's a common occurence
that these problems disappear when an alert is used? If I don't use an
alert, how do you display JS variables during testing. Here are some
of my JS functions. thanks in advance for any help.

Don


function onChangeSpan(sp_id){
//Triggered when a new span is selected
document.getElementById('Span'+currentSpan).style.display =
'none';
document.getElementById('Span'+Sp_id).style.display = 'block';
currentspan = Sp_id;

//alert(currentExamplePanel);
hideExamplePanel(currentExamplePanel);
currentExamplePanel = 'qgetsample'+tt_id+'1';
//alert(currentExamplePanel);
showExamplePanel(currentExamplePanel);
}

function showExamplePanel(examplenum){
//alert(examplenum);
hideExamplePanel(examplenum.substring(0,11)+1);
hideExamplePanel(currentExamplePanel);
document.getElementById('Examplepanel'+examplenum).style.display =
'block';
currentExamplePanel = examplenum;
//alert('new current: ' + examplenum);
}

function hideExamplePanel(value){
//alert('hiding: ' + value);
document.getElementById('ExamplePanel'+value).style.display = 'none';
}
 
R

RobG

I am testing in IE7.

I display one of several spans when the user mouses over some code.
Inside the span are several tabs. Clicking on the tab triggers a JS
function that hides the "current" text for the span, then shows the
"new Current" box. It's a constantly revolving door- turn off old,
turn on new. Switch from one span to another and reset the fields.

When I switch between different "spans" then switch back, there are
ghost form elements on the screen (a text area, a blank button) that
appear near where they should be. The section that I was last on does
not display. This occurs when switching between different spans.
HOWEVER, when I set a javascript alert to display what the old visible
and new visible divs are within each span, none of these problems
occur- everything displays correctly. It's as if the alerts "reset"
the javascript display in some fashion. The errors only happen when
the alerts are not on.

Does anyone know why this might happen or if it's a common occurence
that these problems disappear when an alert is used? If I don't use an
alert, how do you display JS variables during testing. Here are some
of my JS functions. thanks in advance for any help.

Your problems seem more related to HTML and CSS - a span element is a
generic container for inline content, it should not contain block
elements like divs.

Try asking your question in:

news:comp.infosystems.www.authoring.html

or

news:comp.infosystems.www.authoring.stylesheets

They will want a link to a page that displays the error.
 
B

bbcrock

I appreciate the response. I reposted my question there and only kooks
responded I'm afraid. I solve the problem before I got a chance to
create and post this on a public-facing website.

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top