Help - Search - Members - Calendar
Full Version: Expected ')'
xFX JumpStart Public Forums > DHTML Menu Builder > Generic Problems > JavaScript Errors
gbrandwood
Xavier

Since upgrading from 3.5 (latest release) to 3.6 RC-3, I'm getting a javascript error as shown on the attached picture.

I get the error regardless of whether I view the menu on my final page or when compiled internally within DMB (using Internet Explorer 5.5).

Having said that - the menus continue to work perfectly, inspite of the initial error.  In fact, when I look at the menus, the error icon shown in the bottom left of IE disappears :0

Any ideas?

Many thanks

G
xfx
hmmm... If the menus continue working after you dismiss the javascript error, perhaps the error is either caused by the loader code or some other javascript code on your page.

Do you get this error if your preview your project?

Post a ZIP file containing your index.html file and the .js file(s) generated by DMB and I"ll debug the error for you.
gbrandwood
Hi Xavier

The error appears when I preview the menus from within DMB.  I've not made it live because I don't have a test environment available at the moment, it's 'live' or 'not'.

I have attached the index.html file produced, as well as the DMB file itself.

One thing I have noticed is that since the move to relative menus (in more recent versions of DMB), all my links changed to file paths.  E.g., where there once used to be a link to:

/directorates/deptimt

This was changed to:

W:\intranet\directorates\deptimt

After I got the error, I went through and changed all the links back, but this didn't seem to help.  I get the error either way.

My way for forming links, before DMB went relative, provided me with relative links anyway.  I don't want to have to abandon that altogether.

Thanks for your help.

Regards

G
xfx
All your links appear to have been typed manually.

You will need to re-select your links using the browse button.
This let DMB properly format the links so they work with the new engine.
gbrandwood
I can use the browse button for most links - but for virtual directory links, I'll have to enter a false local path.

Do you have to type in the full local path?  I'm sure I never used to and still had relative links.

Regards

G
xfx
I think I've finally fixed this issue.

Please re-download 3.6, compile/preview your project and let me know how it goes.
gpin75
I am having the exact same problem... and I have done the exact same thing as gbrandwood in regards to manual entering all the relative url's, and manually correcting all the relative links. (My setup does not allow the browse feature to work.).

Here is the only difference: I getting the same error with the DMB 3.5 engine 1.3.003 so I upgraded to DMB 3.6 1.5.000 as of 15 minutes ago and I am having still getting the JS error: expected ')'

I'm running two menu's that are styled the same in every way but of course each menu has different command and group names. The only other difference is one of the menu's has one onMouseOver image (right side) of a group.  I've removed the image and re-compiled but still no change.  Any ideas?
xfx
Please post your project so I can test it.
xfx
It's "almost" official.
Version 3.6RC4 completely resolves this problem.

Please download at your earliest convenience and let me know if it really fixes the problem for you.
gpin75
The error has changed.  Instead of of the Expected ')' JS error that occured on page load I'm now getting an Expected ';' error when I click a command within a group. I get the error in my dev site as well as in the built in preview mode.

Why is DMB setup to use the windows backslash (\) for directory paths versus the web standard forward slash (/) for directory paths? (I know it will work but it's really annoying!!!).

FYI... I think I found a bug in 3.6 with the find/replace functionality.  It gives the error below after the string value can't be found.
xfx
gpin,

(I will address your new error later)

Can you please post your project... I would like to take a look at it.
xfx
Sorry... I didn't remember you had posted already.

Ok, I will re-upload 3.6
Give me 5 minutes.
xfx
Please download 3.6 again.
Recompile your project.

If you still get js errors post a ZIP file with the .js files generated by the compilation process.

NOTE #1: I've also fixed the error with the Find/Replace feature.
NOTE #2: It doesn't matter how the links look in the URL/Script text box. DMB will change the slashes to the appropriate ones depending on the type of configuration selected. Just don't worry about it.
xfx
That error has to come from somewhere else.

I create a simple page that loads the .js file for DOM-compliant browsers and it works as expected: no js errors.

Attached is the sample I created.

---------

If you wish post the HTML document that's loading your menus and I'll try to find out what's causing the error.
gpin75
Thanks for the post.  I've download your example files and tried them.  I am still receiving the JS error when I click on a link within the menu - but only on an onClick event.

> In IE 5.0, 5.5 and 6.0 the error is the same.
> In NS 4.7 I get "rHnd is not defined" prompt which kills the menu's from loading all together.
> In NS 6.2 there is no visible error but looking at the Javascript Console there is an error recorded - "invalid flag after regular expression...  line 1".  

These are all being produced from the test files posted above.  I did the testing on two different boxes with the same results. I can send screenshot's if those would help?
gpin75
I decided to go ahead and post the screenshots. I'm hoping they will help.
xfx
When clicking! when clicking!
I never clicked on the commands! sad.gif

Ok... let me try to figure out what's causing the error "when clicking".
xfx
Ok... let's give it another try: take #987 wink.gif

Download DMB 3.6 again and recompile your project.
gpin75
Okay... good job on the JS error, it is no more!  However... now when I click the a link DMB is taking the domain name and appending the local root path to root web of the project AND the onClick path specified in the each command.

So, the url looks something like this after I click a link:

{domain}/%5C{local%5Cpath%5Cto%5Croot%5Cweb}%5C{link%5Centered%5Cinto%5Cthe%5Ccommand's%5Cevent_tab}.shtml

where %5C == \

Obviously not creating a valid link to the correct page...

I think this thread is going to hit 3 pages... I was hoping it would stay on 2. :) Thanks for the help![CODE][/CODE]
rodmanlab
Xavier,

Could you check my code? ... I installed the latest 3.6 RC4 and began having the following javascript error:

Error: Expected ')'
Code: 0

Thanks!
xfx
QUOTE
Xavier,

Could you check my code? ... I installed the latest 3.6 RC4 and began having the following javascript error:

Error: Expected ')'
Code: 0

Thanks!

Please post your .dmb project as well.
rodmanlab
Here it goes:
xfx
gpin75/rodmanlab

Please... one more try.
Go ahead and d/l 3.6 again and let me know how it goes.
rodmanlab
Xavier:

Genious!!! .... menus work ok! ... I'll upload the codes to my site and you can check yourself ... any question or problem I could help I'll be glad.

Thanks again!

Rodrigo
xfx
Thank you very much for letting me know.

Now... let's hope for a similar report from gpin75 wink.gif
gbrandwood
I'd just like to add that since upgrading to the later version of RC3 and now RC4, my problems have gone away.

Thanks

G
gpin75
Getting closer... but not quite there.  When clicked the resulting URL looks much better. DMB is still having some problems handling the relative links.  It is appending the location of the menu's folder, then the manually entered url's within the menu.  So, the links look like this:

{domain}/{path to js menus folder}/{url to linked page}.shtml

If I pull out "{path to js menus folder}/" the URL works!
xfx
hmmm...

I can confirm that this is not what DMB is doing.
What DMB does is that it appends the current root web path to the manually entered folder.

The latest RC4 is not modifying the manually entered paths in any way.
So, when you click on a menu item DMB does the following:

url = _purl(url);

_purl will simply add the relative path to the root web in front of the manually typed URL.
You can "predict" the results by looking at the loader code on your HTML files.
You will find this line in the loader code:

rPath2Root = rjsPath + {something here}

rPath2Root will then contain the path to the .js files plus the necessary path information to move from the .js files location to the root web.
For example, this could be a common rPath2Root declaration:

rPath2Root = rjsPath + "../";

Then the _purl function will simply prefix the manually typed URL with the rPath2Root contents, so the full URL will always be:

fullURL = rPath2Root + manually_typed_url;

Now, if your links are always pointing to the .js files folder it may be because your loader code is invalid or outdated.
Again, verify this line of code on your HTML documents:

rPath2Root = rjsPath + {something here}

And make sure is valid.
If its not, try re-installing the loader code.
gpin75
This is what my loader code is installed as: rPath2Root = rjsPath + "";

I re-loaded the code from DMB and the same problem is happening.  I have posted my files to a friends dev area so you can see what I'm talking about.
http://dev.pcikc.com/about.html

Click any link and you will see the path of the .js files being appended to the link.  Any of the links with the posted menu should be /about/.. but as you can see, they all are /js/menus/about/..            (except / is \).

I thank you for all the help... I really need to have this problem resolved by Thursday - if possilbe.
xfx
Ok... here's the problem: on your project you have setup DMB so the folder where you store the .js files is the same as the root web so DMB thinks that your root web si actually the /menus/ folder... this is why the loader code looks like this:

rPath2Root = rjsPath + "";

relative_path_to_the_root = relative_js_path

Here's your configuration:

Local Path to the root web:
\\mokc2w9ntfsx01\workgrps\IT\WebCAT\aquila_website\menus\

Path to store the JS files:
\\mokc2w9ntfsx01\workgrps\IT\WebCAT\aquila_website\menus\

See? they are the same and that can't be correct.

But wait... there's more. It looks like your web server's directory structure is different from that on your local computer.

On your web server your js files are located in:
/js/menus/

But your configuration does not have any references to this "js" folder.

The directory structure of your local web site MUST be the same as that on the web server.

For example, my local path to the root web  is:
c:\wwwroot\inetpub\

The folder where the JS files are stored is:
c:\wwwroot\inetpub\menu\

And on the web server the path to the js files is:
/menu/

As you can see, its consistent: both the local and the web server have the same path to the .js files.
gpin75
It always come's back to a user error. smile.gif  I made the adjustments to the paths and everything's up an running.  

If it's not to much problem, can you clean out the company specific info on your previous posts?  

Thanks for the quick and tireless help on this!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.