JavaScript - Td Orientation Attribute In Javascript For Firefox
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:
if(MyTd.orientation == "Vertical") //throws undefined { //Do something } The HTML for this Td is as follows: <td id="MyTd" orientation = "Vertical" ></td> Thanks. Similar TutorialsHey all, 1) When clicking on a list in an accordion, it should change the quicktime movie playing in a main window area. It works in firefox but not in safari. The variable imgTitle holds the expected output (e.g. '../images/Intro-1.mov'). It changes the src attribute of the embed tag. This change works in Firefox where the new movie plays on click. However, when clicking the list item in safari, nothing happens. 2) There is a problem in firefox as well in that the movie overlays everything else on page, even though it should be behind the text. Positioning would be tedious given that there's many nested elements and I would have to set relative positioning to the entire page. Any reason for this behavior of embed tags? Code: $(".image_thumb ul li ul li").click(function(){ var imgTitle = $(this).find('a').attr("href"); var imgDesc = $(this).find('.block').html(); var imgDescHeight = $(".main_image").find('.block').height(); if ($(this).is(".active")) { return false; } else { console.log(imgTitle); $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { $(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 ); $(".main_image embed").attr({ src: imgTitle}); }); } $(".image_thumb ul li ul li").removeClass('active'); $(this).addClass('active'); return false; }) .hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); Thanks for response. $_SESSION['order']['paymentmethod'] equals "Cheque". With the code bellow, I was expecting JavaScript to change the SELECT drop down menu to "Cheque", but it doesn't... However, when I remove the OPTION attribute value="cheque/", it works. This appears to be because there is a conflict with the OPTION attribute value and the SELECT content value "Cheque". Does anyone know how I can get around this issue? Code: <FORM action="" method="post" name="form"> <DIV> <SELECT class="verdana" name="paymentmethod" onchange="this.form.action = this.value;"> <OPTION></OPTION> <OPTION value="cheque/">Cheque</OPTION> <OPTION value="visa/">Visa</OPTION> </SELECT> <BR> <BR> <INPUT type="submit" value="PROCEED"> </DIV> </FORM> <SCRIPT type="text/javascript"> document.forms["form"]["paymentmethod"].value = "<?php echo $_SESSION['order']['paymentmethod']; ?>"; </SCRIPT> I have an array of all links on a page (see var wa_links = document.links; below). How do I determine if the target of a link is set to "_blank"? I need to do this because currently with my code below, when a link has target="_blank" it ends up adding the Google Analytics code to the parent window and also opening a new window (so basically the new page opens in both the parent and target window instead of just the target window as expected). Code: /*Regex list of on-site domains, pipe and backslash delimited. */ var wa_onsiteDomains = /mydomain\.com|my2nddomain\.com|my3rddomain\.com|javascript/i; //Display-friendly domain and path name var wa_displayDomain = location.hostname.replace("www.","").toLowerCase(); var wa_displayPathname = location.pathname.toLowerCase(); /*Used to unobtrusivly add events to objects*/ function unobtrusiveAddEvent (element,event,fn) { var old = (element[event]) ? element[event] : function () {}; element[event] = function () {fn(); old();}; } function wa_crossDomainLink(i) { return function () { var thisLink = decodeURI(wa_links[i]); if (typeof(_gaq) == "object") _gaq.push(['_link', thisLink]); return false; }; } var wa_links = document.links; if ( wa_links ){ for(var i=0; i<wa_links.length; i++) { if( wa_links[i].href.match(wa_onsiteDomains) && !wa_links[i].href.match(location.hostname)){ unobtrusiveAddEvent( wa_links[i], 'onclick' , wa_crossDomainLink(i)); } } } With jquery I could just do something like... Code: if (jQuery(link).attr('target') == "_blank") ...but how do I do this in plain old JavaScript? Thanks! so i have a navigation bar and instead of clicking on it to another page on the site where everything reloads again i want it to just reload the content area, so i have 5 tables of content each representing a different page and i just want it this way so i can implement something else that doesnt have anything to do with this Code: <script type="text/javascript"> var page = 1; function setPage1() { page = 1; } function setPage2() { page = 2; } function setPage3() { page = 3; } function setPage4() { page = 4; } function setPage5() { page = 5; } function setBlank1(x) { if (page==1) { x.class="content"; } else { x.class="blank"; } } function setBlank2(x) { if (page==2) { x.class="content"; } else { x.class="blank"; } } function setBlank3(x) { if (page==3) { x.class="content"; } else { x.class="blank"; } } function setBlank4(x) { if (page==4) { x.class="content"; } else { x.class="blank"; } } function setBlank5(x) { if (page==5) { x.class="content"; } else { x.class="blank"; } } this is my javascript so whats supposed to happen is when someone clicks a link on the nav bar it sets the page to that value so only that value is showing. i put the functions setPage1-5 in class="setPage1(this)" according to what content area they go too Code: table.blank { display: none; that is my blank class attribute so its not there but its loaded please ask me any questions and sugest anything im not a javascript expert or anything of that sort but ive been looking this over for a couple days now and i cant find anything online either i have the code: foreach($product_names as $product_row) { ?> <tr> <td > </td><td width='200px'><?php echo $product_row->getName();?></td> <td width='200px'><input type="checkbox" name="graphic[]" value="<?php echo $product_row->getId();?>" onclick="check()"/></td> <td width='200px'><input type="checkbox" name="text[]" value="<?php echo $product_row->getId();?>" onclick="check()"/></td> </tr> <?php } ?> and a submit button on the page. the i also have the javascript code for the onclick="check()" : <html> <head> <script type="text/javascript"> function check() { var graphics = document.getElementsByName("graphic[]"); for(i=0;i<graphics.length;i++) { if(graphics[i].checked) { if(document.getElementById('submit').style.display=='none') { document.getElementById('submit').style.display='block'; } } } var text = document.getElementsByName("text[]"); for(i=0;i<text.length;i++) { if(text[i].checked) { if(document.getElementById('submit').style.display=='none') { document.getElementById('submit').style.display='block'; } } } } </script> </head> so what all this means is i have two arrays of checkboxes for each product. as soon as i check any checkbox the submit button appears. i click on the submit button and i go to the next form. the problem now comes in if i click on the "back" button to go back to the previous page via the bwrowser..the submit button is disabled althou all my checkboxes that i checked, are still checked....i want the submit button to show??? please help?? thanks Hi, I have been attempting to transition to use of xhtml strict doctype and my text editor, BBEdit (on Mac) tells me, when I ask it to check syntax, that the attribute 'name' is not allowed in form object, as in any other form element that I tried to use it in. This begs the question, how do I script forms with javascript in the context of this doctype? None of the javascript texts I have address this issue (O'Reilly Rhino book and others). I could figure it out, but it appears to be a complicated process, just doing getElementById() and sorting it out. Does anyone have a reference to material that deals with this issue? Or do I just abandon xhtml strict doctypes? Thanks for time and attention JK I am looking for a image gallery that will work where some photos are positioned horizontally and some are vertical. I hope it is possible. The photos are for an artist that I am working with. I hope someone will have an answer. It doesn't have to be fancy. Even a simple magnifyer would be fine. I guessed that javascript might be the most appropriate form. Thank you in advance, Buffmin.
Alright, I'm trying to work on a little web app. I want to put my phone into landscape and have it return the correct values instead of reversing everything. Does this make sense? I'm talking about the alpha, beta, and gamma positioning. Also, when rotating a cube I made with it...if i rotate gamma positioning, it only goes from 0-180 and -180 to 0. So when I reach that 180, the cube totally reverses on it's other side, how can i prevent this? I need to add a form field to be on the top - centered on the page regardless if the page is portiat or landscape. Is this possible? Everything works like a Charm with the exception of the alignment on the different page orientation - Here is what I have so far: // add form field to each page of the PDF for (var pageNumber = 0; pageNumber < this.numPages; pageNumber++) { var dateStamp = this.addField("DateStamp","text",pageNumber,[450,770,155,790]); dateStamp.textSize=10; dateStamp.textColor=color.red;} this.setAction("WillPrint", "var today = new Date(); var current_hour = today.getHours(); var current_minute = today.getMinutes(); this.getField('DateStamp').value = \"Valid 24 Hours From Printed Date... \" + util.printd(\"dd/mmm/yyyy\",new Date()) + \" \" + current_hour + \":\" + current_minute;"); Please help! DSatele Hi there, can anyone let me know how to add an "ALT" tag to this bit of javascript? myimages[1]="html/images/cat-image-10.jpg" Cheers Hi all, I'm faced to a problem : I'm programming a styles generator for the Stylish add-on. What i want is the same thing that when i click on the button "Install with Stylish" : A Window appear to ask user if he wants to install the script with Stylish. I saved the website page on my desktop and opened it. Obviously it did not worked, nothing happens when i click. I also changed the path for javascript file in the html and so on.. There is a XMLhttprequest() function wich opens the url of the style ending by ".css". But i replaced the url by my file path ( by a locally file) and i replaced the statut (200 by 0, because i'm working on a local file). But whatever i do, nothing happens when i click. There is also a function called firecustomevent() who creates the event, but my knowledges are limited at this point. I read document on mozilla website on how to call an event but i can't get it to work. So if anybody knows how to display a windows asking the user if he wants to install the style, i will be grateful. Thanks and sorry for my bad english The url containing the javascript is a simple style url like this one : http://userstyles.org/styles/17120 where you can see the "install with stylish" button. I also attached the concerned javascript in a txt file. so im using firfoxes firebug and its giving me this java script error missing ; before statement document.getElementById("aia").innerHTML = "<p onclick="" >Sword</p>"; i tried just puting this ; behind the beginning but i just cant figure it out. Hi, This problem has completely stumped me, was hoping from a bit of advice. I have used the code of my affiliate software to show my company logo. This code works in Firefox, but for some reason doesn't work in IE. The company who own the affiliate software have never seen this problem before and have been unable to assist. Not sure if it's a server problem? To see the problem have a look at logo at the top of my test website in firefox then IE. http://www.nctshop.co.uk/staging/ Here is a snippet of the code below. It is the line where it links to nctshopaffiliate which is where the problem lies. Thanks! Adrian Code: <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td class="topnav1bgcolor"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><a href="../default.asp"><script language="JavaScript" type="text/javascript" src="http://www.nctshopaffiliate.co.uk/display.php?token=logo" alt="NCTSHOP" width="650" height="89" border="0"/></script></a></td> <td align="right" valign="top"> <table width="223" border="0" cellpadding="0" cellspacing="0"> <tr><td height="5" colspan="5"><img src="images/clear.gif" alt="" style="width:1;height:1;border:0"></td></tr> <tr><td colspan="5"> </td></tr> <tr><td height="25" colspan="5"><img src="images/clear.gif" alt="" style="width:1;height:1;border:0"></td></tr> <tr> <td class="plaintext"><a title="View Basket" href="basket.asp"><img src="images/newcart_Img.gif" alt="View Basket" style="width:23;height:12;border:0"></a></td> <td><img src="images/clear.gif" alt="" style="width:5;height:1;border:0"></td> <td style="background-image:url(images/bkg_cartinfo.gif);height:21"> <table width="200" border="0" cellpadding="0" cellspacing="0" > <tr> <td class="plaintext" align="center"><a title="View Basket" href="basket.asp"><span class="plaintext"><u>Items</u></span></a> <%=session("SL_BasketCount")%> | Sub Total <%=formatcurrency(session("SL_BasketSubTotal"))%></td> </tr> </table> </td> <td> </td> <td><a class="topnav1" title="Checkout" href="<%=session("secureurl")%>custinfo.asp" ><u>Checkout</u></a></td> </tr> </table> </td> <td style="width:10"><img src="images/clear.gif" alt="" style="width:1;height:1;border:0"></td> </tr> </table> </td> </tr> </table> I'm new to HTML and javascript programming, so I apologize if the solution to this is blatantly obvious. I've got expanding text / menus in javascript on my page. These all work in IE with no problems that I can tell. Unfortunately, when I view the page in Firefox, only the first expanding menu is actually a link and works - the rest do not even appear as links and don't work (and the expanded text isn't showing either). You can visit the page at http://www.scienceadvice.ca/uploads/...s/may2010.html Any help would be most appreciated! Thanks! Hi, I am using googles O3D software and it uses a javascript base, one of there plugins works in Firefox only and not Internet Explorer I was wondering if anyone here could help me find out why it isnt working in IE and even how to fix it, here is the page that works in firefox but not IE http://o3d.googlecode.com/svn/trunk/...edesigner.html Many Thanks, Simon This is a JavaScript sample that works with Internet Explorer and Safari, but not with FireFox and Chrome. If you take the code and save it as test.html open the file with explorer or Safari you will see it works. This is the first time of posted on this forum, sorry if I missed any information. This form posts to a InternetSecure(payment gateway) Sandbox account. [CODE] <head> <title>Variable Payment - JavaScript</title> </head> <script language="javascript"> function getamount() { prod = "::1::P001::Sample Payment::"; pvalue = document.getElementsByName("payvalue")(0).value; amount = pvalue + prod; document.frmdo.Products.value = amount; } </script> <body> <table align="center" width="600"> <tr> <td align="center" valign="middle"><big>View Source For HTML Code<br></big><em><strong>Variable Payment - JavaScript</strong></em><br /></td> </tr> </table> <td align="center" valign="top"> <FORM method=post name="frmdo" action="https://test.internetsecure.com/process.cgi" onsubmit="return getamount();"> <input type="hidden" name="GatewayID" value="106" /> <input type="hidden" name="ReturnURL" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=THK2" /> <input type="hidden" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=SAM1" name="xxxCancelURL" /> <input type="hidden" name="Products" value="" /> <table align="center" width="600"> <tr> <td width="300" height="100%" align="right" valign="middle"><font face="Arial, Helvetica, sans-serif" size="2" color="Black">Invoice Number</font></td> <td width="300" height="100%" align="left" valign="middle"><input type="text" id="Invoice Number" name="xxxMerchantInvoiceNumber" size="8" /></td> </tr> <tr> <td width="300" height="100%" align="right" valign="Middle"><font face="Arial, Helvetica, sans-serif" size="2" color="Black">Payment Amount $</font></td> <td width="300" height="100%" align="left" valign="middle"><input type="text" name="payvalue" value="" size=10 style="text-align:right;" /> <font face="Arial, Helvetica, sans-serif" size="2" color="Black"> USD</font></td> </tr> </table> <table align="center" width="600"> <tr> <td width="600" height="100%" align="center" valign="middle"><input type="submit" value="Submit Payment" name="submit" /></td> </tr> </table> <table align="center" width="600"> <tr> <td width="600" height="100%" align="center" valign="middle"> <!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/visa04.gif" WIDTH=37 HEIGHT=23> <!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/mc04.gif" WIDTH=37 HEIGHT=23> <!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/amex04.gif" WIDTH=37 HEIGHT=23> <!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/disc04.gif" WIDTH=37 HEIGHT=23> </td> </tr> </table> <table align="center" width="600"> <tr> <td width="600" height="100%" align="center" valign="middle"><a target="_blank" href="https://testwww.internetsecure.com/cgi-bin/certified.mhtml?merchant_number=106"><img height="33" border="0" align="center" width="98" alt="" src="https://testwww.internetsecure.com/images/ismerch_sm.gif" /></a></td> </tr> </table> </form> [CODE] Hi There, I have recently completed making a website for my sister's wedding. I am quite new to the web design world, and have only taken 2 classes on the subject. I used a Javascript function that was provided to us in one of my HTML coding classes in order to automatically resize the (nesting?) div's according to how long the content in them is. This all seems to work perfectly fine in Google Chrome, as well as most versions of Internet Explorer - however, in some versions of internet explorer, and ALL versions of Firefox, this resize function does not seem to work. Since this coding was provided to me by a teacher (who is unfortunately in another country), I'm not sure what kinda of edit would make it so it would function in Firefox, or if there is a way to make in function in Firefox at all. I would appreciate if some of you could take a look at it, and let me know if you have any ideas/suggestions/advice, as to what is happening with the code/why it does not work in Firefox/some versions of Internet Explorer. The specific javascript code (which i assume is the issue here - please let me know if I'm wrong about it being the javascript that isn't working) is he PHP Code: function fnReset(){ document.getElementById('dTorso').style.height="380px"; document.getElementById('dMiddle').style.height="auto"; var middleHt=document.getElementById('dMiddle').scrollHeight; var maxHt=Math.max(380,middleHt); document.getElementById('dTorso').style.height=maxHt + "px"; document.getElementById('dMiddle').style.height=maxHt + "px"; } Which is then called to action he Code: <body onLoad="fnReset();> Also, in some versions of Firefox, the background image for the whole page isn't showing up either - any tips on why that is happening would also be amazing. Thank you so much for any help you may provide. This is a gift to my sister and her fiance, and I really want it to work well for them, and all their guests. Thanks! Hi, I am having a strange problem. I have a javascript that I am running on my system and on server(both in IE and FF). The problems I am encountering are as follows: My system IE - everything working fine FF - Not able to set focus correctly. When focus() is called, it jumps to next field. On Server IE - Focus doesnt set as expected. No blinking cursor.Doesnt do anything. FF- Same thing as above. When focus functionality is called, nothing happens. It is a long javascript, but here is a snapshot of the code with problem. Please let me know if you want to know about any variables. The (fname,lname..)are all the Name attributes of textbox. userArray is a array containg the number of users whose information is not filled up correctly(ie. some reqd fields are left empty). Code: df=document.form; for(var j=0;j< val;j++) { if(df['fname'+userArray[j]].value =="") { df['fname'+userArray[j]].focus(); break; } else if(df['lname'+userArray[j]].value =="") { df['lname'+userArray[j]].focus();break; } else if(df['ph'+userArray[j]].value =="") { df['ph'+userArray[j]].focus();break; } else if(df['email'+userArray[j]].value =="") { df['email'+userArray[j]].focus();break; } else if(df['comp'+userArray[j]].value =="") { df['comp'+userArray[j]].focus();break; } else if(df['addra'+userArray[j]].value =="") { df['addra'+userArray[j]].focus();break; } else if(df['city'+userArray[j]].value =="") { df['city'+userArray[j]].focus();break; } else if(df['state'+userArray[j]].value =="") { df['state'+userArray[j]].focus();break; } else if(df['zip'+userArray[j]].value =="") { df['zip'+userArray[j]].focus();break; } else if(df['country'+userArray[j]].value =="") { df['country'+userArray[j]].focus();break; } } The code is definitely not clean,pls forgive me for that. Any suggestion on that will be appreciated. Thanks // otherwise search the parent element tempElem=tempElem.parentElement; // return when it reaches the top of the code if(tempElem.tagName=="HTML") { return el; } } return tempElem; } function fixTBpos() { var OCode = document.getElementById('OCode'); var ODiv = document.getElementById('ODiv'); st=document.body; if(isW3Mode) OCode.style.height=ODiv.style.height=st.clientHeight-119; else OCode.style.height=ODiv.style.height=st.clientHeight-113; typeof(toc) == "undefined" ? '':Resizetoc(); } function hasTagsInText(text) { if(text.indexOf("<TABLE") >=0 || text.indexOf("<table") >=0) return 'table';<<<<<<<<NOT WORKING if(text.indexOf("<TD") >=0 || text.indexOf("<td") >=0) return 'column'; if(text.indexOf("<IMG") >=0 || text.indexOf("<img") >=0) return 'image'; if(text.indexOf("<H2") >=0 || text.indexOf("<h2") >=0) return 'h2'; if(text.indexOf("<DIV") >=0 || text.indexOf("<div") >=0) return 'div'; if(text.indexOf("<A") >=0 || text.indexOf("<a") >=0) return 'link'; if(text.indexOf("<FORM") >=0 || text.indexOf("<form") >=0) return 'form'; if(text.indexOf("<P>") >=0 || text.indexOf("<p>") >=0) return 'invisible paragraph-mark'; if(text.indexOf("<BR>") >=0 || text.indexOf("<br>") >=0) return 'invisible new-line-mark'; return ''; } function hasFormatInText(text) { var format = '' if(text.indexOf("id=subtitle") >=0) format+= 'id=subtitle' if(text.indexOf("class=greytext") >=0) format+= 'class=greytext' if(text.indexOf("class=prices") >=0) format+= 'class=prices' if(text.indexOf("class=small") >=0) format+= 'class=small' if(text.indexOf("class=bct") >=0) format+= 'class=bct' // jae added if(text.indexOf("class=price") >=0) format+= 'class=price' if(text.indexOf("class=error") >=0) format+= 'class=error' // to here if(text.indexOf("<BLOCKQUOTE ") >=0 || text.indexOf("<BLOCKQUOTE>") >=0) format+= 'header=blockquote' if(text.indexOf("formatted-text") >=0 || text.indexOf("class=")>=0) format+= 'id=misctext' if(text.indexOf("<SPAN ") >=0 || text.indexOf("<SPAN>") >=0) format+= 'span' if(text.indexOf("<H1 ") >=0 || text.indexOf("<H1>") >=0) format+= 'header=h1' if(text.indexOf("<H2 ") >=0 || text.indexOf("<H2>") >=0) format+= 'header=h2' if(text.indexOf("<H3 ") >=0 || text.indexOf("<H3>") >=0) format+= 'header=h1' if(text.indexOf("<H4 ") >=0 || text.indexOf("<H4>") >=0) format+= 'header=h2' if(text.indexOf("<EM ") >=0 || text.indexOf("<EM>") >=0) format+= 'style=em' if(text.indexOf("<B ") >=0 || text.indexOf("<B>") >=0) format+= 'style=b' if(text.indexOf("<STRONG ") >=0 || text.indexOf("<STRONG>") >=0) format+= 'style=strong' if(text.indexOf("<I ") >=0 || text.indexOf("<I>") >=0) format+= 'style=i' if(text.indexOf("<U ") >=0 || text.indexOf("<U>") >=0) format+= 'style=u' if(text.indexOf("<FONT ") >=0 || text.indexOf("<FONT>") >=0) format+= 'style=font' return format } hello, The following code is causing firefox to crash: Code: if (!e) { alert("!e"); e = window.event; } alert("before"); var x = e.pageX; alert("after"); By 'crash', I mean it just stops running. It doesn't give me an error message or shut down the browser, it just quits reading the script. I get the alert box "!e" and "before" but I don't get anything for "after". At the line var x = e.pageX; it seems to die. This seems to happen anytime I use e, for example e.clientX, e.screenX, e.type, etc. This doesn't occur in IE. Anyone know what the problem is? |