none
sitemap Url javascript:window.open a new window leaves "[object]" on the parent form

    Question

  • I'm using SiteMap to popup an new window outside of CRM. The new window pops up fine, but it's leaving behind [object] on the parent form. Is there a way to remove it?

    I've tried using <SubArea Id="ICU_SubArea" Url="javascript:window.open('http://www.msn.com', '')">, but I'm still seeing the [object]. Is there any special tricks to this? Thanks in advance.

            <Group Id="Extensions" ResourceId="Group_Extensions">
              <Titles>
                <Title LCID="1033" Title="Links" />
              </Titles>
              <!--<SubArea Id="icu_ticket" Entity="icu_ticket" />-->
              <SubArea Id="ICU_SubArea" Url="javascript:window.open('http://www.msn.com')">
                <Titles>
                  <Title LCID="1033" Title="MSN" />
                </Titles>
              </SubArea>
            </Group>

    Friday, December 10, 2010 4:53 AM

Answers

  • CRM has a special way of loading the contents of its frames, in such a way that the frame isn't actually having its location changed, so much as the results of an asynchronous HTTP call to the URL are being loaded into the frame by way of AJAX.  Check it out for yourself by using the IE Developer tools to locate the <frame> element with the ID "stage".  Navigate around CRM, and watch that the src attribute of the frame does not change, yet its contents do.

    The reason for this, is that it's the only way to get the "Loading" functionality.  When you stick "void(0)" at the end of your script, you're effectively nullifying the return of the AJAX call to the URL you've provided (which seems to be implemented as either Msxml2.FreeThreadedDOMDocument or Msxml2.DOMDocument ).  When you click on a SubArea, the method loadSubArea is called, which basically inserts the "Loading" HTML into the frame.

    At any rate, the behavior you're experiencing is basically the way CRM is designed.  Because there's no content returned by your URL to place into the "main stage", the space remains populated with the perpetual "Loading" graphic.  I surmise that it will be nearly impossible to simply leave the original content unmolested, because you'd basically have to rewrite CRM's UI scripts to handle URL loads differently.

    Suffice it to say that the URL element of a SubArea is not designed to support javascript.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Thursday, December 30, 2010 6:46 PM
    Moderator

All replies

  • I've tried this

    <SubArea Id="ICU_SubArea" Url="javascript:void window.open('http://www.msn.com', '')">

    [object] goes away but the page says loading with the busy green circle icon.

    Any ideas from anyone? Thanks.

    Friday, December 10, 2010 4:31 PM
  • I also tried the change below and it's still outpuing Loading... text with the busy green circle icon on the center of the parent page.

    <SubArea Id="ICU_SubArea" Url="javascript:window.open('http://www.msn.com');void(0);">

    Wednesday, December 15, 2010 8:29 PM
  • Moving this to the CRM Development forum and bumping to get some exposure

    Regards, Donna

    Thursday, December 30, 2010 5:03 PM
    Owner
  • CRM has a special way of loading the contents of its frames, in such a way that the frame isn't actually having its location changed, so much as the results of an asynchronous HTTP call to the URL are being loaded into the frame by way of AJAX.  Check it out for yourself by using the IE Developer tools to locate the <frame> element with the ID "stage".  Navigate around CRM, and watch that the src attribute of the frame does not change, yet its contents do.

    The reason for this, is that it's the only way to get the "Loading" functionality.  When you stick "void(0)" at the end of your script, you're effectively nullifying the return of the AJAX call to the URL you've provided (which seems to be implemented as either Msxml2.FreeThreadedDOMDocument or Msxml2.DOMDocument ).  When you click on a SubArea, the method loadSubArea is called, which basically inserts the "Loading" HTML into the frame.

    At any rate, the behavior you're experiencing is basically the way CRM is designed.  Because there's no content returned by your URL to place into the "main stage", the space remains populated with the perpetual "Loading" graphic.  I surmise that it will be nearly impossible to simply leave the original content unmolested, because you'd basically have to rewrite CRM's UI scripts to handle URL loads differently.

    Suffice it to say that the URL element of a SubArea is not designed to support javascript.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    Thursday, December 30, 2010 6:46 PM
    Moderator
  • I tried this in sitemapnode. Hope it will help for you as well url="javascript:var w=window.open('http://url.com','Title');"
    shawinder pal singh
    Thursday, August 18, 2011 4:06 PM