Solved

Javascript Permission Denied Error in IE

Posted on 2008-06-09
8
4,307 Views
Last Modified: 2010-04-21
I am embedding this code:

http://www.livemediamarketing.com/local/stock/

onto a page and the script works fine in FF but I'm getting a Permission Denied error in IE. (Line 105, Char 3)

This is a stock ticker script that parses the csv stock feed from yahoo. The data is successfully being pulled in to this page:

http://www.livemediamarketing.com/local/stock/ajax-sqt.php

Any suggestions on this IE issue?

Thanks.
0
Comment
Question by:corywatilo
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:tomaugerdotcom
Comment Utility
If you're testing this locally, you may get permission denied issues because of the scripting hasards. This is a setting you can override in IE settings. But you should try testing this on the webserver - sometimes these issues only show up when you're testing locally.

The other time I've encountered this was with some Symantec enterprise anti-virus. It actually over-wrote certain bits of JS code on-the-fly. Check to see whether you're running a Symantec anti-virus - if so, that could be the cause of your issues. Other users that do not have this installed will not be experiencing the problem.

Otherwise, check out your security settings. If you work for an Enterprise, perhaps your corporate security policy is set unusually high. Check with your IT admin on this issue.
0
 

Author Comment

by:corywatilo
Comment Utility
Thanks for the tips. However, I am trying to pull from a web server, not locally. I have also tried from computers with anti-virus protection, and I also tried pulling down all security and privacy levels to no avail.

Any other ideas? I would hope it's something relating to the script that can be tweaked rather than something that would have to be modified on every single computer. Thanks!
0
 
LVL 14

Expert Comment

by:tomaugerdotcom
Comment Utility
Yeah, I hear you.

I also got access denied errors when trying to change window size on certain types of windows. So, maybe you could help by specifiying what it is that your script is doing specifically at the time the error is thrown.
0
 

Author Comment

by:corywatilo
Comment Utility
Happens onload.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 14

Expert Comment

by:tomaugerdotcom
Comment Utility
Okay, what are you doing onload?
0
 

Author Comment

by:corywatilo
Comment Utility
I just realized that my original post is a bit confusing. I mentioned I am trying to embed that page and it's not working - it doesn't even work in IE standalone as it is.
0
 
LVL 14

Accepted Solution

by:
tomaugerdotcom earned 100 total points
Comment Utility
Looking at your code again, I'm thinking that it's definitely something in this script:
http://www.livemediamarketing.com/local/stock/ajax-sqt.js
that is causing the problem. Something invoked by doUpdate() probably.

I have the feeling we're getting into a cross-domain data load issue. In a nutshell, you might be breaking a security sandbox setting if you're using Ajax to grab data from another service or server than the one your page is on.

Take a a look at these links to see if they put you on the right track:
http://blog.strainu.ro/programming/html/permission-denied-to-call-method-xmlhttprequestopen/

From:
http://developer.mozilla.org/en/docs/AJAX:Getting_Started

httpRequest.open('GET', 'http://www.example.org/some.file', true);
httpRequest.send(null);

The first parameter of the call to open() is the HTTP request method  GET, POST, HEAD or any other method you want to use and that is supported by your server. Keep the method capitalized as per the HTTP standard; otherwise some browsers (like Firefox) might not process the request. For more information on the possible HTTP request methods you can check the W3C specs

The second parameter is the URL of the page you're requesting. *********As a security feature, you cannot call pages on 3rd-party domains. Be sure to use the exact domain name on all of your pages or you will get a 'permission denied' error when you call open(). A common pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld.

The third parameter sets whether the request is asynchronous. If TRUE, the execution of the JavaScript function will continue while the response of the server has not yet arrived. This is the A in AJAX.

----

So it looks like you have to explore cross-domain solutions. There are two notable approaches, which

1. use a proxy. Instead of calling the remote source directly, call a PHP script on your domain that gets the information from the remote domain
2. using JSON, put the remote url into the src attribute of a <script> tag.



You can learn more about these approaches here:
http://www.simple-talk.com/dotnet/asp.net/calling-cross-domain-web-services-in-ajax/
-----

Looking at your code though, I'm struggling to find where you are running into these cross-domain issues. The most obvious thing that jumps out at me is that
www.mysite.com
is seen as a different domain from
mysite.com

If you are using the non-www shortcut, I suggest switching it to www.

Hope this puts you on the right track. Without more debugging on your part I don't think I can offer much more advice
0
 

Author Closing Comment

by:corywatilo
Comment Utility
Your last comment nailed it. Everything was absolute linked. I simply removed the absolute linking to make it relative and it worked. Who woulda thought? Thanks so much!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now