Search Results

Search found 326 results on 14 pages for 'getjson'.

Page 3/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • fetching a url using $.getJSON and parsing it correctly

    - by sofia
    This is probably really stupid but i can't find the problem with my code. It fetches a url that returns json and the function is then supposed to return a string: function getit() { var ws_url = 'example.com/test.js'; var user = false; $.getJSON(ws_url, function(data) { alert('user '+data.user);//shows john user = data.user || false; } ); return user;//should return john but returns false } test.js will have something like this: {"id":"12","username":"ses","user":"john","error":""} or like this: {"error":"123"} I also tried if(data.user){}else{} but it didn't work either.. So what am i missing? Thanks :)

    Read the article

  • JQuery $.getJSON appends a question mark to the request URL

    - by David Neale
    I have the folliwng JSON request code on an ASP.NET MVC web application: var userID = 'id=' + $('#namesList').val(); $.getJSON('/Person/GetPerson/', userID, function(data) { $('#collar').text(data.collarNumber); $('#name').text(data.Name); $('#email').text(data.EmailAddress); }); This creates a request such as: http://localhost:48610/Person/GetPerson/?id=6. Why is there a question mark in there? I get the server error The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32'.... If I make the request manually without the question mark it works fine.

    Read the article

  • valid json still fails on IE with jquery's ajax or getJSON callbacks

    - by lock
    everytime my page loads, im supposed to create a datatable (also a jquery plugin) but when im fetching the contents, using .ajax or .getJSON always goes straight ahead to the error function, without even telling me what went wrong inside the callback $.ajax({ cache: false, type: "POST", url: oSettings.sAjaxSource, data: {'newdate' : date}, contentType: "application/json; charset=utf-8", dataType: "json", success: function(json) { console.log('retrieving json data'); }, error: function() { console.log("An error has occurred. Please try again."); } }); that's the actual code with the callback stripped for security purposes... this works fine in firefox which actually executes what's on the callback function but IE simply fails and proceeds to writing my log i've read alot that the primary reason the JSON calls fails for IE is whenever there are trailing commas or simply malformed JS but i used JSONLint already and verified that my json object is a valid one :(

    Read the article

  • jQuery Sparklines: $.getJSON data can't be read

    - by Bob Jansen
    I'm trying to generate a pie graph with Sparklines but I'm running into some trouble. I can't seem to figure out what I'm doing wrong, but I feel it is a silly mistake. I'm using the following code to generate a sparkline chart in the div #traffic_bos_ss: //Display Visitor Screen Size Stats $.getJSON('models/ucp/traffic/traffic_display_bos.php', { type: 'ss', server: server, api: api, ip: ip, }, function(data) { var values = data.views; //alert(values); $('#traffic_bos_ss').sparkline(values, { type: "pie", height: "100%", tooltipFormat: 'data.screen - {{value}}', }); }); The JSON string fetched: {"screen":"1220x1080, 1620x1080, 1920x1080","views":"[2, 2, 61]"} For some reason Sparklines does not process the variable values. When I alert the variable it outputs "[2, 2, 61]". Now the jQuery code does work when I replace the snippet: var values = data.views; with var values = [2, 2, 61]; What am I doing wrong?

    Read the article

  • pass php array to jquery with getJSON

    - by robertdd
    i want to pass a php aray to jQuery: $.getimagesarr = function() { $.getJSON('operations.php', {'operation':'getimglist'}, function(data){ var arr = new Array(); arr = data; return arr; }); } var data = $.getimagesarr(); if (data){ jQuery.each(data, function(i, val) { .... }); } it return undefined in php i have this: function getimglist(){ $results = $_SESSION['files']; echo json_encode($results); } it is possible?

    Read the article

  • Simple getJSON does not work...

    - by user54197
    JSON function(Index) does not fire. Any Ideas? <script type="text/javascript"> $(document).ready(function() { alert("This alert is displayed :("); $("form[action$='GetQuote']").submit(function() { $.getJSON($(this).attr("action"), $(this).serialize(), function(Result) { alert("This alert is not shown :("); $("#name").html(Result.name); $("#address").html(Result.address); }); return false; }); }); </script> CONTROLLERS... public JsonResult GetQuote(string dataName) { if (dataName != "" || dataName != null) return new JsonResult { Data = new Result { name = "Hello", address = "World" } }; else return null; }

    Read the article

  • getjson alternative method for variable

    - by Florian Stanek
    I made a script which gets the data from a json file and parse it. It worked on a webserver. But now I have to find a solution to get it work on a local file (file:///C:/xampp/htdocs/script/index.html) instead on a server. It only works in FF: $.getJSON('data2.json', function(data) { $.each(data.selection_form.entities, function(i,name){ ...do something }); }); Any ideas? A local webserver is not a solution.

    Read the article

  • jQuery $.getJSON: "Failed to load resource: cancelled"

    - by Alex
    I'm having problem loading a json resource from a local rails app with jQuery 1.4.4 The json is valid (based on jsonlint.com) and I can download it properly if I'm requesting it from other sources. In webkit (Safari), I got this error: Failed to load resource: cancelled Response Header on Firebug: Content-Type application/json; charset=utf-8 Set-Cookie geoloc=toulouse; path=/; Connection close Server thin 1.2.7 codename No Hup jQuery code to load json: $.getJSON("http://127.0.0.1/search_agenda", {'edition': edition, 'categories': categories}, function(data){ console.log(data); } });

    Read the article

  • asp.net mvc, jquery dialog + select + getJson (different results in ff, ie and chrome)

    - by vbobruisk
    Hi everybody. i'm using jquery 1.3.2, and have a problem in situatsuin where i fill select via getJson $.each(data, function() { $("#select_elem").append("<option value='"+this.Value+"'>" + this.Value + "</option>"); }); and after, when i try to get selected value : var sel_val = $("#select_elem"); alert(sel_val.val()); in IE it works, in FF it always shows the first value in list, in chrome it's always null. is there any way to fix this? Thank You !

    Read the article

  • using variable in DATA of getJASON Callback function

    - by asilloo
    Hi, My problem is manage the code which get the tag and use is as variable (var searchterm= ??????). With JSON I want first get the "location" tags with tagthe and show the relate photos from flickr. <!DOCTYPE html> <html> <head> <style>img{ height: 100px; float: left; }</style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <div id="images"> </div> <script> $.getJSON("http://tagthe.net/api/?url=http://www.knallgrau.at/en&view=json&callback=MyFunc",function(data){ var searchterm=data[location]; }); $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags="+searchterm+"&tagmode=any&format=json&jsoncallback=?", function(data){ $.each(data.items, function(i,item){ $("<img/>").attr("src", item.media.m).appendTo("#images"); if ( i == 3 ) return false; }); });</script> </body> </html>

    Read the article

  • Error with a getJSON call in jquery with ASP.NET MVC

    - by Jedi Master Spooky
    I have the following code in html, I cannot get the Function call back of JSON get call. Down is the code in controller. Please Help <script type="text/javascript"> $().ready(function() { $("#CuitDespachante").typeWatch({ highlight: true, wait: 500, captureLength: -1, callback: finished }); }); function finished(txt) { $.getJSON('/Documentacion/GetDatosDespachantes', { cuitDespachante: txt }, function (data) { alert('You typed: '); } ); }; </script> public ActionResult GetDatosDespachantes(string cuitDespachante) { cuitDespachante = cuitDespachante.Replace("-", "").Replace("_", ""); DepositarioFielWS.DepositarioFielWebService ws = new DepositarioFielWS.DepositarioFielWebService(); var res = ws.GetDespachante(cuitDespachante); if (res.Licencia.CodigoLicencia == DepositarioFielWS.CodigoLicencia.Ok) { DepositarioFielWS.Despachante desp = new DepositarioFielWS.Despachante(); desp.Cuit = res.Despachante.Cuit; desp.Nombre = res.Despachante.Nombre; var respuesta =new { cuit = desp.Cuit, nombre = desp.Nombre }; return Json(respuesta); } else { var respuesta = new { cuit = cuitDespachante, nombre = "Imposible Realizar Consulta" }; return Json(respuesta); } }

    Read the article

  • Can't add object to Array in jQuery's getJSON data function (scope issue)

    - by seo20
    I have a person object and wants to store it into a global ArrayCollection I have made. Works great in normal scope: var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); The problem is when I want to add people inside my jQuery function "mainFunction". I can't seem to get it right. I know it's something to do with scope and I have to wrap something in functions like in my ArrayCollection. Please help me - thanks a lot. function ArrayCollection() { var myArray = new Array; return { empty: function () { myArray.splice(0, myArray.length); }, add: function (myElement) { myArray.push(myElement); }, getAll: function () { return myArray; } } } function person(firstName, lastName, age) { this.firstName = firstName; this.lastName = lastName; this.age = parseInt(parseFloat(age)); } function mainFunction() { //.... var s = new ArrayCollection(); s.add(new person("Knud", "Mikkelsen", 35)); $.getJSON(url, function (data) { for (var x = 0; x < data.length; x++) { var myPerson = new person(data[x].FirstName.toString(), data[x].LastName.toString(), data[x].Age.toString()); s.add(myPerson); } }); alert(drawArray(s.getAll())); } function drawArray(myArray) { var v = ""; for (var i = 0; i < myArray.length; i++) { v += myArray[i].firstName + " " + myArray[i].lastName + " (" + myArray[i].age + ")\n"; } return v; }

    Read the article

  • ASP MVC Controller Method not always called from $.getJSON request

    - by johnvpetersen
    I have a controller method that returns a jSON object and in one calling situation, it works and in another calling situation, it does not work. When the URL in my browser is this: http://localhost:65247/Client -- it works. But, when my url looks like this: http://localhost:65247/Client/UserAdmin?id=6 -- it DOES NOT work In a nutshell, clients have users. From within the client, I wish to work on a specific user (this is the UserAdmin view). In this case, the client id is 6. From within the UserAdmin view that was launched with Id=6, I then wish to select a user from a dropdown. The idea was to use javascript and $.getJSON to fetch data for the specific user so as not to have to refresh the entire page. I use this approach in other parts of the app. The only difference I can see is with the URL in the browser. It would appear the presence of parameters via the '?' is futzing things up a bit. Any ideas?? Thanks in advance. John

    Read the article

  • jScrollPane jEditable DOM problems

    - by Kyle Lafkoff
    Hello world, I am having a funky problem. See (this link won't disappear): www.skitzo.org/~el/bugjeditable.png for the firebug output screenshot. Here's my code. I run getJSON() to fetch the info from the PHP which pulls from DB and I fill a div with the result. I have jScrollPane and jEditable so a user can scroll down and click to edit any of the content. It works sometimes and then it doesn't work which makes me wonder if the browser is not interpreting the code properly or if I am misunderstanding fundamental DOM concepts here.... Here is a live current version of the code: http://www.musedates.com/testing.php $().ready(function() { $('#pane1').jScrollPane(); $('#tab_journal').tabs(); $('#tab2').load("/journal_new.php"); var i=0; var row = ''; var k, v, dt; $.getJSON("/ajax.php?j=22", function(data) { row = '<p>'; while(i<data.length) { $.each(data[i], function(k, v) { if (k == 'subject') { row += '<div style="font-size:1.5em; color:#000000;"><div class="editable" style="width:705px;" id="title-'+data[i].id+'">'+v+'</div></div>posted: '+dt+'<br />'; } else if (k == 'dt') { dt = v; } else if (k == 'msg') { row += '<div class="editableMsg" style="width:705px; height:40px;" id="msg-'+data[i].id+'">'+v+'</div></p>'; } }); i++; } $('#pane1').append(row).jScrollPane({scrollbarWidth:10, scrollbarMargin:10, showArrows:true}); }); $('.editable').livequery(function () { $('.editable').editable("/savejournal.php", { submitdata : function() { }, tooltip : 'Click to edit', indicator : '<img src="/UI/images/indicator.gif">', cancel : 'Cancel', submit : 'OK' }); $('.editableMsg').editable("/savejournal.php", { submitdata : function() { }, tooltip: 'Click to edit', indicator : '<img src="/UI/images/indicator.gif">', cancel : 'Cancel', submit : 'OK', type : 'textarea' }); $(".editable,.editableMsg").mouseover(function() { $(this).css('background-color', '#FDD017'); }); $(".editable,.editableMsg").mouseout(function() { $(this).css('background-color', '#fff'); }); }); }); And then the HTML: <div id="tab_container" style="margin:0px 0px 2px 8px;"> <ul id="tab_journal"> <li><a href="#tab1"><span>View / Edit</span></a></li> <li><a href="#tab2"><span>New Entry</span></a></li> </ul> </div> <div id="tab1" style="margin:0px 0px 0px 8px;"> <div id="pane1" class="scroll-pane super-wide"></div> </div> <div id="tab2" style="margin:0px 0px 0px 8px; width:700px;"></div> Thanks world.

    Read the article

  • Charaters with jquery json

    - by Mikk
    Hi everyone, I'm using jquery $.getJSON to retrieve list of cities. Everything works fine, but I'm from Estonia (probably most of you don't know much about this country =D) and we are using some characters like õ, ü. ä, ö. When I pass letters like this to callback function, I keep getting empty strings. I've tried to base64 encode(server-side)-decode(jquery base64 plugin) strings (i thought it was a good idea as long as I can compress pages with php, so I don't have to worry about bandwidth), but in this way I end up with some random chinese symbols. What would be the best workaround for this problem. Thank you.

    Read the article

  • Characters with jquery json

    - by Mikk
    Hi everyone, I'm using jquery $.getJSON to retrieve list of cities. Everything works fine, but I'm from Estonia (probably most of you don't know much about this country =D) and we are using some characters like õ, ü. ä, ö. When I pass letters like this to callback function, I keep getting empty strings. I've tried to base64 encode(server-side)-decode(jquery base64 plugin) strings (i thought it was a good idea as long as I can compress pages with php, so I don't have to worry about bandwidth), but in this way I end up with some random chinese symbols. What would be the best workaround for this problem. Thank you.

    Read the article

  • Trying to use json to populate areas of my website using mysql, php, and jquery.

    - by RyanPitts
    Ok, so this is my first attempt at doing anything with JSON. I have done a lot with PHP and MySql as well as jQuery and JavaScript...but nothing with JSON. I have some data in a MySql database. In the codes below i am using a PHP file to retrieve the data from the MySql database and using json_encode to format it to JSON. This file is being called by the JavaScript that runs when the page loads (well, it runs on document.ready actually). I then use jQuery to access the JSON keys and values to fill in areas of the page "dynamically". Here is the code snippets i am using (excuse my "noobness" on writing these snippets, still learning all this). This is my script that is on my HTML page test.php: <script type="text/javascript"> $(document).ready(function(){ $.getJSON("json_events.php",function(data){ $.each(data.events, function(i,events){ var tblRow = "<tr>" +"<td>" + events.id + "</td>" +"<td>" + events.customerId + "</td>" +"<td>" + events.filingName + "</td>" +"<td>" + events.title + "</td>" +"<td>" + events.details + "</td>" +"<td>" + events.dateEvent + "</td>" +"<td><a href='assets/customers/testchurch/events/" + events.image + "'>" + events.image + "</a></td>" +"<td>" + events.dateStart + "</td>" +"<td>" + events.dateEnd + "</td>" +"</tr>" $(tblRow).appendTo("#eventsdata tbody"); }); }); $.getJSON("json_events.php",function(data){ $.each(data.events, function(i,events){ $("#title").html("First event title: " + events.title + " ..."); }); }); }); </script> This is the code for the php file being called by the above JS: json_events.php <?php require_once('includes/configread.php'); $arrayEvents = array(); $resultsEvents = mysql_query("SELECT * FROM events"); while($objectEvents = mysql_fetch_object($resultsEvents)) { $arrayEvents[] = $objectEvents; } $json_object_events = json_encode($arrayEvents); $json_events = "{\"events\": " . $json_object_events . " }"; echo $json_events; require_once('includes/closeconnread.php'); ?> This is my JSON that is held in the variable $json_events from my php file json_events.php: { "events": [ { "id": "2", "customerId": "1004", "filingName": "testchurch", "title": "Kenya 2011 Training Meeting", "details": "This meeting will be taking place on Sunday, February 10th @ 6pm. Get ready for our annual Kenya trip in 2011. We have been blessed to be able to take this trip for the past 3 years. Now, it's your turn to bless others! Come to this training meeting to learn how to minister to the people in Kenya and also learn what we'll be doing there.", "dateEvent": "2011-02-10", "image": "kenya2011.jpg", "dateStart": "2010-09-04", "dateEnd": "2011-02-10" }, { "id": "6", "customerId": "1004", "filingName": "testchurch", "title": "New Series: The Journey", "details": "We will be starting our new series titled "The Journey". Come worship with us as we walk with Paul on his 2nd missionary journey.", "dateEvent": "2011-01-02", "image": "", "dateStart": "2010-09-06", "dateEnd": "2011-01-02" } ] } This is my HTML on test.php: <table id="eventsdata" border="1"> <thead> <tr> <th>id</th> <th>customerId</th> <th>filingName</th> <th>title</th> <th>details</th> <th>dateEvent</th> <th>image</th> <th>dateStart</th> <th>dateEnd</th> </tr> </thead> <tbody></tbody> </table> <div id="title"></div> I have two questions really... Question 1: Does this code look like it is written correctly at first glance? Question 2: I want to be able to select only the title from the first event in the JSON array. The code i am using now is selecting the second events' title by default it seems. How can i accomplish this?

    Read the article

  • MYSQL Data -> PHP arrays -> Javascript (or Jquery) How can I pass the data with JSON ?

    - by Alex
    I am starting with a new site (it's my first one) and I am getting big troubles ! I wrote this code <?php include("misc.inc"); $cxn=mysqli_connect($host,$user,$password,$database) or die("couldn't connect to server"); $query="SELECT DISTINCT country FROM stamps"; $result=mysqli_query($cxn,$query) or die ("couldn't execute query"); $numberOfRows=mysqli_num_rows($result); for ($i=0;$i<$numberOfRows;$i++){ $row=mysqli_fetch_assoc($result); extract($row); $a=json_encode($row); $a=$a.","; echo $a; } ?> and the output is as follows : {"country":"liechtenstein"},{"country":"romania"},{"country":"jugoslavia"},{"country":"polonia"}, which should be a correct JSON outout ... How can I get it now in Jquery ? I tried with $.getJSON but I am not able to fuse it properly. I don't want yet to pass the data to a DIV or something similar in HTML. Alex

    Read the article

  • jQuery JSON .each problem

    - by Aran
    I have a JSON object that looks like this. [ { "id" : "23", "event_id" : "0", "sport_title" : null, "event_title" : null, "title" : "Under 1 day!", "content" : "It\\'s all hotting up and battle commences in under one day!", "link" : "" }, { "id" : "20", "event_id" : "0", "sport_title" : null, "event_title" : null, "title" : "Getting Exciting", "content" : "Less than two days till it all kicks off, with cricket....", "link" : "" }] and I am trying to get the details out of this JSON Object and prepend them to a <ul> the code that I am currently trying looks like this and is having problems var writeup_list = writeuplist; $.getJSON('../json/getWriteups.json', function(data) { $.each(data.items, function(i, item) { writeup_list.html(function() { var output; output = '<li><a href="/writeups/index.php#writeup_' + item.id + '">'; if(item.sport_title != null) { output += item.sport_title + ' - '; } output += item.title + '</a></li>'; return output; }); }); }); writeuplist is just the ul object. I am also worried about overriding information that is already in the list or just adding again. Don't want to keep adding the same data. What is a good way to avoid this? I seem to be having a problem in getting the data out of the JSON file I believe it has something to do with the way am trying to access it in the .each function. Can anyone spot where am going wrong?

    Read the article

  • OpenCalais API using jQuery

    - by Varun
    Hi I've wanted to do some language processing for an application and have been trying to use the OpenCalais API. The call to the API works perfectly and returns data. The problem is that even though I can see the data in the firebug, I cannot access it because the callback never triggers. Details: the call requires callback=? as it is a JSONP request. so callback=foo SHOULD call the foo method once the data is returned, it doesn't. in fact, if callback is anything other than ? the call fails and doesn't return any data. (i've also checked JSLint to make sure the returned JSON is valid). tried using $.ajax instead of $.getJSON so that I can get an error callback, but neither the success or error callbacks fire. in firebug, usually when you make a JSON request, the request shows up in the console. In this case, the request doesn't show up in the console, but instead shows in the "Net" tab in firebug...dunno what that means, but somehow the browser doesn't think its an XHR request. any ideas? thanks.

    Read the article

  • callback execution order in jQuery getJSON

    - by lau
    I'm trying to implement a iGoogle like dashboard interface using widgets that get their content from other sites using JSONP calls. The problem is that if the first widget that calls the "$.ajax" takes 8 seconds to get the content back, it seems that the callbacks of the other widgets will only be called after the callback of the first widget gets executed. For the user experience, it would be better if the widgets could be displayed as soon as they get the content back from the remote sites, and not wait for those that were scheduled before to complete. Is there a way I can do that?

    Read the article

  • Retrieving data from enumerated JSON sub arrays in Javascript without getJSON

    - by Archie Ec
    I'm new to JSON and ajax, but i'm trying to access data in an array where the items are enumerated in a sub array within another sub array. So, I can access without issues data.items[0].details.specs.name data.items[0].details.specs.id etc But I run into problems with I try to access something like data.items[0].details.specs[1].name data.items[0].details.specs[1].id data.items[0].details.specs[2].name data.items[0].details.specs[2].id etc Can anyone point me in the right direction on how to access this second aspect? Thanks.

    Read the article

  • jquery getjson works fine in mac, and fails in windows

    - by viper
    this code loads the data jQuery.ajax({ type: "GET", url: "getOptionsJson.php", cache: false, dataType: "json", data: "config_id="+config_id, success: function(json) { jQuery.extend(dataArr, json.ajax); jQuery.extend(opts, json.ajax2); printResult(config_id); }, error: function() { alert('Error. Please try again'); location.reload(); } }); this code generates it <?php header('Content-type: application/javascript'); echo json_encode(array( "ajax" => array(1 => "test", 2 => "test 2"), "ajax2" => array(1 => "test 3", 2 => "test 4") ); ?> when im working on mac, everything goes fine, but today i tried it on widnows, and it doesnt work. the code flows like its success, but opts and dataArr are null i tried all headers (application/json, text/html, etc) i checked if getOptionsJson.php is called correctly via mail function filnally firebug says that im getting response, but theres no content and file is just 1kb i tried even changing datatype to xml, still fails ie gives a hint, it says 'there's error on site' which reffers to 127 line of jquery file any idea?

    Read the article

  • getJSON and variable scope in javascript

    - by nillls
    Hi! In order to make function calls to our back-end php code we've implemented something called an ActionProxy like this: function ActionProxy(action, input, callback){ $.post("ActionProxy.php?method="+action, { data: input}, function(data, textStatus, XMLHttpRequest){ //return data.ResponseWhatever } }); The problem we're having is that using data outside the ActionProxy is impossible due to variable scope limitations (we assume), setting var res = data.ResponseWhatever or return data.ResponseWhatever is pretty futile. How would one handle these responses most appropriately so that functions calling the actionproxy can access the response values?

    Read the article

  • ASP.NET MVC Consume JSONResult in Bing Maps API

    - by rockinthesixstring
    I know there are a few topics on this, but I seem to be fumbling my way through with no results. I'm trying to use a controller to return JSON results to my Bin Maps functions. Here's what I have for my controller (yes it is properly returning JSON data. Function Regions() As JsonResult Dim rj As New List(Of RtnJson)() rj.Add(New RtnJson("135 Bow Meadows Drive, Cochrane, Alberta", "desc", "title")) rj.Add(New RtnJson("12 Bowridge Dr NW, Calgary, Alberta, Canada", "desc2", "title2")) Return Json(rj, JsonRequestBehavior.AllowGet) End Function Then in my script I have this, but it's not working. <script type="text/javascript"> var map = null; var centerLat = 51.045 ; var centerLon = -114.05722; var json_object = $.getJSON("<%: Url.Action("Regions", "Events")%>"); function LoadMap() { map = new VEMap('bingMap'); map.LoadMap(new VELatLong(centerLat, centerLon), 10); $.each(json_object, function () { alert(this.address); //this alert is returning "address is undefined" StartGeocoding(this.address, this.title, this.desc); }); } function StartGeocoding(address, title, desc) { map.Find(null, // what address, // where null, // VEFindType (always VEFindType.Businesses) null, // VEShapeLayer (base by default) null, // start index for results (0 by default) null, // max number of results (default is 10) null, // show results? (default is true) null, // create pushpin for what results? (ignored since what is null) true, // use default disambiguation? (default is true) false, // set best map view? (default is true) GeocodeCallback); // call back function } function GeocodeCallback(shapeLayer, findResults, places, moreResults, errorMsg) { var bestPlace = places[0]; // Add pushpin to the *best* place var location = bestPlace.LatLong; var newShape = new VEShape(VEShapeType.Pushpin, location); var desc = "Latitude: " + location.Latitude + "<br>Longitude:" + location.Longitude; newShape.SetDescription(desc); newShape.SetTitle(bestPlace.Name); map.AddShape(newShape); } $(document).ready(function () { LoadMap(); }); </script>

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >