Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript Permission Denied Error in IE

Posted on 2008-06-09
8
Medium Priority
?
4,342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:tomaugerdotcom
ID: 21747298
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
ID: 21747590
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
ID: 21747654
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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

Author Comment

by:corywatilo
ID: 21747681
Happens onload.
0
 
LVL 14

Expert Comment

by:tomaugerdotcom
ID: 21747886
Okay, what are you doing onload?
0
 

Author Comment

by:corywatilo
ID: 21748318
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 400 total points
ID: 21751226
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
ID: 31465466
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…

721 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