Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Load JS files faster inside CGI script

by kalyanrajsista (Scribe)
on Feb 24, 2010 at 12:49 UTC ( #825066=note: print w/ replies, xml ) Need Help??

Comment on Re^4: Load JS files faster inside CGI script
Re^5: Load JS files faster inside CGI script
by Corion (Pope) on Feb 24, 2010 at 12:52 UTC

    I'm sorry, but this is not a code writing service. This is a site for people who want to discuss Perl problems or programming problems and their application in Perl. This is not a site where people write code for you, especially without specifications.

    Your problem and question seem ill thought out, as you haven't made any effort to determine the cause of the load nor have you described any of your attempts to reduce the current bottleneck. Also, you haven't drawn any connection from your problem and how it relates to Perl. I recommend that you spend some time analyzing where the problem is, then some time analyzing how you can leverage existing tools like Perl and jQuery to solve your problem, then implement one or more solutions using these tools, and then, if you still have problems, ask again, this time showing representative input, output and code.

      Sorry Corion, don't mistake me

      I've the working code with me implemented in Perl and JavaScript and I'll post in my next post.

      Let me clarify you that

      Perl is for getting information from the database to populate the list +boxes.. I'm refering Continents and Countries for better understanding... Say, listbox 1 -> Continents and listbox 2 -> Countries I'll fetch all the Continents information and related countries and wh +en any user tries to select a particular continent in listbox 1 & cor +responding countries will be displayed in listbox 2

      Also, my intention is just point me to any example sites where not exactly this type of requirement is implemented but can show any other working examples... I can understand without any proper specifications or working code, nobody can draw conclusions of how to improve or suggest a better solution.

        I suggest that you read the jQuery Ajax Documentation, and write a Perl program that returns just the relevant part of the information, that is, for a given continent, you make a request for its contained countries.

        Also, I wonder how you get a list of 7MB for just associating countries and continents. That strikes me as a bit large.

Re^5: Load JS files faster inside CGI script
by pemungkah (Priest) on Feb 24, 2010 at 21:29 UTC
    Check out http://john.beynon.org.uk/2009/02/11/jquery-validation-remote-attribute/ - you can tell jQuery to go to a URL to validate a field (almost) automatically. This would make a dramatic difference in your performance, as that 7MB would never have to leave the server. (You can always leverage Spidermonkey to run your current validation JS on the server if need be, but unless it's hideously complex I'd redo it in Perl.)

    A quick Google search on 'jquery remote validation' turned this right up.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://825066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-08-28 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls