0

I've got a page I'm adding as a Web Resource in a dynamics CRM form. I've developed the code outside the iframe and it works standalone in IE (9+) and Firefox navigating directly to the resource URL. (edited)

Coming back to testing the code embedded in CRM after a days standalone development and now; none of the scripts run when loaded as part of the CRM form. I've tested this by adding small alert scripts at every stage of the javascript load (as follows), now these work in all browsers as far back as IE5, but not when loaded within an IFrame on the CRM form:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>        
       <script type="text/javascript">
           alert("1");
       </script>
       <!-- etc.. -->

I've also tried creating a local page to load my page in an iframe which also works as expected:

<!DOCTYPE html>
<html>
    <head>
        <title>Iframe test</title>
    </head>
    <body style="background: Red;">
        <h1>Hello, World!</h1>
        <iframe width="500" height="500" src="http://server:5555/...">
        </iframe>
    </body>
</html>

as this issue only occurs in an IFrame I've run out of ideas for how to debug it. My best guess would be the issue is a conflict with code in the parent page but even then I'd expect my alert at the entry point of the html file would run.

I'm not sure at what point yesterday the code stopped working and don't have a backup unfortunately. I'd appreciate any speculation on why scripts would be abandoned within an IFrame, tips on any extra debugging steps I could try... or a solution =p.

3
  • FYI, forgot to mention that the page content does still load, though most of it is written dynamically with JS.. or should be! Commented Apr 30, 2013 at 11:04
  • Try to disable cross site scripting filter, follow this guide https://jobs.missouri.edu/howtos/DisableIE8XSS.pdf Commented Apr 30, 2013 at 11:12
  • @GuidoPreite Unfortunately dissabling xss didn't resolve the issue Commented Apr 30, 2013 at 11:32

2 Answers 2

1

Turned off "Restrict Cross-frame scripting" in the properties for the web-resource on the form which solved the issue.

Thanks for all the help though!

Sign up to request clarification or add additional context in comments.

Comments

0

Have you tried adding it as a web resource rather than an iframe? There could be some xss security kicking in. Web Resource should get over that. The Web Resource also has other advantages (dependency aware etc).

2 Comments

ahh, it's already a webresource, it's not hosted separately in IIS, sorry I'll edit to include this.. bit of a brain fart.
turning off xss entirely didn't resolve the issue either. But also I can access the page in Firefox which doesn't have this feature (RU13) and I encounter the same issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.