Hey there programming peps! I have a question re: jQuery. We have a software application that is producing a very large HTML report… large on the order of 500-2000 printed pages. It can take Google Chrome between 12-20 seconds to load it from the hard drive.
There is a some JavaScript in use which serves only to give the HTML version of the report some additional functionality. Right now, all of the events are fired off from inline HTML onclicks and so on.
If I convert to jQuery and use selectors to bind the events, the selectors could easily be matching 10’s of thousands of elements. Plus, the typical way to use jQuery (eg., $(document).ready()) would cause the click event not to fire until the document was fully loaded.
So the questions are:
Is jQuery up to this task? Or am I better suited leaving inline script?
If it is, are there certain techniques I need to use to make it work well?
And is there a way to circumvent the “no events until document load” scenario?
And a secondary question (this one just occurred to me as I was writing this):
This report is being sold to a client. What are my license obligations if jQuery is included as apart of the report?
Edit
@jfriend00 : I’ve been at a bit of a loss on how to do this (split the report up). The report is issued in 2 formats: HTML and PDF. The clients want to have a digital manual available from which they can print sections. They also want the HTML version because it provides anchors which link key parts. The JavaScript allows for a popup that provides a view into the underlying data that the report was based on. What has happened is that we’ve run into a scaling problem. The data being analyzed has increased greatly and so has the size of the resulting report.
For confidentially reasons, the report cannot be live online nor on an internal intranet. It has to be a deliverable that will run on an individuals local machine.
If anyone has tips on how to handle this gracefully, I would love to hear your ideas. This is an issue that has been plaguing me for some time.
jquery’s up to pretty much any task. Question is if the browser these reports will be loaded into can keep up.You could embed a “start processing” directive every certain number of lines in the report, so that after (say) 100 lines of report are out, there’s a JS call to start your script on those 100 lines.
Then another 100 lines of report, and another function call. Painful, but at least those first few hundred lines would be interactive as the rest of the page loads.
As for #2, that’s a legal issue. jquery’s under dual MIT/GPL licensing, so you’re probably ok, but talk to a lawyer to be sure. “But some random weirdo on the internet said it was ok!” is not a valid defence if/when you get hauled into court on a copyright violation rap.