Frame reload not working in Firefox and Chrome - javascript

A frame is not reloading in Firefox and Chrome, but works in IE.
parent.toolbar.location.reload()
my function executes in the "builder" frame. i have used this method before and it has worked in all browsers...but not anymore, only works in i.e.
here is frame layout
<FRAMESET id="frameset" rows="95,*" cols="*">
<FRAME noresize="" id="toolbar" name="toolbar" src="Application/toolbar/<?=$id ?>">
<FRAMESET COLS="81%,*">
<FRAME id="preview" name="preview" src="<?=$preview_url ?>" onload="builder.setPreviewEvents()" >
<frameset id="tcolor" rows="60,*" cols="*">
<FRAME id="colorfr" name="colorfr" scrolling="no" src="<?=$colorfr_url ?>" >
<FRAME id="builder" name="builder" src="<?=$builder_url ?>" >
</frameset>
</FRAMESET>
</FRAMESET>

Try this:
parent.document.getElementById("toolbar").src = parent.document.getElementById("toolbar").src;

Related

I want to resize frame horizontal as well as vertical

I want to resize code horizontally as well as vertically. When one frame goes to near other frame also pushing with first frame and move both frames.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
function getFrameSize(frameID) {
var result = {height:0, width:0};
if (document.getElementById) {
var frame = parent.document.getElementById(frameID);
if (frame.scrollWidth) {
result.height = frame.scrollHeight;
result.width = frame.scrollWidth;
}
}
return result;
}
</script>
</head>
<frameset rows="42,*" cols="*">
<frame src="menu_bar.html" name="topmenu" noresize="noresize" marginwidth="20">
<frameset rows="*" cols="33%,33%,33%" border="20" bordercolor="silver">
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2">
<frame Id="frameID" name="google" src="frame_a.html" marginwidth="20">
<frame src="frame_b.html" marginwidth="20">
<frame src="frame_c.html" marginwidth="20">
</frameset>
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2">
<frame src="frame_d.html" marginwidth="20">
<frame src="frame_e.html" marginwidth="20">
<frame src="frame_f.html" marginwidth="20">
</frameset>
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2" id="foo">
<frame src="frame_g.html" marginwidth="20">
<frame src="frame_h.html" Id="idFrame" marginwidth="20">
<frame src="frame_i.html" marginwidth="20">
</frameset>
</frameset>
</frameset>
</html>

Frames referencing with a frameset

I want to load the content of this page in the right frame, how do i specify this?
<html>
<head>
<script type="text/javascript">
function LoadInCenter(doc1)
{
parent.right_bottom.location.href = doc1
}
</script>
</head>
<body align="center">
test
</body>
</html>
This is a page with frames which I have created, the left-bar as the navigation pane and the right as the place to display the content. When a user clicks on any of the links on the left it should display it in the middle. How do I achieve this?
<?php
?>
<!DOCTYPE html>
<html>
<frameset rows="15%,75%">
<frame src="loggedin.php">
<frameset cols="15%,75%">
<frameset rows="5%,5%,5%,5%,*">
<frame src="myprofile.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" name="myprofile">
<frame src="mycompany.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="mycompany">
<frame src="myproduct.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="myproduct">
<frame src="market.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="market">
<frame src="">
</frameset>
</frameset>
</frameset>
</html>
This is the answer to the question posted above. What I wanted to achieve has been stated. This is to split the frameset into header, side-bar and content area.
The header is to display logo and others things that as pertaining to the company. This line of code achieves that:
<frame src="loggedin.php">
The sidebar is to serve as the navigation link, when any of these links is clicked the content should be displayed in the content-area. This line of codes achieve that:
<frameset rows="5%,5%,5%,5%,*">
<frame src="myprofile.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" name="myprofile">
<frame src="mycompany.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="mycompany">
<frame src="myproduct.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="myproduct">
<frame src="market.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="market">
<frame src="" >
</frameset>
The last part is the content area which occupies the the rest of the page. This is displayed by this line of code:
<frame src="empty.html" noresize="noresize" marginwidth="5" marginheight="5" name="centerpage">
So, this is the full code. Anyone can copy and paste to see the output.
<!DOCTYPE html>
<html>
<frameset rows="15%,75%">
<frame src="loggedin.php">
<frameset cols="15%,75%">
<frameset rows="5%,5%,5%,5%,*">
<frame src="myprofile.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" name="myprofile">
<frame src="mycompany.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="mycompany">
<frame src="myproduct.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="myproduct">
<frame src="market.html" noresize="noresize" scrolling="no" marginwidth="5" marginheight="5" border="0" name="market">
<frame src="" >
</frameset>
<frame src="empty.html" noresize="noresize" marginwidth="5" marginheight="5" name="centerpage">
</frameset>
</frameset>
</html>

set target frame for onclick event

My onclick opens a page called index.html. My site has frames and I want to set the target frame. my function is in FRAME id="preview" and i want to load index.html in FRAME id="bu"
onclick : function() {
// Add you own code to execute something on click
window.location = 'index.html';
}
-
<FRAMESET id="frameset" rows="95,*" cols="*">
<FRAME noresize="" id="tool" name="tool" src="Application/tool/<?=$id ?>">
<FRAMESET COLS="81%,*">
<FRAME id="preview" name="preview" src="<?=$preview_url ?>" onload="bu.setPreviewEvents()" >
<frameset id="tcolor" rows="60,*" cols="*">
<FRAME id="colorfr" name="colorfr" scrolling="no" src="<?=$colorfr_url ?>" >
<FRAME id="bu" name="bur" src="<?=$bu_url ?>" >
</frameset>
</FRAMESET>
</FRAMESET>
You can access the main window from any frame using top. To refer a specific frame element, you can use its name, or frames collection of the main window:
window.top.frames['bur'].location.href = 'index.html';
Notice, that frames collection contains the window objects within frame elements, not frame elements.

XPATH of framesets

I have a page that has two frames side by side.
<HTML>
<HEAD>
..various scripts..
</HEAD>
<FRAMESET framespacing="0" border="2" rows="93,*,0" frameborder=0>
<FRAME scrolling=no noresize SRC="title_new_2.asp" NAME=titleFrm id=titleFrm>
<FRAMESET framespacing="5" border="5" cols="51%,*" name="cjSet" id="cjSet" frameborder=1>
<FRAME SRC="../project/search/project_search.aspx" NAME=left scrolling="auto" frameborder=0>
<FRAME SRC="dashboard.aspx?demo=n" NAME=right scrolling="auto" frameborder=0>
</FRAMESET>
<FRAME src="blank.htm" border=0 noresize frameborder=0 scrolling=no framespacing=0 NAME=tcj>
</FRAMESET>
</HTML>
I'm trying to get some data that's contained in the frame name=left with the project_search.aspx URL. I've tried both of the below and neither seem to work.
/html/frameset/frameset/frame
//*[#id="cjSet"]/frame[1]
Any pointers would be of great help.

How to add a globally frameset backgound image for a main page?

I want to add a backgound page for my Jsp page, In this i used a frameset when i used a backgound image for a main frameset its showing problem in FF and IE,
Code Is:
<frameset cols="*,1020px,*" border="0" class="bg" style="images/background.jpg">
<frame src="about:blank" />
<!-- Next frameset is centered horizontally and have width:1020px -->
<!-- Tested in IE8,Chrome13,Opera11.50,Safari5,FF7 -->
<frameset rows="8%,*" border="0" >
<frame src="HeaderUi.jsp" name="header" scrolling="no" style="border-bottom:5px solid #630000;" />
<frameset cols="220px,540px,*" border="0" style="background:#000">
<frame src="webSearchUi" name="search" />
<frameset rows="65%,*" border="0" >
<frame src="webMainPageUi" name="mainPage" scrolling="yes" style="border:1px dotted #7D7D7D; border-top:0px; border-bottom:0px dashed #5c5c5c" /> <frame src="webEventPanelUi" name="eventPanel" style="border:1px dotted #7D7D7D; border-top:1px solid #7D7D7D; border-bottom:0px dashed #5c5c5c" /> </frameset>
<frame src="webDataPanelUi" name="dataPanel" style="border-style:solid;border-width:0pt;border-color:66CC33">
</frameset>
<frame src="about:blank" class="Bg" />
</frameset>
</frameset>
<frame src="about:blank" /> </frameset>
In This Code i want to use a background-image.
Thanks in Advance
Mayur Mate
If you are going to use attribute style you should write there css styles in the following way:
style="property1: value1; property2: value2"
in your case the code should be:
<frameset cols="*,1020px,*" border="0" class="bg" style="background: url('images/background.jpg');">

Categories

Resources