#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    4
    Rep Power
    0

    PROBLEM: IE, JavaScript, and Java Communication


    I am creating a website where a user creates data in a Java applet that is stored to a temporary file. The data needs to be read by several other applets on other pages.

    What I am doing is opening the next page from that first applet, passing the name of the temporary file as a query string at the end of the URL. Then, in the page with the applets (which is another page down, again the query string is passed with the name), I'm using JavaScript to write a parameter line in the applet, and then I have the applet get the value of that parameter.

    My problem is that it works in Netscape/Mozilla derivatives (Camino, Mozilla, Netscape, Safari), but not in MS IE.

    I need this to be cross-platform/browser compliant, so not working in IE is a major issue, not to mention perplexing.

    This is the JavaScript code that I have in the header:

    <script language="JavaScript">
    <!--
    function temp_file() {
    var s_query = this.location.toString();
    var index = s_query.indexOf("?");
    if(index == -1) { }//if there's no ? in the URL
    else {
    index++
    s_query = s_query.substring(index, s_query.length);
    return(s_query); } }
    function writeAppletParam() {
    document.writeln("<param name='temp_fort95' value = '"+temp_file()+"'>"); }

    //-->
    </script>

    In the body, within the applet tag, I have:

    <script language="JavaScript">
    <!--
    writeAppletParam();
    //-->
    </script>

    The way I'm testing this is to, in the applet, have a text box, which I set the text to the value of the parameter.

    Has anyone any idea what I can do in order to make this work in IE, or an idea of how to do the same thing but differently that will work in other browsers?

    Thank you to anyone who can help!
    Last edited by astro206265; July 19th, 2003 at 10:44 PM.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    4
    Rep Power
    0
    Alright. No thanks to this board, I found out the problem. Apparently, IE loads an applet before it loads JavaScript. So, by putting the entire applet tag to be written out by the JS solved the problem. Hopefully this post will help anyone else with this problem.

IMN logo majestic logo threadwatch logo seochat tools logo