www.webdeveloper.com
Results 1 to 5 of 5

Thread: undefined Doc

  1. #1
    Join Date
    Nov 2008
    Posts
    14

    undefined Doc

    I have an IFrame coming into a jsp page. I'm using this java script to call the correct url. It works in I.E., but in Firefox I get a error messages that says "document is undefined", which as you can see, is true. I tried x=document, but not good enough. Can anyone tell me what I have to include in the scipt to define the doc correctly? Thank you for your help.

    <script language="javascript">
    document.exchangeIndicesModule.location="<%= exIndModuleURL %>";
    </script>

  2. #2
    Join Date
    Jun 2007
    Location
    Washington D.C. Metro
    Posts
    76
    Code:
    <script language="javascript">
    window.frames[exchangeIndicesModule].location="<%= exIndModuleURL %>";
    </script>

  3. #3
    Join Date
    Nov 2008
    Posts
    14

    Still undefined in Firefox

    I am still getting an undefined message on the javascript at the bottom of this code.

    One of the URL's with this iframe on it is:

    https://www.intersecurities.com/wps/portal/isi

    and below is all the code from the one of the view jsp's. We are using a blank.html page in the src tag because we are behind a secure protocol. If I put the individual URL feeds coming into the IFrames in src tag, everything is fine, but we have multiple sites sharing the portlet, so we had to define the URL's for the IFrames inside a java class. Please let me know if you have any suggestions.

    <%@ page session="false" contentType="text/html" import="javax.portlet.*,com.aegon.us.afp.marketwatch.*" %>
    <%@taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
    <portlet:defineObjects/>

    <div id="marketwatch">

    <%
    MarketWatchViewBean viewbean = (MarketWatchViewBean)request.getAttribute("viewbean");
    String exIndModuleURL = viewbean.getExchangeIndicesURL();
    System.out.println("exIndModuleURL in nviewbean is *** "+exIndModuleURL);
    System.out.println("exIndModuleURL in nviewbean is *** "+renderRequest.getWindowState());
    /*
    * Portal Server seems to be storing the window state of the portlet.
    * This is causing problem whenever portlet is rendered in maximized mode and the user
    * leaves to another page and come back to the original page. In that situation
    * the portal server is rendering the portlet in maximized mode eventhough
    * the page has other portlets.
    * The following logic is to fix the above problem.
    */
    if (renderRequest.getWindowState().equals(WindowState.MAXIMIZED)) {
    %>
    <script language="javascript">
    location.href('<portlet:actionURL windowState="Normal" />');
    </script>
    <%
    } else {
    %>
    <table class="noborder" align="center">
    <tbody>

    <tr>
    <td valign="bottom">
    <IFRAME src='blank.html' name='exchangeIndicesModule' id='exchangeIndicesModule' width='170' height='248' scrolling='no' marginheight='0' marginwidth='0' frameborder='0'></IFRAME>
    </td>
    </tr>

    <tr>
    <td>
    <jsp:include page="QuoteLookup.jsp" flush="true"/>
    </td>
    </tr>

    <tr>
    <td>
    <a href="<portlet:actionURL windowState="Maximized"><portletaram name='content_dm' value='complete'/></portlet:actionURL>">
    Click here for the complete market summary</a>
    </td>
    </tr>

    </tbody>
    </table>
    <%
    }
    %>
    </div>
    <script language="javascript">
    document.exchangeIndicesModule.location="<%= exIndModuleURL %>";
    </script>

  4. #4
    Join Date
    Jun 2007
    Location
    Washington D.C. Metro
    Posts
    76
    did you try?:
    Code:
    <script language="javascript">
    window.frames[exchangeIndicesModule].src="<%= exIndModuleURL %>";
    </script>
    if that doesn't work, try:
    Code:
    <script language="javascript">
    document.getElementById('exchangeIndicesModule').src="<%= exIndModuleURL %>";
    </script>
    don't think location is a valid property of an iframe object.

  5. #5
    Join Date
    Nov 2008
    Posts
    14

    Undefined in Firefox

    It was the .location property. Everything is working in Firefox. Thank you so much for your help.

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



Recent Articles