×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    3

    How to read txt files on Nokia phone using Javascript?

    Hi,everyone:
    I want to make an e-book reader which can be setup on Nokia phone. My reader is written in language Javascript.
    I have already realized it on phone Nokia 5800 using ajax's response object. But if i setup my widget onto Nokia e63 or Nokia n95,something is wrong. Who has a better solution? Please reply my ask,thank you very much!

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

    Re: How to read txt files on Nokia phone using Javascript?

    Hi crystal azalea,

    could you specify why on E63/N95 your code fails? Try posting the code that doesn't seem to work on these phones, so that it'll be possible to spot out possible issues.

    Pit

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

    Re: How to read txt files on Nokia phone using Javascript?

    hi,jappit,thank you for paying attention to my question.
    Part of my code is as follow:
    Code:
    if(xmlHttp.readyState==4){
         if (xmlHttp.status == 200 ||xmlHttp.status == 0){
              alert(xmlHttp.responseText); 
    	  h=xmlHttp.responseText;}
       }
       xmlHttp.open("GET", src, false);
       xmlHttp.send(null);
    where src is the position of txt file,and xmlHttp is a ajax xmlHttpRequest.
    I find xmlHttp.readyState only can rise to 3 on nokia N95/E63 by debugging,
    that's to say,the request i sent is accepted,but the txt file doesn't been
    analyzed correctly.
    However,this problem doesn't happen on Nokia 5800,I guess maybe the operating system
    of Nokia n95/e63 is of low level.
    I want to know if there is other way to solve this problem.
    Last edited by crystal azalea; 2010-04-21 at 02:59.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Re: How to read txt files on Nokia phone using Javascript?

    Hi Mr.

    I got this kind of problem too using Nokia N8. My code that cause the problem is
    ajaxRequest = new XMLHttpRequest();

    ajaxRequest.onreadystatechange = function() {

    if(ajaxRequest.readyState == 4) {
    ..
    ..
    }
    }
    ajaxRequest.open("GET", "dbase/" + filename, true);
    ajaxRequest.send(null);

    Somehow this has no problem in Nokia N900.

    Thanks in advance for your help.

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

    Re: How to read txt files on Nokia phone using Javascript?

    Quote Originally Posted by zairochess View Post
    Hi Mr.

    I got this kind of problem too using Nokia N8. My code that cause the problem is
    ajaxRequest = new XMLHttpRequest();

    ajaxRequest.onreadystatechange = function() {

    if(ajaxRequest.readyState == 4) {
    ..
    ..
    }
    }
    ajaxRequest.open("GET", "dbase/" + filename, true);
    ajaxRequest.send(null);

    Somehow this has no problem in Nokia N900.

    Thanks in advance for your help.
    Make sure that the widgets are allowed to access the network. Goto home screen and then from the menu select "widgets to online mode".
    -Ilkka

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Re: How to read txt files on Nokia phone using Javascript?

    Already solve after doing phone update. thanks anyway

Posting Permissions

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