Results 1 to 8 of 8

Thread: HTML onLoad Event Not firing on some machines

Hybrid View

  1. #1
    Join Date
    Nov 2010

    Exclamation HTML onLoad Event Not firing on some machines

    Hi There.

    I have a htm page that takes in an entry from the user in an input box.

    On the onLoad event i go and check whether the user has a value in for their username and password, passed into from a seperate application.

    If they have a valid username and password I set the focus to be the CCI.Input box where the user enters in the CCI number of the printer they want to print to.

    On some machines the on load event is not firing. I have found this by using the alert function in the onLoad function on my machine it pops up, on other machines it pops up but in a small handfull it does not pop up.

    If i F5 the page it triggers the onLoad event and the CCI input box gets the focus. I am just a bit perplexed as to why on some machines it will not fire.

    There is an error popping up saying permission denied and when it is refreshed it gets rid of this.

    I am running IE6 on my machine, the machine that it is not working is an IE6 machine.

    Any help or hints would be greatly appreciated.

  2. #2
    Join Date
    Apr 2003
    or as this appears to be on an intranet, Internet Options > Browser History > Always Refresh from Server
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    No way. There are some problem with onload event in FF, but only when the user turns back using the back button. Otherwise, no, as far as I know.

    The same browser, on the same Operation System will do always the same things, on different machines.

    Post your code HTML and JavaScript (or the relevant part of it) or a link to a test page, and tell us exactly on which browsers onload does not fire. And when.

  4. #4
    Join Date
    Nov 2010
    ---I have stripped out the bits you dont need --- but this is all the bits that is needed.

    <title>Launching PASWEB. Please wait ...</title>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    <script language=javascript>

    // ======================================================================
    // Script Function: To automatically log into PASWEB System
    // Requires: AutoIt Version in the form of a registered dll file
    // Author: Stewart Blair
    // Created: 10/11/2010
    // ======================================================================
    var username = "<&#37;=Request.username%>";
    var password = "<%=Request.password%>";
    var patientid = "<%=Request.patientId%>";
    var pathToExecutable = "<%=Request.pathToExecutable%>";
    var winVersion = "";

    function numbersonly(myfield, e, dec)
    var key;
    var keychar;

    if (window.event)
    key = window.event.keyCode;
    else if (e)
    key = e.which;
    return true;
    keychar = String.fromCharCode(key);

    // control keys
    if ((key==null) || (key==0) || (key==8) ||
    (key==9) || (key==13) || (key==27) )
    return true;

    // numbers
    else if ((("0123456789").indexOf(keychar) > -1))
    return true;

    // decimal point jump
    else if (dec && (keychar == "."))
    return false;
    return false;

    function checkInternetBrowserVersion(){
    var browserName = navigator.appName;

    // Test for Microsoft IE browser
    if (browserName=="Microsoft Internet Explorer")
    //var showButton = false;
    var appversion = navigator.appVersion.toString();
    var listArray = appversion.split(";");

    var entryArray;
    // loop round appversion
    for (var i = 0; i < listArray.length; i++) {

    // split up value where possible by a space
    entryArray = listArray[i].split(" ");

    // test first part of array for MSIE

    if (entryArray[1].toUpperCase() == "MSIE") {

    // Test the second part for IE version

    if (parseFloat(entryArray[2]) == 6 ) {
    winVersion = "6";
    // everything ok

    if (parseFloat(entryArray[2]) == 7 ) {
    winVersion = "7";
    // everything ok



    function checkusernameandpassword(){
    if((username == "") || (password == "")) {
    alert("Problem loading Pasweb: check that your username and password are entered in the Clinical Portal My Details Page.");



    function CheckValid() {
    var CCInumber = document.getElementById('CCI').value

    if (CCInumber == "") {
    alert("Problem loading Pasweb: You must complete the CCI box. Please Relaunch and Enter Your CCI Number");

    AutoItXDLL.WinClose("Launching PASWEB. Please wait ...","");




    function loadPASWEB() {
    var CCInumber = document.getElementById('CCI').value


    <body OnLoad="checkusernameandpassword()">
    <form name="input" onsubmit="CheckValid()">

    <td BGCOLOR="#AACCFF"><NOBR>Please Enter Your CCI Number ...<input type="text" name="CCI" id = "CCI" SIZE=4 maxlength="4" onKeyPress="return numbersonly(this, event)" /></NOBR></td>
    <td BGCOLOR="#AACCFF"><NOBR><input type="Button" enabled ="false" VALUE="submit" name="SubmitCCI" OnClick="CheckValid()"/> </NOBR></td>
    <td><FONT COLOR="RED"><B>IMPORTANT: Please enter the correct CCI for your PC. </FONT COLOR></B> </td>
    <FONT COLOR="RED"><B>A label should be attached to the PC showing this number.</FONT COLOR></B>

    <td><FONT COLOR="RED"><B>This number determines the printer your PAS labels, letters and OCS request forms are sent to. </FONT COLOR></B></td>
    <td><FONT COLOR="RED"><b>Entering a different CCI number may result in your labels and letters being </FONT COLOR></B></td>

    <FONT COLOR="RED"><B>printed in a different department/hospital.</FONT COLOR></B>


    <span style="font-family:arial;font-size:10pt;"></span>
    <object classid=clsid:1A671297-FA74-4422-80FA-6C5D8CE4DE04


  5. #5
    Join Date
    Nov 2010
    My machine is a windows Xp SP3 machine with IE version 6.0.2900.5512
    Other test machine is windows xp sp2 with IE version 6.0.2900.2180
    Machine not working Win XP sp2 with version 6.0.2900.2180

    Although my machine has a diffrent XP sp pack and up to date Browser the 2nd machine is the same as the 3rd and works on the 2nd and not on the 3rd.

    I have compared settings and all IE settings are the same accross the board.

    If username and password is null then it displays the message Problem loading.......on all machines

    If the username and password is not null it does not set the focus of the CCI input box. Only of refreshed does it seem to then set the focus of the input box and will carry on as expected.


    Am at a loss.
    Last edited by Stewart.Blair; 11-12-2010 at 06:57 AM. Reason: More info...

  6. #6
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    eeeer. quite a rusty code.
    1. you have no Doctype. See: http://www.w3schools.com/tags/tag_doctype.asp. A DTD HTML strict would be enough for you.

    2. language=javascript is deprecated, <script type="text/javascript"> is to be used these days.

    3. try using a standard HTML coding style, which proved to be accepted all over the Doctypes, browsers, etc:
    <tag attribute=" " onevent=" ">
    That means: use lowercase for tags, attributes and events. And nest in quotes, usually double, their values.

    4. What is that for?
    AutoItXDLL.WinClose("Launching PASWEB. Please wait ...","");
    I don't see any AutoItXDLL object nor a WinClose() method around.

    Note. No offense but: For God's sake, how long are you going to use IE6? Even Microsoft makes for about a whole year an appeal to all of you to switch toward at least IE7, if not straight to IE8 or IE9. What' the use of that IE test? A break there? Break what? Returns what?

    And test first your document/link at:

  7. #7
    Join Date
    Jun 2005
    United Kingdom
    Quote Originally Posted by Kor View Post
    Note. No offense but: For God's sake, how long are you going to use IE6....
    For those of us who may have, or wish to have, UK Government visitors for quite a while yet.

    ....It is therefore more cost effective in many cases to continue to use IE6 ....

  8. #8
    Join Date
    Nov 2010
    I would validate your code first then test the onload event.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10654 seconds
  • Memory Usage 3,156KB
  • Queries Executed 13 (?)
More Information
Template Usage (31):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (8)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (72):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates