I currently have an assignment that is really pushing my limits so I need some help on how to approach this.

  1. We have a set of 25 results
  2. We are using a jquery plugin to vertically scroll through these 25 results, the container displays five results at a time.
  3. When viewing the source code of the page, you can see the html for all 25 results. Obviously the jquery plugin is what is making them visible or not.
  4. The task is to make it so that only five of the result set are displaying at any time during a source code viewing. All the rest of the results must come from javascript or some other technique.

So I somehow have to either:

  1. Send a pool of 25 results to JS and have it generate the div info on the fly OR
  2. Some type of timed script that grabs five results at a time and displays them. But this all has to continuously scroll vertically so that is a consideration also.

So I am trying to get my head around how I should approach this: One idea I had was to run an ajax call every five or ten seconds that has a php script generate five new results, then display them in the appropriate div. This is slow and would basically mean a page that is constantly sending out ajax calls. the random results are coming from a php script that is parsing an xml feed.

I am really just looking for a roadmap or some conceptual directions on how this could be approached.

  • So what you want is "5 elements present in the DOM at any given time", as opposed to "25 elements in the DOM but all except 5 hidden via CSS"? This sounds like performance optimisation.
    – Kos
    Commented Oct 6, 2013 at 16:39

1 Answer 1


This is not a Obfuscation issue. Obfuscation is when you let the user see the code but try to make it difficult to understand.

I think your option 1 works best.

Don't load any of the results to the Page using server side code that generates HTML. Make an AJAX Call to dynamically get and add the results to the page at run time. Since you are Uning JQuery See jQuery.ajax()

NOTE: There is no way to allow a Good hacker to viewing your results on screen while eliminating his ability to programtically get the results.

  • Yes, already using jquery ajax and I am already working your answer with good results. Seems like I can have ajax call the script to get the results, then parse the return into what I need an use something like .append to generate results on the fly. At least that is what I am working with at the moment. Comments on obfuscation and good hackers noted!
    – absentx
    Commented Feb 20, 2012 at 19:29
  • 1
    Even a very moderate hacker would be able to see what's going on using some kind of DOM inspection utility. Commented Feb 20, 2012 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.