jquery - 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'getElementsByTagName' -
i have simple mvc application in want show location dynamically google map.
i getting error in file----
unhandled exception @ line 16, column 59007 in https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js
0x800a01b6 - javascript runtime error: object doesn't support property or method 'getelementsbytagname'
the view page contains simple html javascript code , javascript files included----
<!doctype html> <html> <head> <title></title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>google maps </h1> <div align="left"> <input type="text" value="" id="searchbox" style=" width:800px;height:30px; font-size:10px; margin-top: 7px;"> </div> <div align="left" id="map" style="width:800px; height: 600px; margin-top: 10px;"> </div> </body> </html> <script type="text/javascript"> $(document).ready(function () { var mapoptions = { zoom: 10, maptypeid: google.maps.maptypeid.roadmap, center: new google.maps.latlng(41.06000, 28.98700) }; var map = new google.maps.map(document.getelementbyid("map"), mapoptions); var geocoder = new google.maps.geocoder(); $(function () { $("#searchbox").autocomplete({ source: function (request, response) { if (geocoder == null) { geocoder = new google.maps.geocoder(); } geocoder.geocode({ 'address': request.term }, function (results, status) { if (status == google.maps.geocoderstatus.ok) { var searchloc = results[0].geometry.location; var lat = results[0].geometry.location.lat(); var lng = results[0].geometry.location.lng(); var latlng = new google.maps.latlng(lat, lng); var bounds = results[0].geometry.bounds; geocoder.geocode({ 'latlng': latlng }, function (results1, status1) { if (status1 == google.maps.geocoderstatus.ok) { if (results1[1]) { response($.map(results1, function (loc) { return { label: loc.formatted_address, value: loc.formatted_address, bounds: loc.geometry.bounds } })); } } }); } }); }, select: function (event, ui) { var pos = ui.item.position; var lct = ui.item.loctype; var bounds = ui.item.bounds; if (bounds) { map.fitbounds(bounds); } } }); }); });
want answer own question...................i think old javascript library file not compatible new versions of ie9. so, changed referenced js libraries files latest 1 page....developers.google.com/speed/libraries , working fine now....
Comments
Post a Comment