Jquery says 'a.split is not a function'
i'm trying to make an adress book using team leader. I can perfectly open the first item, but everything after that can't open.
- <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$output;
include_once('config.php');
$i = 0;
do {
$url = "https://www.teamleader.be/api/getCompanies.php";
$fields = array("amount" =>100, "pageno" => $i, "filter_by_tag" => "Partner","api_group"=>(GROUP),
"api_secret"=>(KEY));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$api_output = curl_exec($ch);
$json_output = json_decode($api_output);
$outp = $json_output?$json_output:$api_output;
curl_close($ch);
if(sizeof($outp) < 100) { $output = $outp; break;}
else {array_merge($output, $outp); $i + 1;}
}while(0);
function info($company) {
$name = "Naam: " . $company->name;
$taxcode = "Taxcode: " . $company->taxcode;
$bus_type = "Business Type: " . $company->business_type;
$location = "Locatie: " . $company->street . " " . $company->number;
$location2 = "Woonplaats: " . $company->zipcode . " " . $company->city;
$country = "Land: " . $company->country;
$website = "Website: " . $company->website;
$email = "Email: " . $company->email;
$telephone = "Telefoon: " . $company->telephone;
$fax = "Fax: " . $company->fax;
$iban = "IBAN: " . $company->iban;
$bic = "BIC: " . $company->bic;
$lang_code = "Taalcode: " . $company->language_code;
$lang_name = "Taal: " . $company->language_name;
$date_add = "Datum toegevoegd: " . $company->date_added;
$date_changed = "Datum laatst veranderd: " . $company->date_edited;
$stat = "Status: " . $company->status;
$btw = "VAT: " . $company->vat_liability;
$pay_term = "Betalingstijd: " . $company->payment_term;
return $name . '<br>' . $taxcode . '<br>' . $bus_type . '<br>' . $location . '<br>' .
$location2 . '<br>' . $country . '<br>' . $website . '<br>' . $email . '<br>' . $telephone
. '<br>' . $fax . '<br>' . $iban . '<br>' . $bic . '<br>' . $lang_code . '<br>' . $lang_name
. '<br>' . $date_add .'<br>' . $date_changed . '<br>' . $stat .'<br>' .
$btw . '<br>' . $pay_term;
}
?>
</head>
<body>
<div data-role="page" id="home">
<div class="content" id="list">
<ul data-role="listview">
<?php foreach ($output as $k=>$company): ?>
<li><a href="#<?php echo $k; ?>" data-id="<?php echo $k; ?>" data-transition="slide"><?php echo $company->name; ?></a></li>
<?php endforeach;
print_r(sizeof($output));?>
</ul>
</div>
</div>
<?php foreach ($output as $k=>$company): ?>
<div data-role="page" id="<?php echo $k; ?>">
<div data-role="main" class="content">
<div id="text">
<?php
echo info($company);
?>
</div>
</div>
<ul data-role="listview"><li><a href="#home" data-transition="slide" data-direction="reverse">Keer terug</a></li></ul>
</div>
<?php endforeach; ?>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</body>
</html>
that's the code, if any of you sees the problem i'm having please tell me