Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    connecticut
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    html and javascript

    description of problem

    using, windows XP to load an html containing a javascript is the problem.
    first , the html page doesn't display all the fields defined in the javascript running on netscape 6,
    I have one button in my java code that calls this html page to open. this page contains the javascript file which is suppose to open with the html. but when the button is pressed, the html page is displayed but the javascript doesn't.
    is there any work arounds on this problem?

    thanks,

    Isaac.

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,453
    Thanks
    1
    Thanked 21 Times in 19 Posts
    Source code and/or a link, please.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Location
    connecticut
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript and html

    Error: app2 has no properties
    Source File: file:///C:/brobbwork/MyTest.html
    Line: 26

    The above is the error that i get when i run the javascript. below :
    thanks,
    Isaac.


    <html>
    <head>
    <title>Graphics</title>
    <applet
    code="SqlApplet.class"
    codebase="http://localhost:8080/learn/applet/"
    height="0"
    name="SqlApplet"
    width="0">
    <param
    name="servlet"
    value="http://localhost:8080/learn/servlet/SqlServlet" />
    </applet>
    <applet align=middle code="Vasxe.class" ARCHIVE="visad.jar" width=1080 height=600 name="GraphicDisplay">
    </applet>
    <script LANGUAGE="JavaScript">
    var app1 = document.SqlApplet;
    var app2 = document.GraphicDisplay;
    function getFields() {
    fields = new Array(4);
    //var sql = "select P.Locus, P.Mass, P.Pi, NT.Proportion ";
    //sql += "from PROTEIN P, EXPERIMENT E, table (E.PropData) NT ";
    //sql += "where P.Locus = NT.Locus and P.Mass < 10000";
    sql = parent.frames[1].document.controlForm.sqlQuery.value;
    app1.execute(sql);
    app1.changeRowCount(30);
    while (app1.next()) {
    var cols = app1.getColumnCount();
    for (var j=0; j<cols; j++) {
    fields[j] = app1.getString(j);
    }
    app2.loadProteinVector(fields[0],fields[1],fields[2],fields[3]);
    }
    //app2.setXAxisLength();
    //app2.execute();
    }
    function DisplayProteinPage() {
    parent.frames[1].document.controlForm.pName.value=app2.IIprox();
    location.href="LoadProtein.html";
    }
    </SCRIPT>
    </head>
    <body onLoad="getFields();" BGCOLOR="lightblue">
    <form>
    <input
    type="button"
    name="displayProPageButton"
    onclick="DisplayProteinPage()"
    value="DisplayProteinPage">
    </form>
    </body>
    </html>

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,968
    Thanks
    0
    Thanked 236 Times in 233 Posts

    Re: javascript and html

    see the changes in bold:

    <applet
    code="SqlApplet.class"
    codebase="http://localhost:8080/learn/applet/"
    height="0"
    name="SqlApplet"
    width="0" MAYSCRIPT>
    <param
    name="servlet"
    value="http://localhost:8080/learn/servlet/SqlServlet" />
    </applet>
    <applet align=middle code="Vasxe.class" ARCHIVE="visad.jar" width=1080 height=600 name="GraphicDisplay" MAYSCRIPT>
    </applet>
    <script LANGUAGE="JavaScript">
    var app1 = document.applets["SqlApplet"];
    var app2 = document.applets["GraphicDisplay"];


    To enable an applet to access Javascript on your page, you must specify the <APPLET> tag's MAYSCRIPT attribute; failure to do this will cause an exception if the applet tries to access JavaScript. This allows a measure of security for each HTML page that contains the applet.


  •  

    Posting Permissions

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