XMLHttpRequest #18 DOMException (SECURITY_ERR)

I test the same application in a Web Widget and within the Web of BlackBerry browser to the native address, and I get errors of strange security on the Web version.

I use XMLHttpRequests, and my understanding is that those who are allowed so that the script that performs the application is hosted on the same server as the service, that she asks data.

In my case, that I get a DOMException #18 eventhough (SECURITY_ERR), the script and the resource it accesses are in the same domain (subdomain)

Of course, frustrating is that the same code on iPhone and Android (and of course a desktop browser) works perfectly.

Is it possible that this error is actually hide a different problem with the BlackBerry browser? Tested with both the Simulator with 9550 (5.0.0.469) and a real device...

Help!

OK, for the benefit of other developers. The BlackBerry browser does not support the original resource Cross W3C standard sharing :-( (http://www.w3.org/TR/cors/)

But it seems to apply origin cross-the location of the html, not the script file...

I'm serving everything one host through a magic of apache.

oO

Tags: BlackBerry Developers

Similar Questions

  • DOMExceptions: DOM Exception 11 - XMLHttpRequest -.

    Hello

    Some of my users have this error: DOMExceptions: DOM Exception 11 when they try to make an asynchronous request to our webservice.

    Theses users run BOLD 9700 (OS 5.0.0.351).

    function NotificationClient(pId,action) {
        var ajaxRequest;  // The variable that makes Ajax possible!
        var id = 423101774;
        var sem = 301;
        var lang = 1;
    
        if (BBPin == "") // Retrieve pin
            BBPin = espresso.homescreen.pin();
    
        var url = "https://mywebsite.com/BlackberryNotifications/index.html?PIN=" + BBPin + "&Action=" + action + "&ReceivedNotes=" + pId;  
    
        try {
    
            ajaxRequest = new XMLHttpRequest();
        } catch (e) {
    
            try {
                ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {
                    // Something went wrong
                    alert("Your browser broke!");
                    return false;
                }
            }
        }
    
       try {
    
            ajaxRequest.open("GET", url, true); // true = asynchronous        ajaxRequest.send(null);    } catch (ee) {    alert("Error when notifying : " + ee);    }
    
    }
    

    Any idea?

    Why only some users have this problem?

    Thank you very much for your help

    Hello

    Just out of curiosity do you use html_5init.js?

    If so you can try him commenting "XMLHttpRequest = function() {}.

    He can ask questions?

    See you soon

    Andrew

  • Because the update for FF30 always get TypeError: XMLHttpRequest constructor requires 'nine', before no problem. What has changed?

    Since the update this morning to FF30, I get the errormessage of the js

    TypeError: XMLHttpRequest constructor requires 'nine ';

    Code:

    function ajaxManager() {}
    the var request;
    var version = new Array('MSXML2.) XMLHTTP.7.0 ',' MSXML2. XMLHTTP.6.0 ',' MSXML2. XMLHTTP.5.0 ',' MSXML2. XMLHTTP.4.0 ',' MSXML2. XMLHTTP.3.0 ',' MSXML2. XMLHTTP ',' Microsoft.XMLHTTP');
    {if (document.getElementById)}
    If (Window. {XMLHttpRequest())}
    request = new XMLHttpRequest();
    }
    If (Window. ActiveXObject) {}
    for (var I = 0; I < versions.length; i ++) < = "" activexobject (versions [i]); " "=" "catch (exception) =" "p =" "request ="new";" "=" "return =" "try {=" "{=" ' "} =" "(> < / versions.length; i ++) >"}

    I hope someone knows what has changed or what I missed.

    Now found a job by myself:

    "if (window. XMLHttpRequest()) {'}

    changed to

    "if (window. XMLHttpRequest) {'}

    Seems the old way I used now no longer works

  • XMLHttpRequest is undefined

    I write an add-on bootstrap for Thunderbird on Ubuntu 13.10 computer 24.3.0.

    When you try to run the following snippet (taken for Mozilla Developer Network)

        var req = new XMLHttpRequest();
        req.open('GET', 'http://www.mozilla.org/', false);
        req.send(null);
        if(req.status == 200)
            dump(req.responseText);
    

    I get "ReferenceError: XMLHttpRequest is undefined ' error console when you try to create the object.

    This problem is very similar to Firefox:

    https://support.Mozilla.org/en-us/questions/987100

    Hmm, would it be a change in the SDK?

    It might be useful to check on this forum: http://forums.addons.mozilla.org/

  • "TypeError: XMLHttpRequest.Open is not a function" error message

    I have the following javascript code:

    var XmlHttp = new XMLHttpRequest();
    XmlHttp.Open("GET", "http://localhost/MenuOptions.aspx?ca_key=1631&isRollup=1", false);

    In Firefox (version 22) the XMLHTTP.open("get",URL,true) () throws an error "TypeError: XMLHTTP.open("get",URL,true) is not a function".

    It seems to be 'open' with a tiny "o":

    See:

  • What are the causes a refresh of XMLHttpRequest?

    I'm developing a JavaScript program that uses XMLHttpRequest to retrieve an XML of my Apache server. It all works very well, but in my XML file that I do outside, changes appear not in my test page until I exit and restart Firefox. Is there another way to get an XMLHttpRequest to reread the file on the server?

    Changes to my program of javaScript or HTML code that transports, are quickly when I simply click the icon refresh at the right end of the URL bar. (I think I can put something in preferences to get this effect.) However, the changes I made with a text editor in the XML file on the server that the program is to pick up do not appear immediately. I have to exit and restart Firefox to get those changes appears.

    Obviously, the mechanism of XMLHttpRequest must be cached the file somewhere. Is not a bad idea, the file is big enough, but it's annoying, all highlighting. Is there a way to mitigate this caching?

    -Gil

    Try reloading Web pages, and ignore the cache to refresh potentially stale or corrupt.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (MAC)

    Alternatively, you can try to disable the HTTP cache when setting cache network.http.use pref Boolean false testing on the topic: config page.

    A good place to ask for advice on web development is to the 'Web Standards Development/evangelism' MozillaZine forum.

    Aid to this forum are better informed on issues related to web development.

    You must register on MozillaZine forum site to post in this forum.

  • XMLHttpRequest and being off screen blocking something

    My application talks about stuff, but when it's an XMLHttpRequest to retrieve the info to talk and the screen is off he talks using a MediaPlayer until the screen turns back on. It is quite in QML. Before he speaks of XMLHttpRequest stuff he talks about the conditions of the unit using the native APIs and those even when the screen is off it will speak without problems. Why is it that only occur for the XMLHttpRequest? Also, the app is to get the location info too just before the XMLHttpRequest. I have all entered permissions. This works when the screen is turned on. I have the option to display switch for notifications and I noticed that when the application is blocked from speaking, if a notification comes that lights up the screen upward, the MediaPlayer talk then the news of XMLHttpRequest.

    Looks like the problem has been using 'PositionSource' in QML. It does not seem to allow the updates when the screen is off so I had to go on the road to the PRC.

  • Popup on XMLHttpRequest for 'requires authentication' - Webworks on BB OS 5.0 +.

    Hello

    In my app Webworks for OS 5 +, I do multiple XMLHttpRequest calls to my server for you to connect, pull down, etc.  The usual.

    Occasionally and without apparent motive (and not always the first time after starting the app.) Not only the queries. ) I have will get a popup with something in the sense of 'this page requires authentication, enter the user name and password' and then request for domain, user name and password.

    However, I can just regularize and try again and it works perfectly.

    Anyone have experience with this and know what is possibly cause it or a fix?

    Or any portrait?  I'm stumped at the moment.

    This does not only happen on real devices, however.  I saw not in ripple (not provided) or the emulator.  Unfortunately, my curve doesn't seem to let me so I don't have any information other than the dialog box that opens for debugging.

    Thank you

    Rob.

    OK, it turns out it was a 401.  DOH.  And the solution for it is here: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Suppressing-HTTP-401-Authenticat...

  • Could not load the XMLHttpRequest

    Hello community,

    I found this weird thing and want to ask you guys, please help me if you have met before.

    My app works well in the Simulator trip but run this not found "XMLHttpRequest" error when you run on Dev Alpha.

    But when I try to change the version of Widget tags in the file config.xml to 2.0.0.0, something like

    http://www.w3.org/ns/widgets ".
    "xmlns:RIM ="http://www.blackberry.com/ns/widgets"
    version = "2.0.0.0".

    The app works well, trip and Dev Alpha

    But if the version 1.0.0.0, just run on trip, but not in the Alpha Dev.

    Could you tell me the difference from version 1.0 and 2.0?

    Information, I use 1.0 in WebWork 2.0 SDK 1.0.1 1.0.2 SDK

    I'm so confused,

    Any help would be appreciated

    Thank you

    try using the latest version of the SDK + you need to white list of your website (such as http://site-where-i-download-something-using-xmlhttprequest.com ) to the config.xml file

  • ERROR: SECURITY_ERR:DOM Exception 18 in blackberry r50

    Hello

    I develop a webworks using websql which works very well under OS 7 and 10 of the OS.

    I have four devices, blackberry curve, blackberry "BOLD", alpha 10 dev blackberry and blackberry rc50/9360.

    It works very well on the curve, "BOLD" and bb10 but not on 9360. I am not able to create the web database in this particular device.

    Cant, we create the database in 9360? When I try on the training for this camera Simulator, it works fine. I get the following error:

    ERROR: SECURITY_ERR: DOM Exception 18

    When and why do we get this error?

    Kind regards

    Annuk

    Hello

    The problem seems to be resolved. There is no SD card in this device.
    Had a SD card inserted in it and now its works well.

    https://github.com/BlackBerry/WebWorks-samples/issues/16

    http://blog.davidtruxall.com/2011/10/06/BlackBerry-Simulator-error-with-SQLite-and-HTML5/

    Kind regards

    Annuk

  • openDatabase and 10.1 translates SECURITY_ERR

    I just put my phone to 10.1 and now when I run my application phonegap/webworks, it gives me an error when I try to openDatabase.

    SECURITY_ERR: DOM Exception 18: attempt to break the security policy of the user agent.

    Hello

    I'll be back to work on the new BB10 app, and I still get this error as seen in my other thread (I forgot that I had created this one...)

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/BB10-2-with-Cordova-3-2-0-giving...

  • Browserfield invalid XMLHttpRequest

    I am launching a javascript inside a BrowserField ajax request.

    Here is a demo application, it's just an html element that is trying to perform an ajax request when the click on.

    public MyScreen() {
            // Set the displayed title of the screen
            setTitle("MyTitle");
    
            BrowserFieldConfig _myBrowserFieldConfig = new BrowserFieldConfig();
    
            _myBrowserFieldConfig.setProperty(
                    BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
            _myBrowserFieldConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR,
                    Boolean.TRUE);
            BrowserField browser = new BrowserField(_myBrowserFieldConfig);
            browser.displayContent(
                    ""
                            + ""
                            + "

    AJAX

    Request data
    ", "http://www.w3schools.com"); add(browser); }

    The problem is that even the first alert does not, so there should be a javascript syntax error, but well, everything looks good to me. I tried this code in Firefox on my computer, and alerts are displayed (I know cross-domain is not always possible). So, what is the error in my script?

    I tested on the Simulator with BB 5.0.0 and 7.0.0.

    I find the solution.

    What is the problem, is to use an absolute url to open the XMLHttpRequest. Use a url relativie (demo_get.asp) and the browserfield must have correctly set baseurl (http://www.w3schools.com/ajax/).

    It's very embarrassing.

  • use XMLHttpRequest with address of the server variable

    I have a connundrum.

    I develop an application WebWorks for BB10, in which he performs XMLHttpRequest GET funcitons to send a http message to a server to communicate information at determined intervals.

    Here's the problem: the address of the server that receives GPS messages must be specified by the user within the application itself, depending on their configuration (they usually set up their own host / server).

    So I can't put any http://www.theirserver.com ' / > info in my config.html, because it is specified by the user running.

    And is not a solution, which will still allow no requests via XMLHttpRequest.

    Do I have other options at my disposal to allow that works the way you want?  I have considered using a web proxy to a fixed address to work around the problem, but I would use rather than as a VERY last resort.

    Thank you very much

    Ray

    You can disable the blacklist/white list Ajax altogether, using the following:

    
        
    
    

    As mentioned in the documentation, this feature is only a convenience of development. In production, all URIS must be known and should be in the whitelist using the element. But for the dynamic AJAX requests, I do not see otherwise.

    https://developer.BlackBerry.com/HTML5/documentation/param_element.html

  • Problem with XMLHttpRequest and 0.9.4 on PlayBook

    I'm working on with the latest SDK 0.9.4 PlayBook. When I try to send an XMLHttpRequest like this

     var myJSONObject = {'function': 'add', 'params': [parseFloat(s1), parseFloat(s2)]};
        var xmlHttp = null;
        try {
            xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
            try {
                xmlHttp = new XMLHttpRequest();
            } catch(e) {
                try {
                    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
                } catch(e) {
                    xmlHttp  = null;
                }
            }
        }
      if (xmlHttp) {
            xmlHttp.open('GET', 'http://xxx.xxx.xxx.xxx:8080/test/testservice?rpc=' + myJSONObject.toJSONString(), true);
            xmlHttp.onreadystatechange = function () {
                if (xmlHttp.readyState == 4) {
                    alert('Result is ' + xmlHttp.responseText);
                    var jsp3 = json_parse(xmlHttp.responseText);
                    document.getElementById("resarea").innerHTML = jsp3.result;
                }
            };
            xmlHttp.send(null);
        }
    

    all I get is an empty response and State == 0 ((ce n'est pas sur l'objet JSON, car côté serveur, je peux voir fonctionner correctement).) If I remember correctly, I think that it always worked less 0.9.3.

    Has anyone else encountered this problem? Or does anyone have an idea how to solve this ?

    OK, after that I spent all morning trying to solve this problem, I just went to get some coffee, came back, and now it works.

    I don't know what to say to this :/

  • Verb PUT XMLHttpRequest not supported?

    Hello

    I'm trying to consume a Restful web service that has a method that uses the verb PUT. I am creating an XMLHttpRequest in my webworks app but this COULD is changed to a POSITION so accordingly I get 'Method not allowed' from the server all the time.

    Looking at the server logs I can see that if I call the service from a page in Google Chrome, I get:

    2011-04-12 09:22:58 127.0.0.1 PUT /RESTTest/Appointment/Outcome - 80 - 127.0.0.1 Mozilla....
    

    If use the blackberry on the phone browser, it works well

    2011-04-12 09:24:57 127.0.0.1 PUT /RESTTest/Appointment/Outcome - 80 - 127.0.0.1 BlackBerry9550....
    

    However the request sent via the webworks app fails as the verb is different from MAIL

    2011-04-12 09:25:24 127.0.0.1 POST /RESTTest/Appointment/Outcome - 80 - 127.0.0.1 BlackBerry9550
    

    The service is not editable because it must conform to standards of restful service, does anyone have a work around to bypass this behavior in webworks applications?

    Updated OS5 version Storm 2 5.0.0.517 simultor and the real device has solved this in case someone else has the same problem

Maybe you are looking for

  • Satellite M100 (PSMA0E) - Driver for SD card reader

    Hello. I have a Toshiba Satellite M100 PSMA0E. I installed win XP and does not recognize the SD card reader. The site Web of Toshiba is not the pilot. How can I fix it? I'm waiting for your answers. Thank you

  • HP 50 g: function Division - grrr

    In College, I used the 48gx and loved.  I have two HP 50g calculators.  I use RPN mode.  If I do the following > > 5 enter 8 then enter the symbol of the division, I get two results - one is:, 625 is the other 5/8, that is, it does not work the calcu

  • T410s internal speakers fade out after a second, headphones work fine

    Hello community, My THinkpad T410, type 2912-45 G, Windows 7 (64-bit) has a problem with the speakers. From Monday (June 25) my speakers stop working. When I boot the TP you can hear a static click through the speakers, and he plays the sound windows

  • BlackBerry Smartphones 9530 German

    Hello, I'm German man living in Canada from 1 to 3 years, I 9530 and I use it all over the world and have all my contacts and calendar, but I need German language support please, how can I do? All phones in the world have 3 laguages in all mobile pho

  • Cancel the default grouping of records in OBIEE Analytics

    Hi allI have a requirement that the result should be displayed in as follows:Example assume that an X employee works for several customers A, B, C.Thus, in the results, its display by grouping the customer in respect of this particular employee that