Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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??

in reply to Re^3: Load JS files faster inside CGI script
in thread Load JS files faster inside CGI script

any working example, Please

  • Comment on Re^4: Load JS files faster inside CGI script

Replies are listed 'Best First'.
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 - 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://825066]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-05-26 10:36 GMT
Find Nodes?
    Voting Booth?