下部のUPDATEをご覧ください。
私は 1and1 を使用して自分の (最初の) サイトを公開しています (このコミュニティから多くの助けを借りて喜んでいます - ありがとう!)。私のローカルホストではすべて完璧です。
質問の結論:
ホスト: 1and1
Ajax: URL ?
(ローカルホストではなく) ネット上のページをデバッグする方法は?
よろしくお願いいたします。
コードの一部は次のとおりです。
$.ajax({
type : 'POST',
url : '/homepages/23/d97025366/htdocs/sodabrasil/php/locationsJsonBrasil.php',
dataType : 'json',
success: function( json ){
neighborhood=[];
infobubbles=[];
$.each(json,function(i,item){
neighborhood.push(new google.maps.LatLng(this.lat,this.lng));
contentString = ({link:this.link,name:this.name,lat:this.lat,lng:this.lng,link:this.link, web:this.web, city:this.city, youtube:this.youtube, state:this.state, country:this.country})
infoBubble = new InfoBubble (contentString)
infobubbles.push(infoBubble)
}); //$.each
json ファイルは次のとおりです。
<?php
require 'config.php';
try {
$db = new PDO($dsn, $username, $password);
$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sth = $db->query("SELECT * FROM globalstories");
$locations = $sth->fetchAll();
echo json_encode( $locations );
} catch (Exception $e) {
echo $e->getMessage();
}
?>
そして最後に設定ファイル
<?php
$server = 'dbXXXXXXXX.db.1and1.com';
$username = 'dboXXXXXXX';
$password = 'password';
$database = 'dbXXXXXXXXX';
$dsn = "mysql:host=$server;dbname=$database";
?>
アップデート
私はこれを数日間試しています。別の会社を追加しましたが、現在は Bluehost です。ページはこちらです。「 sem fronteiras 」をクリックしてください。それは今ファイルとのみリンクするということです。
firebug と expllorer の画像はこちらです。. 地図を読んでいないようです。しかし、構成を削除し、構成と ajax URL を自分のコンピューターに向けると、すべてが再び機能します。御時間ありがとうございます。