kevindb / jquery-load-json Goto Github PK
View Code? Open in Web Editor NEWjQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM
License: GNU Lesser General Public License v2.1
jQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM
License: GNU Lesser General Public License v2.1
1. Downloaded the source from the svn repository.
2. Attempted to load list.html and hierarchy.html into Safari, Firefox, and
Chrome.
3. Neither page loads the JSON in either browser.
What is the expected output? What do you see instead?
I expect the page to load as it does when viewed on your web site.
What version of the product are you using? On what operating system?
Latest jquery-load-json from repository.
Mac OS X 10.9.4
Safari 7.0.6
Chrome 36.0.1985.143
Firefox 31.0
Please provide any additional information below.
Also tried replacing the very old jQuery (1.6.4) with the current release
(2.1.1), with no better results.
Original issue reported on code.google.com by [email protected]
on 14 Aug 2014 at 4:47
What steps will reproduce the problem?
1. Adding jQuery callbacks on generated HTML
What is the expected output? What do you see instead?
I am using a <img> template with class n id as "imgUrl", when I do a
$("imgUrl").slideToggle(); only the first img gets the event. How should I
identify each element other than using .next()?
What version of the product are you using? On what operating system?
1.1
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 3 Jun 2011 at 1:54
What steps will reproduce the problem?
1. Add in a form <input id="ffind" type="date">
<input id="ffint" type="time">
2. load Json
3. verify
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Jquery Mobile 1.4.5 test with Crome
Please provide any additional information below.
The solution is
change
case 'text':
case 'hidden':
with:
case 'text':
case 'date':
case 'time':
case 'hidden':
Original issue reported on code.google.com by [email protected]
on 18 Jan 2015 at 9:08
1.2.5.mod.1
-----------
Removed unused mobile option
Added option to avoid init method execution (to solve problem when used with other jQuery plugins -jQuery Form Plugin-)
Added option to implement custom onSetValue method (so you can change default behavior for specific fields)
Replaced $().attr("value", newVal) with $().val(newVal) (to solve problem when used with other jQuery plugins -jQuery Form Plugin-)
Original issue reported on code.google.com by rubensa
on 24 Apr 2013 at 9:59
Attachments:
Added some HTML5 Elements ('email','url','date','datetime','time','number')
Original issue reported on code.google.com by [email protected]
on 26 Sep 2012 at 10:38
Attachments:
What steps will reproduce the problem?
1. Have a JSON file with text that matches a select element.
2. Load that JSON file in IE9.
3. The selection is not changed.
What is the expected output? A field from my JSON that matches an option value
should select that value. What do you see instead? Nothing is selected.
What version of the product are you using? 1.0.0 On what operating system?
Windows Vista 64 bit using Internet Explorer 9
Please provide any additional information below.
Change the code to this:
case 'select-one':
case 'select':
for (var i = 0; i < element.options.length; i++) {
element.options[i].selected |= element.options[i].value == value;
}
break;
case 'text':
Original issue reported on code.google.com by [email protected]
on 18 Dec 2013 at 7:59
What steps will reproduce the problem?
1. create form with checkbox
2. load json containing checkbox checked = true
3. load json containing checkbox checked = false
What is the expected output?
checkbox should be unchecked
What do you see instead?
checkbox still checked
What version of the product are you using? On what operating system?
1.0.0
Please provide any additional information below.
to correct use following code:
case 'checkbox':
if (value)
$(element).attr("checked", "checked");
else
$(element).removeAttr("checked");
break;
Original issue reported on code.google.com by [email protected]
on 21 Jun 2012 at 5:07
First off, Great code - A HUGE time saver!
I have found that some Hierarchical data scenarios cause your code to produce
unexpected results. It looks like a bug with the scope of your variables in
the BrowseJSON() function source lines 120,128, and 140 your for() loops do not
have var declarations to make them local on the counters (iExist, iCreate and i
respectively), which when called iteratively can cause some unexpected
duplication of parent rows due to the lingering of previous values.
Once those are made local, things appear to work okay.
Thanks for the code!
Original issue reported on code.google.com by [email protected]
on 11 Sep 2011 at 2:58
What steps will reproduce the problem?
1. I downloaded all the project files(include sub folders and files) to my
folder named "demo"
2. Set "demo" webshare name "loadjson"(I have IIS installed on my computer)
3. In my browser(chrome), "http://localhost/loadjson/list.html" doesn't load
JSON object into the DOM.
What is the expected output? What do you see instead?
http://jquery-load-json.googlecode.com/svn/trunk/list.html works fine.
http://localhost/loadjson/list.html doesn't work well.
What version of the product are you using? On what operating system?
jquery.loadJSON.js
Version: 1.1.0.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 30 Apr 2011 at 2:34
What steps will reproduce the problem?
1. create a form with some text inputs and a text area
2. enter data in the form; make sure to hit the Enter key inside the text area
3. submit the form
4. do some processing on the form input and redisplay the form
What is the expected output? What do you see instead?
I expected to see the inputs displayed on the form. All the inputs are blank.
What version of the product are you using? On what operating system?
1.0.0. Windows, Linux
Please provide any additional information below.
If I view the source for the page I can see the JSON data is constructed
correctly. Including the CR LF for the Enter key.
Original issue reported on code.google.com by [email protected]
on 2 Oct 2013 at 2:08
Hi,
This is not actually an issue - just a notification.
I decided to resurrect my original loadJSON code and I'm maintaining it here:
https://github.com/JocaPC/jquery-view-engine
I have created a new project because I have removed some features such as selecting elements by rel attribute, I'm binding elements by classes that have bind- prefix, not supporting Url as an argument because I want to separate loading via Ajax from template code, etc. Due to backward compatibility I'm not claiming that the new code is just a new version of loadJSON.
You are free to use this version as your own and maintain it if you want or you can switch to new code. If you continue to use your fork, could you just for test reasons try to put my new version of library into some of your projects and let me know does it works.
Thanks,
Jovan Popovic
Hi,
I use the v. 1.2.5. on Windows 7 Pro.
Please goto http://www.jslint.com/ for validation test code.
This code run fine, but the syntax code is very poor,
and total errors not permit minify of code.
Problem at line 1 character 367: Too many errors. (100% scanned).
Thank you for your work.
Bye,
Claudio
Original issue reported on code.google.com by [email protected]
on 27 Nov 2011 at 8:34
Hi Kevin,
Thanks for maintaining this component, I have found several exports of original source, but it seems that you are the only one who is fixing issues. I would like to help if possible.
There might be a licencing problem with your copy.
Licence of original code is dual (BSD or GPL) and you have retained this in the source code; however, you stated on project home that the licence is GPL. If you look at the original slte https://code.google.com/p/jquery-load-json/ you will see that primary licence is BSD (in the left side).
The main difference is that with BSD people can use it in commercial software without need to make it GPL or to use other GLP components only. Primary BSD licence is chosen because we should not have any restriction.
It might be even better to change licence to MIT since it depends on jQuery, which is licensed under MIT licence. This might avoid any misunderstanding such as duality of licences.
Regards,
Jovan Popovic
What steps will reproduce the problem?
1. The version 1.0.0 wasn't working with multiple check boxes
2. The version 1.0.0 wasn't properly populating the text areas
What is the expected output? What do you see instead?
For the checkbox it was limited for one true/false value per field.
The textarea wasn't showing the updated value
What version of the product are you using? On what operating system?
Firefox 2.5
Please provide any additional information below.
I have changed the code in order to fix the issues and add this functionality.
For the checkboxes to work it needs to be initially (before load values) all
unchecked - for me it works this way.
Please help testing validating. It would be good if it was possible to publish
it as a new version.
Original issue reported on code.google.com by [email protected]
on 10 Feb 2014 at 9:02
Attachments:
Would you consider putting this on https://cdnjs.com ?
Hi Kevin, first of all, thank you for taking the effort to maintain this library.
I'm currently encountering a scenario where the library does not work. In essence, when I have the following (for the purpose of having a default value instead of "" when no checkbox is selected aka Ms MVC checkbox), jquery-load-json does not work:
<input type="checkbox" name="PreferencePrimary" value="P1" />P1
<input type="checkbox" name="PreferencePrimary" value="P2" />P2
<input type="hidden" name="PreferencePrimary" value="XXX" />
To enhance the library to support this, I've made the following changes.
Add before line 274 (v1.3.1)
else if (element.length > 0 && element.filter('input:hidden').length > 0 && element.filter(':checkbox').length > 0) {
element.filter(':checkbox').each(function () {
setElementValue(this, obj, name);
});
} else if (element.length > 0 && element[0].type == 'checkbox') {
And line 318-328 (v1.3.1)
var value = obj;
var type;
if (element.length > 0) {
if (element.filter('input:hidden').length > 0 && element.filter(':checkbox').length > 0) {
setElementValue(element.filter(':checkbox').first()[0], obj, name);
} else {
var i = 0;
for (i = 0; i < element.length; i++) {
setElementValue(element[i], obj, name);
}
}
} else {
setElementValue(element, obj, name);
}
Thanks! Please accept my thanks for reviewing the code and apologies if I'm not adhering to any protocol since I'm still pretty new to Github.
What steps will reproduce the problem?
1. Create multiple HTML text inputs such as <input type="text"
name="element[0][0]"> where element has multiple dimensions (element[3][4])
2. Get a JSON response with a multidimension array such as:
Object {…}
elements: Array[7]
0: Array[6]
0: "apple"
1: ""
3. What is the expected output? What do you see instead?
I expect to see the input elements populated with the data from the array (e.g.
element[0][0] = 'apple').
Instead a GET request is performed which results in a 403 response. The request
is not to a page but just the current directory and is suffixed with some HTML
(e.g.
http://domain/myDir//<!DOCTYPE%20html><!--[if%20lt%20IE%207]>%20%20%20%20%20%20.
..
What version of the product are you using? 1.0.0
On what operating system? Linux Webserver
Please provide any additional information below.
Sorry I don't have a solution.
Original issue reported on code.google.com by [email protected]
on 25 Dec 2013 at 1:09
We use this plugin extensively, recently updated to the latest 1.3.3 version to support HTML5 elements too.
While loading the form with the json data if one of the properties has a null value then we get this issue. Never occurred with the older version.
Uncaught TypeError: Cannot read property 'constructor' of null
at h (jquery.loadJSON.min.js:18)
at h (jquery.loadJSON.min.js:18)
at HTMLFormElement.<anonymous> (jquery.loadJSON.min.js:18)
on https://github.com/kevindb/jquery-load-json/wiki/WorkingWithFormElements
The live example page section doesn't work.
What steps will reproduce the problem?
1. select is not working
What is the expected output? What do you see instead?
i am using "select option", but its not changing the value and keeping the
default value.
What version of the product are you using? On what operating system?
i am using v1.0
Please provide any additional information below.
i have checked the code and found out, its setting the value using attr(),
which is not giving desired results in case of select.
So i have changed the case for select as followed -
case 'select':
$(element).val(value);
break;
Original issue reported on code.google.com by [email protected]
on 24 Feb 2015 at 3:27
What steps will reproduce the problem?
1. An HTML div with an id of 'tmd_charge_flag'
2.
3.
What is the expected output? What do you see instead?
Instead of the field being populated with JSON data it is not populated
What version of the product are you using? On what operating system?
v1.0.0
Please provide any additional information below.
I'm not sure if its the length or a combination of the length and the
underscores?
Original issue reported on code.google.com by [email protected]
on 9 Apr 2014 at 2:22
What steps will reproduce the problem?
1. input type color doesnt get populated with the json data
2. <input type="color" name="color_lo_idx" id="color_lo_idx" value="#00ff00"/>
3.
What is the expected output? What do you see instead?
Instead of the field being populated with JSON data it is not populated
What version of the product are you using? On what operating system?
v1.0.0
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 1 Aug 2014 at 6:47
We use this plugin extensively, recently updated to the latest 1.3.3 version, and are facing this issue
`Uncaught TypeError: Cannot read property 'constructor' of null
at h (jquery.loadJSON.min.js:18)
at h (jquery.loadJSON.min.js:18)
at HTMLFormElement.<anonymous> (jquery.loadJSON.min.js:18)
at Function.each (jQuery-2.1.4.min.js:2)
at n.fn.init.each (jQuery-2.1.4.min.js:2)
at n.fn.init.a.fn.loadJSON (jquery.loadJSON.min.js:18)
at loadModal (queueConfiguration.js:82)
at HTMLAnchorElement.onclick (queueConfigurationList.html:1)`
What steps will reproduce the problem?
1. Get phone number from server in this format: 8888888888
2. Want to display it in the UI in this format: 888-888-8888
3. But the name tag is binded with the bean class on the server
What is the expected output? What do you see instead?
I see the same display data of the server
What version of the product are you using? On what operating system?
Please provide any additional information below.
Is there a way in which we can manipulate the data thats coming from the server
and then display it on the UI page
Original issue reported on code.google.com by [email protected]
on 1 May 2014 at 7:02
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.