2017-03-20 7 views
-1

ウェブサイトを読み込もうとするとエラーが発生します。私がindex.htmlを私のブラウザの中に開くときはいつでも、私はproblem loading pageという応答を得ます。応答が混乱して正常に私は、これはファイルが読み込めなかったことを示していることを期待するので、しかし、私の応答は次のことを示していますJavascriptコードをファイル構造として開くしようとしているブラウザ

Firefox can’t find the file at /home/crow/UdacityProjects/mapapp/function (data) { // Setting Self var self = this; this.name = data.name; this.lat = data.lat; this.long = data.long; this.URL = ""; this.street = ""; this.city = ""; this.phone = ""; this.visible = ko.observable(true); // Foursquare URL var foursquareURL = ' https://api.foursquare.com/v2/venues/search?ll= ' this.lat ',' this.long '&client_id=' clientID '&client_secret='

それは続くが、私はスペースのための残りを残してきました。あなたの試みがURLに自分のコードをロードするのを見ることができますが、なぜこれが起こっているのでしょうか?

私は、ブラウザがファイルをロードしようとしているように見える私のjavascriptのコードを含めました:

// --- Location information and foursquare URLJSON. 
var location = function(data) { 

    // Setting Self 
    var self = this; 
    this.name = data.name; 
    this.lat = data.lat; 
    this.long = data.long; 
    this.URL = ""; 
    this.street = ""; 
    this.city = ""; 
    this.phone = ""; 
    this.visible = ko.observable(true); 

これは私のindex.htmlファイルです:

:私のディレクトリ構造がどのように見える

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title>Bolton Hill Neighborhood Map</title> 
    <link rel="stylesheet" href="static/main.css"> 
    <meta name="viewport" content"width=device-width, initial-scale=1"> 
</head> 
<body> 
<div class='map'>maps error</div> 

    <script src="/js/knockout.js"></script> 
    <script src="/js/jquery.min.js"></script> 
    <script src="/js/app.js"></script> 
    <script async defer src="https://maps.googleapis.com/maps/api/js?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&callback=initApp&libraries=places" onerror="errorHandler"></script> 
</body> 
</html> 

私がここで間違っていることはわかりませんuldは私に本当に感謝するいくつかのアドバイスを提供します。ありがとう!

答えて

2

locationは、Javascript keywordです。変数の名前を変更します。

+0

返信いただきありがとうございました! – NoOrangeJuice

関連する問題