01-25-2010 11:45 AM
Is it possible to have Javascript make a request to the client on which the page is running? I've been trying to use XMLHTTPRequest to the device's IP address and I keep getting error 500. I also tried localhost or 127.0.0.1 and got the same error. The page making the request is stored as a file on the blackberry.
This probably isn't a BlackBerry-specific thing but I figured I'd ask here anyway.
Thanks!
--Ryan
01-26-2010 09:31 AM
Hi Ryan,
To access a file on the local system, use the "file:///" protocol. Here's an example of the path to an image file stored on removable media (SD card):
file:///SDCard/BlackBerry/pictures/image.jpg
You can also load file paths directly in the address field of the browser (e.g. to verify path is valid).
As a reminder, you cannot access these files if your BlackBerry is currently in mass storage mode.
Sincerely,
Adam
02-09-2010 03:26 AM
I am using "Blackberry Java Development Environment". In that I am trying to request the server(59.165.0.0) to access data . While I am requesting the server it is giving the error that.
--> Cross origion Access Voilation.
I am requesting the server as http://59.165.80.20/abc/PhonePage.aspx in Phone.html.
Here I am using HTMl and Javascript only to get the details from the server.
Is it possible to use xmlHTTP request in Blackberry Java Development Environment to interact with the server.
Please help me in this regard.And im new to this technology. More over all the HTML pages are stored locally. And some html pages are used from server.
Thanks and Regards
L.V.Ganesh
02-09-2010 12:30 PM
Hi There,
I have a few questions that might help clarify your approach and possible solutions.
- Which version of the BlackBerry operating system are you using?
- If it is v5.0, are you using the BrowserField or BrowserField2 API?
Thanks
02-10-2010 11:52 PM
Hi tneil
We are using Black Berry 5.0 OS. and we are using Vista OS
And we are using Browser field2
Thanks & Regards
Ganesh
02-11-2010 11:08 AM
In order to allow cross origin XHR requests in BrowserField2, you will need to set the proper BrowserFieldConfig property.
There is a property called ALLOW_CS_XHR and it needs to be set to true
Cheers