A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
JSP
Author
JSTL loop through jQuery array
Kevin P Smith
Ranch Hand
Joined: Feb 18, 2005
Posts: 362
posted
Jul 29, 2010 05:44:57
0
Hi
I have a jQuery function that builds an array of hyperlinks that I then need to display out onto screen
The array is built from the following:-
var thumbnails = new Array(); $.each(data.photoset.photo, function(i,photo){ var link = ""; link+= '<li><a target='viewer' rel="nofollow">'; link+= '<img border='0' />'; link+= '</a></li>'; thumbnails.push(link); }
Then in a div in my page I was hoping for something like:-
<c:forEach items='${thumbnails}' var='item'> ${item} </c:forEach>
But the links are simply not appearing, so I'm guessing the JSTL can not see the jQuery thumbnail array.
Any advice would be appriciated.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
Jul 29, 2010 05:59:54
0
...
JSTL is executed entirely on the server side before the client even sees the page.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56232
13
I like...
posted
Jul 29, 2010 07:42:59
0
You might want to read
this article
to understand how
JSP
works and to understand why things happen in a different order than you are expecting.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://aspose.com/file-tools
subject: JSTL loop through jQuery array
Similar Threads
How to populate Dropdownlist from database
How to get jsp:param
cannot iterate over same Result more than once
jQuery -- add remove list item
Problem with struts-menu for second level submenu
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter