About <mp:AddThisButton ...> control in the layout.Master page.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

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.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/17/2008 8:32:02 AM
Gravatar
Total Posts 59

About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe

     In masterpage layout.Master uses a control <mp:AddThisButton ...>,  And in AddThisButton.cs , the  function "SetupScripts" has below code:

////////////////////////////////////////////////////////////////////////////////////////

private void SetupWidget()
{

......

mouseOverAttribute.Append("return addthis_open(this, '',");

......
this.Attributes.Add("onmouseover", mouseOverAttribute.ToString());

......

}

private void SetupScripts()
{

......

if(useMouseOverWidget)
Page.ClientScript.RegisterStartupScript(
typeof(AddThisButton),
"addthisbuttonsetup", "\n<script type=\"text/javascript\" src=\""
+ protocol + "://s7.addthis.com/js/152/addthis_widget.js"
+ "\" ></script>");

......

}

////////////////////////////////////////////////////////////////////////////////////

we use  "s7.addthis.com/js/152/addthis_widget.js" , it has "addthis_open" javascript function, 

AddThisButton's onmouseover event use this javascript function.

Problem is:

When the page is not load complete, and we mouseover the AddThisButton will lead to javascript error,

because the addthis_open javascript function is not  exist yet.

e.g

When I go to  http://www.mojoportal.com/,  when the page not load complete, I move mouse on the top-right corner where has a AddThisButton ,

IE will error.

This is only a small problem, would you fix it?

 

Thanks!

 

 

 

 

5/17/2008 8:57:52 AM
Gravatar
Total Posts 18439

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi,

Thanks for letting me know. I was not able to produce the symptom, but I put in a try catch in the javscript to prevent the error. I've updated this site with it and its in svn trunk. Please let me know if that solved it.

Thanks,

Joe

5/17/2008 9:48:22 AM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe.

  I close the ie, then open ie, then go-to http://www.mojoportal.com/, if before the page load complete, I move mouse circle  over the    BOOKMARK(AddThisButton)'s place, ie still alert error window.

  So problem still exist, But few people will move mouse over the BOOKMARK just before the page load complete, so it's  not a big problem.

   You can' see the problem, maybe has three reasons:

   1. You network speed is too fast, IE load the page immediately.

   2. Before the page load complete, your mouse moves not just over the bookmark(AddThisButton)'s place .

   3. you disabled the javascript debug in IE->internet option->advance->disable script debug(internet explorer), so the alter error window can't show, but there should still has a warning icon on IE's left-bottom.

  Because visual studio 2008's debug environment loads the page slowly, maybe you can use it  to repeat the problem.

 

  Thanks!

 

 

 

   

 

 

  

5/17/2008 11:31:03 AM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe

  Your method is effective, but not enough.

  you only fix onmouseover, not fix onmouseout, so the problem is still exist.

so, change

//////////////////////////////////////////////////////////////

private void SetupWidget()
{

......

this.Attributes.Add("onmouseout", "addthis_close()");

......

}

to

private void SetupWidget()
{

......

this.Attributes.Add("onmouseout", "try {return addthis_close();}catch(ex){};");

......

}
/////////////////////////////////

Problem disappear.

And I think

/////////////////////////////////////////////

mouseOverAttribute.Append(")}catch(ex){}; ");

change to

mouseOverAttribute.Append("); }catch(ex){}; ");

is better(only more a ';').

////////////////////////////////////////////

Thanks!

 

5/18/2008 7:50:20 AM
Gravatar
Total Posts 18439

Re: About <mp:AddThisButton ...> control in the layout.Master page.

I added the other try catch as you indicated. Does it solve the problem on your machine? I have not updated this site yet so you may still see the symptom here.

Best,

Joe

5/18/2008 11:28:56 AM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe

Yes, It's ok now about AddthisButton.

 

But except AddThisButton problem, http://www.mojoportal.com/  has  another similar problem:

IE show errors:

msAnalytics is undefined:

when view the html source code, below code  msAnalytics is not defined.

/////////////////////////////////

<script language="javascript" type="text/javascript">
msAnalytics.ProfileId = 'C62F';
msAnalytics.CookieDomain = 'mojoportal.com';
msAnalytics.EnableLinkTracking();
msAnalytics.TrackPage();
</script>

////////////////////////////////

 

You can see this problem by yourself with ie when uncheck the checkbox in  tool->internet option->advanced-> disable script debug(internet explorer)  and uncheck the checkbox disable script debug(other).

Then goto www.mojoportal.com, when load complete, the error occurs (need not move mouse as AddThisButton).

Thanks!

 

 

5/18/2008 11:43:39 AM
Gravatar
Total Posts 18439

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi,

I uncheck both those items but still no error occurs for me.

Best,

Joe

5/18/2008 12:00:39 PM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe.

  Maybe you use IE7, But I use Ie6. Maybe Ie6 has bug, can't find a defined msAnalytics in below code.

///////////////////////////////////////////////////

<script type="text/javascript">
var mgJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + mgJsHost + "analytics.live.com/Analytics/msAnalytics.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script language="javascript" type="text/javascript">
msAnalytics.ProfileId = 'C62F';
msAnalytics.CookieDomain = 'mojoportal.com';
msAnalytics.EnableLinkTracking();
msAnalytics.TrackPage();
</script>

//////////////////////////////////////////////////

It's only a tiny problem.

Thanks!

5/18/2008 12:04:45 PM
Gravatar
Total Posts 18439

Re: About <mp:AddThisButton ...> control in the layout.Master page.

When I get a chance I'll boot up a VM I have with IE 6 and take a look. IE 6 is really a pain from a css point of view. I really wish everyone would upgrade, but I know some companies can't because they have apps that don't work right in IE7.

Best,

Joe

5/18/2008 8:23:14 PM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe

   You need not  use VM to get the error, you can use firefox get the error too, method is :

    Open Otion->error console (crtl+shift+j), then go to http://www.mojoportal.com/, then it will show the below errors and warnings:

///////////////////////////////////////////////////////////////////////

   error:

   error: msAnalytics is not defined  source:http://www.mojoportal.com/  line:290

   error: addthis_close is not defined source:http://www.mojoportal.com/ForumThreadView.aspx?thread=1546&mid=34&pageid=5&ItemID=2  line:1

---------------------------------------------------

   warning:

   warning: 分析属性 'filter' 值时出错。 声明被丢弃。 源文件:http://www.mojoportal.com/Data/Sites/1/skins/mojosite-brightside/ibox.css 行:13

   warning: 分析属性 'filter' 值时出错。 声明被丢弃。 源文件:http://www.mojoportal.com/ClientScript/FCKeditor26/editor/skins/default/fck_editor.css line:154

warning: 分析属性 'filter' 值时出错。 声明被丢弃。 源文件:http://www.mojoportal.com/ClientScript/FCKeditor26/editor/skins/default/fck_editor.css
行:160

 .......

 and many  similar warnings

/////////////////////////////////////////////////////

I don't like ie7, it is so ugly, and has no menu bar,  i usually use firefox, above information is  provided by Mozilla Firefox 3 Beta 5's Option->error console(ctrl+shift+j), Other Firefox shoud be the same.

IE has a featureis it tolerates and hides many errors in html code.

 

Thanks!

 

5/19/2008 9:01:07 PM
Gravatar
Total Posts 59

Re: About <mp:AddThisButton ...> control in the layout.Master page.

Hi, Joe

    Today, when I go to http://www.mojoportal.com/, almost all errors are not exist yet, it's so good.

    But still a little javascript bug, but it is in  msAnalytics.js,

Under the html code, has this script:

///////////////////////////////////////////////////////////////////

<script language="javascript" type="text/javascript">
msAnalytics.ProfileId = 'C62F';
msAnalytics.CookieDomain = 'mojoportal.com';
msAnalytics.EnableLinkTracking(); // I did't know the function of this, but this code will lead a small bug in msAnalytics.js .
msAnalytics.TrackPage();
</script>

//////////////////////////////////////////////////////////////////
 

In msAnalytics.js, there are below code:

//////////////////////////////////////////////////////////////

;MicrosoftAnalytics.prototype.OnTrackLink=function(evt)
{

..............
  var loggingObject=srcElement.LoggingObject;var urlPath=srcElement.pathname;var dotIndex=urlPath.lastIndexOf(".");var foundMatch=false;

}

//////////////////////////////////////////////////////////////

Because all the AspNet-Menu elements like Home, Blog,Download,Online Demos, Documentation,........ all has no pathname attrubute,

So when click these element the ie will show "undifined urlPath" error.

But this is no effect, because almost most user will not see this error.

 

Thanks!

 

 

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