TypeError: jQueryxxxxxx is not a function



  • When first opening the mobile app homepage it returns an error

    "TypeError: Jqueryxxxxxx is not a function" although it shows the API callback results "jQuery111309512500500950475_1459208158307({"code":1,"msg":"Ok","details":{"data"..." according to Firebug.
    

    I have to open different app pages then return to homepage to see Featured Merchants parsed.

    JS Code

    case "page-home":
        callAjax('getFeaturedMerchant','');
        break;
    case "getFeaturedMerchant":
        displayFeaturedRestaurant( data.details.data ,'list-featured');
        break;
    case "getFeaturedMerchant":
        createElement('list-featured','');
        break;
    

    API PHP Code

    public function actiongetFeaturedMerchant()
    {
        $DbExt=new DbExt;  
        $DbExt->qry("SET SQL_BIG_SELECTS=1");       
    
        $start=0;
        $limit=200;
    
        $and='';
        if (isset($this->data['restaurant_name'])){
            $and=" AND restaurant_name LIKE '".$this->data['restaurant_name']."%'";
        }
    
        $stmt="SELECT a.*,
        (
        select option_value
        from 
        {{option}}
        WHERE
        merchant_id=a.merchant_id
        and
        option_name='merchant_photo'
        ) as merchant_logo
    
        FROM
        {{view_merchant}} a
        WHERE is_featured='2'
        AND is_ready ='2'
        AND status in ('active')
        $and
        ORDER BY sort_featured ASC
        LIMIT $start,$limit     
        ";              
    
        if (isset($_GET['debug'])){
            dump($stmt);
        }
    
        if ($res=$DbExt->rst($stmt)){
            $data='';
    
            foreach ($res as $val) {                
                $data[]=array(
                  'merchant_id'=>$val['merchant_id'],
                  'restaurant_name'=>$val['restaurant_name'],
                  'logo'=>AddonMobileApp::getMerchantLogo($val['merchant_id']),               
                );
            }
            $this->details=array(
              'data'=>$data
            );
            $this->code=1;$this->msg="Ok";
            $this->output();
        } else $this->msg=$this->t("No Featured Restaurant found");
        $this->output();
    }
    

    Please also check my SOF

    http://stackoverflow.com/questions/36274120/typeerror-jqueryxxxxxx-is-not-a-function


Log in to reply