We have A Framed Application. In one of the process, when the page is submitted, we show a busy image until the response is received as the process might take 1+ minute.
In IE11, the Application keeps on loading and never shows the result. But it works fine in Chrome, Firefox and IE Compatibility mode. Please see below for the code.
var myTop = form_input();
if (typeof isaTop == 'function' && isaTop().header) {
isaTop().header.busy(parent.form_input)
}
myTop.location.href = request;
function busy(frameObject) {
try {
with(frameObject.document){
// get all the stylesheets from the header
var allStylesheets = this.window.document.styleSheets;
writeln("<html><head>");
// add the css sheets
for(var i = 0; i < allStylesheets.length; i++) {
writeln('<link type="text/css" rel="stylesheet" href="' + allStylesheets[i].href + '" />\n');
}
// add the rest
writeln("</head>\n<body><div id='busy'>\n" +
"<img src='<%=WebUtil.getMimeURL(pageContext, "b2b/mimes/images/busy.gif") %>' alt='<isa:UCtranslate key="b2b.busy.message"/>' />" +
"<p><isa:UCtranslate key="b2b.busy.message"/></p>" +
"</div></body></html>");
}
frameObject.document.close();
}
catch (e) {}
}
<frameset cols="*,15,0" id="fourthFS" border="0" frameborder="0" framespacing="0">
<!--End of edit by Arshid to hide the history frame from startup of application-->
<frameset rows="0,*" id="workFS" border="0" frameborder="0" framespacing="0">
<frame name="documents" src="<isa:webappsURL name="/b2b/updateworkareanav.do" />" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" />
<frame name="form_input" src="<isa:webappsURL name="/b2b/updatedocumentview.do?refresh=1" />" frameborder="0" scrolling="auto" marginwidth="0" marginheight="0" title="<isa:translate key="b2b.frame.jsp.forminput"/>" />
</frameset>
<frame name="closer_history" src="<isa:webappsURL name="/b2b/closer_history.jsp" />" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" title="<isa:translate key="b2b.frame.jsp.closerhistory"/>" />
<frame name="_history" src="<isa:webappsURL name="/b2b/history/updatehistory.do" />" frameborder="0" scrolling="auto" marginwidth="0" marginheight="0" title="<isa:translate key="b2b.frame.jsp.history"/>" />
<noframes>
<p> </p>
</noframes>
</frameset>
We tried enabling IE Compatibilty mode by putting following code but we are not able to fix the issue.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8">
Can some one please give us any clues or help?
Thanks,
Srinivas
enter code here
Related
I have a frameset that has 3 frames:
<frameset rows="124, *, 0">
<frame id="f1" scrolling="No" frameborder="0" src="" name="control">
<frame id="f2" frameborder="0" src="" name="main">
<frame id="f3" noresize frameborder="0" name="go">
</frameset>
I'm going to check if frame with id = "f2" exist?
I have tried :
<script>
if( document.getElementById("f2").contentDocument.documentElement.innerHTML !== null) {
alert('ok');
}
</script>
But not worked.
I know i should do something like:
document.getElementById("f2")
but need more info
Well - actually what you should do is only check if document.getElementById("f2") return something, however in order for this to work you must set the doctype of your document to frameset:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
Otherwise the browser will not recognize the frame, and it will return nothing.
Check this fiddle:
https://jsfiddle.net/b8xg9y8u/
document.getElementById() returns null if the element doesn't exist, so the expression will be false, either add ! at the begining, or add your code in the else case
if (!document.getElementById("f2")) {
}
or
if (document.getElementById("f2")) {
} else {
}
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>
First, sorry for my english but I'm not native and It's my first post (Yep, I'm new member here).
I have the following HTML and jQuery code:
<div id="info" style="width: 100%; height:280px;">
if (sectores.getVisible()) {
if (url1) {
$('#info').html('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url1 + '"></iframe>');
}
}
if (despachos.getVisible()) {
if (url1) {
$('#info').html('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url2 + '"></iframe>');
}
}
Result:
It works but only show me the last "iframe".
I've thought I need to put "the iframes" within a stack or something similar... But I'm not really sure.
So, I'd like to visualize more than one iframe within of info 'div'.
The recommended way would be to append the iframes into the parent. Typically, when doing that, you empty the parent prior to any append operations:
var $info = $("#info");
$info.empty();
if (sectores.getVisible()) {
if (url1) {
$info.append('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url1 + '"></iframe>');
}
}
if (despachos.getVisible()) {
if (url1) {
$info.append('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url2 + '"></iframe>');
}
}
If you want to perform fewer DOM modifications or have some special-case, you can build up multiple elements in a string before adding them to the DOM:
var $info = $("#info");
$info.empty();
var info_html = "";
if (sectores.getVisible()) {
if (url1) {
info_html += '<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url1 + '"></iframe>';
}
}
if (despachos.getVisible()) {
if (url1) {
info_html += '<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url2 + '"></iframe>';
}
}
$info.html(info_html);
Can you put the second iframe into a second "div"?
I would think that your second one is overriding the first.
Instead of .html() you should use .append() else the second .html() will write the first .html()
if (sectores.getVisible()) {
if (url1) {
$('#info').append('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url1 + '"></iframe>');
}
}
if (despachos.getVisible()) {
if (url1) {
$('#info').append('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url2 + '"></iframe>');
}
}
You are basically overwriting one piece of code with another when you use .html().
What you should do instead is:
$('<iframe width="100%" height="100%" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" seamless src="' + url1 + '"></iframe>').appendTo('#info');
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.
I'm trying to write a script in Greasemonkey that will generate link's in a frame, but with my limited Javascript knowledge I don't really know how to do this.
Example of subject:
<html>
<head>
<frameset border="0" frameborder="no" framespacing="0" cols="*,280" rows="*">
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,200">
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="75,*">
<frame scrolling="NO" name="bannerFrame" src="banner.php">
<frame scrolling="auto" name="mainFrame" src="main.php">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<body class="framemainbg" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<table class="areadescription" cellspacing="0" cellpadding="0" border="0">
<br>
<table>
<tbody>
<tr>
<td>
<p class="personlistcaption">Text:</p>
<p class="listusersrow">
<table>
<tbody>
<tr>
<td valign="top">
<td valign="top">
<b>Text </b>
Text -
Attack
-
<a class="fastattack" onclick="this.href += '&yscroll=' + window.pageYOffset;" href="fight.php?action=attacknpc&checkid=8409099&act_npc_id=764">Quickattack</a>
<br>
Text
</td>
</tr>
</tbody>
</table>
</p>
</td>
</tr>
</tbody>
</table>
<br>
<table>
<form name="formular">
</body>
</html>
</frame>
</frameset>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,0">
</frameset>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,360">
</frameset>
<noframes><body> Text </body></noframes>
</html>
Example of desired Output :
<html>
<head>
<frameset border="0" frameborder="no" framespacing="0" cols="*,280" rows="*">
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,200">
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="75,*">
<frame scrolling="NO" name="bannerFrame" src="banner.php">
<frame scrolling="auto" name="mainFrame" src="main.php">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<body class="framemainbg" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<table class="areadescription" cellspacing="0" cellpadding="0" border="0">
<br>
<table>
<tbody>
<tr>
<td>
<p class="personlistcaption">Text:</p>
<p class="listusersrow">
<table>
<tbody>
<tr>
<td valign="top">
<td valign="top">
<b>Text </b>
Text -
Attack
-
<a class="fastattack" onclick="this.href += '&yscroll=' + window.pageYOffset;" href="fight.php?action=attacknpc&checkid=8409099act_npc_id=764">Quickattack</a>
-
Hit
-
Chase
<br>
Text
</td>
</tr>
</tbody>
</table>
</p>
</td>
</tr>
</tbody>
</table>
<br>
<table>
<form name="formular">
</body>
</html>
</frame>
</frameset>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,0">
</frameset>
<frameset border="0" frameborder="NO" framespacing="0" cols="*" rows="*,360">
</frameset>
<noframes><body> Text </body></noframes>
</html>
This Links should be generated:
-
Hit
-
Chase
The 'checkid=...' and the 'npc_id=...' must be the same value as in this link:
<a class="fastattack" onclick="this.href += '&yscroll=' + window.pageYOffset;" href="fight.php?action=attacknpc&checkid=8409099act_npc_id=764">Quickattack</a>
OK, this is really just basic HTML DOM manipulation, there's nothing GreaseMonkey-specific here.
First, I'm going to assume that the link you want to copy the URL parameters from is the only one with class="fastattack", since that makes finding it easy:
var link = document.getElementsByClassName( 'fastattack' )[0];
if ( link ) {
// we found the link, do stuff with it...
Next, we need to generate the first new link:
var newlink = document.createElement( 'a' );
...make it point to the URL we want:
newlink.href = link.href.replace( 'action=attacknpc', 'action=slapnpc' );
...and give it the link text we want:
newlink.textContent = 'Hit';
Next, we insert the new link into the DOM just after the original link, like this:
var nextNode = link.nextSibling;
link.parentNode.insertBefore( newlink, nextNode );
Oops, we forgot to insert the delimiter first! No worries, we can still do that:
var delim = document.createTextNode( ' - ' );
link.parentNode.insertBefore( delim, newlink );
Now we can just do the same for the other link:
var newlink2 = document.createElement( 'a' );
newlink2.href = link.href.replace( 'action=attacknpc', 'action=chasenpc' );
newlink2.textContent = 'Chase';
link.parentNode.insertBefore( delim.cloneNode( true ), nextNode );
link.parentNode.insertBefore( newlink2, nextNode );
This time, I remembered to insert the delimiter first. I used the same delim node as above, but I made a copy of it because I wanted to insert another identical delimiter, not move the original delimiter to a new position in the DOM.
Finally, we need to close the if block, and that's it:
}
(Disclaimer: I have not actually tested the code above. I think it should work, but there might be bugs or typos that I've missed.)
Edit: Changed the code to insert the new links just after the original, rather than at the end of the parent paragraph.
Addendum:
If you have multiple links with class="fastattack" in the document, and wish to apply the code above to each of them, you can do that by replacing the first two lines above with a loop over all the links, instead of just the first one:
var links = document.getElementsByClassName( 'fastattack' );
for ( var i = 0; i < links.length; i++ ) {
var link = links[i];
// now do stuff with link just like above