Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q5604

Feedback on: irt.org FAQ Knowledge Base Q5604

Sent by Adam Rubin on April 01, 2000 at 23:40:02: - feedback #1026

Worth:
Worth reading

Comments:
You may want to pass the info along as a hidden input to a form as well... this is using the same idea as above, but here's another way to implement it:

This example is using VBScript instead of javascript.

firstname = "adam";
document.write(\"<input type=hidden name=firstname value=\" & firstname & \">\")


When the form is submitted, your perl code now has full access to the "$firstname" variable.


Sent by Yakov Simkin on April 26, 2000 at 12:25:16: - feedback #1144

Worth:
Very worth reading

Length:
Too short

Comments:
Please correct me if I am worng but the eval i this example would return 'undefined' because the string does no correspond to valid
object.


Sent by michel on May 05, 2000 at 15:37:08: - feedback #1185

Comments:
The javascript and assumption on this page is not correct.I have had a few confused

var firstname = 'Jason'; // JavaScript variable containing firstname

var URL = eval('http://www.server.com/cgi-bin/script.pl?firstname=' + firstname);
document.location.href = URL;

1. Why the eval????
2. It is window.location, not document.location one should use.
document.location is in principle read only, It is only to be compatible with older wrong scripts that it is kept on as a location changer

I would code it like this:

var firstname = 'Jason';

window.location = 'http://www.server.com/cgi-bin/script.pl?firstname=' + firstname;

and it should be mentioned that the page the user is looking at will be replaced by whatever script.pl returns unless it returns a 304 nothing changed http header.

Michel


©2018 Martin Webb