×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Serbia
    Posts
    12

    Question AJAX Remote calls?

    Hi there, I'm new to this forum and Nokia WRT Widget Development so please excuse my ignorance.

    I'm trying to maka AJAX call to some remote http address and I can't seam to do it right. My XMLHttpRequest returns status of 0 (null) even though I enabled AllowNetworkAccess in my .plist file. When I use it on a local file it works just fine but when I try it on a remote location (like http://www.example.com/) I get nothing.

    Is it even possible to make a remote AJAX call with WRT and how?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: AJAX Remote calls?

    Hi aiveldesign,

    are you testing on a real device, or on a simulator (and which)?

    Pit

  3. #3
    Registered User
    Join Date
    Apr 2010
    Location
    Serbia
    Posts
    12

    Re: AJAX Remote calls?

    Sorry, my bad I tested it in Symbian WRT IDE and it's integrated simulator. I thought it's OK to test it like that cos the IDE was downloaded directly from Symbian dev site and I believed it works. By the way, it's working just fine on the phone itself so if you can tell me what to do to make my simulator work it would be much appreciated.

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Re: AJAX Remote calls?

    Could you check if you have the following line in the html file

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    Also I hope you are using onreadystatechange

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    5

    Re: AJAX Remote calls?

    Quote Originally Posted by aiveldesign View Post
    Sorry, my bad I tested it in Symbian WRT IDE and it's integrated simulator. I thought it's OK to test it like that cos the IDE was downloaded directly from Symbian dev site and I believed it works. By the way, it's working just fine on the phone itself so if you can tell me what to do to make my simulator work it would be much appreciated.
    It should work there. There are two project templates (RSS and Flicr) that do AJAX calls to a different domain. You can create one of those and try if remote call works there. If not - you can open a bug.

  6. #6
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: AJAX Remote calls?

    Quote Originally Posted by aiveldesign View Post
    Sorry, my bad I tested it in Symbian WRT IDE and it's integrated simulator. I thought it's OK to test it like that cos the IDE was downloaded directly from Symbian dev site and I believed it works. By the way, it's working just fine on the phone itself so if you can tell me what to do to make my simulator work it would be much appreciated.
    This is my personal opinion, but at the moment I would suggest to use Aptana + WRT plugin for WRT development, because Symbian WRT IDE is still in Beta stage.
    However it is always good to check every now and then how it evolves

    Aptana + WRT plugin installation instructions
    http://www.forum.nokia.com/Tools_Doc...Aptana_Plugin/

    Check the release notes for configuring the network connection and section 21. HTTP Access Control for instructions to bypass the same origin policy.
    http://tools.ext.nokia.com/wrt/prod/...tes/2.2.0.html
    You could actually test if the same trick works with the Symbian WRT IDE as well.

    Those who are interested, the Symbian WRT IDE can be downloaded from:
    http://developer.symbian.org/wiki/in...ls_(WRT_Tools)


    Br,
    Ilkka

  7. #7
    Registered User
    Join Date
    Apr 2010
    Location
    Serbia
    Posts
    12

    Re: AJAX Remote calls?

    OK, thank you all for relying even though I still can't test it in WRT IDE this thread actually solved my problem in a way. I downloaded remote XML that I was referring to and tested it locally. That made it easier (and faster) to make required functions for working with it. When I was happy with it I just changed my URL to remote one and deployed the app to the phone. It worked like a charm

    On the other hand, I used WRT IDE cos I'm new to Symbian development. The thing is I'm not now to web development (I do that for a living) so I downloaded Dreamweaver extension (Dreamweaver is my native web dev tool) and I'm ready to go I also downloaded Aptana Studio just to check it out for when I work in Linux. It's eclipse based and I have some experience with eclipse so I guess it won't be a problem working in it.

    Thanks again, cheers.

  8. #8
    Registered User
    Join Date
    May 2010
    Posts
    3

    Re: AJAX Remote calls?

    If you are using Firefox this behavior will happen. AJAX was not meant to work on cross domain calls, so the browsers stop it from working (security issues). If you want to use Firefox testing the WRT (which can be done via the Dreamweaver extension using the preview files), then you have enable Firefox for remote calls.

    Just read this: http://installingcats.com/2008/01/21...-ajax-toolkit/

    Hope this helps.

  9. #9
    Registered User
    Join Date
    Apr 2010
    Location
    Serbia
    Posts
    12

    Re: AJAX Remote calls?

    Oh I forgot to tell you all, I use jQuery and JSONP now so I don't have the problem of getting remote data with AJAX

Similar Threads

  1. Aborting Ajax calls using XMLHttpRequest.abort();
    By JasperGoes in forum Symbian
    Replies: 2
    Last Post: 2010-04-19, 12:47
  2. Please Help! How do I retrieve recieved calls from N95?
    By ConsultantDavid in forum General Development Questions
    Replies: 5
    Last Post: 2009-09-06, 17:44
  3. Replies: 5
    Last Post: 2008-02-20, 09:52
  4. ETelMM: Swap doesn't work on two received calls
    By iDeveloper in forum Symbian
    Replies: 4
    Last Post: 2007-10-25, 17:54
  5. remote calls
    By evertse in forum Symbian
    Replies: 0
    Last Post: 2003-09-09, 09:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×