When you click on "resume" or "portfolio", the Javascript console is telling me that my elements "resumeNav" and "portfolioNav" are not defined. I'm just attempting to change the classnames of certain divs from invisible to visible. The javascript is very simple:
function clearHeader()
{
resumeNav.className = "hide";
portfolioNav.className = "hide";
}
function showHeader(header)
{
clearHeader();
if (header == resumeNav)
{
resumeNav.className = "showNav";
}
if (header == portfolioNav)
{
portfolioNav.className = "showNav";
}
}
when you click the link from the iframe it doesn't work at all in firefox...says the function is not defined.This is working like a charm in Safari ---I have tried defining the function in a dozen different places -- INCLUDING the index.php header and the content item there on the page.Also in the google.blogger header --- NONE work in safari as consistently as what I have got here.I basically hacked a google.blogger widget and wanted to use a submit-form instead of the get-url variables to load the page of the website wth the blogger iframed into the site.
I'm having some issues with firefox, chrome seems to work ok. Firebug is giving me an error stating country is not defined. The line it's saying it's on is where the function for an ajax call to populate a select input on page load.[code]...
Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and Firefox 1.0 PR. When I call a function previously defined inside another function I've got "function is not defined". Why?
Im getting and error in firefox saying that total is not defined, However i think it is in blue. i understand the return statement concept just not how it works in conjuction with arrays.
Using advice from this newsgroup, I tried this JS to create new DOM elements on-the-fly
var divSidebarItem = document.createElement("div"); divSideBarItem.setAttribute("class", "sidebarToDo");
but I get a JS error on the second line "divSideBarItem" is not defined when I try and invoke the "setAttribute" method. Is there a better way to create an element with attributes or is there something wrong with the above?
I've got some text that I want to change what it says:(63%) on RRP (£80.00) The percentage value and RRP Price will change dependant on the product and its discount. All I want to change with jquery is the text:
It works if I specify the actual background image within the function, so I know the image is there, and I know it's been properly assigned to div2, but div1's background image doesn't change.
I know it's something stupid I'm doing but I can't figure it out. Essentially I'm trying to load two objects with URLs with two websites that can be loaded(displayed) and unloaded(hidden) at the click of a button.
I've spent an hour trying to debug this and I'm at my whits end! I'm doing this with changing the width and height of the divs that contain the objects that will load the websites. But, in Firefox I get an error in the error console saying : loadUnload is not defined. why? code...
At work I have written a form builder which is all drag and drop.
The issue I have is with ending the drop, I have no problems in IE. The drag is controlled by the onmousemove and onmouseup events for the document body.
The trouble is, in Firefox, if the cursor is over a form item, then the onmouseup event doesn't fire and therefore the drag doesn't end.
There is no problem with other items, other HTML items, tables, list, divs, then all bubble the event to the body.
Anyone ever come across this, if so how did you get round it.
Do I need to manually make form elements bubble in Firefox? Maybe I should just stick a div opacity 0 over the drag objects and make that call the body's onmouseup event.
I know this isn't in the context of the rest of the code but hoepfully it's enough to go on. Is anyone able to tell me why the following works in FireFox but not IE code...
I need it to be supported in both so I've put in a check to see which browser the code is currently dealing with and used both snippets in an if/else but it seems to me that something so straightforward shouldn't require this and I am missing something obvious.emulate the DOM property hasAttribute(attributename) in ie7?
Do we have any alternative for orientation attribute of Td element in javascript for firefox? Below code works fine in IE but throws undefined in firefox:
I have form where I add dynamic html element as below. In the php code via ajax I have built the full drop down list. So when I post the form in IE when I do like this $masterID=$_POST['masterID']; I am able to capture the form value. But in both firefox and chrome it shows me empty
function getMaster(entID,nextElement) { var table = document.getElementById('myTable'); var rowCount = table.rows.length;
I'm writing a function to fade the background color of an element, and the function I've written works for hex values, but if I do element.style.backgroundColor in Firefox it returns the value as "rgb(r, g, b)" instead of the hex string. IE and Opera both return the hex string. Is it possible to force FF to return the hex value? I could just store the hex value in the code instead of grabbing it from the element, but I'd rather it be more flexible. I haven't been able to find anything online about making firefox cast to hex, and I don't really want to write a custom rgb to hex function.
I have the script below, which is supposed to populate a text box on a form which opened this popup window - it should then call a function 'PostThisPage' on the opener document, and then close the current window/popup.
This works ok in IE - can anyone please help me by pointing out what it needs to become cross-browser compatible? It doesn't work in Firefox 1.0.
All this time I was testing my sites only in IE6 until my friend told me it wasn't working in FireFox. So I have to make changes in my Javascript code. In the Javascript console all the errors are pointed at the window object in all lines. alert(event.type) gives event undefined. Then I tried Event.type because I read somewhere that mozilla reads it as Event while IE as event. But then it gives:
Error: document.Event has no properties Source File: http://localhost/xxx/xxx/xxx.js Line: 3
Any idea of what I should be doing for it to work in FireFox ? The site works perfectly fine in IE until someone told me that IE doesn't follow w3c rules.
I am using a custom JS dropdown in place of an HTML select ... the problem is the drop is used to select a link then a button is clicked to goto the selected item.
In IE it work perfect ... but in FF the values just get appended to the URL in address bar ... it is just a window.open function but will not work. Code:
I use the following script in order to show/hide a section, and at the same time to change a companion .gif with another:
function doExpand(paraNum,arrowNum){ if (paraNum.style.display=="none"){paraNum.style.display="";arrowNum.src="../../images/arrOn.gif"} else {paraNum.style.display="none";arrowNum.src="../../images/arrOff.gif"} }
and then in the body: <div id="reltpc"><a href="javascript:;" onClick="doExpand(xplan1,ico1)"><img id="ico1" src="../../images/arrOff.gif" alt="" width="10" height="9" border="0"> Show Info</a></div> <div id="xplan" style="display:none" onClick="doExpand(xplan,ico1)"> <p>text here</p> <p>some more text here</p> </div>
Furthermore, two more scripts are used in order to show/hide a section without the image:
function doSection (secNum){ if (secNum.style.display=="none"){secNum.style.display="block"} else{secNum.style.display="none"} }
function noSection (secNum){ if (secNum.style.display=="block"){secNum.style.display="none"} }
and then in the body: <div id="more"><a href="javascript:;" onClick="doSection(dtails1)">More Info</a></div> <div id="dtails1" style="display:none" onClick="noSection(dtails1)"> <p>text here</p> <p>some more text here</p> </div>
All three of them are working good in IE and Ffox, however the second claims to use "gelElementById" instead.
Well, how could it be done? Would you help me please, to get that conversion?
I have a php page with a drop down list, and the default selected option is "Select a location" (without quotes). Using the drop down initiates a database query. One of (3) things should happen:
1. If an option is selected for which results are available, they should be displayed on the same page beneath the drop down list in a table.
2. If an option is selected for which results are NOT available, a message should be displayed informing the visitor that there were no results for that query.
3. If the default selected option has not yet been changed (ie: when the page first loads), no message should display.
#1 and #2 work, but the message described in #2 is still displayed when the page first loads before the default selected option is changed (#3) but in Internet Explorer only. Firefox displays the page correctly under all three conditions.
The message that I want hidden on page load is wrapped in a div named "infobox" and I'm using the following script to hide it which is at the bottom of the page:
<script language="javascript" type="text/javascript"> function ClearDiv() { if (document.form2.name.options[document.form2.name.selectedIndex].value=="Select a location") { document.getElementById("infobox").style.display = "none"; } }
ClearDiv(); </script>
I've also included the php code that writes out the message and the table below....