小编Joh*_*ack的帖子

未捕获的ReferenceError:未定义谷歌(索引):21初始化(谷歌地图API)

继续在控制台中收到此错误"未捕获的ReferenceError:未定义谷歌".已经做了一段时间但没有运气.任何帮助非常感谢.提前致谢

<!DOCTYPE html>
<html>
 <head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0; padding: 0 }
  #map-canvas { height: 100% }
  </style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"</script>
<script type="text/javascript"
  src="https://maps.googleapis.com/maps/api/js?sensor=false">
  </script>
<script type="text/javascript">
   function initialize(location) {

  console.log(location);

  var mapOptions = {

      center: new google.maps.LatLng(location.coords.latitude, location.coords.longitude),
      zoom: 8
    };
        var map = new google.maps.Map(document.getElementById("map-canvas"),
        mapOptions);
  }

  $(document).ready(function()
  {
  navigator.geolocation.getCurrentPosition(initialize);
  });
  </script>
  </head>
  <body>
  <div id="map-canvas"/>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript google-maps

3
推荐指数
1
解决办法
4万
查看次数

接收PHP变量

接收变量时遇到问题,我收到的错误消息是

注意:未定义的索引:第7行的C:\ Users\PC\Documents\XAMPP\htdocs\php\addpost.php中的标题注意:未定义的索引:C:\ Users\PC\Documents\XAMPP\htdocs\php \中的文本第8行的addpost.php

// HTML文档

<div id="postdialog" title="Add Post" action="php/addpost.php">
<p>Please Fill in out member information.</p>
<form name="insertmember" action="php/addpost.php" >
<label>Title<input type="text" name="title" id="title"/></label>
<label>Text<textarea name="text"></textarea></label>
<input name="submit" type="submit" value="Submit" id="submit" />  
</form>
</div>
Run Code Online (Sandbox Code Playgroud)

// PHP文件

if ($_POST['submit'] = "submit") {

    $title = $_POST['title']; 
    $text  = $_POST['text']; 

    $errors = array();

    if (empty($_POST['title'])) {
        $errors[] = "Title is Missing";
}
else 
{
    $title = $_POST['title'] 
    if (strlen($fname) > 15 ) {
        $errors[] = "Title is too long";
    }
} …
Run Code Online (Sandbox Code Playgroud)

php variables

0
推荐指数
1
解决办法
60
查看次数

纠正MySQL语法以返回多行

我想查询数据库并从多行中提取检索信息,但我不确定MySQL语法.像这样的东西;

SELECT LastName FROM Users WHERE ID = 1 AND ID = 2 AND ID = 3
Run Code Online (Sandbox Code Playgroud)

所以我想收回来

Smith,Doe和Doe

Users
ID    FirstName    LastName    
1     John         Smith
2     Joe          Doe
3     Jane         Doe
More data etc etc
Run Code Online (Sandbox Code Playgroud)

php mysql sql

0
推荐指数
1
解决办法
60
查看次数

标签 统计

php ×2

google-maps ×1

html ×1

javascript ×1

mysql ×1

sql ×1

variables ×1