Smart Navigation problem with Javascript

Y

Ying Huang-Isella

I have a Javascript menu bar on top of each of my aspx pages. The menu bar
would not display when I turn on SmartNavigation. I did some search on this
newsgroup and found the answer to my problem in this post
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6EidZJoBHA.2244@tkmsftngp05

Apparently Smart Navigation does not work with Document.Write on the same
page and I use Document.Write to generate the menu bar. Does anyone have any
simple work around? Many thanks in advance!
 
P

Peter Blum

Let's assume that you are correct with Document.Write. Here's another
approach to inserting HTML.

Within javascript, write your new HTML into a string. Then assign it to the
innerHtml property of a <span> or <div> tag that you placed at the location
of where the HTML should go.

var vScript = "html";
var vSpan = document.all['ClientIDtoSpanTag'];
vSpan.innerHtml = vScript;

NOTE: Not all browsers support the innerHtml tag. IE for the Mac is buggy
when you set that value. Since SmartNavigation only works for IE/Windows, I
recommend using your original technique on all other browsers that you
support.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top