Crossbrowser In Framesets?
Oct 3, 2006
I am building a linear sequence of pages with forward and backward nav. Because they have to pass info from one page to another they're in a frameset. I want the same title to appear on all the pages so I've put the title as a variable in the frameset. title="Mytitle"
I have a global.js which is loaded with every page and it contains a script to run certain functions on page load. One of these is a function addTitle() which is to take the variable from the frameset and put it into the appropriate div on the page. I did it at first with innerHTML
var titleplace=top.mainFrame.document.getElementById("sectionTitle")
title=parent.title
titleplace.innerHTML=title
This works in IE5.5 and 6 but not in Firefox or Opera. No error message but it just doesn't show anything.
I then tried with DOM scripting:
var titleplace=top.mainFrame.document.getElementById("sectionTitle")
title=parent.title
mazename=top.mainFrame.document.createTextNode(title)
titleplace.appendChild(mazename)
Same thing - no-show in FF or Opera, but OK in IE.
I've proved that the addTitle function is being run on pageload and it is getting the right value for title from the frameset. It just isn't putting it into the page.
OK, I could just hard-code it but this is to be a template for other apps so I'd like as much as possible scripted. I don't want anything specific in global.js as it should be reusable by anyone using the templates without them going into it.
View 1 Replies
Feb 10, 2006
i need a DHTML drop down menu sample with framesets used or the cross-frame..i dont have any dropdown menu creator because they are just a trial verion..
View 1 Replies
View Related
Jul 12, 2006
I'd like to know where I can find some informations on how to retrive
element dimensions in a cross browser whay. Until now I used
offsetWidth and offsetHeight, but I know their are not standard and
they have a different behaviour on different browsers. I need a way
that includes also margins, padding and eventually border size. I know
I have to deal with doctypes, but my javascript knowledge is not so
advanced.
View 3 Replies
View Related
May 26, 2005
As you might know, removeNode() is an IE DOM extension (works only for IE5, IE6 and Opera 8 but not in IE 5.2 for Mac, Moz, Safari.
Following one of my clients request I think I found a cross-browser solution to remove a node but keeping it's childs. The request was to find a function which will remove, onevent, the <a href=""> tags, but keeping the inner text.
This is what I have done. If you know a better or a shorter solution, please let me know:
function removeN(tag){
var tags = document.getElementsByTagName(tag);
for (var i=tags.length-1;i>=0;i--){
var root = tags[i].parentNode;
var kids = tags[i].childNodes;
var eSpan = document.createElement('span')
for(var j=0;j<kids.length;j++){
clon = kids[j].cloneNode(true);
eSpan.appendChild(clon)
}
root.replaceChild(eSpan,tags[i])
}
}
the variable tag might be 'a', 'strong', 'em'....
I guess that the code might be used as a crossbrowser solution for replaceNode() as well. In fact the code as it is replaces the node tag with a <span> tag, but it might replace it whith another desired tag....
View 5 Replies
View Related
Nov 3, 2010
Is anyone able to make this code crossbrowser? Can it actually be done?It brings up the print dialog box and will print out the contents of a textarea box, but only in IE.
Code:
/*
for notepad printouts
[code]....
View 3 Replies
View Related
Jun 30, 2011
I have a page that is running several scripts. I am trying to add a script which refreshes an iframe every 5 seconds. The iframe is reading the contents of a chat buffer so I want the frame to show non-logged-in viewers the latest...I can get my existing code using setInterval to work fine on IE, but it wont on FF or Chrome though Chrome will show the updated info if I refresh the page (which I dont want to do as a am also reloading jpgs. and which FF wont do without emptying the cache).
the page is here: kayasplace.com/cam2.php
and the body code:
Code:
<script>
window.setInterval("reloadIFrame();",5000);
function reloadIFrame() {
[code]....
View 3 Replies
View Related