Board Logo

Reloading more than one frame with single item
tigra - 9/2/2005 at 06:23 PM

in menu_items.js inside the items structure:

['test item', "javascript:rl('page1.html', 'page2.html')"]

in menu_items.js below the items structure:

function rl (url1, url2) {
if (url1) parent.frames['framename1'].location = url1;
if (url2) parent.frames['framename2'].location = url2;
}

replace framename1 and framename2 with actual frame names. the function can be extended to any number of frames. pass null if you don't want particular frame reloaded.


kP - 4/14/2006 at 05:58 PM

I know very little about javascript, however, I'm having trouble with the following solution to call multiple pages with multiple targets in Internet Explorer on the PC. It seems to work just fine in Safari, but Firefox and Internet Explorer and presumeably Netscape don't work when this code is used.


tigra - 4/14/2006 at 09:10 PM

what kind of problem do you experience? Do you receive any javascript errors?


kP - 4/14/2006 at 09:22 PM

Here is the code I have in my tree_item.js file:

/*
the format of the tree definition file is simple,
you can find specification in the product documentation at:

http://www.softcomplex.com/products/tigra_tree_menu_pro/docs/#hierarchy
*/

var TREE_ITEMS = [
['Project Development', "javascript:rl('solutions/Client Services/Project Management Meth/top_pm_meth.html', 'solutions/Client Services/Project Management Meth/navigation.html', 'solutions/Client Services/client_services.html')",
],
['Solution Development', "javascript:rl('solutions/Client Services/Solution Development Meth/top_solution_dev_meth.html', 'solutions/Client Services/Solution Development Meth/navigation.html', 'solutions/Client Services/client_services.html')",
],
];
function rl (url1, url2, url3) {
if (url1) parent.frames['topFrame'].location = url1;
if (url2) parent.frames['navigation'].location = url2;
if (url3) parent.frames['content'].location = url3;
}

I've also attached a screenshot of the error message I receive. The page it says the error is coming from is always different depending on what it's loading, but I've read that the error message can actually say this, but be coming from the externally loaded .js file.... or simply someplace other than where the error is stating. It's pretty much the same, line 1 stuff error message.


tigra - 4/14/2006 at 09:25 PM

move function rl above the place where you first call it (i.e. put it at the beginning of the file)


kP - 4/14/2006 at 10:02 PM

I tried moving the function to the top of the page as well as under the comments.... I still seem to be getting the same errors... assuming there isn't something else that is jacked up with my stuff. The menu works fine on subsequent pages... the only thing I can't get to work is calling the multiple pages to load stuff into different frames.

/*
the format of the tree definition file is simple,
you can find specification in the product documentation at:

http://www.softcomplex.com/products/tigra_tree_menu_pro/docs/#hierarchy
*/
function rl (url1, url2, url3) {
if (url1) parent.frames['topFrame'].location = url1;
if (url2) parent.frames['navigation'].location = url2;
if (url3) parent.frames['content'].location = url3;
}
var TREE_ITEMS = [
['Project Development', "javascript:rl('solutions/Client Services/Project Management Meth/top_pm_meth.html', 'solutions/Client Services/Project Management Meth/navigation.html', 'solutions/Client Services/client_services.html')",
],
['Solution Development', "javascript:rl('solutions/Client Services/Solution Development Meth/top_solution_dev_meth.html', 'solutions/Client Services/Solution Development Meth/navigation.html', 'solutions/Client Services/client_services.html')",
],
];


tigra - 4/14/2006 at 11:15 PM

You also have commas at the end of the list (where the next symbol after comma is the closing bracket). If fixing this doesn't help then zip all files needed to reproduce the problem and attach the package to the support ticket; our technician will check out your menu setup.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/