Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot call method 'toLowerCase' of undefined GetJson
    primarykey
    data
    text
    <p>I'm Stucked in a situation where i need to fix my codes when getting Jsonresult for my Google Maps v3 but when i am in the loop to load my map with worker from jquery, this error shows <code>Uncaught TypeError: Cannot call method 'toLowerCase' of undefined</code> i don't know how to fix this and i dont see some fixtures with this problem . I hope Someone can help me with this </p> <p>This is my Codes for my Javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; var geocoder; var map; function initialize() { var minZoomLevel = 4; var zooms = 7; geocoder = new google.maps.Geocoder(); map = new google.maps.Map(document.getElementById('map'), { zoom: minZoomLevel, center: new google.maps.LatLng(38.50, -90.50), mapTypeId: google.maps.MapTypeId.ROADMAP }); // Bounds for North America var strictBounds = new google.maps.LatLngBounds( new google.maps.LatLng(15.70, -160.50), new google.maps.LatLng(68.85, -55.90) ); // Listen for the dragend event google.maps.event.addListener(map, 'dragend', function () { if (strictBounds.contains(map.getCenter())) return; // We're out of bounds - Move the map back within the bounds var c = map.getCenter(), x = c.lng(), y = c.lat(), maxX = strictBounds.getNorthEast().lng(), maxY = strictBounds.getNorthEast().lat(), minX = strictBounds.getSouthWest().lng(), minY = strictBounds.getSouthWest().lat(); if (x &lt; minX) x = minX; if (x &gt; maxX) x = maxX; if (y &lt; minY) y = minY; if (y &gt; maxY) y = maxY; map.setCenter(new google.maps.LatLng(y, x)); }); // Limit the zoom level google.maps.event.addListener(map, 'zoom_changed', function () { if (map.getZoom() &lt; minZoomLevel) map.setZoom(minZoomLevel); }); } var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/'; function codeAddress() { $.getJSON("/Dashboard/LoadWorkerList", function (address) { var infowindow = new google.maps.InfoWindow(); $.each(address,function (index,currVal) { currVal = $(this).val(); geocoder.geocode({ 'address': currVal }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, icon: iconBase + 'man.png', position: results[0].geometry.location, title: currVal }) google.maps.event.addListener(marker, 'click', (function (marker, i) { return function () { infowindow.setContent(currVal); infowindow.open(map, marker); } })(marker, currVal)); address.push(marker); } else { alert("Geocode was not successful for the following reason: " + status); } }); }); }); return true; } window.onload = function () { initialize(); codeAddress(); } &lt;/script&gt; </code></pre> <p>This is the code for LoadWorkerList</p> <pre><code> public JsonResult LoadWorkerList() { var workerList = new List&lt;Worker_Address&gt;(); // check if search string has value // retrieve list of workers filtered by search criteria var list = (from a in db.Worker_Address where a.LogicalDelete == false select a).ToList(); List&lt;WorkerAddressInfo&gt; wlist = new List&lt;WorkerAddressInfo&gt;(); foreach (var row in list) { WorkerAddressInfo ci = new WorkerAddressInfo { ID = row.ID, Worker_ID = row.WorkerID, AddressLine1 = row.Address_Line1 + " " + row.Address_Line2+ " " +row.City + " "+ GetLookupDisplayValById(row.State_LookID), LogicalDelete = row.LogicalDelete }; wlist.Add(ci); } return Json(wlist.ToList().OrderBy(p =&gt; p.AddressLine1), JsonRequestBehavior.AllowGet); } </code></pre> <p>The Error is in this ff: codes</p> <pre><code>Uncaught TypeError: Cannot call method 'toLowerCase' of undefined v.fn.extend.val jquery-1.8.3.min.js:2 (anonymous function) $.each(address,function (index,currVal) { v.extend.each jquery-1.8.3.min.js:2 (anonymous function) currVal = $(this).val(); l jquery-1.8.3.min.js:2 c.fireWith jquery-1.8.3.min.js:2 T jquery-1.8.3.min.js:2 r </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload