Results 1 to 4 of 4
  1. #1
    camaross is offline Member
    Join Date
    May 2011
    Rep Power

    Default How to call javascript when the html is rendered from PERL

    My javascript works perfectly fine if I load the html using http web address. However, it quits working when I am rendering the html?
    I did some research and found that it is working when the page is loaded from http, because "JavaScript is executed on page load".
    When I render my html, my JavaScript are not automatically called.

    My question is how should I call the javascript in this situation?

    The html page:
    Java Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="xupload.css">
    <form id="myform" enctype="multipart/form-data" action="/cgi-bin/upload.cgi" method="post" onSubmit="return StartUpload(this);">
    <DIV id="div1">
    <b><font id='x_max_files'>?</font> files <font id='x_max_size'>?</font> Mb total maximum</b>
    <div id="upload_input"><input id="my_file_element" type="file" name="file_1" size=58></div>
    <div id="files_list"></div>
    <p align=center><input type="submit" value="Upload Files" class="myForm" id="submit_btn"></p>
    <iframe src="javascript:false;" name="xupload" style="position:absolute;left:-9999px;"></iframe>
    <script type="text/javascript">
    //Specify your form ID
    var x_form_id = 'myform';
    var x_mode = 1;
    var x_tmpl_name = '';
    <script src="xupload.js" type="text/javascript"></script>

    Perl code rendering the html
    Java Code:
    if(my $verifypage = $g->{CV}{htmlverify}) {
    # passing variables
    # render the page:
    Last edited by camaross; 05-16-2011 at 12:43 AM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    What part of this is related to java?

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    JavaScript is to Java as Ham is to Hamster -- similar names, but otherwise unrelated. Your best bet is to Google a JavaScript forum and ask this question there.

  4. #4
    camaross is offline Member
    Join Date
    May 2011
    Rep Power

Similar Threads

  1. Replies: 1
    Last Post: 01-02-2011, 08:23 PM
  2. HonoGenerate for Java,jsp,html,javascript,css
    By jaapnap in forum Reviews / Advertising
    Replies: 0
    Last Post: 12-06-2009, 12:56 AM
  3. How to print a HTML/JSP span using javascript?
    By sayan751 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-14-2009, 06:38 AM
  4. [B] How to call Perl script from Java [/B]
    By JavaEmpires in forum Advanced Java
    Replies: 7
    Last Post: 12-19-2008, 04:10 PM
  5. struts html tags vs javascript
    By murali in forum Web Frameworks
    Replies: 0
    Last Post: 12-01-2008, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts