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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Helo with DIV and IFRAME onload

    On our Intranet homepage, I have a layer with an iframe contained in it. The iframe is linked to an html document that is stored in our Content Library system. You have to be authorized to view the documents in Content Library. The problem I'm having is that when you launch the Intranet site, the SSO login screen appears, but it looks like the iframe is trying to launch the html file before the homepage loads. So after you log in, the iframe displays the authentication screen. When you refresh the browser, it then displays the html file because you were authenticated when you logged in. it seems as if the iframe is launching ahead of logging in.

    I would like iframe to display after the browser loads. With doing this you should be authenticated and the html page will display. Currently when the body loads, the animation for image links loads. I would like to add the iframe to onload function. This is the code I had prior to editing suggesting I saw online. I have it in BOLD:

    <!--#INCLUDE VIRTUAL="/Common/Includes/global.asp"-->
    <html>
    <head>

    <%

    dim ServerName, VUurl, QALBSurl, PRODLBSurl, URL, PromoDoc

    ServerName = LCase (Request.ServerVariables("Server_Name"))

    VUurl = "/VU/default.asp"
    QALBSurl = "/em_uat.html"
    PRODLBSurl = "/em_prod.html"

    If ServerName = "www.test.gliconline.com" Then
    VUurl = "http://" + ServerName + VUurl
    URL = "https://" + "www.qa.gliconline.com" + QALBSurl
    PromoDoc = "uat017348.html"

    ElseIf ServerName = "www.qa.gliconline.com" Then
    VUurl = "https://" + ServerName + VUurl
    URL = "https://" + ServerName + QALBSurl
    PromoDoc = "uat017348.html"

    Else
    VUurl = "http://" + ServerName + VUurl
    URL = "https://" + ServerName + PRODLBSurl
    PromoDoc = "015935.html"
    End If

    %>

    <script LANGUAGE="JavaScript">
    dynamicanimAttr = "dynamicanimation"
    animateElements = new Array()
    currentElement = 0
    speed = 0
    stepsZoom = 8
    stepsWord = 8
    stepsFly = 12
    stepsSpiral = 16
    steps = stepsZoom
    step = 0
    outString = ""
    function dynAnimation()
    { Code for the dynamic animation is entered here
    }

    </script>
    <title>Main Page - Right Side</title>
    </head>

    <BODY
    background="../images/blugradpln.jpg"
    text="<%=appmenutext%>"
    class="<%=appmenuclass%>"
    link="<%=appmenulink%>"
    vlink="<%=appmentvlink%>"
    onload="dynAnimation()"
    >

    <div id="background" style="position:absolute; left:0; top:0; width:92px; height:90px; z-index:1">
    <%'add%>
    <img src="../images/bluwatermrk.gif">
    </div>

    <!--Promo Box added 7/26/06-->

    div style="position: absolute; width: 458px; height: 73px; z-index: 3; left: 75px; top: 10px" id="Promobox">
    <iframe name="I1" src="../webdocs/cl_getStellantDoc.asp?DocName=<%=PromoDoc%>" scrolling="no" border="0" frameborder="0" width="448" align="center" height="62" marginwidth="1" marginheight="0"></iframe></div>


    <!--<div id="g" style="position:absolute; left:326px; top:221px; width:125px; height:135px; z-index:2">-->
    <div id="g" style="position:absolute; left:0px; top:0px; width:125px; height:495px; z-index:2">

    <table border=0 cellpadding=0 cellspacing=0 width=615>
    <tr>
    <td height=89>&nbsp;</td>
    </tr>
    <tr>
    <td align=center colspan=2>
    <p ALIGN="center" dynamicanimation="spiral" style="position: relative !important; left: 10000 !important">
    <img src="../images/welc_online2.gif" border=0>
    </p>
    <BR>
    </td>

    </tr>

    <A HREF="../webdocs/cl_ContentLibraryLink.asp?CLLink=GOLWhatsNewResult s.do"
    onMouseOver="document.roll.src='../images/g2.gif'"
    onMouseOut="document.roll.src='../images/whatsnew.gif'">
    <p ALIGN="left" dynamicanimation="flyBottom" style="position: relative !important; left: 10000 !important">
    <IMG BORDER="0" NAME="roll" SRC="../images/whatsnew.gif">
    </P>
    </A>
    </div>

    </body>
    </html>
    Last edited by dimepiece18; 07-28-2006 at 05:27 PM.

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First, a few posting guidlines...
    • Please enclose your code snippets in [CODE] ... [/CODE] tags
    • Try to limit the code to only what the client would see (especially in the client-side forums). The ASP can be distracting and not all people use the same server-side language (eg I use PHP, so the ASP is somewhat foreign). Try running the page and copy the code from the 'View Source' of the browser instead of the actual file.


    As to your problem...
    Not sure what you were planning to do with the dynAnimation() function; whether this was just a stub for a possible fix to this problem or if it's a completely different function that you want to run at document onload. I'm going to assume it's the latter so that you can see how to implement multiple functions onload...

    Have this code inside your <script> tags in the header, perhaps after the dynAnimation() function:
    Code:
    function setIFrame()
    {
      document.getElementById('I1').src="../webdocs/cl_getStellantDoc.asp?DocName=<%=PromoDoc%>";
    }
    
    window.onload = function() {dynAnimation(); setIFrame();};
    You can then remove the onload event from the <body> tag. Also, remove the src attribute from the IFrame; this will be added after the page has loaded. Finally, you'll have to give an id attribute to the IFrame; in the above code, I assumed you'd just give it the same value as its name.

    Note that I'm taking your word for granted that loading the IFrame source after the page has load will solve your problem, since I couldn't see anything about logging in, etc. in the code you posted (perhaps not needed to show if you're correct). Also note that the IFrame "box" will still be visible when the page loads, although it may be empty while the IFrame src loads.
    If you want answers, write a smart question.

    Yes, someone probably does know how...

    Oh, and if you want to learn, STFW!

  • #3
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the tips. I'm new to posting to forum sites. I will go through your suggestion and test it out.

    The dynamicanimation function is to have images fly in on the home page, either spiral in, or fly in from the bottom. This function was created long before I took over the code. The images are links to applications.
    So right now the body onloads the images with animation.


  •  

    Posting Permissions

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