117 users online (0 members and 117 guests)  


  Results 1 to 4 of 4

Related

  1. querystring pass info with link    Forum: HTML Forum
    Replies: 1
  2. Pass Form Checkbox Value on Click    Forum: Javascript Forum
    Replies: 1
  3. How to Pass Dynamic values in Anchor    Forum: HTML Forum
    Replies: 4
  4. How to pass an array through a form?    Forum: CGI Perl Forum
    Replies: 1
  5. Pass variable between php scripts.    Forum: PHP Forum
    Replies: 5
  1. #1
    kpoindexter's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Lightbulb how to pass variables from one .htm to the next .htm?

    I am a cobol programmer who is brand new to html and javascript, no exposure at all. I need to modify this hugh out of the box (vendor undisclosed) html and javascript application. I am getting a feel of how this app flows and how I can modify it to fit our business needs, however, one simple concept eludes me. I don't understand how this .htm is opening another .htm and passing variables. The first .htm then closes itself. See my example. I simply want to pass MyNewVariable besides the current ones being passed. MyNewVariable will be used in the second .htm to set another flag. I see where the value of the var "program" in the 1st .htm is passed to the var "prm" in the 2nd .htm, but I have tried various things and cannot figure out how to pass a value of "true" to MyNewVariable in the 2nd .htm. I hope this is enough info. Also, I am using textpad to modify the .htm and .js files. I just change some code then run the .htm and see what happens. Is there a debugger where I can step through the code? I could get my company to buy it if I knew what I needed. Thanks

    <!--start 1st .htm-->
    <HTML>
    <HEAD>
    <META …………..>
    <SCRIPTSRC="/xxxxx/authenticate.js"> </SCRIPT>
    <!-- many more javascripts are loaded , then…-->

    <SCRIPT Language="JavaScript">
    // Global Variables.
    var program = unescape(window.location.search) || unescape(window.location.hash)
    program = program.substring(1);
    var perform;
    var PlanCode
    var Reports
    var MyNewVariable = true;

    //after this point there are many functions, part of a function is ….
    else XxWindow=window.open("/xxxxx/hrnet/xxentry/employee/xxentry.htm?"+program+","+Index+",
    nosummary,"+MyNewVariable+"", "XXENTRY", "status,resizable=no,height=550,width=800")
    }

    </SCRIPT>
    </HEAD>
    FRAMESET rows="100%,30,*,*" frameborder=no border=0 onLoad="Initialize();onUnload="Unload();">
    <!—lots more framesets here-->

    </FRAMESET>
    </HTML>
    END 1ST .htm
    START 2ND .htm
    <HTML>
    <HEAD>
    <META …………..> <SCRIPTSRC="/xxxxx/authenticate.js"> </SCRIPT>

    <!-- many more javascripts are loaded , then…-->

    <SCRIPT Language="JavaScript">
    var prm = unescape(window.location.search) || unescape(window.location.hash)
    prm = prm.substring(1);
    var perform;
    var Reports, ReportsSaved;
    var MyNewVarible;
    var NoSummaryFlag = false;

    function OpenProgram()
    {
    //my added code next
    XxWrec = new XxWrecObject();
    if (MyNewVariable == true)
    {
    XxWrec.XxNotTimeEntryReview = false;
    }
    else
    {
    XxWrec.XxNotTimeEntryReview = true;
    }

    clearTimeout(Timer)
    if(typeof(self.xxxheader.gmsgnbr) ="undefined") return;
    perform = new PerformanceObj(true)
    //function calls a few more functions
    }
    //many more functions,then.....
    /SCRIPT>
    </HEAD>
    <FRAMESET rows="80,100%,31,*,*,1,*" frameborder=no border=0 onLoad="OpenProgram();" onResize="Resize();" onUnload="Unload();">
    <!--set up many frames, then...
    </FRAMESET>
    </HTML>
    //end of second .htm
    Last edited by kpoindexter; 12-20-2006 at 12:10 PM.

  2. #2
    kpoindexter's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Re: how to pass variables from one .htm to the next .htm?

    ok, I can't believe I did not see this sooner, this is further down in another function......
    var prmArray = prm.split(",")
    if(prmArray.length >= 0)
    {
    prm = prmArray[0]
    var index = prmArray[1];
    if(prmArray.length==3 && prmArray[2]="nosummary")
    NoSummaryFlag = true;
    }
    ...so I changed the prm.Array.length to 4 by inserting my variable MyNewVariable, and all I have to do is look at prmArray[3] to accomplish what I was asking, I see that I have to be very careful modifying .htm and .js, I did not realize that I changed prmArray.length and thereby changed code I did not mean to change. I still have the debugger question, and also would like to understand how??..
    var prm = unescape(window.location.search) || unescape(window.location.hash)
    ..in xxentry.htm, captures the 4 things appended to
    /xxxxx/hrnet/xxentry/employee/xxentry.htm
    in the next line of code from the 1st .htm...
    XxWindow=window.open("/xxxxx/hrnet/xxentry/employee/xxentry.htm?"+program+","+Index+",
    nosummary,"+MyNewVariable+"", "XXENTRY", "status,resizable=no,height=550,width=800")
    ....I would also like to ask, if by inserting MyNewVariable into the previous line of code, could I have affected what the rest of the line is suppose to do? that is : "XXENTRY", "status,resizable=no,height=550,width=800")
    ....I found that by changing the height and width, it changed the size of the window it opened, but I am not sure what function XXENTRY and status are preforming? Thanks for any insight. I am slowly picking this up, but I am having more fun than coding COBOL

  3. #3
    kpoindexter's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2006
    Posts
    3

    Re: how to pass variables from one .htm to the next .htm?

    What A Waste Of Time Posting A Question Here. I Have Learned A Lot Since Posting This Question. No Thanks To Anybody Who Read This Posting With The Least Bit Of Knowledge Who Could Have At Least Told Me To Set My Internet Options To Use A Debugger

  4. #4
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: how to pass variables from one .htm to the next .htm?

    Rather than complain, you could have set an example by helping others. That is what this forum(and life) is about, people helping people, atleast that is what I learned when I was 5.
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting



Tags for this Thread