rpnzl / jquery-lazyjson Goto Github PK
View Code? Open in Web Editor NEWLoad and display JSON easily and dynamically
License: MIT License
Load and display JSON easily and dynamically
License: MIT License
Showing following error
name: "invalidMainElement", type: "error", data: "The main object [object Object] does not exist.
JSON API output :
[{"id":557,"data":{"li_class":"top_none ","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo3.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo3.jpg&w=300&h=250&zc=1","post_title":"Test New gallery"}},{"id":293,"data":{"li_class":"top_none ","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg&w=300&h=250&zc=1","post_title":"gallery 6"}},{"id":292,"data":{"li_class":"top_none third","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo2.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo2.jpg&w=300&h=250&zc=1","post_title":"gallery 5"}},{"id":291,"data":{"li_class":"top_none ","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo3.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo3.jpg&w=300&h=250&zc=1","post_title":"gallery 4"}},{"id":290,"data":{"li_class":"top_none ","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg&w=300&h=250&zc=1","post_title":"gallery 3"}},{"id":289,"data":{"li_class":"top_none third","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/10/gallery_thumb12.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/10/gallery_thumb12.jpg&w=300&h=250&zc=1","post_title":"gallery 2"}},{"id":18,"data":{"li_class":"top_none ","photo_image":"http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg","pimage":"http://emaratfm.wpengine.com/wp-content/themes/adrn/timthumb.php?src=http://emaratfm.wpengine.com/wp-content/uploads/2014/09/photo11.jpg&w=300&h=250&zc=1","post_title":"adrn gallery"}}]
Hi, in the template, what's the syntax for accessing nested arrays in objects?
I am using this feed in a dev site currently, and it works fine except on IE. It doesn't seem to be dependant on the version, it just seems to not like IE at all. Any ideas why this might be and how to fix?
Hello ,
i followed your demo , and i have the folowing issues in debug mode :
Object {name: "currEvent", type: "error", data: "The event is not defined in pagination settings."}
vendor.js:7 Object {name: "pagination", type: "notice", data: Object}
vendor.js:7 Object {name: "options", type: "notice", data: Object}
Thank you
Hello,
I am using lazyjson and responsive equal height grid https://github.com/Sam152/Javascript-Equal-Height-Responsive-Rows plugin. I am also using bootstrap for my site. When using lazyjson the equal height is not applying for rows. I am using two column row layout. Can you help me for solving the issue as the website is live and client needs solution ASAP. Please check http://www.turjenter.no/blogg/ link.
Thanks,
Sushant Khadilkar
How do you write login into the templates?
I've tried single and double brackets for an if statement.
{if (data.image !== "")}
<div class="image">
<a href="/events/{{data.id}}/"><img src="{{data.image}}" /></a>
</div>
{{/if}}
{if (data.image !== "")
<div class="image">
<a href="/events/{{data.id}}/"><img src="{{data.image}}" /></a>
</div>
{/if}
Any help would be appreciated.
I followed your tutorial pretty much to a t, but couldn't get this working. I was hoping to use this library to paginate through an api that has next links, like the itunes reviews url. I now realize that I can't do that with this api, but was wondering if you could tell me why this doesn't work...
html
<div id="ratings" class="row small-up-1 medium-up-2 large-up-3">
<div class="column" id="template-ratings">
<div class="callout">
<p>{{feed.entry.title.label}}</p>
</div>
</div>
<!-- /template -->
</div>
my js file
(function($){ $( 'div#ratings' ).lazyjson({ api: { uri: 'https://itunes.apple.com/rss/customerreviews/id=284882215/json', method: "jsonp" }, debug: true }); })(jQuery);
console
And here's what I'm getting in the console...
Object {name: "currEvent", type: "error", data: "The event is not defined in pagination settings."}
Object {name: "pagination", type: "notice", data: Object}
Object {name: "options", type: "notice", data: Object}
I have recently cloned and scraped the origina rpnzl.com site in an attempt to copy your JSON lazy loading portion of your lasyjson DEMO.
The error returned was the result of so-called mixed content: HTTPS scheme with http URLs in the content i.e.
api: http://rpnzl.com/api/names
Will cause the error. Is there a workaround?
Thank you for this plugin.
But i tried all the demos in your website, but not working. it only returns :
{{data.first_name}} {{data.last_name}}.
ID: {{id}}
Any help would be appreciable.
Thank you
You do not say what to do with the {{template}} as this does not render on the page.
How do you get the data object back to work with it on the page?
Hi,
I's it possible to change the way of loading more items? In one of your example we can load more items by clicking "show more" button but then all current items are replaced by new one. Id like to just add let say 20 more items to existing one instead replacing them. So when page is loaded you can see 20 items, click button "show more" and then you can see 40 items, 60 items etc.
Thanks for your help!
Hi, how can I pass a variable containing a json string rather than uri? Great plugin, thanks.
This works as regular html+jQuery
<ul id="buttons">
<li id="template-buttons" style="display:none;">
<span>{{value}}</span>
</ul>
But when converted to jQuery Mobile Listview, it does not work any more:
<ul id="buttons" data-role="listview">
<li id="template-buttons" style="display:none;">
<span>{{value}}</span>
</li>
</ul>
This is the js code
$( 'ul#buttons').lazyjson({
loaderImg: 'js/libs/jquery-mobile/images/ajax-loader.gif',
effect: 'slideDown',
pagination: {
active: true,
pages: 1,
count: 10
},
api: {
uri: 'http://gd.geobytes.com/AutoCompleteCity?q=phi'
}
});
Any Ideas?
Use of '{{ variable }}' to display the parsed json object's data conflicts with twig template engine's '{{ variable }}' syntax
It looks like this is not in development any more but I thought I would ask a question about the template. I have a structure like this:
<ul id="imageGallery">
<!-- template -->
<li id="template-imageGallery" class="light" data-thumb="{{slide.thumb}}" data-iframe=" {{slide.iframe}}" data-src="{{slide.Ssrc}}" data-sub-html="{{slide.subhtml}}" data-description=" {{slide.description}}">
<img data-thumb="{{slide.thumb}}" class="img-responsive" src="{{slide.thumb}}" alt="{{slide.label}}" /> </li>
<!-- /template -->
</ul>
My problem is I need the 'li' to contain json data as well. Is there a way to do this or am I stuck?
Cannot use the response in html data attribute.
For example, the {{id}} is showing literal value instead of reference value in the data-id attribute
ID: {{id}}
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.