15,949,741 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by klein_jnr (Top 7 by date)
klein_jnr
12-Dec-13 8:16am
View
I need attributes like Dog Food,Rand,Distance to belong to one Shopname:Shoprite and all the other details to another SHopName :spar it like Shopname:Shoprite has to be a parent container to Name,Rand,Distance and SHopname:Spar has to be a parent container to Name,Rand,Distance too
klein_jnr
12-Dec-13 7:06am
View
This only shows one results in other words it only returns one array this is what it returns ShopName :Shoprite
Name : DogFood
Rand :150
Distance in Km :8309559.355265908 and does not return the secound one like this(reults that are not displayed ) ShopName :Spar
Name : DogFood
Rand :100
Distance in Km :16471269.62219214 i need to return both these results but they shouldnt be clustered first result must alone and visa versa
klein_jnr
12-Dec-13 6:37am
View
Okay thank you so much here there working code
function GetProductDetails(barcodeId,coords)
{
$.getJSON("api/products/?barcodeId=" + barcodeId + "&latitude=" + coords.latitude + "&longitude=" + coords.longitude)
.done(function (data) {
$('#result').append(data.message)
console.log(data)
var list = $("#result").append('<ul></ul>').find('ul');
$.each(data.results, function (i, item)
{
if (data.results == null) {
$('#result').append(data.message)
}
else {
list.append('<li>ShopName :' + item.retailerName + '</li>');
list.append('<li>Name : ' + item.productName + '</li>');
list.append('<li>Rand :' + item.price + '</li>');
list.append('<li>Distance in Km :' + item.Distance + '</li>');
}
});
$("#result").append(ul);
});
}
klein_jnr
12-Dec-13 3:51am
View
Thank you so much Talip, i managed to display everything the way you told me to go about like this. Product Details
Thank you for shopping with us details will be sent to you shortly
ShopName :Shoprite
Name : DogFood
Rand :150
Distance in Km :8309559.355265908
ShopName :Spar
Name : DogFood
Rand :100
Distance in Km :16471269.62219214 but now i need to to separate the list in two parts for readabilty purposes, so that if there are many shops that have the searched product the shopname with all the other items will be added but they should be grouped together i tried the </br> tags but just makes spaces between each item and dont make spaces between two groups, your help is appriciated i am very new to all this
klein_jnr
12-Dec-13 2:07am
View
Thank you Tadit no i dont see my data on my console and i would also like to know how i would iterate or go through each object while using the code that you showed me because my data result object is an array of 2 using something like $.each(data, function (key, item) and i only see undefined appearing on my html page as my list,Thank you for your help
klein_jnr
24-Oct-12 10:42am
View
@richard no i am not the same the same person that did answer that question
klein_jnr
24-Oct-12 6:12am
View
@jhetal i did use now i just need to create a dynamic loop to join lines of different segment thanks so i need to knw that dynamic looping if u able to help thanks
Show More