javascript - "TypeError: $(...).dialog is not a function" is showing when I am trying to open the map using markicon method -
why getting error?when trying open map not showing , getting above error. please me. when not adding "jquery.min.js" working fine.but when adding map not opening @ time.when map showing "quicksearch" method not working.
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8./jquery.min.js"> </script> <script type="text/javascript" src="scripts/jquery.quicksearch.js"></script> <script type="text/javascript"> <!--quick search method--> $(function () { $('[id$=txtbdonames]').each(function (i) { alert("search running"); $(this).quicksearch("[id*=grdagentreport] tr:not(:has(th))", { 'testquery': function (query, txt, row) { return $(row).children(":eq(" + ")").text().tolowercase().indexof(query[0].tolowercase()) != -1; } }); }); }); function openpopup(popurl) { alert("map running"); winpops = window.open(popurl, "", "width=1000, height=800, left=15, top=45, scrollbars=yes, menubar=no,toolbar=no,resizable=no,directories=no,location=no") } var map = null; var infowindow; var directionsdisplay; var directionsservice = new google.maps.directionsservice(); function initializemap() { directionsdisplay = new google.maps.directionsrenderer(); var latlng = new google.maps.latlng(0.0, 0.0); var myoptions = { zoom: 13, center: latlng, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid("map"), myoptions); directionsdisplay.setmap(map); } function calcroute(start, end) { var request = { origin: start, destination: end, travelmode: google.maps.directionstravelmode.driving }; directionsservice.route(request, function (response, status) { if (status == google.maps.directionsstatus.ok) { directionsdisplay.setdirections(response); } }); } function markicons(liststring) { initializemap(); var markerarray = new array(); var locations = []; var ltlng = liststring.split('~'); var bounds = new google.maps.latlngbounds(); (var = 0; < ltlng.length; i++) { var loc = ltlng[i].split(",") var lat = parsefloat(loc[0]) var lng = parsefloat(loc[1]) var curpoint = new google.maps.latlng(lat, lng); bounds.extend(curpoint); locations.push(curpoint); } (var = 0; < locations.length; i++) { var iconpath = 'http://maps.google.com/mapfiles/ms/icons/red-dot.png'; if (i == 0) { iconpath = 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png'; } else if (i == locations.length - 1) { iconpath = 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'; } marker = new google.maps.marker({ map: map, icon: iconpath, position: locations[i] }); markerarray[i] = marker.getposition(); (function (i, marker) { google.maps.event.addlistener(marker, 'mouseover', function () { if (!infowindow) { infowindow = new google.maps.infowindow(); } if (i == 0) { infowindow.setcontent("starting point"); } else if (i == locations.length - 1) { infowindow.setcontent("ending point"); } else { infowindow.setcontent("point: " + (i + 1)); } infowindow.open(map, marker); }); })(i, marker); } var flightpath = new google.maps.polyline({ path: markerarray, geodesic: true, strokecolor: '#ff0000', strokeopacity: 1.0, strokeweight: 2 }); flightpath.setmap(map); var dil = $("#map").dialog({ autoopen: false, minheight: 500, minwidth: 1024, height: 500, width: 1024, closeonescape: true, modal: true, buttons: { "close": function () { $(this).dialog("close"); //$("#map").style.display = "none"; } } }); dil.dialog('open'); google.maps.event.trigger(map, "resize"); map.setcenter(locations[0]); } </script>
jquery included twice. removing older 1 enough solve problem.
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <script type="text/javascript" src="scripts/jquery.quicksearch.js"></script>
Comments
Post a Comment