Using Milonic and Prototype

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

Using Milonic and Prototype

Post by Shap5202 »

I know this has been dealt with in the past on the forum, but nothing really seem to resolve my problem.

I'm using the latest version (5.766) and have tried this on prototype 1.4.0, and whatever their latest dev version is that is available right now.

Unfortunately there is not a public website I can post this on but essentially what I'm trying to do is have some dummy content page, with a div that gets refreshed with content via an Ajax request made through Prototype. There's a parameter you can pass (evalScripts) to the Ajax requset that tells it to evaluate the javascript on the incoming content. This works fine until it tries to deal with Milonic code. I stripped down the incoming HTML to contain nothing but 1 menu with a single item in it and as soon as you call drawMenus() it all goes to heck in a hand-basket.

Firebox reports the error(s) as "$N is not defined" in milonic_src.js. I had thought perhaps it's just a function conflict as was discussed in the past with $F but I can find no reference to $F in any Prototype code. If i take out the drawMenus() call, everything works as I want it to.

I'm running out of things to try here and am now seeing if anyone else has had this problem or similar with a solution. Thanks
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

follow-up to above.

Post by Shap5202 »

Ok... I think I figured out what is causing some of the problem, how to solve it is another issue, perhaps if Ruth or anyone else from Milonic is around...

You'll excuse me if this violates the terms of milonic's use, but since the problem was occuring in the drawMenus() method, I went into the source and just separated the lines out so I could use Firebug to debug where it died. The line in question that kills the page is

"_d.write(_mt);" in mmenudom.js I think the problem is because the data being rendered is coming in from the ajax call, and it's trying to do a docment.write() but there's a permissions issue or something since the page had already been written?

Any thoughts there
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I think this is one issue where you're going to have to contact Milonic directly, if you're a pro license user then you could use the support section. I will post and see if I get a response, but I have no knowledge of the internals of the program. It's just a bunch of symbols and strange word combinations and abbreviations [I know they're js language, but still they look weird] :lol:

I will post to them, but you might try using the support ticket system which is for the professional license holders.

Sorry I can't help on this.

Ruth
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

Post by Shap5202 »

Well... I think the problem is that document.write() cannot be called after the page has finished rendering. So of course when that is done via an AJAX call it's not happy. I was able to get around the problem by overriding the document.write() method after the initial page load. By making it take whatever text was to be written, be put in a span that gets appended to the end of the body.

This works fine for popup menus or submenus, but anything that had position context (inside a td or something) just appears at the bottom of the page. And, it is feasible for use to convert all our menus to a popup menu, and frankly, even if Milonic made some change, the way the Prototype call works, don't see how it would be possible to get the results you would normally achieve. (it strips out all the script tags and executes them in order after the page has been displayed)

Ruth, to your post, we do have a Worldwide license.
Post Reply