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
ADVERTISEMENT
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
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
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
View Related
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
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
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
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
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
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
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
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
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
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
Jul 17, 2011
I have a form button with id="submit". When pressed, ClickGeocode(credentials) is called. This works fine and dandy with: $('submit").click(ClickGeocode) Despite there being no indication that the function takes an argument 'credentials'. So when I want to call the function at some point in my code, I should be able to do something like ClickGeocode(credentials) ... no? However, my issue is that credentials isn't once defined in my code - it is part of Bing Maps function... like so:
function ClickGeocode(credentials)
{
map.getCredentials(MakeGeocodeRequest);
}
So why does it work using .click(), and how can I call the function without user interaction (simply somewhere in my code) even if 'credentials' is not defined?
View 1 Replies
View Related
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
Feb 26, 2006
How do we trim out or remove a part of a URL or path?
eg. http://www.mywebsite/folder/somefile.htm ----I want to trim
http://www.mywebsite/folder/ so All I have left is the file name.
<script language="JavaScript">
var pathtotrim = location.href;
document.write (pathtotrim);
</script>
View 10 Replies
View Related
Jun 17, 2009
I have a little problem and I hope that I need to get the path of the URL except for the first slash "/". Now if I use window.location.pathname I get an output like this: /about/about/9081ae1b02/
That is almost right but I need to get rid of the first slash (marked in red) so I get: about/about/9081ae1b02/
View 1 Replies
View Related
Sep 8, 2011
I'm trying to figure out how to split a url variable... I tried these two ways, with an alert to see my result, but I'm not getting anything.
[Code]...
View 8 Replies
View Related
Aug 16, 2010
I've got an idea for simplifying my code and avoid a bunch of switch functions but don't know how, though I assume it's possible.
How do I write a function to change/insert only part of an img src?
View 4 Replies
View Related
Jul 23, 2005
How do you print part of an html page using the javascript print()
function? Is it possible to put the printable area inside a
<div></div> block and print it, or can you use a hidden style then
print it?
Is there a site on the www which has some information?
View 4 Replies
View Related
Feb 15, 2006
Is it possible to refresh only part of a page rather than reload the
entire thing?
I have dropdown box that's populated from a database using ASP that I
need refreshed but I don't want to reload the entire page.
View 6 Replies
View Related
Jul 20, 2005
is it possible to use the javascript:window.print() command to print only a
part of my window, lets say a table without navigation?
View 1 Replies
View Related
Nov 16, 2011
Based on screen size, I'd like to change one of the folder names of a url on the page. I know how to detect screen size with jQuery, but I'm not sure how to change only part of a url.
For example:
if screensize > 480px
[URL]
else
[URL]
View 6 Replies
View Related
May 11, 2011
I have a bit of html like this
<div id="J5">
<dt class="shade" id="profilefield_title_5">Member type</dt>
<dd id="profilefield_value_5">
[Code].....
This displays OK on my generated page anyway, but later when I want to use a switch statement on the member type it fails because of the spurious stuff I picked up in the variable
View 5 Replies
View Related
Mar 13, 2011
Given the following standard jQuery code to .get() a (valid) .xml file: $.get(file)
[Code]...
This is exactly what I need, it'll get me the complete XML document structure, including all nodes and texts. If I have this as a string I can then use $.parseXML() to convert this (back) into a XML document.
View 2 Replies
View Related