Sponsored Content
Top Forums UNIX for Dummies Questions & Answers transforming small javascript into perl Post 302190353 by cbkihong on Tuesday 29th of April 2008 11:05:15 AM
Old 04-29-2008
Then that is a client-side Javascript problem. It has nothing to do with Perl even though Perl is used to generate the Javascript.

If what you want to do is to execute different bits of Javascript depending on condition. That is possible with Javascript alone. People are doing that all over the Web to address different browsers. Sometimes you may need to wrap the code in a try ... catch block to catch exceptions so that you can try several variations until finding one that works!

Of course, unless you have reasons to generate dynamic Javascript from Perl, moving all the javascript away from the HTML to a separate .js file that is sourced from the HTML esp. if you have lots of javascript. Then you can serve that JS file with Apache directly rather than wasting resources generating JS from Perl.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help Required In Transforming A File

How will i convert a file <LREC><L:EPOCH>1198331268.553</L:EPOCH><LDATE>10-12-07</LDATE><L:SERVER>NONE</L:SERVER><L:PORT>NONE</L:PORT><LTIME>13:47:48.553</LTIME><LTEXT>dnvdmxk</LTEXT></LREC>... (3 Replies)
Discussion started by: anju
3 Replies

2. UNIX for Dummies Questions & Answers

onChange + javascript in perl CGI - question

Hello all, Am trying to include a onChange java script to my perl CGI application which uses POST method to upload files to file_server This is how I embedded javascript in the perl code that renders CGI application print qq| <script type="text/javascript" src="display.js"> </script>... (4 Replies)
Discussion started by: matrixmadhan
4 Replies

3. Shell Programming and Scripting

transforming records

Hi all In input file I have records like this: 0,1,0,87,0,0,"6,87","170,03",0,"43,5",0,0,0,0,"6,87","126,53" and in output file I need that these records transforms in : 0 1 0 87 0 0 6,87 170,03 0 43,5 0 0 0 0 6,87 126,53 Could you help me in this case? Please (13 Replies)
Discussion started by: shizik
13 Replies

4. UNIX for Advanced & Expert Users

Transforming psmf to ogv

Hi all. I would like to create a program that converts psmf file format (PSMF - MultimediaWiki) to ogv (Ogg - Wikipedia, the free encyclopedia). I know C++ and I worked with BMPs (so I can understand a simple file system like the BMP header is) but I didn't touch any kind of sound/video file... (1 Reply)
Discussion started by: lilezek
1 Replies

5. Shell Programming and Scripting

How to use JavaScript in Perl Object Oriented

i am new to Perl CGI Object oriented. I want to use some java script in my Perl CGI but i am not able to do that. I am using Submit button then via param() i am getting all field parameters. But i want to validate all fields first then i want to move. But Use of Java script, i don't know (1 Reply)
Discussion started by: Navrattan Bansa
1 Replies

6. Shell Programming and Scripting

How to call perl web service from javascript?

Hi, I would like to call the below perl web service from javascript .Any help would be appreciated.I am new to web services.Please do the needful. Server Program(Perl Web Service) #!/usr/bin/perl use lib '/usr/lib/perl5/5.8.8/SOAP-Lite-0.65_3/lib'; use SOAP::Transport::HTTP; use Demo;... (3 Replies)
Discussion started by: liyakathali
3 Replies

7. Programming

Transforming data to other format

Dear All I would like to transform data from one format to another format. my Input: 0 0 1 0 1 0.308 0 2 0.554 0 3 0.287 output: Z (0,0)= 1 Z (0,1)=0.308 Z (0,2)=0.554 Z (0,3)=0.287 (2 Replies)
Discussion started by: bala06
2 Replies

8. UNIX for Dummies Questions & Answers

Transforming data so it looks like the one you specified

Lets say for instance I have this data within a file named transform xxx#yyy@zzz and I want it to be in the format ofZZZ xxx-yyy How do I go about doing this? (3 Replies)
Discussion started by: l3monz
3 Replies
BB-HOSTSVC.CGI(1)					      General Commands Manual						 BB-HOSTSVC.CGI(1)

NAME
hobbitsvc.cgi - CGI program to view Xymon status logs SYNOPSIS
hobbitsvc.cgi [--hobbitd|--historical] [--history={top|bottom}] DESCRIPTION
hobbitsvc.cgi is a CGI program to present a Xymon status log in HTML form (ie, as a web page). It can be used both for the logs showing the current status, and for historical logs from the "histlogs" directory. It is normally invoked as a CGI program, and therefore receives most of the input parameters via the CGI QUERY_STRING environment variable. Unless the "--historical" option is present, the current status log is used. This assumes a QUERY_STRING environment variable of the form HOSTSVC=hostname.servicename where "hostname" is the name of the host with commas instead of dots, and "servicename" is the name of the service (the column name in Xymon). Such links are automatically generated by the bbgen(1) tool when the environment contains "BBLOGSTATUS=dynamic". With the "--historical" option present, a historical logfile is used. This assumes a QUERY_STRING environment variable of the form HOST=hostname&SERVICE=servicename&TIMEBUF=timestamp where "hostname" is the name of the host with commas instead of dots, "servicename" is the name of the service, and "timestamp" is the time of the log. This is automatically generated by the bb-hist.cgi(1) tool. OPTIONS
--hobbitd Retrieve the current status log from hobbitd(1) rather than from the logfile. This is for use with the Xymon daemon from the Xymon monitor version 4. --historical Use a historical logfile instead of the current logfile. --history={top|bottom|none} When showing the current logfile, provide a "HISTORY" button at the top or the bottom of the webpage, or not at all. The default is to put the HISTORY button at the bottom of the page. --env=FILENAME Load the environment from FILENAME before executing the CGI. --templates=DIRECTORY Where to look for the HTML header- and footer-templates used when generating the webpages. Default: $BBHOME/web/ --no-svcid Do not include the HTML tags to identify the hostname/service on the generated web page. Useful is this already happens in the hostsvc_header template file, for instance. --multigraphs=TEST1[,TEST2] This causes hobbitsvc.cgi to generate links to service graphs that are split up into multiple images, with at most 5 graphs per image. This option only works in Xymon mode. If not specified, only the "disk" status is split up this way. --no-disable By default, the info-column page includes a form allowing users to disable and re-enable tests. If your setup uses the default sepa- ration of administration tools into a separate, password- protected area, then use of the disable- and enable-functions requires access to the administration tools. If you prefer to do this only via the dedicated administration page, this option will remove the disable-function from the info page. --no-jsvalidation The disable-function on the info-column page by default uses JavaScript to validate the form before submitting the input to the Xymon server. However, some browsers cannot handle the Javascript code correctly so the form does not work. This option disables the use of Javascript for form-validation, allowing these browsers to use the disable-function. FILES
$BBHOME/web/hostsvc_header HTML template header $BBHOME/web/hostsvc_footer HTML template footer ENVIRONMENT
NONHISTS=info,trends,graphs A comma-separated list of services that does not have meaningful history, e.g. the "info" and "trends" columns. Services listed here do not get a "History" button. TEST2RRD=test,test A comma-separated list of the tests that have an RRD graph. SEE ALSO
xymon(7), hobbitd(1) Xymon Version 4.2.3: 4 Feb 2009 BB-HOSTSVC.CGI(1)
All times are GMT -4. The time now is 10:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy