JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 25th, 2001, 10:04 PM
dman dman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 50 dman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
I am calling a perl script when a user exits a page through javascript with something like the following:

<script language="javascript" type="text/javascript">
function person_out()
{
document.writeln("<scr" + "ipt language='javascript' src='/cgi-bin/script.pl?foo=" + variable + "'>");
document.writeln("</scr" + "ipt>");
}
</script>
.
.
.
<BODY onUnload="person_out".......>

This works in Netscape but not in IE. When the script is called from my html page in IE, I get a blank screen. When I view the source, all I see is the <script language="javascript" src ="/cgi-bin/script.pl?...">. All the rest of the other javascript and html code is gone.

I know that the script is executed because it does what it's supposed to do. And the reason it has to be onUnload is because I want to know how long the user stays on the page.

Any help would be appreciated.

Reply With Quote
  #2  
Old February 26th, 2001, 02:28 PM
ajax's Avatar
ajax ajax is offline
Resident DJ
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 283 ajax User rank is Lance Corporal (50 - 100 Reputation Level)ajax User rank is Lance Corporal (50 - 100 Reputation Level)ajax User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 2 h 34 m 26 sec
Reputation Power: 13
It would be better to have this as a complete redirect in JS and PERL. Add another part of your PERL script that takes them to the actual link.


<script language="javascript" type="text/javascript">
function person_out(variable,linkvar)
{
window.location("/cgi-bin/script.pl?foo=" + variable + "&link=" + linkVar);
}
</script>

then you links will be
<a href="javascript:person_out(timeFunction(),'page.html');">link</a>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > calling a perl script with javascript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap