Javascrit error 'Access Denied'

Last post 11-07-2013, 2:56 AM by Adam. 9 replies.
Sort Posts: Previous Next
  •  01-18-2005, 1:59 AM 3535

    Javascrit error 'Access Denied'

    I am trying to integrate the editor into an existing application, however I can't get around an 'Access Denied' javascript error message on line 50 of CuteEditor.htc.aspx.
     
    On the page where the CuteEditor control is placed, i have set the domain to an alternate domain within javascript like so:

        document.domain = "mydomain.com";

    This is required, because the page I'm developing is called within an IFRAME on another web server and the page within the iframe needs to be able to communicate with the parent page.

    The question is, how can i set the document.domain property for the CuteEditor application to work in this environment?  - I have already tried setting the document.domain property within the javascript on CuteEditor.htc.aspx but this causes IE to crash on every browser I've tested with.

    Does anyone else have a solution to this?
     
    /Simon
  •  01-18-2005, 2:28 AM 3536 in reply to 3535

    Re: Javascrit error 'Access Denied'

    document.domain dosn't work in this case!

    That's because you're using two different domains.

    In order for document.domain to apply, both servers must be on the same domain.

    Please check the MSDN article:

    About Cross-Frame Scripting and Security 

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-18-2005, 4:02 PM 3553 in reply to 3536

    Re: Javascrit error 'Access Denied'

    I understand that I'm using two different domains.  But both domains share the same base domain name 'mycompany.com'.  Setting the document.domain property allows the parent and child frames to talk - this works okay now.
     
    The problem is that with the introduction of the CuteEditor control onto the child page (within the iframe), I now receive the Permission Denied error message.  If I remove the document.domain property from the page in the parent frame, the error message goes away (but this breaks other functionality of the page).
     
    My question remains:  Is there a way to set the document.domain property for the javascript that is created by the CuteEditor control?
     
    - I believe that the CuteEditor control must create it's own frame or iframe where it writes much of the client side javascript to the browser.  However because the document.domain property isn't set to the same value as my other frames, then it causes the error.
     
    I hope that this is more clear.  Any help would be much appreciated.
     
    /Simon
  •  01-20-2005, 10:15 AM 3592 in reply to 3553

    Re: Javascrit error 'Access Denied'

    Simon :
     
        Could you provide more details ?
     
        Do you visit the http://aaa.bbb.com/editor.aspx , and then the template is http://aaa.bbb.com/template.aspx
     
        And in the editor.aspx , you do :
     
        document.domain="bbb.com" ? 
        or 
        document.domain="child.aaa.bbb.com" ?
        or
        document.domain="other.com" ?
     
     Regards , Terry .
  •  01-20-2005, 4:55 PM 3606 in reply to 3592

    Re: Javascrit error 'Access Denied'

    Hi Terry,
     
    First of all, I'm running all of this on a secured Intranet so I can't post you any URL's unfortunately.

    In our organisatoin, we deploy all our web applications as portlets within a portal server.  The simplest way to deploy our ASP.Net apps in the portal server is to wrap them up inside iframes.

    In this example, I have my ASP.Net application with the CuteEditor control on a page like this:

    http://scripts.mydomain.org/myproject/mypage.aspx

    The ASP.Net application including the CuteEditor control is framed within an iframe by our portal server on a page with a URL something like this:

    http://portal.mydomain.org/dir/dir/dir/somepage.jsp

    The parent frame and the iframe are able to talk with each other through the browser, because in both the parent (portal) page and the iframe (ASP.Net) page I've added the following line of JavaScript code on each page.

    document.domain = "mydomain.org";

    This basically allows for our pages within the ASP.Net Application to resize the iframe window so you don't see any scroll bars etc.  In fact you can't even tell it's running as an iframe, it just looks like it's part of the Portal server.  This is working fine, however when I load the page with the CuteEditor Control into the iframe, i get an 'Access Denied' message.  This is probably because the control creates it's own frame for serving JavaScript to the browser, but in that frame it will be running as 'scripts.mydomain.org', so the browser won't allow it to execute.

    I believe that I could fix this, if i can force the CuteEditor control to use the same document.domain, 'mydomain.org'.

    As a work around, it may be possible to simply remove the document.domain property from the ASP.Net page which has the CuteEditor Control, and remove the functionality which is resizing the Portal Frame when the ASP.Net page loads.  This should work, but it's not ideal.  However, if your interested at all, i have posted another issue where the browser crashes when i do this: http://cutesoft.net/forums/ShowPost.aspx?PostID=3586

    Thanks for your help on this! - Everyone I have shown the CuteEditor control to has been very impressed with it, in particular the spellchecking and ease of which you can create tables.  So I really hope I can manage to sort this out and implement the first of many CuteEditor controls within our organisatoin.

    Regards,

    /Simon
     
  •  01-21-2005, 12:48 PM 3635 in reply to 3606

    Re: Javascrit error 'Access Denied'

    Simon

    I know your meaning now .
     
    Could you try this ?
     
    Open the CuteSoft_Client/CuteEditor/Template.aspx
     
    and add this code into the <head/> element ?


    Hope this helps.

    Regards , Terry .

  •  02-01-2005, 1:59 AM 3830 in reply to 3606

    Re: Javascrit error 'Access Denied'

    Hi Simon,
    Apologies for this non-related query -- I was just looking for an answer to my problem and happened to see your post..
    I have a similar situation ..as in, I have a parent page containing an IFRAME. Both the parent and child(within the IFRAME) share the same base domain - 'mycompany.com'
    I want to resize the IFRAME to the height of the content within. Icouldn't find a site/forum where they discuss this situation..You mentioned that you were able to communicate between pages using **document.domain = "mydomain.org"; **
    Can you please let me know how you do it?
     
    Thanks in advance,
    mvsinha
  •  06-15-2011, 6:27 PM 67980 in reply to 3635

    Re: Javascrit error 'Access Denied'

    I tried your suggestion regarding "domain relaxing" but it just does not work. I still getting "Access Denied" javascript. Is there any workaround? I just cannot make CuteEditor work in the page that requires cross-domain scripting (domain relaxing).
  •  08-13-2013, 10:31 AM 77846 in reply to 67980

    Re: Javascrit error 'Access Denied'

    I have the same issue and really need a solution.

     

    As described I have an IFRAME with runs on one sub-domain, e.g. "a.domain.com". From a parent page on domain "b.domain.com" I load a cuteeditor enabled page but the HTML editor is in DISPLAY mode only.

     

    I get a javascript error:     Access is denied

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Tue, 13 Aug 2013 10:29:51 UTC


    Message: Access is denied.

     

    Line: 3
    Char: 18118
    Code: 0
    URI: https://a.domain.com/EX_SQLSVC/CuteSoft_Client/CuteEditor/Load.ashx?type=scripts&file=IE_Loader

     

     

     

    Should I  try to add "document.domain=..." in the ashx file?
  •  11-07-2013, 2:56 AM 78317 in reply to 77846

    Re: Javascrit error 'Access Denied'

    mortenm:

    I have the same issue and really need a solution.

     

    As described I have an IFRAME with runs on one sub-domain, e.g. "a.domain.com". From a parent page on domain "b.domain.com" I load a cuteeditor enabled page but the HTML editor is in DISPLAY mode only.

     

    I get a javascript error:     Access is denied

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Tue, 13 Aug 2013 10:29:51 UTC


    Message: Access is denied.

     

    Line: 3
    Char: 18118
    Code: 0
    URI: https://a.domain.com/EX_SQLSVC/CuteSoft_Client/CuteEditor/Load.ashx?type=scripts&file=IE_Loader

     

     

     

    Should I  try to add "document.domain=..." in the ashx file?

     

    I suggest you upgrade to version 6.7 first then try terry suggetion. 


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML