JavaScript - Http Request Working In Ie, Not In Firefox
I have a text box that is updated automatically via a javascript that posts back. It works fine in IE, but not in firefox. I know I call the aspx correctly, because other code work. I tried to insert the URL that I send in the browser, and it returns data. So either the event handler is never called, or else the response is empty in firefox.
Any ideas? Code: function CreateReq() { var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; } function fetch(){ var xmlhttp=CreateReq(); //alert ("fetch"); xmlhttp.open("GET", "CtrlLoader.aspx?MachinePrefix="+ document.getElementById('LblMachinePrefix').value+ "&RequestTime="+ (new Date()).getTime()+"&method=Refresh",false);//was true xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById('TxtCtrlConsole').value+=xmlhttp.responseText; for (var i=0;i<200;i++) document.getElementById('TxtCtrlConsole').scrollTop=document.getElementById('TxtCtrlConsole').scrollHeight; } } xmlhttp.send(null); } Edit: it appears, that it s the onreadystate function that is never called. I tried adding an alert to it. I also tried init of onreadystatechange before open. No effect for firefox Similar TutorialsHi, I am writing JavaScript code that runs inside HTTP page, I need to make XMLHttpRequest to a REST web service. The service is running on the same site but it only accepts HTTPS. I tried to prefix the URL with https:// and Firefox rejected it as cross-site scripting attempt. It's not really cross site as I am calling the same site. I don't have an option to redirect the entire page to https. Is there a proper way to implement this request? Sergey p.s. (sorry if this is a dumb question, I am a JavaScript newbie) Hi i want to find out the idle time when there is no http request is going on... i dont want to track any mouse or key board events... i dont want that... i read these thread but it is only about screen idle time http://www.codingforums.com/showthre...t=33068&page=2 i am trying to track the time when there is no transaction going between client and server and no http request is sending . if i will get that time then that time i can use to load my additional javascript files... so further transaction of user will become speed up.... i appreciate your help THANKS hereis the html file and javascripton click of this button a html ***************************** <table class=matcolor id=topnav cellspacing=0 cellpadding=0 width=550 border=0 bgcolor="#FFCCCC"> <tbody> <tr align=middle> <td id=menu1 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Desk Top Publishing </font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu2 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Transcription</font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu3 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Accounts Processing </font></div> </td> </tr> </tbody> </table> ***************************************** <script language=JavaScript> ix = document.getElementById('tblmenu1').getBoundingClientRect(); new ypSlideOutMenu("menu1", "right",ix.left + ix.right ,ix.bottom + 10); </script> **any thing i have to alter to work in firefox please help Hi, I'm new to JS and been thrown in at the deepend as our developer has just left! You are dealing with a total newbie! I have the following script that is not working in FF but is fine in Chrome and IE can anyone tell me what is wrong with it please?! Code: function showTotalCost(val) { if(val=='yes') { if(document.getElementById('secondaryeventtype').value == 'adventure') { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 100).toFixed(2) + ' (including insurance)'; } else { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 27).toFixed(2) + ' (including insurance)'; } } else { document.getElementById('totalcost').innerText = document.getElementById('cost').value; } } Code: function calculateGroupMembers() { var iMultiplier; if(document.getElementById('txtGroup1Firstname').value != '' || document.getElementById('txtGroup1Surname').value != '' || document.getElementById('txtGroup1Email').value != '') { iMultiplier=2; } if(document.getElementById('txtGroup2Firstname').value != '' || document.getElementById('txtGroup2Surname').value != '' || document.getElementById('txtGroup2Email').value != '') { iMultiplier=3; } if(document.getElementById('txtGroup3Firstname').value != '' || document.getElementById('txtGroup3Surname').value != '' || document.getElementById('txtGroup3Email').value != '') { iMultiplier=4; } if(document.getElementById('txtGroup4Firstname').value != '' || document.getElementById('txtGroup4Surname').value != '' || document.getElementById('txtGroup4Email').value != '') { iMultiplier=5; } if(document.getElementById('txtGroup5Firstname').value != '' || document.getElementById('txtGroup5Surname').value != '' || document.getElementById('txtGroup5Email').value != '') { iMultiplier=6; } document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) * iMultiplier).toFixed(2) + ' (inc group members)'; } It is fired from an onblur event in the div below once the chkbox is ticked, the link to the page is https://www.doitforcharity.com/book-...eid=1990&cid=0 but you may need to progress through https://www.doitforcharity.com/book-....aspx?eid=1990 first: Code: <div id="pnlGroupBooking"> <label class="boldfieldlabel" for="chkGroupBooking">Do you wish to book for others too? </label> <input id="chkGroupBooking" type="checkbox" language="javascript" onclick="__doPostBack('chkGroupBooking','')" checked="checked" name="chkGroupBooking"> (you may book up to 5 additional people) <div id="pnlGroupBookingNames" style="border: 1px solid LightGrey; width: 500px;" styles="padding:10px;"> <strong>Group Member Names</strong> <br> <p> </p> <p> </p> <p style="vertical-align: top;"> <strong>1) </strong> <input id="txtGroup1Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Firstname"> <input id="txtGroup1Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Surname"> <input id="txtGroup1Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup1Email"> <br> <strong>2) </strong> <input id="txtGroup2Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Firstname"> <input id="txtGroup2Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Surname"> <input id="txtGroup2Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup2Email"> <br> <strong>3) </strong> <input id="txtGroup3Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Firstname"> <input id="txtGroup3Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Surname"> <input id="txtGroup3Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup3Email"> <br> <strong>4) </strong> <input id="txtGroup4Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Firstname"> <input id="txtGroup4Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Surname"> <input id="txtGroup4Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup4Email"> <br> <strong>5) </strong> <input id="txtGroup5Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Firstname"> <input id="txtGroup5Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Surname"> <input id="txtGroup5Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup5Email"> </p> </div> </div> Thanks! Hey people! New to using Javascript but have a problem. Working in Firefox but not in IE, and no errors flash up - it just does not work! Here is my code if anyone has the time to take a peak! What it does in Firefox is has a drop down with two options, both of which call the functions passing over the name of the items to be hidden or displayed. Works fine, but not in IE. Javascript Function: Code: <script type="text/javascript"> function showStuff(id) { document.getElementById(id).style.display = 'block'; } function hideStuff(id) { document.getElementById(id).style.display = 'none'; } </script> Form drop down to call javascript: Code: <select name="golf_package"> <option value='Yes' onClick="showStuff('Golf'); hideStuff('Accommodation')">Yes</option> <option value='No' selected='selected' onClick="showStuff('Accommodation'); hideStuff('Golf')">No</option> </select> Hide and Show date: Code: <span id="Golf" style="display: none; return: false;">HIDE BIT</span><span id="Accommodation" style="display: none; return: false;">HIDE BIT TWO </span> Any help will be much appreciated! Thanks Hello all, I have a property of text box which works well in firefox but not in IE ..I am unable to understand why ..andy help is appreciated ? Code: onfocus="this.style.backgroundColor='#F1CC8E';" Hello - I'm a total newbie to html and javascript but have been forced to learn it somewhat since I'm making a website for my wife's business. Anyway, the site has a page where people can choose from menuitems of a form ("select" elements). That form info is then used to call Foxycart. I've decided to link the choosing of those menu-items to showing appropriate product images, thus providing visual feedback for the buyer. I have hacked my way to a point that the page does what I want in Firefox, but it breaks in IE and I have no idea why since the same sort of simple code algorithm to poll the menus with "document.getElementByIdworks" works in IE until I leave the page, but then stops working when I return. The page is he http://angelatoyarn.squarespace.com/...our-own-gelato (the site is still a WIP obviously) In Firefox everything is fine - I can select the items I want and the pictures of those images appear at the bottom of the page. If I leave the page and come back, the function Updateyarn() is called which grabs the .selectedindex values and re-inserts the images. But in IE when I leave the page and come back the select-menus retain their previous values (as they should) but my update yarn () function errors out and doesn't return a valid integer. Please Help! I have no Earthly clue why the IE version is breaking. -thanks, - TJ Hi there Im having an issue with some javascript that works fine in IE, but in FF is not working properly. The script is used to display a list of check boxes, the user can expand, which can checked to enabke a users selection of products. This is the script: Code: <script type="text/javascript"> var xcNode = []; // m = Parent UL ID // c = function xcSet(m, c, q, isCompletedLength) { if (document.getElementById && document.createElement) { var xs = m; m = document.getElementById(m).getElementsByTagName('ul'); var d, p, x, h, i, j; for (i = 0; i < q; i++) { var xp = document.getElementById("_" + xs + i); if (d = xp.getAttribute('id')) { if (navigator.userAgent.indexOf("Firefox") != -1) { var lstr = TrimTags((document.getElementById(xs).innerHTML)); xcCtrl(d, c, 'x', '[+] Click for more info', 'Show', 'Click to expand', lstr.length, isCompletedLength); x = xcCtrl(d, c, 'c', '[-] Click to Hide', 'Hide', 'Click to collapse', lstr.length, isCompletedLength); } else { xcCtrl(d, c, 'x', '[+] Click for more info', 'Show', 'Click to expand', (document.getElementById(xs).innerText).length, isCompletedLength); x = xcCtrl(d, c, 'c', '[-] Click to Hide', 'Hide', 'Click to collapse', (document.getElementById(xs).innerText).length, isCompletedLength); } p = xp.parentNode; if (h = !p.className) { j = 2; while ((h = !(d == arguments[j])) && (j++ < arguments.length)); if (h) { if (xp.name == parseURL()) { xp.style.display = 'block'; x = xcNode[d + 'c']; } else { xp.style.display = 'none'; x = xcNode[d + 'x']; } } } p.className = c; var expand = document.getElementById("expandBtn_" + xs + "0"); expand.insertBefore(x, expand.firstChild); } } } } works fine in IE, but not in Firefox where the expanded list is not showing the current number of items (checkboxes), it shows 34 check boxes in IE but only 17 in firefox. Thanks in advance Nice for a change: a piece of code that does work in all versions of IE, but not in Firefox. I'm stuck. Code: <img alt="Loodgieters" title="Loodgieters" src="/core/loodgieters_uit.png" name="loodgieters" border="0" style="margin-right:1px; margin-top:1px; float:left; cursor:pointer;" onclick="document.location='/pages/loodgieters.php';" onmouseover="foto1.style.backgroundColor='#392d63'; loodgieters.src='/core/loodgieters_aan.png'" onmouseout ="foto1.style.backgroundColor='#008ac9'; loodgieters.src='/core/loodgieters_uit.png'" /> Explanation: element "loodgieters" is a menu button that should change on mouseover. It doesn't in FF, it does in IE. Secondly, when you "mousover" the image, it should change the backgroundcolor of a second element (foto1). Element 'foto1' is a table cell. In return, when you mouse-over this table cell, the image element 'loodgieters' should change as well. So it's a two-way thing. The code for the table cell is: Code: <td height="189" id="foto1" bgcolor="#008ac9" valign="top" onmouseover="style.backgroundColor='#392d63'; loodgieters.src='/core/loodgieters_aan.png';" onmouseout="style.backgroundColor='#008ac9'; loodgieters.src='/core/loodgieters_uit.png';" style="cursor:pointer;" onclick="document.location='/pages/loodgieters.php';"> <img alt="Loodgieters" title="Loodgieters" src="/core/loodgieters.png" style="border:0; margin-left:auto; margin-right:auto; margin-top:10px; display: block;" /></td> Again: it all works as I expected in IE, Safari and Chrome, but it does not in Firefox. The whole page validates as XHTML 1.0 Transitional What am I overlooking here? I'm stuck. Any help is welcome Hi Guys, I'm trying to do up a contact form that after a user submits the information, the drop down contact box will slide back up instead of redirecting to another page. The script works fine in Chrome and Safari, but Firefox and IE keeps redirecting to the php page. Hope someone can shed some light here, thanks! Html form: Code: <div class="left"> <!-- Login Form --> <form class="clearfix" action="contactengine.php" name="cform" method="post"> <h4>Drop us a mail</h4> <label class="grey" for="emailName">Name:</label> <input class="field" type="text" name="emailName" id="emailName" value="" size="23" /> <label class="grey" for="emailFrom">Email Address:</label> <input class="field" type="text" name="emailFrom" id="emailFrom" value="" size="23" /> <label class="grey" for="message">Message:</label> <textarea type="text" name="message" id="message" size="23"></textarea> <div class="clear"></div> <input type="submit" rows="" cols="" name="submit" value="Submit" class="bt_register" /> <span id="messageSent">Message sent successfully!</span> </form> <script language="JavaScript" type="text/javascript"> //You should create the validator only after the definition of the HTML form var frmvalidator = new Validator("cform"); frmvalidator.addValidation("emailName","req","Please enter your Name"); frmvalidator.addValidation("emailName","maxlen=20", "Max length for Name is 20"); frmvalidator.addValidation("emailFrom","maxlen=50", "Max length for email is 50"); frmvalidator.addValidation("emailFrom","req","Please enter your Email"); frmvalidator.addValidation("emailFrom","email","Please enter a valid email"); </script> </div> <div class="left right"> <!-- Register Form --> <h4>Contact Details</h4> <p class="grey"><b>XXX<br /></b>XXX<br />XXX<br />XXX</p> <p class="grey">T: 999<br />F: 999</p> <h5>Stalk Us</h5> <a href="index.html"><img src="misc/fb.png" border="0" alt="Facebook" /></a> <a href="index.html"><img src="misc/twit.png" border="0" alt="Twitter" /></a> </div> </div> </div> <!-- The tab on top --> <div class="tab"> <ul class="login"> <li class="left"> </li> <li>Hello there</li> <li class="sep">|</li> <li id="toggle"> <a id="open" class="open" href="#">Contact Us</a> <a id="close" style="display: none;" class="close" href="#">Close Panel</a> </li> <li class="right"> </li> </ul> </div> <!-- / top --> The Slider JS: Code: $(document).ready(function() { // Expand Panel $("#open").click(function(){ $("div#panel").slideDown("slow"); }); // Collapse Panel $("#close").click(function(){ $("div#panel").slideUp("slow"); }); // Switch buttons from "Hey There | Contact us" to "Close Panel" on click $("#toggle a").click(function () { $("#toggle a").toggle(); }); //submission scripts $('div#panel').submit( function(){ //statements to validate the form var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var email = document.getElementById('emailFrom'); if (!filter.test(emailFrom.value)) { $('.email-missing').show(); } else {$('.email-missing').hide();} if (document.cform.emailName.value == "") { $('.name-missing').show(); } else {$('.name-missing').hide();} if (document.cform.message.value == "") { $('.message-missing').show(); } else {$('.message-missing').hide();} if ((document.cform.emailName.value == "") || (!filter.test(email.value)) || (document.cform.message.value == "")){ return false; } if ((document.cform.emailName.value != "") && (filter.test(email.value)) && (document.cform.message.value != "")) { //hide the form $('.div#panel').hide(); //show the loading bar $('.loader').append($('.bar')); $('.bar').css({display:'block'}); //send the ajax request $.post('contactengine.php',{emailName:$('#emailName').val(), emailFrom:$('#emailFrom').val(), message:$('#message').val()}, //return the data function(data){ //hide the graphic $('.bar').css({display:'none'}); $('.loader').append(data); }); //waits 2000, then closes the form and fades out $("#messageSent").show("slow"); setTimeout('$("#toggle a").toggle(); $("div#panel").slideUp("slow")', 2000); //stay on the page return false; } }); }); The PHP Code: PHP Code: <?php $EmailFrom = "xxx@xxx.com"; $EmailTo = "xxx@xxx.com"; $Subject = Trim(stripslashes($_POST['Webmail'])); $Name = Trim(stripslashes($_POST['emailName'])); $Email = Trim(stripslashes($_POST['emailFrom'])); $Message = Trim(stripslashes($_POST['message'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email Adress: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; // send email $success = mail($EmailTo, Webmail, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=success.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> In IE online.php script was executed once, In Firefox didn't worked at all... Where is the problem? Here is my AJAX script: PHP Code: <script language="javascript" type="text/javascript"> <!-- // Get the HTTP Object function gethttpObject2(){ if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } // Change the value of the outputText field function setOutput(){ if(httpObject2.readyState == 4){ document.getElementById('online').innerHTML = httpObject2.responseText; } } // Implement business logic function doWork(){ httpObject2 = gethttpObject2(); if (httpObject2 != null) { httpObject2.open("GET", "../content/tables/tb_online.php", true); httpObject2.send(null); httpObject2.onreadystatechange = setOutput; } } setInterval(doWork, 10); var httpObject2 = null; //--> </script> <div id='online' ></div> This code works fine in IE but it won't in FF. The error console says topdiv.style and sidediv.style are 'undefined' This is the javascript: Code: function changeposition() { topdiv = "document.getElementById('top')"; sidediv = "document.getElementById('side')"; if (document.scrolltop > 100) { topdiv.style.position = "fixed"; topdiv.style.top = "-100px"; sidediv.style.position = "fixed"; sidediv.style.position = "35px"; } else { topdiv.style.position = "absolute"; topdiv.style.top = "0px"; sidediv.style.position = "absolute"; sidediv.style.position = "135px"; }} window.onscroll = changeposition(); and the HTML: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="standardstyle.css"> <script type="text/javascript" src="menuposition.js"></script> </head> <body> <div class="top" id="top"> ... </div> <div class="sidebar" id="side"> ... </div> ... </body> </html> I'm using FF4 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> Hi, After spending hours trying out many different examples that supposedly work with IE and FF, I've decided to post here This is the code I'm using to catch the down arrow: Code: function is_int(event) { var Key = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if(Key==40) { alert('down arrow'); } } And called using the following on the text input of a form field: Code: onKeyDown="is_int(event);" This works in IE but still not in Firefox (3.5.7). Surprised as it has the .which in there - I thought this is what FF needed? I have a function that checks to see the number entered in a textfield and then, if greater than 1, will change a radio button from Single to Multiple and visa versa. The function is called from the textfield with an onkeyup="function()". The problem I am having is that it works in IE just fine, but in Firefox it doesn't seem to be doing anything. I'm not getting any errors and can't seem to see what is the problem. Google doesn't seem to be any help... Anyone have any ideas? Thanks! Hey everyone. I have built a simple page for where I work, nothing complex going on here at all. But for some reason it won't run the Javascript functions in Firefox. Sarfari and Chrome work fine. It's not calling any external files or anything, like I said super simple. So if anyone can go to the page, view the source, take a look and let me know what I am missing here I would be greatly appreciative. http://www.aaronhager.com/BM/ To see what it does, just open that link in Chrome or Safari. I am more of a Flash guy then Javascript, and hopefully the reason is simple for one of you geniuses out there. Thanks A. I'm working on my own site for layouts for sites like Myspace and Ning. Myspace changed their layouts to no longer include CSS so I am working on a new way to post their layouts. I used this same method to post all our other layouts. For some reason this is not showing up in IE. Firefox: IE: Interestingly enough, when I run the debugger in IE it loads when it is done. If not I get the black hole effect above. ERRORS: Object required Not implemented Any help will be greatly appreciated! Code: bgImg = document.getElementById('bg').innerHTML; tile = document.getElementById('bgtile').innerHTML; att = document.getElementById('bgatt').innerHTML; pos = document.getElementById('bgpos').innerHTML; top = document.getElementById('mar').innerHTML; ht = document.getElementById('marht').innerHTML; alink = document.getElementById('sel').innerHTML; col = document.getElementById('bgcol').innerHTML; hed = document.getElementById('hdr').innerHTML; bord = document.getElementById('bdr').innerHTML; con = document.getElementById('ct').innerHTML; div3 = document.getElementById('MS3css').innerHTML; if (document.getElementById('bg')){ document.getElementById('bgimgEmpty').innerHTML='Background Image: <br /><textarea id="MS3" style="width:250px; height: 55px; background: #999999; color: #000000; padding: 2px;" onclick="select()" ><img src="'+bgImg+'"></textarea><br />';} if (document.getElementById('bgtile')){ document.getElementById('bgtileEmpty').innerHTML='Background Tile: <br /><textarea id="MS3" style="width:250px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+tile+'</textarea><br />';} if (document.getElementById('bgatt')){ document.getElementById('bgattEmpty').innerHTML='Background Attachment: <br /><textarea id="MS3" style="width:250px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+att+'</textarea><br />';} if (document.getElementById('bgpos')){ document.getElementById('bgposEmpty').innerHTML='Background Position: <br /><textarea id="MS3" style="width: 250px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+pos+'</textarea><br />';} if (document.getElementById('mar')){ document.getElementById('marEmpty').innerHTML='Marquee: <br /><textarea id="MS3" style="width:250px; height: 55px; background: #999999; color: #000000; padding: 2px;"><a href="http://skemaholicsanonymous.com/"><img src="'+top+'"></a></textarea><br />';} if (document.getElementById('marht')){ document.getElementById('marhtEmpty').innerHTML='Marquee Height: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+ht+'</textarea><br />';} if (document.getElementById('sel')){ document.getElementById('selEmpty').innerHTML='Selected: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+alink+'</textarea><br />';} if (document.getElementById('bgcol')){ document.getElementById('bgcolEmpty').innerHTML='Background Color: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+col+'</textarea><br />';} if (document.getElementById('hdr')){ document.getElementById('hdrEmpty').innerHTML='Header: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+hed+'</textarea><br />';} if (document.getElementById('bdr')){ document.getElementById('bdrEmpty').innerHTML='Borders: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+bord+'</textarea><br />';} if (document.getElementById('ct')){ document.getElementById('ctEmpty').innerHTML='Content: <br /><textarea id="MS3" style="width:60px; height: 25px; background: #999999; color: #000000; padding: 2px;" onclick="select()" >'+con+'</textarea><br />';} if (document.getElementById('MS3css')){ document.getElementById('code2Empty').innerHTML='<form id="genDone"action="http://blog.skemaholicsanonymous.com/MSPreview3/preview.php" method="post" rel="nofollow" target="_blank"><textarea id="codebox" style="display: none;" name="genCode">'+div3+'</textarea><br /><input type="submit" value="Preview" id="prevLoad" /></form>';} Hi, I have a login script which is working in IE but not firefox or safari. I was hopoing someone might be able to point me in the right direction as i'm at a loss as to why it isn't working My login form looks like this Code: <?php session_start(); include_once("inc.php"); $wlog='not'; $msm_error=''; if (isset($_GET['wlog'])) { $wlog=$_GET['wlog']; if($wlog =='out' or $wlog =='not') { global $HTTP_SESSION_VARS; unset($HTTP_SESSION_VARS['client']); } if($wlog =='not') { $msm_error='<h1 style="color:#CC0000">Username or Password is incorrect</h1>'; } }else{ $wlog=$_GET['wlog']; } $cms=check_login_status(); $show_cat=0; $show_cat_sub=0; $brand=0; $p_size=0; $color=0; $r_price=0; $status=0; ?> function client_login_signup_form($wlog,$msm_error) { if($wlog =='out') { global $HTTP_SESSION_VARS; unset($HTTP_SESSION_VARS['client']); } ?> <form name='Formlogin' id='Formlogin' method='post' action='check_user.php' onSubmit='return clientvalidate();'> <input type='hidden' name='wlog' id='wlog' value='<?php echo $wlog; ?>'/> <div id='logmsm'><?php echo $msm_error; ?></div> <h1>Existing Customer - Login</h1> <p style='color:#fdca00'>Please enter your email address and password</p> <table width='100%' border='0' cellspacing='2' cellpadding='2'> <tr> <td width="20%" align='left'><p>Email Address: </p></td> <td width="80%" ><input name='e_mail' type='text' class="input1" id='e_mail' /></td> </tr> <tr> <td align='left'><p>Password: </p></td> <td><input name='pass' type='password' class='input1' id='pass' /></td> </tr> <tr> <td> </td> <td><input name='submit' type='submit' value='Submit' /></td> </tr> <tr> <td colspan="2"><p style="margin-top:5px; font-size:10px"><a href="forgotten_password.php">Forgot your password ?</a></p></td> </tr> </table> </form> <?php } My Javascript validation looks like this Code: function clientvalidate() { //alert('user') if (document.Formlogin.e_mail.value=="") { alert("Please fill the E-mail.") document.Formlogin.e_mail.focus() return false }else{ var user=document.Formlogin.e_mail.value; } if (document.Formlogin.pass.value=="") { alert("Please fill the password.") document.Formlogin.pass.focus() return false }else{ var str=document.Formlogin.pass.value var v2=replacewithreg(str) if(v2==false) { document.Formlogin.pass.focus(); return false; }else{ var pass=document.Formlogin.pass.value; } } var wlog=document.Formlogin.wlog.value; url='ajax_check_client_login.php?user=' url =url+user url += '&'; url += 'pass='; url =url+pass; url += '&'; url += 'wlog='; url =url+wlog; //alert(url) javascript:void(0); new Ajax.Updater('', url); //updateaccountlink(); return true } Hi Guys, I have written a simple code to open up a new window onclick of a button as follows; Code: function loadExamp() { var reqType = getElementValue("reqType", 1); window.open("../jsp/loadExamples.jsp?reqType=" + reqType, "Connection Test Utility - Message Examples", "width=500,height=300,menubar=no,status=yes, location=yes,toolbar=no,scrollbars=yes" ); return; } The problem is that this code is working on Google Chrome but not in Firefox and IE. Why is that and how can I resolve this issue. I am using Firefox 3.6.11 and IE 8.0.XX. Also I tried to open a new window using <a href> option with the same URL and its working but the only problem is that I want to pass my next JSP an argument which is only possible with function or script. I googled it but couldn't find much information except that there is some security problem. For that I have disabled the 'Pop up Bloker' on both Firefox and IE but still not working. When I click my button there is no activity with 'Firefox' but IE gives me error as follows; Code: Message: Invalid argument. Line: 74 Char: 2 Code: 0 URI: http://localhost:8080/T24Utility/scripts/verifyCxPool.js Please help, Thanks, -- Sjunejo Hey guys, My code works perfectly fine in internet explorer and google chrome, however, in firefox it does not. I have created an online form, but nothing happens when pressing the "submit" button firefox, whereas in other browsers, it works correctly. Also, the centering of the form is different. Please help me if possible. Thanks <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Airduct Cleaning</title> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <link href="text.css" rel="stylesheet" type="text/css"> <script type="text/JavaScript"> function gosubmit(){ musimw.submit(); } </script> <style type="text/css"> #text { width: 250px; position: relative; margin-left: 200px; } </style> </head> <body leftmargin="0" topmargin="0"> <table width="998" heigt="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="147" valign="top"> <!----LEFT MENU---------> <? include "left_menu.php"; ?> </td> <td width="591" valign="top" colspan="1"> <!----TOP---------> <? include "top.php"; ?> <!----TITLE---------> <table width="100%" heigt="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="590" height="33" background="images/top_bg2.gif" valign="bottom"><img src="images/title_sub09_01.gif" /></td> <td width="1" bgcolor="#d3dfe6"></td> </tr> </table> <!----CONTENT---------> <!----story------> <form action=sendmail2.php method=post name=musimw enctype=multipart/form-data onSubmit="return musimm_check(this);"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr style=" position: relative; margin-left: 28px;"> <td width="50"></td> <td><p><span class="stxt2">Call for a Free Estimate</span><br> <br> <img src="images/img25.gif" align="left"><strong>For a free estimate, call: </strong></p> <div id="text"> Office: Insert Office #<br /> Toll-Free: Insert Toll Free # <br /> Email: Insert Email<br /> <br><em>Or, submit the online form below.</em> </div> </td> </tr> <tr> <td width="50"></td> <td> <table width="530" align="center" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF"> <tr> <td width="10"></td> <td width="180" height="25">*First name</td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='fname'/></td> </tr> <tr> <td width="10"></td> <td width="180" height="25">*Last name</td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='lname'/></td> </tr> <tr> <td></td> <td >Phone Number<br /></td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='ptel'/> <select name='pteltype'> <option value='Home'>Home</option> <option value='Work'>Work</option> </select></td> </tr> <tr> <td></td> <td >Cell Phone Number<br /></td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='ctel'/></td> </select></td> </tr> <tr> <td></td> <td height="25">*Email Address</td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='email'/></td> </tr> <tr> <td></td> </tr> <tr> <td colspan="3"height="1" background="images/point.gif"></td> </tr> <tr> <td width="10"></td> <td width="180" height="25">*Type of Service</td> <td style="padding:10px 5px 5px 5px"><select name='bnametype'> <option value='Air Duct Cleaning'>Air Duct Cleaning</option> <option value='Dryer Vent Cleaning'>Dryer Vent Cleaning</option> <option value='Chimney Cleaning'>Chimney Cleaning</option> </select></td> </tr> <tr> <td></td> <td height="25">Square Footage<br /></td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20" name='feet'/></td> </tr> <tr> <td></td> <td height="25">Approximate # of Ducts<br /></td> <td style="padding:10px 5px 5px 5px"><input type="text" size="20"name='vent' /></td> </tr> <tr> <td></td> <td height="25">Number of furnaces</td> <td style="padding:10px 5px 5px 5px"><select name='furnaces'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select></td> </tr> <tr> <td colspan="3"height="1" background="images/point.gif"></td> </tr> <tr> <td></td> <td valign="top" style="padding-top:5px">*Address</td> <td style="padding:10px 5px 5px 5px"><input type="text" class="inputPlain004" size="30" name='address'></td> <tr> <td></td> <td height="25">*City<br /></td> <td style="padding:10px 5px 5px 5px"><input name="city" type="text" class="inputPlain004" value="" size="12"></td> </tr> <tr> <td></td> <td height="25">*State </td> <td style="padding:10px 5px 5px 5px"><select name='statetype'> <option value='State'>IL</option></td> </tr> <tr> <td></td> <td height="25">*Zip Code</td> <td style="padding:10px 5px 5px 5px"><input name="zip" type="text" class="inputPlain004" value="" size="12"></td> </tr> <tr> <td colspan="3"height="1" background="images/point.gif"></td> </tr> <tr> <td></td> <td valign="top" style="padding-top:5px">Comments or Questions</td> <td style="padding:10px 5px 5px 5px"><textarea name='Comment' cols="45" rows="8"></textarea></td> </tr> <tr> <td colspan="3"height="1" background="images/point.gif"></td> </tr> </table> <!---BUTTON---> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="50" align="center"><a href="javascript:gosubmit()"><img src="images/bt_submit.gif"></a> <a href="#"><img src="images/bt_cancel.gif"></a></td> </tr> </table> </form> </td> <td width="1" bgcolor="#d3dfe6"></td> </tr> </table> </td> <td width="260" valign="top"> <!----RIGHT--------> <? include "right_menu.php"; ?> </td> </tr> </table> <!------BOTTOM----------> <? include "foot.php"; ?> </body> </html> |