Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 JS Error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 22 January 2004 :  19:14:32  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I put a IFrame on a page that links to another page which you can see here...

http://raytheon.shabang.net/default.asp?page=nav&link=services

The problem is on the other page I am getting a JS error which I am not getting when i visit the page by itself. I try to insert the include file for the js into my page and I am still getting the problem. Does anyone know why the page could not be included in the IFrame without getting any JS errors? Here is the top half of the JS file so maybe you can see why it cant be included...


<!--
// page loaded var
var _pageLoaded = 0;
// Some variables governing the apperarance of menu
// items. Note that these values also appear in the CSS
// code below, so if you change these values, be sure
// to change them in both places!
// -------------------------------------
// get root based on folder name
var _folders = new Array("/about_us","/beechcraft","/contact_us","/government","/hawker","/investment","/jobs","/press","/service_support");
var _root = "";
var _location = (top.location + "").toLowerCase()
var _found = -1;
var _foundAt = 999999;
for (var r=0; r<_folders.length; r++)
  if (_location.indexOf(_folders[r]) != -1 && _location.indexOf(_folders[r]) < _foundAt)
  {
    _found = r;
	_foundAt = _location.indexOf(_folders[r]);
  }
if (_found != -1)
{
  _root = _location.substr(0,_foundAt) + "/";
}
//  -> The width of menu items in pixels. This does not
//     include its 1-pixel border, so the menu will
//     actually be 2 pixels wider than this value.
if (!menuItemWidth) var menuItemWidth = 180;
if (!bmenuItemWidth) var bmenuItemWidth = 180;
if (!cmenuItemWidth) var cmenuItemWidth = 180;

//  -> The height of menu items in pixels. This does
//     not include the 1-pixel border between menu
//     items, above the first menu item, and below the
//     last menu item. Thus, the menu's height will
//     actually be: ((menuItemHeight+1)*numMenuItems)+1
if (!menuItemHeight) var menuItemHeight = 19;
if (!bmenuItemHeight) var bmenuItemHeight = 19;
if (!cmenuItemHeight) var cmenuItemHeight = 19;

// The menuURLs array should contain the number of items
// in each menu. For example, if you have two menus with
// 1 menu item and 4 menu items respectively, this would
// be:
//     var menuLengths = new Array(1,4);
//
// NOTE: If you only need a single menu, you can't
// use this syntax. Instead, do
//     var menuLengths = new Array();
//     menuLengths[0] = x;
// where x is the number of menu items.
if (!menuLengths) var menuLengths = new Array();
if (!bmenuLengths) var bmenuLengths = new Array();
if (!cmenuLengths) var cmenuLengths = new Array();

// The menuURLs 2D array should contain the URL's to be
// loaded by each menu item. Leave the following lines alone
// (they set up the empty array).

// the menu items. Be sure to keep your URLs in sync.

// Pop-up menus close after a brief delay when the user's
// mouse passes out of them. If the user's mouse returns to
// the menu before that delay expires, however, the menu
// should no longer be closed. The menuTimers array stores
// these timers for menus that are in the process of closing.
// You don't have to set anything here; the array is
// created based on the menuLengths variable you defined
// above.
var menuTimers = new Array(menuLengths.length);
var bmenuTimers = new Array(bmenuLengths.length);
var cmenuTimers = new Array(cmenuLengths.length);

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 22 January 2004 :  19:40:30  Show Profile
OK it is the preloading of the images at the page you are trying to load: http://www.raytheonaircraft.com/service_support/aircraft_services/overview.htm

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../images/home_page/menu_1s.gif','../../images/home_page/menu_2s.gif','../../images/home_page/menu_3s.gif','../../images/home_page/menu_4s.gif','../../images/home_page/menu_5s.gif','../../images/home_page/menu_6s.gif','../../images/home_page/menu_7s.gif','../../images/home_page/menu_8s.gif','../../images/home_page/menu_9s.gif')" onresize="MM_reloadPage()">
Seen it before where it is looking for the images on the server where the iframe page is being called up.

I hope that helps..

Cheers,

David Greening
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 22 January 2004 :  20:42:31  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Well do you have any idea how I can fix this? It seemed though that the JS error cmenuTimers has nothing to do with the preload since that error comes up only when you hover over the menu item.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 23 January 2004 :  06:08:36  Show Profile
i got the error on this line:

var _location = (top.location + "").toLowerCase()

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 January 2004 :  07:04:27  Show Profile  Visit HuwR's Homepage
the cause of the problem is to do with cross site scripting, because the main window and the iframe are not in the same domain space so the js is getting confused
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 23 January 2004 :  09:39:46  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
http://raytheon.shabang.net is a temp URL and the finaly site will be hosted on the same domain name but in a different directory. Would this still cause problems or would that fix the issue?

The URL that is in the IFrame now is http://www.raytheonaircraft.com/service_support/aircraft_services/overview.htm and then the final URL for the project will be http://www.raytheonaircraft.com/service_support/aircraft_services/kiosk/default.asp

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 January 2004 :  09:56:49  Show Profile  Visit HuwR's Homepage
that should fix the problem
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 23 January 2004 :  10:59:16  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
thanks everyone for the info

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07