×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    JQuery 1.3.2 WRT Aptana weirdness

    I'm new to WRT development, I downloaded Aptana DSP and have it installed and running. I've been using jQuery on my web site for 2 months now so getting a hang of it.

    I'm running into some weirdness when I embed jQuery into my WRT project. It works just fine when runing in Aptana, but when I download the .wgz file to my N96 8G phone a lot of the jquery calls either work or don't work, I've only figured that out by many ALERTS() added to the code after each line.

    My HTML

    <DIV CLASS="QOD_FULL" ID="ID_QOD_FULL" style="color:#000055;width:100%;font-size:13pt;font-family:Trebuchet MS, Helvetica, sans-serif;">
    ...
    </DIV>

    in my doc ready function (note call_to_php is not the actual name but used for example

    $(document).ready(function(){
    $.post("call_to_php", { uanswer: uanswer, qid: qid }, function(data) {

    // This line works all the time
    document.getElementById('ID_QOD_FULL').innerHTML = data;

    // This does not ever work when uncommented
    //$("#ID_QOD_FULL").html( data );

    }, 'html');
    });



    The document.getElementById works all the time and I can update my page, but the jQuery call never works. Yet in other places in my code I have been able to use .html() call with some success.

    What am I missing? The second line works just fine when running in Aptana, but never on my actual device of my N95 8G

    Thanks in advance
    Andy

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

    Re: JQuery 1.3.2 WRT Aptana weirdness

    Hi Andy,

    jQuery has some compatibility issues when used in WRT environment (this old post report an issue similar to yours: http://discussion.forum.nokia.com/fo...d.php?t=150333).

    Anyway, have you tried checking if the $("#ID_QOD_FULL") call returns the correct node?

    Pit

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    Re: JQuery 1.3.2 WRT Aptana weirdness

    I'm really new to Javascript coding, have been a PHP developer for a while now. I just got my N97 so will be trying it out on that today.

    I'm not really sure how to check the node that is being returned when using a phone instead of the developer environment. I'll scan the forums for info about that.

    The one piece that may be causing the problem is that the HTML code that I'm looking for was not part of the initial page, but html that was returned from my PHP script the widget called. So it might be the DOM tree is different that what jQuery expects.

    Thanks for the link and the reply.

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

    Re: JQuery 1.3.2 WRT Aptana weirdness

    Try just adding this code:
    Code:
    alert($("#ID_QOD_FULL"));
    and see what gets alerted.

    Pit

    PS: check also out the JavaScript console, that greatly helps to debug errors occurring on real devices:
    http://library.forum.nokia.com/index...616259DB9.html
    Last edited by jappit; 2009-06-18 at 09:29.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    11

    Thumbs up Re: JQuery 1.3.2 WRT Aptana weirdness

    Pit,

    Thanks, my N95 didn't have all those options, I actually have my N97 and it all works on that device, so I'm guessing its something in the old N95 8G (US version) device. Since I'm a N97 and have a lot more screen space, I find my app is better suited for the larger screen and giving up supporting the older device. The N97 does all the JavaScript options, but since the jQuery code works on it, I'm not needing it right now :-)

    Thanks for the help. and look for my Question Of the Day application coming to a N97 near you.

    Andy

Similar Threads

  1. Replies: 3
    Last Post: 2013-06-16, 01:10
  2. jQuery click() events not working in WRT
    By bryanrieger in forum Symbian
    Replies: 5
    Last Post: 2010-05-19, 14:44
  3. Replies: 14
    Last Post: 2009-02-16, 14:40
  4. Replies: 19
    Last Post: 2008-12-14, 04:06

Posting Permissions

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