mattjtayl Posted November 1, 2007 Share Posted November 1, 2007 I was sifting through some php code and was wondering what does "statements" + .$blah + do? for example distcol_id.innerHTML= "<select name='paytype_distribution_id_" + paytype_id + "_new_" + new_count + "' onchange=\"geturl_editemployees_distribution_reset ('" + paytype_id + "','new_" + new_count + "')\" what about "_new_" is that a php command or just a variable? how about . postOBJ.addpost(theElement.name,'n'); what does .addpost do or postOBJ also im trying to piece together what this is supose to do: onchange="geturl_editemployees_deduction_reset('<?=$ded_row['id']?>')" onblur= "if(this.value=='none') {geturl_edit_employees_deduction_checkdelete(this.parentNode.parentNode.rowIndex-1);}"> what does this.parenNode do? this . ? what does .rowindex -1 do? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 1, 2007 Share Posted November 1, 2007 Hi, Sorry, but what you've presented is predominantly javascript and not PHP. But to answer your questions: The + operator in javascript is used either for mathematical operations (ie. 5 + 4) or for concatenating/connecting strings ("hello" + " world" will equal "hello world") However, in your example ("statements" + .$blah + ) you present a strange hybrid of PHP and Javascript... So moving on: as for "_new_" -- that is neither a php command nor a variable, it is a literal string value. I have a feeling you don't understand OOP, nor do you know about the DOM--without which explaining postOBJ, addpost or parentNode, etc. would be too difficult. Quote Link to comment Share on other sites More sharing options...
kratsg Posted November 1, 2007 Share Posted November 1, 2007 nodes and parents are part of JavaScripts DOM structure, research that a bit and you'll see how it pieces together. the "something"+.$blah.+"something" is a weird mix, first of all, javascript adds a variable to strings using "+" signs, php with periods (concatenating) so having a mix is bugging me out here, since the fact is that $blah is a string and you don't add a string to a string unless you have quotation marks around it (javascript speak). Quote Link to comment Share on other sites More sharing options...
mattjtayl Posted November 1, 2007 Author Share Posted November 1, 2007 actually I did take a Java class and majored in Information Systems, but that was 4 years ago so my knowledge is a little foggy. So somethings I am relearning. If somone could tell me what postOBJ.addpost and .this does I would appreciate it I know (this) is like a reference in java? I did learn about the DOM in my java class I believe. But I forgot it and I only got a basic understanding from it. and I know nodes are a part of tree. Each element in html is part of the node. So I think parenNode calls what is attached to that node? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.