Why can I not use XMLHttpRequest to access a local resource from a local resource ?

Why can I not use XMLHttpRequest to access a local resource from a local 
resource ?

Source URL :

> file:///F:/Hellenic-Institute/Research/Etheridge/Electronic-Edition/Index.html

Error diagnostic :

> Timestamp: 25/03/2014 12:01:55
> Error: NS_ERROR_DOM_BAD_URI: Access to restricted URI denied
> Source File: file:///F:/Hellenic-Institute/Research/Etheridge/Electronic-Edition/Index.html
> Line: 264

Relevant code fragment :

> 	function LoadApparatusCriticus ()
> 		{
> 			var XHR = new XMLHttpRequest ()
> 			var URL = "../Resources/Production/Texts/Glosses/ApparatusCriticus.html"
> 			XHR.open ("GET", URL, false)
> 				{
> 					XHR.send(null)
> 				}	
> 		 . . .
> 		}

Philip Taylor
0
Philip
3/25/2014 12:06:56 PM
mozilla.support.seamonkey 13721 articles. 0 followers. Post Follow

2 Replies
1466 Views

Similar Articles

[PageSpeed] 16

Philip Taylor wrote:
> Access to restricted URI denied

You can access the current server directory or below, you can't go up 
(../resource)

For local testing set security.fileuri.strict_origin_policy to "false". 
  It's recommended to set that back to "true" in production.

Lemuel Johnson
0
Lemuel
3/25/2014 5:50:33 PM

Lemuel Johnson wrote:

> You can access the current server directory or below, you can't go up
> (../resource)

Thank you, Lemuel.  Already tried that (before asking), and
trying to access "resources ..." rather than "../resources ..."
leads to exactly the same error.

> For local testing set security.fileuri.strict_origin_policy to "false".
>   It's recommended to set that back to "true" in production.

That, however, enables it to work.  Thank you !
Philip Taylor
0
Philip
3/25/2014 5:59:25 PM
Reply:

Similar Artilces:

How to use image resource in a local resource file?
Hello everyone! As the question says: The .resx files has the ability to store an image, icon, audio or any kind of files. Let's say I wanted to put a banner picture to my web page. To do this; 1) I add Default.aspx page to my web project. And put <asp:Image> control inside. So the page's code would look like this;1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" culture="auto" uiculture="auto" %> 2 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 T...

Localization and generate local resource
hi all, i am developing a localized site and i used the new implemented feature in asp.net 2 ( Generate local resource ), nice   but the problem is that feature produces a resource file per each page or usercontrol in my application   but is i want to implement it as Dotnetnuke allowing the admin to manage locals,   how to make it in a single resource file making use of that feature. thanks,Ahmed El NobySenior Web DeveloperMCP,MCTS thanks ,   i found my solution and i used App_Globalresources the solution was in this link http://forums.asp.net/911614/S...

I can't use a Local Resource value
Hello,I have a page class and inside it I have a ITemplate class to create the item template of a repeater:Partial Class Contacts  Inherits System.Web.UI.Page   Private Class myTemplate    Implements ITemplate    ...    Private Sub()         MyLabel.Text = Me.GetLocalResourceObject("MyLabel.Text").ToString()             *****    End Sub    ...   End Class      End Class My...

How do I access local resources?
I have a form which will have to use some error messages that I'd like to store in app_LocalResources. How do I access that file from code-behind?If everything happens for a reason what is the reason for this error? In code behind, its with the GetLocalResourceObject method of the page (dont forget to cast to string, cuz it returns an object!). If its a static value that will not need to be calculated at runtime though, you can do it in the ASPX...   let say: <asp:literal id="blah" runat="server" text="<%$ Resources:MyRessourceKey %>" />...

Using local resources ?
Hi it must be easy but I can't get this to work.  I put a label and a button on a page and selected 'Generate local resource' from the tools menu. I renamed the default.aspx.resx file to default.aspx.nl-NL.resx. I put this in the aspx page directive: Culture="nl-NL" UICulture="nl-NL" Now when I run the page, the control properties are not filled with the values from the resx file. It only works when the resx file is called default.aspx.resx. Does anyone know what I am doing wrong?!?     With Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.Current...

Generate Local Resource / resources provider
Hi,I am using a custom resource provider, extended to support runtime and designer. The option in VS.NET 2005 under Tools menu, called "Generate Local Resource (btw, why not resources as it is doing all of them?...) is in particular I am interested in at this stage. I need to take over what's the tool is doing. The designer part of the resource provider is fine, my code is running nicely. The only problem is that I can't figure out how to cause VS.NET not to insert the "metainfo" identifier in controls. Is it possible? Another related question, is why the VS.NET 2005 / .NET team(s) came with...

Can I use localization that has nothing to do with locale?
I'm just starting out with asp.net and please forgive me if this is a stupid question.... I need to build an application that is completely modifiable but not because of language settings. Its more of a case of wanting to give my application a new "face" depending on who views it. If its a member of group "A" I want to use different labels, images and stylesheets than if its a member of group "B". The group will be part of the URL they use to access the site. I would imagine that resource files and separate directories for images and stylesheets will be...

How to release local/global resources from the resource cache?
Hello everyone! I have a custom resource provider based on the standard .NET classes and interfaces (IResourceProvider, IResourceReader, ResourceProviderFactory). It gets the resources from the database and stores them in the ASP.NET resource cache. So if I change any resource value in the database, I'll have to wait untill it's old value expires from the cache to see the result on the page. Is there any way to force ASP.NET to clear this cache? Thanks!...

Abend when backing cluster resource and local resource
For a while now, the only abends I have gotten on my NetWare 6.5 SP6 servers (sp7 will be applied in January) is a result of the TSAFS. The pattern I have noticed is if the backup system (Veritas Netbackup Datacenter 6) is backing up a cluster resource and then starts to also back up up the local resource (ie, sys:). I've tried to stager the start times so most of the time they won't overlap, but still have the occasional long running full backup that started later than expected. It doesn't happen all the time, just now and then. Below is the abend log entry. An...

Accessing local computer resources
Is there a way to access local resources such as files and devices connected to the Usb ports from a WebApplication?  I have a Dll which communicates with the contents of a Usb device and though the classes in the Dll are accessible and build, the call to the files in the Usb fails. I have worked previously with Silverlight2 which does not allow any local access (just isolated storage).  Any suggestions would be appreciated.  --John   You can use ActiveX to use DLL. However, you need client to have sufficient trust level to access local system resources.Vaibhav Sat...

How to release local/global resources from the resource cache? #2
Hello everyone! I have a custom resource provider based on the standard .NET classes and interfaces (IResourceProvider, IResourceReader, ResourceProviderFactory). It gets the resources from the database and stores them in the ASP.NET resource cache. So if I change any resource value in the database, I'll have to wait untill it's old value expires from the cache to see the result on the page. Is there any way to force ASP.NET to clear this cache? Thanks! any suggestions?...

Can u help me about language resource using xml resource?
<resource name="text">wellcome {0} to mysite</resource> localization.getString(text, username) 'change {0} to username How can to make it? OK, let's assume you have an XML document in this format: <?xml version="1.0" encoding="utf-8" ?> <resources> <resource name="welcome"> <en-US>Welcome {0} to my site.</en-US> <es-MX>Recepción {0} a mi sitio.</es-MX> </resource> </resources> Here is a class that reads that file:  public class XmlLocalizer { XmlDocument xdoc; public XmlLocalizer(stri...

Local Resource
Hi...I have created a Page( first.aspx ) and created a local resource ( first.aspx.resx ) for that  which resides in App_LocalResources.I have added one more custom.resx file in same App_LocalResources folder.Can anyone guide me on how to access the key value pair from custom.resx file in code behindthanks  If you want a custom resource file that should be shared among several pages, I should recommend that you add it to the App_GlobalResources folder instead. If you do that you can get the resources from a typed class (Resources.<your resoruce file name (class name)>.<y...

Accessing the local resources of a page from another
Is it possible to access the local resources (App_LocalResources) of a page from another? A scenario: The local resource file stores a string of xml data that you'd like to fetch using an AJAX call & HTTP handler (ashx).Neil Craig | Web Developerwww.k2.comGive credit where it is due, mark a post as an answer if it helped you. Hi, ASP.NET divides resources in local and global resources. They can be accessed programmatically using ControlTemple .GetLocalResourceObject() and .GetGlobalResourceObject() methods. Although, when you are using global resources defined in App_GlobalR...

Web resources about - Why can I not use XMLHttpRequest to access a local resource from a local resource ? - mozilla.support.seamonkey

XMLHttpRequest - Wikipedia, the free encyclopedia
Data from the response can be used directly to alter the DOM of the currently active document in the browser window without loading a new web ...

Native XMLHTTPRequest object
Hello, I’m Sunava Dutta and I am a Program Manager in the Internet Explorer team. I’m excited to mention that IE7 will support a scriptable ...

function daten2() { var a; //- if(window.XMLHttpRequest) { a - Pastebin.com
function daten2() { var a; //- if(window.XMLHttpRequest) { a - Pastebin.

CodeSOD: MacGyver's XMLHTTPRequest
In these days of browser standards, it’s easy to forget that once upon a time, simple tasks like an HTTP request from JavaScript were difficult ...

JavaScript - XMLHttpRequest functions
This is the XMLHttpRequest function I always use; see quirksmode.js ,the script file that's used in every page on this site. It is presented ...

Help I am getting an XMLHttpRequest exception of Access-Control-Allow-Orig
When working on a demo application recently I was trying to get an ajax call to hit one of my Web API routes and I was immediately hit with the ...

Joshua Odmark (@JoshuaOdmark) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

YouTube API Blog
Web developers are accustomed to making magical user experiences with a few lines of elegant JavaScript, but when faced with talking to RESTful ...


A Brief History of Ajax (Aaron Swartz's Raw Thought)
New technology quickly becomes so pervasive that it’s sometimes hard to remember what things were like before it. The latest example of this ...

Resources last updated: 12/15/2015 8:40:01 PM