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:
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/;
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.
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.
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?
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
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?
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 ..... .... ..... ....
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.
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,
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
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]
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.
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]);
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]...
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.
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.
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
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?
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.
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.