1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    28
    Vote Rating
    0
    Shariar Shaikot is on a distinguished road

      0  

    Default Problem with Ext.util.JSONP.request

    Problem with Ext.util.JSONP.request


    Hello,
    I am seeking help from the experts.
    Here is codes
    Code:
    function showProfile(pid)
                                {
                                  Ext.getBody().mask('Loading...', 'x-mask-loading', false);
                                Ext.util.JSONP.request({
                    url: 'http://cellbuddy.mobi/view_profile.php?pid='+pid,
                    callbackKey: 'callback',
                    callback: function(guests) {
                        
                        var guests = pro.guests;
                        if (guests) {
                            
                            var html = tpl.applyTemplate(guests);
                            Ext.getCmp('profileOne').update(html);
                            Ext.getCmp('profileOne').setTitle('You tapped a profile');
                            Ext.getCmp('profileOne').setInstructions('If you like this profile then please confirm.');
                            Ext.getCmp('Lotto').setHTML('Allo');
                        }else{
                    
                    
                        Ext.getCmp('bottom').setTitle('Wrong profile selected');
                      
                    }
      Ext.getBody().unmask();
                    }
                                });
                                }
    PHP Code:

    <?php
    session_start
    ();
    $dsn 'mysql:dbname=touche;host=localhost';
    $user 'root';
    $password 'result44';
    try {
            
    $callback $_REQUEST['callback'];
            
    $dbh = new PDO($dsn$user$password);
            if(isset(
    $_REQUEST['pid']))
            {
            
    $profileid $_REQUEST['pid'];
            
             
    $_SESSION['pid'] = $profileid;
            
            
    $sql "SELECT * FROM predifind_profiles WHERE profileid='".$profileid."'";
             
            
            foreach(
    $dbh->query($sql) as $row)
            
            {
                
    $guests[] = array('name' => $row['name'], 'descricption' => $row['description']);
            }
           if (
    $callback) {
        
    header('Content-Type: text/javascript');
        echo 
    $callback '(' json_encode(array('guests' => $guests)) . ');';
    } else {
        
    header('Content-Type: application/x-json');
        echo 
    json_encode(array('guests' => $guests));
    }

           
            
          
        }
        
        
        } catch (
    PDOException $e) {
        echo 
    'Connection failed: ' $e->getMessage();
    }

    ?>



    When I call the showProfile function to display profile details then the page keep loading and loading.
    Nothing returns.

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    28
    Vote Rating
    0
    Shariar Shaikot is on a distinguished road

      0  

    Default Also facing same problem

    Also facing same problem


    I also facing same problem when I am trying to submit a cross domain form.
    I mean I also can not connect to the mySQL server when the javascript files was package up for an android app with phonegap.


    Please help me..... I lost too many days for those problems.