OK done... I tested it on Firefox, IE, Opera and Safari... and all worked great<br>it was a bug in my code...<br><br>many thanks to dmitrig01 from #drupal... he was a big help yesterday.<br><br><b><i>Ahmad Al-Obaidy <ahmad@hitech-iraq.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hello Amr,<br>Thank you man,<br>I got it work with with with node service... its more than enough for me!<br>everything works ok on Firefox... but with IE ... it just not working<br><br>my script look like this: <br><br>function avl_get_location() {<br> Drupal.service('node.load',<br> {nid: avl_nid, fields: ["nid", "title"]},<br> function(status, data) {<br> alert(data.title);<br> }<br> );<br>}<br><br>** status is always false!<br>I dont know if it is some bug... <br>but I will make some checks ... and I
will report it here<br><br><b><i>Amr Mostafa <amr.mostafa@gmail.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hello Ahmed,<br><br>In Drupal5 I do this by creating a menu item of the type<br>MENU_CALLBACK, with a callback e.g. mymodule_get_rank_json() which<br>goes like:<br><br>function mymodule_get_rank_json() {<br> // ...<br> // The code to determine rank and put it in $rank.<br> // ...<br><br> // This is how to JSON-ify the returned value<br> header('Content-type: text/javascript');<br> print drupal_to_js($rank);<br>}<br><br>drupal_to_js() converts the given parameter to JSON and then you print<br>that back to the browser. To capture the returned information using<br>javascript and do something useful with it, check Ajax documentation<br>in jQuery library (the library that is included and used by default<br>within Drupal) http://docs.jquery.com/Ajax<br><br>Cheers,<br>-
Amr<br><br>On 7/15/07, Ahmad Al-Obaidy <ahmad@hitech-iraq.com> wrote:<br>> Hi,<br>><br>> I need to display a value given in the database.... the value is modified<br>> regularly by other programs....<br>><br>> the value should be refreshed regularly .... but not the entire page...<br>><br>> I tried JSON ... but didnt find a useful docs..<br>> from where should i start?<br>><br></ahmad@hitech-iraq.com></blockquote><br> </blockquote><br>