help solving javascript error

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
1/17/2009 1:54:04 PM
Gravatar
Total Posts 5

help solving javascript error

.  .  . Well I was finally able to get mojoportal to run on my local machine. The "build" of a lifetime. ha! ;-)) just kidding.
"mojoportal" is a very, very, nice all-in-one application if might say so. Good work! It seems more logical to me than DNNuke.
I am running into a javascript error, when viewing/moving around between pages in the browser (IE 7), which automatically bounces me back into VWD Express 2008,
Microsoft JScript runtime error: Object expected at line (this # and location varies depending on which page I am on in mojoportal)

<script type="text/javascript">$ ('div.yui-navset').each(function(n){var myTabs = new YAHOO.widget.TabView (this.id);})<

. . . then in the error dialogue box, I click the "continue" button, and VWD Express continues with filling in the remainder of the necessary end tags/javascript, then loads more javascript, and then the mojoportal page refreshes in the browser and seems to function as normal.

Any idea where in mojoportal I can fix that error? The pages that the errors occur on in VWD are "read only", so somehow I need to find where within mojoportal they are dynamically being generated from. I will keep trying on my own, but if someone has any tips that would really be appreciated.

Thank you!  - Mark Graves (oceanmarksea)

1/17/2009 2:10:26 PM
Gravatar
Total Posts 18439

Re: help solving javascript error

There is some jquery automatically added to pages that creates YUI tabs where they need to be based on some css class names. The YUI and jquery scripts are loaded from the google CDN so the only reason I could see getting errors is if your machine is not connected to the internet and it can't load the javascript.

Other than that if you have script debugging enabled in IE it may throw errors at debug asserts that would not happen under normal conditions. If you turn off script debugging in IE and you still get errors then its really an error not just something from debug statements, and again that would seem like its not loading the scripts.

If you don't have internat acess on that machine then you can set UseGoogleCDN=false in Web.config or user.config but then you'll have to get your own copy of YUI and jQuery and put them in the correct locations for local use.

I cannot produce the problem locally or on any of my sites using IE 7

Hope it helps,

Joe

1/17/2009 5:38:04 PM
Gravatar
Total Posts 5

Re: help solving javascript error

 

.  .  . okay. Good! That helps. Thanks for the info. - mark

1/13/2010 8:08:53 AM
Gravatar
Total Posts 98

Re: help solving javascript error

Hi Joe,

 

  I have script debugging disabled but on page have the same errors :

   $('div.yui-navset') is null.

  On firefox i tested

1/13/2010 8:14:31 AM
Gravatar
Total Posts 18439

Re: help solving javascript error

If you are not connected to the internet then you need to host the jquery and YUI files locally.

http://www.mojoportal.com/intranets-and-private-networks.aspx

Hope it helps,

Joe

1/13/2010 9:53:51 AM
Gravatar
Total Posts 98

Re: help solving javascript error

I have connection to internet

I found in ScriptLoader.cs this code :

if (includeYuiTabs)
{
Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
"yui-tabview", "\n<script src=\""
+ scriptBaseUrl + "tabview/tabview-min.js" + "\" type=\"text/javascript\"></script>");

string initTabsScript = "$('div.yui-navset').each(function(n){var myTabs = new YAHOO.widget.TabView(this);})";

Page.ClientScript.RegisterStartupScript(typeof(Page),
"yui-tabinit", "\n<script type=\"text/javascript\" >"
+ initTabsScript + "</script>");
}

     I don't undestand why if i put in instalation folder ->web.config <add key="CombineJavaScript" value="false"/> and

<add key="AlwaysLoadYuiTabs" value="false" /> the error continue appear!!

How can I remove this error .

Seems that because of this error in IE7 the other Js files is not considered

 

Please help to solve this

1/13/2010 9:57:59 AM
Gravatar
Total Posts 98

Re: help solving javascript error

Sorry instead CombineJavaScript i refer to <add key="UseGoogleCDN" value="false"/>

1/13/2010 10:01:15 AM
Gravatar
Total Posts 18439

Re: help solving javascript error

Hi,

YUI tabs are used extensively in mojoPortal at the moment. Even if you set AlwaysLoadYuiTabs=false, it will still load them where they are used in admin and edit pages. It does not mean never load YUI tabs.

Make sure you have not changed this to false:

<add key="UseGoogleCDN" value="true" />

With this as true it will load the YUI scripts from google cdn which is why you must be connected to the internet.

The error seems like it is not loading the YUI scripts or they have an incorrect url. You should view the source of the rendered page to determine where the scripts for YUI are loaded from and whether the url is correct or not. If the script fails to load you will get errors.

You can disable all of YUI like this:

<add key="DisableYUI" value="true" />

but then you will have a very ugly admin UI

Hope it helps,

Joe

1/13/2010 10:04:15 AM
Gravatar
Total Posts 18439

Re: help solving javascript error

If you set UseGoogleCDN = false then you must host the YUI and jquery files locally as I told you about this link:

http://www.mojoportal.com/intranets-and-private-networks.aspx

Hope it helps,

Joe

1/13/2010 10:56:54 AM
Gravatar
Total Posts 98

Re: help solving javascript error

Joe, could you please put these folders and files to svn? (Download YUI, at the time of this writing the latest version is 2.7.0b, so I downloaded yui_2.7.0b.zip and extracted it.)

I don't know from where to get it.

 

Thanks a lot

1/13/2010 11:06:02 AM
Gravatar
Total Posts 18439

Re: help solving javascript error

I recommend use YUI 2.6, get it here http://sourceforge.net/projects/yui/files/

I had troubles with YUI 2.7 and higher.

But remember if you are connected to the internet you do not need to host these files locally, just make this true:

<add key="UseGoogleCDN" value="true" />

only when you set it to false is it required to host the YUI files locally.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.