Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:54

clickfunction issues under R28 (if no page refresh)


Poster: tim
Dated: Thursday November 27 2003 - 14:07:31 GMT

Hi Milonicons!

Fantastic software, well done. But alas, I have a problem.

My dev url: http://www.jammusic.com.au/gv3/inside.html?page=about

Okay, here's the problem. Checkout the three menu options 'About', 'Media' & 'Contact' on this page. Each of these uses the menu item actions:

url=#;clickfunction=loadPage('xxxx'); where xxxx is a member of the set [about, media, contact].

As you click on these in turn, you'll notice that I don't refresh the page, rather I load content directly onto the page. You'll also notice that if you click on one of the above links and then go to click on another, it doesn't work first time.

The page works by loading a page [about.html, media.html, contact.html] into a hidden iframe and then scraping the html out of that and dropping it into a div. (Why? 'Cause DHTML drop-down menus can't sit on top of an iframe! :} )

Any idea what's causing this weirdness? Does the Milonic menu system really rely on a page-refresh to make sure it's working?

Thanks in advance for any suggestions!

TIM

url moved . . .


Poster: tim
Dated: Thursday November 27 2003 - 22:47:29 GMT

Due to reasons of needing to go live ASAP, I've moved the problem URL to:

http://www.jammusic.com.au/gv3/inside2.html?page=about

Any help much appreciated!

TIM

moved again . . .


Poster: tim
Dated: Thursday November 27 2003 - 23:17:57 GMT

And now its finally rested at

http://www.jammusic.com.au/goodvibratio ... page=about

Phew! :o


Poster: kevin3442
Dated: Friday November 28 2003 - 23:54:59 GMT

Hi Tim,

As far as I know, the menu's functionality does not rely on a page refresh.

I tried your (final destnation) test site using IE6 and NS7 in Win2k. I don't get the behavior you describe in IE6, but do in NS7. It's not clear to me that the loadPage() function is firing on the first click of the pertinent items in NS7 (don't see the N icon in the upper right moving and don't see any activity in the status bar). Maybe try putting an alert() at the top of loadPage() just to see if the function is actually firing when you click one of the three menu items.

I also notice this: If I go to the media page, then manually out your test url back into NS7's url field and press enter, nothing happens. If I press enter on the url field again, it goes. The same odd behavior holds true if I start from, say, the contact page and manually put in a url to the media page:
Code:
http://www.jammusic.com.au/goodvibrationsfestival/inside2.html?page=media

I have to enter twice to get to the media page. Not sure what this means exactly, but it may provide a clue.

I see where you've defined the hidden iframe, and how you change it's src in the loadPage() function.
Code:
container.src = page+".html";

loads the specified html file into the iframe. But I don't see where you move the contents of the 'content' iframe into the div that you mentioned (clever workaround btw). Perhaps I haven't dug into your code sufficiently. From what I see, after loadPage() loads the iframe, it calls drawMenus(), then returns. So where is the div that you mentioned updated? You haven't modified drawMenus() to load the contents into the div have you? If not, I have to wonder why you are redrawing the menus each time you call loadPage()... shouldn' be necessary.

Anyway, I'll have to dig around some more I guess. In the meantime, I suggest:

(1) Verify that loadPage() is firing when you click one of the suspect items but the page doesn't change.

(2) If you are using an unmodified drawMenus() from the Milonic code, then remove the call to drawMenus() from your loadPage() function.

(3) Your iframe has a background color of #fff. Did you want that to be #ffffff?

(4) Instead of using the clickfunction property to call loadPage(), try it from the url property, like this:
Code:
aI("text=;url=javascript:loadPage('media');image=images/nav_media.gif;overimage=images/nav_media-over.gif;");

Do you get the same problem, or does it work correctly now? That would at least help test whether the problem is related to the clickfunction property or if it exists downstream from that.

Hope that helps some,

Kevin

some probs solved, a couple of new ones . . .


Poster: tim
Dated: Monday December 8 2003 - 12:24:07 GMT

Hi Kevin and thanks for your quick reply, (sorry for my tardy one).

kevin3442 wrote:
Hi Tim,

As far as I know, the menu's functionality does not rely on a page refresh.

I tried your (final destnation) test site using IE6 and NS7 in Win2k. I don't get the behavior you describe in IE6, but do in NS7. It's not clear to me that the loadPage() function is firing on the first click of the pertinent items in NS7 (don't see the N icon in the upper right moving and don't see any activity in the status bar). Maybe try putting an alert() at the top of loadPage() just to see if the function is actually firing when you click one of the three menu items.

I also notice this: If I go to the media page, then manually out your test url back into NS7's url field and press enter, nothing happens. If I press enter on the url field again, it goes. The same odd behavior holds true if I start from, say, the contact page and manually put in a url to the media page:
Code:
http://www.jammusic.com.au/goodvibrationsfestival/inside2.html?page=media

I have to enter twice to get to the media page. Not sure what this means exactly, but it may provide a clue.

> Yes, I had exactly the same thing happen to me. I did go back in and remove the drawmenus command from the loadPage() function and yup, it seemed to fix it. Checkout http://www.jammusic.com.au/goodvibratio ... page=media

However, I've got a new problem with this now - on the mac (IE/safari/Mozilla) at least, I get spinning loading icons, ie.when I load a page, it never seems to stop loading. Hmmmm.

Also, if I scroll down in the content div, and then load in a new page, it stays scrolled down – guess I have to fix this using move() or some such - boo.


I see where you've defined the hidden iframe, and how you change it's src in the loadPage() function.
Code:
container.src = page+".html";

loads the specified html file into the iframe. But I don't see where you move the contents of the 'content' iframe into the div that you mentioned (clever workaround btw). Perhaps I haven't dug into your code sufficiently. From what I see, after loadPage() loads the iframe, it calls drawMenus(), then returns. So where is the div that you mentioned updated? You haven't modified drawMenus() to load the contents into the div have you? If not, I have to wonder why you are redrawing the menus each time you call loadPage()... shouldn' be necessary.

> The page that gets loaded in does an onLoad & calls the other function defined in inside.html, transferUp(), with the contents of its iframe

Anyway, I'll have to dig around some more I guess. In the meantime, I suggest:

(1) Verify that loadPage() is firing when you click one of the suspect items but the page doesn't change.

(2) If you are using an unmodified drawMenus() from the Milonic code, then remove the call to drawMenus() from your loadPage() function.

(3) Your iframe has a background color of #fff. Did you want that to be #ffffff?

(4) Instead of using the clickfunction property to call loadPage(), try it from the url property, like this:
Code:
aI("text=;url=javascript:loadPage('media');image=images/nav_media.gif;overimage=images/nav_media-over.gif;");

Do you get the same problem, or does it work correctly now? That would at least help test whether the problem is related to the clickfunction property or if it exists downstream from that.

Hope that helps some,

Kevin


Mate, you've been a godsend – keep up the great work! & if you've any ideas how to solve the two new problems I've discovered, (endless loading & resetting a div that's been scrolled down, let us know!

Cheers,

TIM


Poster: kevin3442
Dated: Monday December 15 2003 - 23:29:49 GMT

Hi Tim,

I've been away from the forums for awhile... just got back to 'em today, so I just now had a chance to look. I don't see any menu at all right now on

http://www.jammusic.com.au/goodvibrationsfestival/inside2a.html?page=media

(using ie6 or ns7 in win2k). Anyway, I'm afraid I can't help with tha Mac problem... don't do Macs and don't have any to test with. Regarding the scrolled div, it sounds from your description and how your system is set up that it's doing what one might expect, since you're not really loading a new page but rather replacing the div's existing content with different content. Shouldn't be too hard to overcome though (I imagine you've already done it). I'll be glad to have a look if I can see the menu.

Cheers,

Kevin