New Version Of JavaScript Minifier In Perl

May 29, 2007

I've uploaded a new version of the javascript::Minifier module that
was on CPAN. It was a translation of JSMin but I rewrote it so it now
handles missing semicolons, + ++ code, and leaves those freaky IE
conditional comments in the output. The goal was that if working code
is input then working code is output where working == working.
Breaking code that works is not such a good idea. Code:

View 4 Replies


ADVERTISEMENT

Perl Cgi And Javascript Syntax Please

Jul 30, 2009

I just need someone to tell me what the proper syntax is for calling a perl sub from another perl sub.. in trying to use onClick to call a sub in Htmlform() .. but its not working... the cgi works fine.. the mySql parts work fine.. more specificallyprint start_html(-title=>'Lab 6',-scrip=>{-language=>'PerlScript', src=>'mySqlProg.cgi'});i dont know if the above is the corect syntax in relation to thisprint "<button type='button' value='view' onclick='show_entries();'>Show Table Values</button>";

#!/usr/bin/perl
use strict; use warnings;
use CGI qw/:all/;

[code]....

View 4 Replies View Related

Why Using Javascript Version File

Aug 26, 2006

I noticed that some sites use <script src='fineName.js?ver=XXX'></script(even google) Someone told me that it's for script changes, means - if the file in
server has been changed than the new XXX will demand to load the new file.
I find it hard to believe that it's true.

View 8 Replies View Related

Reliable Javascript Version Detection?

Dec 24, 2003

I have been struggling around with trying to figure out a reliable manner for detecting the Javascript version a given browser is using.

Basically, there are two half-decent ways that I have found, neither one being foolproof.

One way is using javascript tags with the language attribute, as in the following code:


Code:
<SCRIPT LANGUAGE="Javascript"><!--
gVersion="1.0";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript1.1"><!--
gVersion="1.1";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript1.2"><!--
gVersion="1.2";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript1.3"><!--
gVersion="1.3";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript1.4"><!--
gVersion="1.4";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript1.5"><!--
gVersion="1.5";
//-->
</SCRIPT>


This works fine but it is not very elegant. Another disadvantage is that it is not XHTML compliant.

The other way is using some sniffer scripting like that found in the JavaScript Browser Sniffer (Web Reference).

However, this is not very reliable as it needs to be constantly updated to take newer browsers into consideration. Also, on my system it gave an incorrect Javasctipt version of 1.3 when it should have given 1.5 (according to the first option above).

I was just wondering if there was a more dependable way of doing this.

Maybe it would just be better to avoid unnecessary headaches and restrict myself to W3C compliant brwosers.

View 5 Replies View Related

JavaScript Blocked By New Version Browsers

Mar 19, 2005

I have a lot of JavaScript code I wrote to add special features and effects to my Web sites. The problem is, with the latest versions of Web browsers, all browser-side scripts are blocked. Most users who visits will either not know how to adjust their security features to allow scripts or will not want to change their settings. In a case where the script is vital to the functioning of the Web page, what is the alternative?

For example, one of my script is for a drop-down menu that takes the user to the selected section from the drop-down menu.

The other feature I need is roll-over that highlight parts of a map so that the user can make a selection.

Is there something I can add to my JavaScript code to prevent browsers from blocking it or is there a different way of using these features with a different script?

View 4 Replies View Related

JavaScript That Detects Both Browser And Version

Oct 11, 2001

I'm looking for a JavaScript that does not only detects wheather the visitor uses Netscape or IExplorer, but also which version.

I would like to use one style.css for Netscape 6.x and IE 5 and up, and an alternative_style.css for Netscape 4.x.

View 2 Replies View Related

JQuery :: Update From Version 1.7.2 To Version 1.8?

Mar 27, 2010

I have problems updating from version 1.7.2. to version 1.8. I'm using a custom theme - can anybody give me a step-by-step guide how to update without destroying the whole site ? :) I would like to have the button featueres in the new version

View 1 Replies View Related

JQuery :: Downloading - Click To Download The Latest Version - Or Any Version - It Doesn't "download" Anything

Dec 21, 2010

I am trying to get started using JQuery, but I find I can't even get to lesson #1. When I go to jquery.com and click to download the latest version (or any version) it doesn't "download" anything. It opens the file as a webpage in my browser and I see all the JQuery in one big string. Why won't the file just download? Is it the browser I am using? Is it my Mac?

View 2 Replies View Related

Perl Program Problem

Jul 31, 2001

I have a problem with my perl program - it is not able to display the output of vowel count and word repetition count from a text file.
The whole Perl program is supposed to read a paragraph of text and calculate followings based on the text:

1. number of empty spaces.
2. number of words in the text.
3. number of vowels in the text (a,e,i,o,u)
4. number of words with repetition in the text

Example output:-
No. of empty spaces: XX
No. of words : XX
No. of vowels -
a:: XX
e: XX
I: XX
o: XX
u: XX
Words with repetition-
Word 1 : XX
Word 2 : XX
..... ....
..... ....


Here below is the program so far:

View 1 Replies View Related

Calling Perl From Js, Part Deux

Jul 23, 2005

I am using the following method to call a Perl script from js:

<script type="text/javascript" src="http://myserver.com/cgi-bin/x.pl?x=abc"
</script>

The Perl writes an application/x-javascript header followed by some js
code (like document.write).

I can't use the hidden frame method suggested by Erwin Moller because the client page is an eBay ad, and they will not allow any frame code.

Now I want to pass to my Perl script an argument value which cannot be
known until the page is loading (specifically, the page title, which is
created by eBay and contains a unique id). I know how to get the page
title with js, but there's no way (that I can figure out) to dynamically
create the src argument of the <script> tag.

View 1 Replies View Related

Return Value To Perl Variable In Cgi File?

Jul 28, 2009

I want to check whether the flash is installed or not on client so i have a javascript function which does this , now i want the resultant variable from this function to return to perl variable in cgi file. i dont want to use form submit because i dont need it. i simply have to take decision for further coding depending on this variable returned from javascript. :cry:the way i m doing is,cgi file,

#!/usr/bin/perl
require './draw_pie.pl';
%lv=("lv1"=>'20',"lv2"=>'10',"lv3"=>'30',"lv4"=>'25',"lv5"=>'10',"lv5"=>'5');

[code]....

View 2 Replies View Related

AJAX :: Passing A Variable From Perl?

Mar 12, 2011

I have a webpage (Perl) that allows a user to select one of two buttons that represent :

<button id = "1" onclick="loadXMLDoc('mysqlinsert.pl')">Choose $name1</button>
<button id = "2" onclick="loadXMLDoc('mysqlinsert.pl')">Choose $name2</button>

Based on the button they choose, I need to pass a variable (declared in Perl) to another Perl page that is responsible for updating/inserting in a MySql Database.

As you can probably tell, I'm new to this. But I'm not sure how the variable ($name1) can be used in Perl to the loadXMLDoc, and then get passed using the 'POST' technique to mysqlinsert.pl??

function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari

[Code].....

View 4 Replies View Related

Embed Perl Code Within A Web Page?

Mar 14, 2011

How can I embed Perl code within a web page? I want something like:

Code:
<script language="perl">
perl commands here
</script>

I know how to run Perl CGI routines from an HTML link. That is not what I want.

View 3 Replies View Related

Read JS Data Only File With PERL?

Mar 22, 2011

I have posted a question I believe that relates more to the PERL language, but it has to do with reading an external data only javascript extension file. [URL]

View 2 Replies View Related

Custom Refresh Rate To Perl Script

Jun 15, 2009

I am asked to use JavaScript as part of an intro course on Perl in one of the projects.There are two html frames. The lower frame contains two user forms, one for a set of fields (name, email, comments etc), and the other that I am trying to add so that I can set a refresh rate for the upper frame.When I submit the frame rate as a number, say 5, the upper frame reloads but does not refresh at the rate I indicate.

View 6 Replies View Related

Make Perl Code From Forum Post?

Apr 16, 2009

here is my perl code from forum post[URL]

#start for todays date
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime (time);
my $day = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",

[code]....

View 2 Replies View Related

Document WriteIn - Reading Perl Cookies

Apr 4, 2009

To read a cookie:
Code:
<script language=javascript>
<!--
var cook=document.cookie.split(";");
var pieces=cook[0].split("=");
document.writeln("Your javascript cookie is called: " + pieces[0] + "<br>");
document.writeln("Its value is: " + pieces[1]);

//-->
</script>

View 1 Replies View Related

Ajax :: Making A Call To A Perl Script

Feb 2, 2011

I am making a call to a perl script using AJAX, this is basically updating a shopping cart item quantity, however; it only works about half the time.. Code:

function UpdateItem(Qty, ProdID, Size){
var XMLHttp;
var ee;
if(navigator.appName == "Microsoft Internet Explorer") {
XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
XMLHttp = new XMLHttpRequest();
}
[Code]...

View 2 Replies View Related

JQuery :: Internal Server Error 500 Thrown From Perl Script

Feb 25, 2011

I have a perl script which is called via Ajax. It simply writes 3 values to a database. The code works fine (values get written successfully) but I get an "Internal Server Error" thrown. The Errorlog says "premature end of script headers". There was no problem with the application - it works as required and has for a few months - but I noticed the error via Firebug when testing something else.So I started stripping perl out of the script in an attempt to locate the problem .. and continued till I only had only had two lines left .. the shebang and exit .. I still get the 500 error. Running the script direct from a browser gives the 500 error in the browser window ... from the command prompt it's fine - ie. nothing in the apache errorlog.

There is nothing wrong with the server configuration - it has hundreds of perl scripts and has been running for years.

View 2 Replies View Related

JQuery :: Parse The XML File A Perl Script Sends Back

Jun 10, 2010

Looking to parse the XML file a perl script sends back.I wantto get values from specific tags in the XML file. Here is my code:

[Code]...

The code seems to be getting hung up on the dataType: "xml", line because when I comment it out, it goes to the next step and executes the function (although it doesn't do anything). how I can change this or just take a different approach? Let me know if I can provide more information.

View 2 Replies View Related

Diving Into Regexp By Porting A Perl Script Over To Js That Uses Regexp To Compress Into A Bookmarklet Capable Format?

Aug 10, 2010

I'm finally diving into regexp by porting a perl script over to js that uses regexp to compress javascript into a bookmarklet capable format.I've successfully worked out 90% of the expressions but am troubled with a few, this one at the moment is odd:I want to remove the first line if it hasjavascript:So I thought str.replace(/^javascripts+:s+/, "") would be ok. I want javascript text, any space, colon, any space and new line. what I'm doing wrong.btw this is the original perl version

$src =~ s{^// ?javascript.+:.+
}{};

View 3 Replies View Related

Which IE Browser Version?

Jul 23, 2005

Does anyone have a quick script to find which version of IE a page is
being viewed with?

Specifically, I want to seperate version 4 from versions 5+, and post a
warning against using 4.

I expect I'll have to search out the (navigator.appAgent) string for
the MSIE substring, but since I don't need it until tomorrow, laziness
dictates I ask here before getting on with it. Is there another
variable? a less cumbersome way?

View 12 Replies View Related

Download IE Version X

Jul 23, 2005

CAn anyone tell me where to get previous versions of internet explorer
(for ecxample version 3 or 4)? I need it to test my javascript code...

View 3 Replies View Related

Version Control

Feb 6, 2007

Is there a possibility to compare and visualize in a user-friendly way
the differences of two html files?

I need also something like a version-control. I think I could generate
for everychange of the text a new record in the database. But now I
need a tool (JavaScript, Java, etc.) to compare and visualize two
versions of these html-files online over a web-browser.
I know, this is not really a javascript topic, but perhaps here is
anyone how knows a tool for that.

View 5 Replies View Related

Which Version To Learn

Apr 8, 2006

Strange question i know, but i am trying to read javascript ( not necessarily clever enough to program), so that i can at least understand other scripts when incorporating them on my site as i feel this is important.

Would it be ok to go straight to v1.5 or as there are differences between the versions, start at say 1.2 and learn the differences between the upgrades.

I suppose i am hoping that i only need to start at 1.5 to make things easier.

View 3 Replies View Related

Printable Version

Dec 26, 2002

i have a problem to create a printable version from html page.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved