JavaScript - Script Problem (interference Somehow)
I have a problem I just can't seem to solve. Seems to be an interference of two scripts.
But have checked no duplicate function names or variables. Tried altering script order too. The one that breaks, breaks on this line: $('*[@title^="ajax:"]').each(function(index){ ... which I don't fully understand. The expression is a jQuery loop thing I believe. index seems to be null. I can't see where index is defined. What the code at this point aims to do is check for the phrase ajax: in all links on the page and do some manipulation so that the contents of the link are shown in a a tooltip. The problem is not about ajax. The full script is he http://www.javascriptkit.com/script/...xtooltip.shtml The problem occurs when the page includes the editor script, such as he http://www.tji-java-ide.com/beijing/...blogs&Itemid=1 The links on the top of the page work fine when there is no editor present, such as he http://www.tji-java-ide.com/beijing/...tpage&Itemid=1 Similar TutorialsI have searched for information on this but so far no luck. site: http://www.brentpurton.com/TrueSteez go to the product page The problem: I have a set of images that have hover scrolling. The idea is that when you click on the thumbnail image at the bottom in the hover scroll area, a swap image behaviour will change the picture on the shirt. The real problem is that when I implement the swap image on the thumbnails and preveiw it. They no longer Hover Scroll, they just stay in 1 spot. They do however swap the image. here is what happens: http://www.brentpurton.com/TrueSteezSwap Any Help is apreciated. Thanks in advance Hello, I am working on a page that has a jQuery full browser BG image and I am trying to also utilize a MooTools gallery. There seems to be some interference between the two JavaScripts as only one works (whichever one is last in order in the header of the HTML document). Links: http://www.courtneyhunt.com.au/press_bg.html http://www.courtneyhunt.com.au/press_gallery.html I am a complete novice with JavaScript so if anyone could help that would be great. Thank you in advance. Hiya all, I'm new here and fairly new to JavaScript and coding - one of my teachers said it would be a fun language to learn to help me out when our GCSE's come up so I thought I would give it a go. I am currently trying to make a roulette style of game - the first phase though is fairly basic. I want the user to click a number and then to be told if it is right or wrong and update their chips. Currently I am using a fixed number whilst building up the script for testing purposes - I will change that to a random number later on. So far I have broke the code down and the parts that work are where the user function is not there(The buttons) so i assume the function for changing a variable to what the user picks is broke. Although when printing that function it says that it has changed. Like I said I'm new here so if this is not where to post for help just let me know and point me in the wrong direction any help would be much appreciated The code is : Code: <html> <body> <script language='JavaScript'> var numbers = new Array(39); numbers[0] = "BLANK IF THIS COMES UP PANIC AND RUN"; numbers[1] = "1"; numbers[2] = "2"; numbers[3] = "3"; numbers[4] = "4"; numbers[5] = "5"; numbers[6] = "6"; numbers[7] = "7"; numbers[8] = "8"; numbers[9] = "9"; numbers[10] = "10"; numbers[11] = "11"; numbers[12] = "12"; numbers[13] = "13"; numbers[14] = "14"; numbers[15] = "15"; numbers[16] = "16"; numbers[17] = "17"; numbers[18] = "18"; numbers[19] = "19"; numbers[20] = "20"; numbers[21] = "21"; numbers[22] = "22"; numbers[23] = "23"; numbers[24] = "24"; numbers[25] = "25"; numbers[26] = "26"; numbers[27] = "27"; numbers[28] = "28"; numbers[29] = "29"; numbers[30] = "30"; numbers[31] = "31"; numbers[32] = "32"; numbers[33] = "33"; numbers[34] = "34"; numbers[35] = "35"; numbers[36] = "36"; numbers[37] = "0"; numbers[38] = "00"; var goldennum = numbers[20]; //roullete number document.write(goldennum +"</br>"); var userpot = 500; // The amount of credits or chips the user has //var userpot = userpot*38; //document.write(userpot); user pot working calc var usernum = 200; //user betting number function button00(){ var usernum = 00; } function button0(){ var usernum = 0; } function button3(){ var usernum = 3; } function button6(){ var usernum = 6; } function button9(){ var usernum = 9; } function button12(){ var usernum = 12; } function button15(){ var usernum = 15; } function button18(){ var usernum = 18; } function button21(){ var usernum = 21; } function button24(){ var usernum = 24; } function button27(){ var usernum = 27; } function button30(){ var usernum = 30; } function button33(){ var usernum = 33; } function button36(){ var usernum = 36; } function button2(){ var usernum = 2; } function button5(){ var usernum = 5; } function button8(){ var usernum = 8; } function button11(){ var usernum = 11; } function button14(){ var usernum = 14; } function button17(){ var usernum = 17; } function button20(){ var usernum = 20; //document.write("</br></br></br>" + usernum + "</br></br></br>"); } function button23(){ var usernum = 23; } function button26(){ var usernum = 26; } function button29(){ var usernum = 29; } function button32(){ var usernum = 32; } function button35(){ var usernum = 35; } function button1(){ var usernum = 1; } function button4(){ var usernum = 4; } function button7(){ var usernum = 7; } function button10(){ var usernum = 10; } function button13(){ var usernum = 13; } function button16(){ var usernum = 16; } function button19(){ var usernum = 19; } function button22(){ var usernum = 22; } function button25(){ var usernum = 25; } function button28(){ var usernum = 28; } function button31(){ var usernum = 31; } function button34(){ var usernum = 34; } function runnums(){ //function to run the if the users bet is equal to the roulette number if(usernum == goldennum){ var userpot=500; userpot = userpot * 38; document.write(userpot); document.write( " YOU ARE A WINNER "); } else{ var userpot = 500; userpot= userpot - userpot; document.write ("You have " + userpot + " credits left "); document.write ( " YOU ARE A LOOOOOSER "); } } </script> <br> <br> <br> <br> <br> <br> <br> <input type="button" name="Button" value="00" onclick="button00()"> <input type="button" name="Button3" value="3" onclick= "button3()"> <input type="button" name="Button6" value="6" onclick= "button6()"> <input type="button" name="Button9" value="9" onclick= "button9()"> <input type="button" name="Button12" value="12" onclick="button12()"> <input type="button" name="Button15" value="15" onclick="button15()"> <input type="button" name="Button18" value="18" onclick="button18()"> <input type="button" name="Button21" value="21" onclick="button21()"> <input type="button" name="Button24" value="24" onclick="button24()"> <input type="button" name="Button27" value="27" onclick="button27()"> <input type="button" name="Button30" value="30" onclick="button30()"> <input type="button" name="Button33" value="33" onclick="button33()"> <input type="button" name="Button36" value="36" onclick="button36()"> <p> <input type="button" name="Button0" value="0" onclick="button0()"> <input type="button" name="Button2" value="2" onclick="button2()"> <input type="button" name="Button5" value="5" onclick="button5()"> <input type="button" name="Button8" value="8" onclick="button8()"> <input type="button" name="Button11" value="11" onclick="button11()"> <input type="button" name="Button14" value="14" onclick="button14()"> <input type="button" name="Button17" value="17" onclick="button17()"> <input type="button" name="Button20" value="20" onclick="button20()"> <input type="button" name="Button23" value="23" onclick="button23()"> <input type="button" name="Button26" value="26" onclick="button26()"> <input type="button" name="Button29" value="29" onclick="button29()"> <input type="button" name="Button32" value="32" onclick="button32()"> <input type="button" name="Button35" value="35" onclick="button35()"> <p> <input type="button" name="Button1" value="1" onclick="button1()"> <input type="button" name="Button4" value="4" onclick="button4()"> <input type="button" name="Button7" value="7" onclick="button7()"> <input type="button" name="Button10" value="10" onclick="button10()"> <input type="button" name="Button13" value="13" onclick="button13()"> <input type="button" name="Button16" value="16" onclick="button16()"> <input type="button" name="Button19" value="19" onclick="button19()"> <input type="button" name="Button22" value="22" onclick="button22()"> <input type="button" name="Button25" value="25" onclick="button25()"> <input type="button" name="Button28" value="28" onclick="button28()"> <input type="button" name="Button31" value="31" onclick="button31()"> <input type="button" name="Button34" value="34" onclick="button34()"> <input type="button" name="Place Bets" value="Place Bets" onclick="runnums()"> </body> </html> Hi there, Im very new to all this and have only been working with scripts for a few days, so simple pointers would be greatly appriciated. My problem; I play an online strategy game where i can use scripts to help my game play. There is a quick bar at the top of the game screen which i can add scripts to. When editing the bar there are 3 options. 1. Name, 2. Image URL, 3. Target URL. The script i have written is entered into the Target URL. It works fine but i have to be on a certain page in the game to run the script because of how it gets the required info. At the minute i have two scripts doing what i would like one to do. The first script (that i wrote) and a second which just redirects me to the right page (which i have to click first). Can i get both tasks on to one script. What i would like the script to do is, upon clicking redirect me to the appropriate page the script needs to be run from, and then run the javascript function. My Script; ( which isnt finished but works fine for now) Code: JavaScript: var n = prompt("1.Plunder / Looting 2. OD 3.Archer 4.Axe ", "1");n = parseInt(n); if(n == 1) {var stringOne = (document.getElementsByTagName("img")[12].title);var stringTwo = (document.getElementsByTagName("img")[10].title);var stringThree = (document.getElementsByTagName("img")[25].title);var stringFour = (document.getElementsByTagName("img")[24].title);var stringFive = stringOne + " \n" + stringTwo + " \nToday " + stringThree + " \nToday " + stringFour + "";alert (stringFive );}; if(n == 2) {var stringSix = (document.getElementsByTagName("img")[15].title);var stringSeven = (document.getElementsByTagName("img")[22].title);var stringEight = (document.getElementsByTagName("img")[23].title);var stringNine = stringSix + " \nToday as attacker " + stringSeven + " \nToday as defender " + stringEight + "";alert (stringNine );}; To sum up. Basicly i want to be able to click the link to this script and have it redirect me to the right page and then run. So where would i put the page address and how do i make the script rum when the page is loaded. Hello all. This script is working fine in IE7 but FF is complaining about undeclared variables. Can anybody assist to get this working in FF or do I need a new script? Any and all advice is welcome. Code: <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test ZOOM</title> <script type="text/javascript"> //Image zoom in/out script- by javascriptkit.com //Visit JavaScript Kit (http://www.javascriptkit.com) for script //Credit must stay intact for use var zoomfactor=0.05 //Enter factor (0.05=5%) function zoomhelper(){ if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){ whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix } } function zoom(originalW, originalH, what, state){ if (!document.all&&!document.getElementById) return whatcache=eval("document.images."+what) prefix=(state=="in")? 1 : -1 if (whatcache.style.width==""||state=="restore"){ whatcache.style.width=originalW+"px" whatcache.style.height=originalH+"px" if (state=="restore") return } else{ zoomhelper() } beginzoom=setInterval("zoomhelper()",100) } function clearzoom(){ if (window.beginzoom) clearInterval(beginzoom) } </script> </head> <body> <!-- CHANGE 99 to your image width, 100 to image height, and "office_map" to your image's name--> <a href="#" onmouseover="zoom(100,63,'office_map_6','in')" onmouseout="clearzoom()">Zoom In</a> | <a href="#" onmouseover="zoom(100,63,'office_map_6','restore')">Normal</a> | <a href="#" onmouseover="zoom(120,60,'office_map_6','out')" onmouseout="clearzoom()">Zoom Out</a> <div style="position:relative;width:420;height:300"> <div style="position:absolute"><img name="office_map_6" src="images/office_map_6.gif" width="100" height="63"> </div> </div> </body> </html> low tech Helo, I'm really hoping one of you JavaScript gurus can help me. I find this a bit difficult, but I'm sure you will find it easy. I wrote a script to detect the version of Windows that a visitor is using. It then loads a remote script based on the OS. You can see it in action by visiting my website http://www.xp-smoker.com and clicking on any link that takes you to another page. This script shows you an offer based on whether you are using XP, Vista or Windows 7. It works great in IE 8. No errors. It does not work at all in Firefox. But once again absolutely no errors. I'm using "onload" in the body tag of my pages like this: Code: <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="loadjs();"> The function is contained in a file that is called locally. Here is the function: Code: function loadjs() { //Create a 'script' element var scrptE = document.createElement("script"); //Set 'type' and 'language' attribs scrptE.setAttribute("type", "text/javascript"); scrptE.setAttribute("language", "JavaScript"); if (navigator.appVersion.indexOf("Windows NT 5.1")!=-1){ scrptE.setAttribute("src", "http://www.trialpay.com/js/pop_under/?c=62020ec"); }else if (navigator.appVersion.indexOf("Windows NT 6.0")!=-1){ scrptE.setAttribute("src", "http://www.trialpay.com/js/pop_under/?c=7ace1f3"); }else if (navigator.appVersion.indexOf("Windows NT 6.1")!=-1){ scrptE.setAttribute("src", "http://www.trialpay.com/js/pop_under/?c=85cfeba"); } // create an object of the head element of current page var hdEl = document.getElementsByTagName("head")[0]; //check for previously appended child //(it ensures that each time the button is pressed it // removes the previously loaded script element) if (hdEl.childNodes.length > 1) { hdEl.removeChild(hdEl.lastChild); } // Now add this new element to the head tag hdEl.appendChild(scrptE); } I don't know if it is the function causing it or if the onload event in the body tag is the problem. I tried removing the onload event from the body tag and using this after the body tag: Code: <script>if(document.all)window.attachEvent("onload",loadjs());else window.addEventListener("load",loadjs(),false);</script> But that didn't work in Firefox either. That gave me an error. Your help would be greatly appreciated. I hope I provided you with enough info. Hi, I'm writing my first tampermonkey script, which is also my first javascript program, and I have run into a bit of a problem - can someone help? First, I'll tell say what I am trying to do and what I have done: I regularly visit a web page that has a table of text and numbers on it. I wanted to do some calculations on the numbers in each row and add a column to the table with the result of the calculation. So far so good - that works. However, the page in question has a javascript component on it that is used for sorting the table by column if the table heading is clicked on and I want the new column to behave in the same way. That bit does not work and I cannot see how to change it. The javascript in the source page looks a like this: <code> <script type='text/javascript' src='http://thesite.com/_javascript/sortable.js?2' language='javascript'></script> <script type="text/javascript"> var st = new SortableTable(document.getElementById("mytable"), ["String", "String", "Number", "None", "Number", "String", "Number", "Number"]); </script> <script type='text/javascript' src='http://thesite.com/_javascript/sortable_plus.js?2' language='javascript'></script> <script type="text/javascript"> paintTable(); </script> </code> So, I thought I might be able to edit the parameter to SortableTable() with something like this is my tampermonkey script: <code> document.body.innerHTML = document.body.innerHTML.replace('"Number", "Number"', '"Number", "Number", "Number"') </code> But that doesn't work. In fact after running that it seems that none of the table is sortable. In fact I just tested that and even if I change the text of a column heading the substitution works, but the sort routine fails, so most likely this is not the best approach. So, can anyone tell me how can I use replace the existing javascript routine or modify it so that it sorts the extra column? Thanks in advance for any assistance, Harrold Reply With Quote 01-14-2015, 10:43 PM #2 harrold View Profile View Forum Posts New to the CF scene Join Date Jan 2015 Posts 3 Thanks 0 Thanked 0 Times in 0 Posts Actually, I can see I mucked up the example replace() - but it really doesn't work even if the parameters are correct! Harrold Reply With Quote 01-16-2015, 08:10 AM #3 rnd me View Profile View Forum Posts Visit Homepage Senior Coder Join Date Jun 2007 Location Urbana Posts 4,497 Thanks 11 Thanked 603 Times in 583 Posts run the code in the script tag after you inject the new content. you might need need to add another item to the end of the column type list, looks like "Number" from here. I am working on a new site wherein i have list of links in colomn. what i want is when i click on a link. that color of the text should change to indicate that the link is selected. I am not talking about roll over effect. even after the mouse is rolls out the color should still remain as it is to show that the link is still selected. how can i do this. How can javascript detect which link is selected. and save it may be in a variable. which changes each time i select a link. what script or logic should i use for this? Hey guys, so I am a designer (not a developer) doing a site for someone. I am playing with some simple free javascripts. I have lightbox and toggler. Both work great individually. They are conflicting and everywhere online says to set the both to onLoad in the body tag. Sounds easy enough. But I can't seem to figure out the call for this script: Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="../js/expand.js"></script> <script type="text/javascript"> $(function() { $("h2.expand").toggler({method: "fadeToggle"}); }); //--><!]]> </script> <body onload="toggler();initLightbox()"> is what is seems like it should be for me. But that isn't working at all. Please help! I feel like I have tried every possible name with the toggler()... If you need more, I can point you to the site itself and you can see all of the (messy) code. I finished this code, the full code is not here, but when I ran it as a diagnostic the action did not occur when i clicked on the "process item" button. I believe it may have something to do with the script, but i am new to javascript and cannot seem to figure it out, it is supposed to multiply the price by the number to give the value of sale (sale). Any help would be much appreciated!!! Code: <html> <script language="javascript"> function test() { var Items,Price,Number,sale; Items = parselfloat(document.victoria.secondnumber.value); Price = parselfloat(document.victoria.price.value); Number = parselfloat(document.victoria.num.value); sale = Price*Number; document.victoria.val.value=sale; } </script> <body><form name ="victoria"> <center> <table border=40 bordercolor="yellow"> <tr><td>Customer Number <input name ="firstnumber" type="text" size="6" value="1" ></td> <td>Home Delivery <input name="customer_name" type="checkbox"Checked></td><tr> <tr><td>Items Purchased</td><td><center><input name="secondnumber" type="text" size="12"></center></td></tr> <tr><td>Item Number</td><td><center><input name="itemnum" type="text" size="12" value="1"></center></td></tr> <tr><td>Price</td><td><center><input name="price" type="text" size="12"></center></td></tr> <tr><td>Number Purchased</td><td><center><input name="num" type="text" size="12"></center></td></tr> <tr><td>Value of Sale</td><td><center><input name="val" type="text" size="12" value="0"></center></td></tr> <tr><td>Customer Total</td><td><center><input name="total" type="text" size="12" value="0"></center></td></tr> <tr><td></td><td><input type="button" value="Process Item" onclick="test()"></td></tr> </table> </center></form> </body></html> I have an age script running in the attachment below. It works fine for numbers such as 1 22 1980. Code: if ((input.search(/\b([1-9]|[12][0-9]|3[01])\b/)!= -1) && (input.search(/\b([1-9]|1[0-2])\b/)!=-1) && (input.search(/\b(19[0-9]{2}|200[0-9]|201[01])\b/)!= -1)) { function getBirth() { var now = new Date(); var myMatchy = input.match(/\b(19[0-9]{2}|200[0-9]|201[01])\b/); var myMatchm = input.match(/\b([1-9]|1[0-2])\b/) var myMatchd = input.match(/\b([1-9]|[12][0-9]|3[01])\b/); var year = myMatchy[0]; var month = myMatchm[0]; var day = myMatchd[0]; var today = { "year" : now.getFullYear(), "month": now.getMonth()+1, "day" : now.getDate() } var age = today["year"] - year; if (month > today["month"]) age--; else if (month == today["month"]) if (day > today["day"]) age-- return age; } document.result.result.value = "Your age is "+getBirth()+"."; return true;} However, if someone writes out the month it doesn't. Such as January 22 1980. I did a work-around by inserting the month value. Highlighted below. But that means I would have to duplicate this lengthy code 12 times for each month of the year. Anybody know a better way to handle this? You can test it in the small attachment below. Any help would be appreciated. Code: if ((input.search(/\b([1-9]|[12][0-9]|3[01])\b/)!= -1) && (input.search(/(january)/)!= -1) && (input.search(/\b(19[0-9]{2}|200[0-9]|201[01])\b/)!= -1)) { function getJan() { var now = new Date(); var myMatchy = input.match(/\b(19[0-9]{2}|200[0-9]|201[01])\b/); var myMatchd = input.match(/\b([1-9]|[12][0-9]|3[01])\b/); var month = 0; var year = myMatchy[0]; var day = myMatchd[0]; var today = { "year" : now.getFullYear(), "month": now.getMonth()+1, "day" : now.getDate() } var age = today["year"] - year; if (month > today["month"]) age--; else if (month == today["month"]) if (day > today["day"]) age-- return age; } document.result.result.value = "Your age is "+getJan()+"."; return true;} confused:hope its the right place to post a newbie here . but i have a problem with a firefox accepting a script that i wrote it works on exploer but not on firefox onclick="javascript:if (this.parentNode.parentNode.nextSibling.style.display !='block') this.parentNode.parentNode.nextSibling.style.display ='block'; else this.parentNode.parentNode.nextSibling.style.display ='none';" hope u can help me thx Dear friends I am trying to code this piece of wonderful fun there is some glitch with it though - the 'female occupation' always gets stuck on lady of leisure'. I cannot figure what the problem is - can anyone spot it? Thank yoo!! Beth xx //define sex var sex=Math.random(); if (sex>0.5) {document.write(". You were male. ");} else {document.write(". You were female. ");} //define occupation number var occu_num=Math.random()*10; occu_num=Math.round(occu_num); //define male occupation var occupation; if (sex>0.5){ if (occu_num==0) {occupation="jeweler or watch-maker.";} else if (occu_num==1) {occupation="jeweler or watch-maker.";} else if (occu_num==2) {occupation="priest.";} else {occupation="man of the law, probably a judge.";} document.write("<br>You were a respected and accomplished " + occupation);} //define female occupation else { if (occu_num==0) {occupation="jeweler or watch-maker.";} else if (occu_num==1) {occupation="jeweler or watch-maker.";} else if (occu_num==2) {occupation="nun or priestess.";} else (occu_num==10) {occupation="lady of leisure.";} document.write("<br>You were a respected and accomplished " + occupation);} Thread duplicated see one above!
I am redoing a web site. We added some pop up menus to consolidate the navigation. I created the template in fireworks MX 2004. The pop up menu has no errors in Firefox. I have some problems in IE. When I first uploaded the page it wanted to know I should load blocked content. Keep in mind my IE 8 setting were set on default. Now without me changing IE settings it just does not load the pop up menus. Can anyone help me with making the code more compatible with IE. I would rather not have it ask me if I want to load blocked content. I also want the menus to pop up when visitors wave over them with the mouse. Here is the domain for the site. Kitchen Remodels Chino Kitchen & Bathroom Remodeling Senior Baths Wave your mouse over some of the blue buttons. The kitchens, cabinets, bathrooms and home improvement buttons should have a pop up when waving the mouse over them. Here is the code in the page. Code: <script language="JavaScript1.2" src="jss/menu.js"></script> <script language="JavaScript1.2" src="jss/mm_menu.js"></script> </head> <body> <script language="JavaScript1.2">mmLoadMenus();</script> Here is the java script code. Code: // JavaScript Document <!-- function mmLoadMenus() { if (window.mm_menu_0725085737_0) return; window.mm_menu_0725085737_0 = new Menu("root",205,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#0099cc","left","middle",3,0,1000,-5,7,true,true,true,0,true,true); mm_menu_0725085737_0.addMenuItem("Kitchen Remodeling","location='kitchen-remodeling.php'"); mm_menu_0725085737_0.addMenuItem("Budget Kitchen Remodeling","location='budget-kitchen-remodeling.php'"); mm_menu_0725085737_0.hideOnMouseOut=true; mm_menu_0725085737_0.menuBorder=1; mm_menu_0725085737_0.menuLiteBgColor='#ffffff'; mm_menu_0725085737_0.menuBorderBgColor='#0098a3'; mm_menu_0725085737_0.bgColor='#ffffff'; window.mm_menu_0725090038_1 = new Menu("root",145,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#0099cc","left","middle",3,0,1000,-5,7,true,true,true,0,true,true); mm_menu_0725090038_1.addMenuItem("Kitchen Cabinets","location='kitchen-cabinets.php'"); mm_menu_0725090038_1.addMenuItem("Cabinet Refinishing","location='cabinet-refinishing.php'"); mm_menu_0725090038_1.addMenuItem("Cabinet Refacing","location='cabinet-refacing.php'"); mm_menu_0725090038_1.hideOnMouseOut=true; mm_menu_0725090038_1.menuBorder=1; mm_menu_0725090038_1.menuLiteBgColor='#ffffff'; mm_menu_0725090038_1.menuBorderBgColor='#0098a3'; mm_menu_0725090038_1.bgColor='#ffffff'; window.mm_menu_0725090215_2 = new Menu("root",167,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#0099cc","left","middle",3,0,1000,-5,7,true,true,true,0,true,true); mm_menu_0725090215_2.addMenuItem("Bathroom Remodeling","location='bath-remodeling.php'"); mm_menu_0725090215_2.addMenuItem("Walk in Tubs","location='walk-in-tubs.php'"); mm_menu_0725090215_2.hideOnMouseOut=true; mm_menu_0725090215_2.menuBorder=1; mm_menu_0725090215_2.menuLiteBgColor='#ffffff'; mm_menu_0725090215_2.menuBorderBgColor='#0098a3'; mm_menu_0725090215_2.bgColor='#ffffff'; window.mm_menu_0725090242_3 = new Menu("root",161,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffffff","#cccccc","#0099cc","left","middle",3,0,1000,-5,7,true,true,true,0,true,true); mm_menu_0725090242_3.addMenuItem("Home Improvement","location='home-improvement.php'"); mm_menu_0725090242_3.addMenuItem("Window Replacement","location='window-replacement.php'"); mm_menu_0725090242_3.addMenuItem("Furniture Refinishing","location='furniture-refinishing.php'"); mm_menu_0725090242_3.addMenuItem("General Contractor","location='about.php'"); mm_menu_0725090242_3.hideOnMouseOut=true; mm_menu_0725090242_3.menuBorder=1; mm_menu_0725090242_3.menuLiteBgColor='#ffffff'; mm_menu_0725090242_3.menuBorderBgColor='#0098a3'; mm_menu_0725090242_3.bgColor='#ffffff'; mm_menu_0725090242_3.writeMenus(); } // mmLoadMenus() //--> Hi Javascript geeks. I am hoping you can help with my shakey images on my carousel. Basically I have a lovely moving carousel on this web page http://www.turningworm.co.uk/nudgegl...nge/icons.html but the images kind of shudder as they come to a stand still before the pause. Does anyone know of a way to smooth the movement out so they glide round better and then pause? The speed is correct, it is just the shakiness of the images that is the problem. Many thanks for looking. Zena hi i have 4 check boxes chk1 , chk2,chk3,chk4 also textbox1 , textbox2 textbox3 textbox4 when selecting one chk box (chk1) textbox1=45 textbox44=45 when chk1 checked if textbox2=56 textbox45=56 when chk2 checked plz give me code sample for me plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz give me a answer Hi Guys, I am trying to create a way for my users to download some code dynamically from my web page via a file download. Below is the code that i have written so far. It seems to be dying on the iframe but i'm not sure why. Here is my jquery trigger which is inside my onreadystate function. Code: $('#export_txt').click(function(e){ alert(LPAjax.ajaxurl + "/download.php"); $.generateFile({ action : "download_txt", filename : "exportme.txt", content : $("#ticket_window").html(), script : LPAjax.ajaxurl + "/download.php" }); e.preventDefault(); }); and here is the code i am using to process the post. Code: (function($){ // Creating a jQuery plugin: $.generateFile = function(options){ options = options || {}; if(!options.script || !options.filename || !options.content){ throw new Error("Please enter all the required config options!"); } alert("Inside Function"); // Creating a 1 by 1 px invisible iframe: var iframe = $('<iframe>',{ width:1, height:1, frameborder:0, css:{ display:'none' } }).appendTo('body'); var formHTML = '<form action="" method="post">'+ '<input type="hidden" name="filename" />'+ '<input type="hidden" name="content" />'+ '</form>'; // Giving IE a chance to build the DOM in // the iframe with a short timeout: setTimeout(function(){ // The body element of the iframe document: var body = (iframe.prop('contentDocument') !== undefined) ? iframe.prop('contentDocument').body : iframe.prop('document').body; // IE alert(" We are almost there"); body = $(body); // Adding the form to the body: body.html(formHTML); alert("added form to page"); var form = body.find('form'); form.attr('action',options.script); form.find('input[name=filename]').val(options.filename); form.find('input[name=content]').val(options.content); alert("submitting form"); // Submitting the form to download.php. This will // cause the file download dialog box to appear. form.submit(); },50); }; })(jQuery); it seems to be dying on this line. Code: var body = (iframe.prop('contentDocument') !== undefined) Any suggestions? Thanks in advance. |