Change dynamically the url of a menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jdespatis
Beginner
Beginner
Posts: 1
Joined: Tue Apr 26, 2005 12:16 am

Change dynamically the url of a menu

Post by jdespatis »

Hello

Here is my need : I have links in a menu that need to get an id from somewhere to update the internal links of the menu

As a good studient, i've seen the log from this forum.

1/The best solution should be as expected:
viewtopic. ... 4348#14348

But I meet some problems : as explained in this link i've added an "aI" link with a onfunction=mm_changeItemProperty(...)
However (the problem appears on Mozilla, I haven't tested on other nav), when i drag the mouse on a menu, i see in the window.status the old url, and AFTERWARDS mm_changeItemProperty() is executed, and then change the url (but afterwards), so if i drag the mouse, and click immediately, i go on the old url, and not the new one (changed by mm_changeItemProperty)

I should drag the mouse on the link, then drag the mouse out, then drag it on again the link to see the new link, i can click on... not a solution...

I've tested by putting updateDisplay = 1 to force the update, in that way, the url is immediately changed, BUT it seems target has been lost, and when i click on the menu, my link appears on top of my page (but it should appear in a specific frame only)

2/ i've seen another solution:
viewtopic. ... modify+url

i would find this solution cleaner, but it don't know if a complete solution is possible in fact.
I've put an "aI" link with a url=javascript:open_link(...)

i've done an open_link() function that gives the correct link, but i don't know what to do with it, i've tried to do something like that:
function open_link() {
var foo = http://www.foo.com/id=453
return foo;
}

but of course, when i click on my menu, the page loaded is javascript:open_link('') and not the url returned by open_link()

i've tried to replace return foo, by parent.location = foo;

But in that way, the link is loaded on the top, and not on my specific frame...


Please I need help, i've no more idea by my own...

Thanks
Jerome
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Do the changes need to be made after the page is already loaded, or can the changes be made at load time, so that the menu item's url is changed when the page loads, but not after it is already loaded? In other words, do you know what the changed urls should be when the page is loading, or do you have to wait for some input from the user on the page (after it's loaded) to decide what the changed urls should be?

Cheers,

Kevin
Post Reply