Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 09:39:36 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Getting data not using localhost in linb.Ajax  (Read 1352 times)
jovibals
Hero Member
*****
Posts: 133


View Profile
« on: January 11, 2010, 06:30:31 PM »

Hi linb,

       I know this is just a simple issue. I tried using linb.Ajax to display data in the treegrid calling other IP where the data is stored.

       Im using this let say:

       linb.Ajax('http:202.202.202:8080/order.php',null,this._ajax1_onrequestok).start();

       This is my order.php :

        {rows: [ ["prod1","prod2","prod3","prod4"],    ["item1","item2","item3","item4"]]}

       And this the function that display data in a treegrid :

        _ajax1_onrequestok:function (response, rspType, threadId) {
            var obj = _.unserialize(response);
            SPA.treegrid5.setRows(obj.rows);
            //alert(obj);
        }

        But if im using this getting it on a folder this works :

        linb.Ajax('data/order.php',null,this._ajax1_onrequestok).start();

What is the problem? Please advice.

thanks
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: January 12, 2010, 04:28:31 PM »

That means your "localtion.href" is not "http:202.202.202:8080".
Logged
jovibals
Hero Member
*****
Posts: 133


View Profile
« Reply #2 on: January 12, 2010, 06:29:49 PM »

thank you for the response, but are you saying that, this only works if i call the same path of url? and meaning if i have a data to get in let say using this code "linb.Ajax('www.google.com/order.php',null,this._ajax1_onrequestok).start();"  i can't get it? can you please elaborate..

And also if it is the case, my localhost and my local IP are not communicating when i use this code below.

           - http://192.168.55.63:8081/sigma-visual-builder2.2/VisualJS/http://192.168.55.63:8081/sigma-visual-builder2.2/VisualJS/projects/MIS/index.html

           - linb.Ajax('http://localhost:8081/sigma-visual-builder2.2/VisualJS/projects/MIS/order.php',null,this._ajax1_onrequestok).start();

What is suppose my problem here?

Many thanks!
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #3 on: January 12, 2010, 08:00:29 PM »

Use linb.request, that can switch linb.Ajax/linb.SAjax/linb.IAjax dynamically.
Logged
jovibals
Hero Member
*****
Posts: 133


View Profile
« Reply #4 on: January 12, 2010, 09:54:02 PM »

Hi linb,

        I tried this code below :

            linb.request("http://localhost:8081/order.php,
                function(rep){
                    var obj = _.unserialize(rep);
                    this.treegrid5.setRows(obj.rows);
                    //alert(rep);
                },
                function(rep){
                    alert(rep);
                }, null,
                {method:'post'}
            );

           and in the firebug i see this response:
           
           {rows: [    ["sub13333","sub12","sub13","sub14"],    ["sub21","sub22","sub23","sub24"]]}

           but the problem is it's not displaying on the form. any trick on here?


Thanks again.
Logged
jovibals
Hero Member
*****
Posts: 133


View Profile
« Reply #5 on: January 12, 2010, 11:05:13 PM »

I noticed that you cannot get data once you call other url address. Request should be relative.

Thank you linb.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!