Smart Navigation problem with Javascript

  • Thread starter Thread starter Ying Huang-Isella
  • Start date Start date
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!
 
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
 
Back
Top