Solved

JS Menu and Smart Navigation

Posted on 2004-04-15
8
237 Views
Last Modified: 2007-12-19
Guys,

I am using smart navigation in an Asp.net page to nice effect. However I now need to add a javascript menu to the page.  There is a problem though. The menu has been implemented using a couple of .js files and I am calling the main function inside a <td> tag.  The problem is that everytime a control with autopostback is used the menu disappears.  I was thinking of possibly calling the function on the page onload event but dont know how to target the output to the necessary table cell.

Does this make any sense? Any advise, suggestion desperately required.

Eagery,

Joe.
0
Comment
Question by:SlammingRumJoseph
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 5

Expert Comment

by:alambres
ID: 10833741
label the td, this is:


<td id="myCell">

to reference it just :

document.getElementById('myCell')
0
 

Author Comment

by:SlammingRumJoseph
ID: 10833875
sorry, i am being dim. how would i call the function referencing that cell?
0
 
LVL 5

Expert Comment

by:alambres
ID: 10833893
I don't understand ya. send code plz
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:alambres
ID: 10834061
are you using document.write?
0
 

Author Comment

by:SlammingRumJoseph
ID: 10834209
yeah, and i added this in
var c = document.getElementById('myCell'); document.c.write.......
But it didnt like it.
0
 
LVL 5

Expert Comment

by:alambres
ID: 10834301
has the td another content or is just waiting to be filled with the menu?
if it's empty:

//supposing you got the HTML code for the menu stored in variable strMenu

document.getElementById('myCell').innerHTML = strMenu;

0
 
LVL 5

Accepted Solution

by:
alambres earned 500 total points
ID: 10834321
if not:

var newSpan = document.createElement("span");
newSpan.innerHTML = strMenu;
document.getElementById('myCell').appendChild(newSpan);
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question