/    Sign up×
Community /Pin to ProfileBookmark

Problem running JSPs with a for loop

Hello. I am having trouble running JSPs in a for loop in my JavaScript code.

My goal is to send a large results set from JavaScript to a JSP that can write the results to a text file. I send the results from JavaScript to JSP by changing the location of a hidden frame to the JSP URL with parameters included (parent.BlankFrame.location = test.jsp?RESULTS=[results]).

Due to length limits for a URL, I can’t send the entire results set at once. Therefore, I have to parse the results into a size that a URL can handle and send them to the JSP in chunks.

To do this, I have a for loop which puts the chunks of results into an array. I then send each part of the array to my JSP (parent.BlankFrame.location = test.jsp?RESULTS=resultsArray[x]).

When running my code, only the first chunk gets sent to the JSP. Strangely, if I put alerts in my for loop, all chunks of the results are transferred to the JSP. However, I would like all chunks transferred without alerts.

If anyone has any ideas or suggestions I would greatly appreciate it. Thank you.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @TMG77 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...