JavaScript - I Dont Recognize This Character In Code
Hi, it's my first post and first thread, actually I joined to ask this question.
I did try searching first but for some reason when I put this character in google search fields I never find what I want, maybe not being recognized. here's the code Code: this.size=a.size||2000; this.handle_event=a.handle_event||'click'; my question ... what is the || character(s)? I'm sure this must be laughably simple and thanks in advance (new to learning js) Similar TutorialsHi, I am using jQuery for the following scenario: There is a random number of divs, each sharing the same class (.slecteable), each having its own id (a unique string extracted from the database). A user clicks on a div. I get the id, and change the color of this div (in gets highlighted). Code: $('.selectable').livequery('click',function(){ var id; id = $(this).attr('id'); //change color based on id. }); Now comes the problem. Once a user clicks again on a div, if it wasn't highlighted, it should return to its original color. If it had been highlighted, and had returned to its original color due to a second click, it should get highlighted again. How would you do that? I wish I could post some code, but at this point, it would be rubbish. Thanks in advance. Regards, -jj. i have this javascript code that IE wont recognize any advise please? Message: Could not get the type property. This command is not supported. Line: 263 Char: 4 Code: 0 Code: function togglePass() { var obj = document.getElementById('pass1'); if (obj.type == 'text') { obj.type = 'password'; } else { obj.type = 'text'; } } Thank you Hi there, If I have Ajax bring back a string of HTML, let's say to replace a whole <select> box, does that get registered in the DOM in such a way that I can later manipulate that element via Javascript? It doesn't seem so. I have a <select> box that gets inserted via Ajax but I have a script I want to use to change which <option> is selected after it is loaded in. The client doesn't seem to pick up on the <select> box when I try to call it via getElementById, etc. It came up as unrecognizable as an MD5 hash and it looks like hexadecimal to me. Can someone help me convert it to what it is supposed to say? I think it is a series of numbers but am not entirely sure. Thank you for your assistance. 86a032c42beb25042d8d4dc7970ccc1e I have a div whose CSS I'm setting as follows: Code: div.services_menu { display: none; position: absolute; top: 215px; left: 240px; overflow: hidden; } I also have a initPage function that gets called on pageload: Code: function initPage() { var menu = document.getElementById("services_menu"); var menuItems = menu.getElementsByTagName("div"); alert("top = " + menu.style.top); } The above CSS applies to menu. The alert box tells me: top = So menu.style.top is not set to anything even though I explicitely set it in my CSS. Why is this? Note: I've verified that menu.style.top is still blank even well after the page loads, just to be sure that it's not an issue with CSS being read/processed after the initPage script is read/processed. I am working on my personal portfolio site, and am using a code that will make each portfolio piece appear in a new div when the name of the piece is clicked on. The problem is, JS does not seem to recognize double digits. I am not familiar with JS at all, I just got comfortable with CSS/HTML a few weeks ago! I am in over my head. It would really, really help if someone could show me how to change the code so that I could make about 15 to 20 divs instead of 9. Here is the code: Code: <script language="JavaScript"> numdivs=9 IE5=NN4=NN6=false if(document.all)IE5=true else if(document.layers)NN4=true else if(document.getElementById)NN6=true function init() { showDiv(0) } function showDiv( which ) { for(i=0;i<numdivs;i++) { if(NN4) eval("document.div"+i+".visibility='hidden'") if(IE5) eval("document.all.div"+i+".style.visibility='hidden'") if(NN6) eval("document.getElementById('div"+i+"').style.visibility='hidden'") } if(NN4) eval("document.div"+which+".visibility='visible'") if(IE5) eval("document.all.div"+which+".style.visibility='visible'") if(NN6) eval("document.getElementById('div"+which+"').style.visibility='visible'") } </script> Thank you for taking the time to read this! Hopefully someone can help. Here's my script wher problem occurs: Code: $.post('do/register.php?username='+('#username').value, function(result) { if(result == 1) { $('#message').html("Everything's ok"); } else if(result == 2) { $('#message').html("Username is missing."); } else { $('#message').html("What the hell is wrong here?!"); } }); If i put alert(result); in function(result){ } part, i get "result" value that is '1' and that is correct value but it seems like IF statement is not recognizing it at all... #message div constantly shows me "What the hell is wrong here?!" message... Anyone know what could cause this problem? Thanks in advance, phpStud. Hi there! OK I need a little help as I'm not sure how to integrate this function into my form. First of all I should explain that my form doubles as a Google Search box. If you select the Google Search radio button it submits the input text to Google. It also defaults to Google if anything else other than "red", "green" or "blue" are entered. Now what I'd like to do is add a function so that if someone enters "purple is my favorite color" it recognizes the "purple" part of the string using something like .indexOf('purple'); and calls something like if(function==-1) { theForm.action = "Other choice "+ q.value; . How can I add this to my form? Thank you for any help. My form code: Code: <script> function convert(theForm){ var els = theForm.getElementsByTagName('input');// store inputs var q = els[0], color = els[1]; if(els[4].checked){// submit to google theForm.action = 'http://www.google.com/search'; return true; }; color.value = "Chosen "+ q.value +" color"; switch(q.value){// check the query case 'red': case 'green': case 'blue': location.href = color.value; return false; break; default: theForm.action="http://www.google.com/search"; break; }; return true; }; </script> <form name= "myform" onsubmit='return convert(this)'> <input name='q' type='text' /> <input name='color' type='hidden' /> <input type='submit' value=" Enter " /> <br /> <input name="searchType" type="radio" value="" checked="checked" > <label for="all"> My Form </label> <input name="searchType" type="radio" value="google" onclick="document.myform.action='http://www.google.com/search';" /> <label for="google"> Google Search </label></form> Hey, I am needing some help trying to remember what is the name of this type of javascript content expand script. It looks like this: It doesnt have to look like that but the same general example of expanding and contracting tabs with the arrow that switches when its open and closed. Thanks alot! Some links would be nice. I have buttons that check all the check boxes and uncheck all the checkboxes. They seem to not be working. Here is the code. Javascript Code: <script type="text/javascript"> function checkall(delchk) { for (i = 0; i < delchk.length; i++) delchk[i].checked = true; } </script> <script type="text/javascript"> function uncheckall(delchk) { for (i = 0; i < delchk.length; i++) delchk[i].checked = false; } </script> PHP PHP Code: <?php error_reporting(E_ALL); require("inc/config.php"); if (isset($_POST['del'])) { for ($count = 0;$count<count($_POST[delchk]);$count++) { $delete = $_POST[delchk][$count]; $query = "DELETE FROM persons WHERE id = '$delete'"; $result = mysql_query($query); if (!$result) { die("Error deleting persons! Query: $query<br />Error: ".mysql_error()); } } } $result = mysql_query("SELECT * FROM persons"); // Check how many rows it found if(mysql_num_rows($result) > 0){ echo "<table id=\"mytable\"> <thead> <tr> <th align=\"center\" scope=\"col\">Delete?</th> <th align=\"center\" scope=\"col\">First Name</th> <th align=\"center\" scope=\"col\">Last Name</th> <th align=\"center\" scope=\"col\">Profile</th> <th align=\"center\" scope=\"col\">Date</th> <th align=\"center\" scope=\"col\">IP Address</th> </tr> </thead> <tbody>"; echo "<form name = 'myform' action='' method='post'>"; while($row = mysql_fetch_array($result)) { echo "<tr align=\"center\">"; echo '<td><input type="checkbox" id="delchk" name="delchk[]" value="'.$row['id'].'" /></td>'; echo "<td>" . $row['FirstName'] . "</td>"; echo "<td>" . $row['LastName'] . "</td>"; echo "<td><a target=frame2 href='" ."profile.php?user1=". $row['FirstName'] ."'>Check Profile</a></td>"; echo "<td>" . $row['AddedDate'] . "</td>"; echo "<td>" . $row['Ip'] . "</td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; echo "<hr>"; echo "<input type='submit' name = 'del' value='Delete Selected'></form>"; echo "<input type='button' onclick='checkall(document.myform[\"delchk[]\"]);' value='Select All'>"; echo "<input type='button' onclick='uncheckall(document.myform[\"delchk[]\"]);' value='UnSelect All'>"; } else{ // No rows were found ... echo 'No registered members.'; } mysql_close(); ?> Please Check the webpage to see what I am trying to do. I am told It cant be done in HTML. That I will have to use Java Script. Can someone Please help me out here. Go to: http://www.capthelm.net If You can assist me please use the email link on my site. Thanks. The Captain Ok, will do, I guess I could sum up the problem now that I think about it into a very simple question. How do you make a variable variable in a loop? ex while(i<=20) { _A_+var+ = multiple vars with var endings like the beginning of this one } Please help me figure out how the f to shorten this ... Trying to turn this into a series of loops has been hell on earth (no good at this part of making a website, the javascript part that is) anyways, I was told by someone that was fairly smug that my javascript was retarded, I don't disagree but it works very well and I don't know enough to make it any other way. Please help me figure out how to shorten this rather than complain about the method I used for making the site. If you have a hotfile or rapidshare account I can pay you for your help by uploading 100 files to your account and using those links on my site to earn around $2 - $40 depending on popularity. (That's what I'm estimating though, and it will take about three months since I need to get users first) The site that needs this upgrade http://www.thefreemenu.com Right now this site is at the very beginning stages mostly due to my incompetence but I would really like to start moving things forward. I'm two months into this project and the last week and a half have really stalled to a stop. Its to slow to load and I really need to shorten the javascript so that it doesn't take up 600 k (bananascript version!). The below is repeated 10x for every letter and number as well as a special bit called all1. Here is the first example using _A_1 as the only part that changes. The next set is for the second page of the letter A so its called _A_p2_1, so basically I need this all the way to _A_p10_1 and I need it for all the letters of the alphabet, ex. _B_1, _B_p2_1. I don't understand how to loop but I think that it must be possible, but I really don't get it at all. I've studied loops, while, for and nothing I've learned has helped me solve this problem. Right now my .js file is 3mbs and I need to cut it down. Please help me figure this out, I"m a noob at javascript but I've created some pretty complex things and somehow manage to have them work. I think I'll get it if you can provide a small example using what I need to work with. Code: _A_0[0]='<ul class="freemenu"><li class="movieimage'; _A_0[1]='"><img src="images\/movies\/'; _A_0[2]='.png" width="75" height="120" \/><ul>\n <li class="hotlink'; _A_0[3]='"><a href="#" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onclick="addText(\''; _A_0[4]='\')"><img src="images\/hotfile.png" width="70" height="43" \/><\/a><\/li>\n <li class="rapidlink'; _A_0[5]='\')"><img src="images\/rapidshare.png" width="55" height="50"\/><\/a><\/li>\n <li class="information'; _A_0[6]='">\n <textarea name="textarea" cols="51" rows="30" style="overflow:hidden;" readonly="readonly" wrap="virtual" >'; _A_0[7]='<\/textarea>\n <\/li>\n<\/ul>\n<\/li>\n <\/ul>\n'; _AC_0[1]=(_A_0[0]+_nl_0[1]+_A_0[1]+_img_0[1]+_A_0[2]+_nl_0[1]+_A_0[3]+_h_0[1]+_A_0[4]+_nl_0[1]+_A_0[3]+_r_0[1]+_A_0[5]+_nl_0[1]+_A_0[6]+_i_0[1]+_A_0[7]); _AC_0[2]=(_A_0[0]+_nl_0[2]+_A_0[1]+_img_0[2]+_A_0[2]+_nl_0[2]+_A_0[3]+_h_0[2]+_A_0[4]+_nl_0[2]+_A_0[3]+_r_0[2]+_A_0[5]+_nl_0[2]+_A_0[6]+_i_0[2]+_A_0[7]); _AC_0[3]=(_A_0[0]+_nl_0[3]+_A_0[1]+_img_0[3]+_A_0[2]+_nl_0[3]+_A_0[3]+_h_0[3]+_A_0[4]+_nl_0[3]+_A_0[3]+_r_0[3]+_A_0[5]+_nl_0[3]+_A_0[6]+_i_0[3]+_A_0[7]); _AC_0[4]=(_A_0[0]+_nl_0[4]+_A_0[1]+_img_0[4]+_A_0[2]+_nl_0[4]+_A_0[3]+_h_0[4]+_A_0[4]+_nl_0[4]+_A_0[3]+_r_0[4]+_A_0[5]+_nl_0[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0[18]+_A_0[4]+_nl_0[18]+_A_0[3]+_r_0[18]+_A_0[5]+_nl_0[18]+_A_0[6]+_i_0[18]+_A_0[7]); _AC_0[19]=(_A_0[0]+_nl_0[19]+_A_0[1]+_img_0[19]+_A_0[2]+_nl_0[19]+_A_0[3]+_h_0[19]+_A_0[4]+_nl_0[19]+_A_0[3]+_r_0[19]+_A_0[5]+_nl_0[19]+_A_0[6]+_i_0[19]+_A_0[7]); _AC_0[20]=(_A_0[0]+_nl_0[20]+_A_0[1]+_img_0[20]+_A_0[2]+_nl_0[20]+_A_0[3]+_h_0[20]+_A_0[4]+_nl_0[20]+_A_0[3]+_r_0[20]+_A_0[5]+_nl_0[20]+_A_0[6]+_i_0[20]+_A_0[7]); var _20_0=(_AC_0[1]+_AC_0[2]+_AC_0[3]+_AC_0[4]+_AC_0[5]+_AC_0[6]+_AC_0[7]+_AC_0[8]+_AC_0[9]+_AC_0[10]+_AC_0[11]+_AC_0[12]+_AC_0[13]+_AC_0[14]+_AC_0[15]+_AC_0[16]+_AC_0[17]+_AC_0[18]+_AC_0[19]+_AC_0[20]); _A_p2_0[0]='<ul class="freemenu"><li class="movieimage'; _A_p2_0[1]='"><img src="images\/movies\/'; _A_p2_0[2]='.png" width="75" height="120" \/><ul>\n <li class="hotlink'; _A_p2_0[3]='"><a href="#" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onclick="addText(\''; _A_p2_0[4]='\')"><img src="images\/hotfile.png" width="70" height="43" \/><\/a><\/li>\n <li class="rapidlink'; _A_p2_0[5]='\')"><img src="images\/rapidshare.png" width="55" height="50"\/><\/a><\/li>\n <li class="information'; _A_p2_0[6]='">\n <textarea name="textarea" cols="51" rows="30" style="overflow:hidden;" readonly="readonly" wrap="virtual" >'; _A_p2_0[7]='<\/textarea>\n <\/li>\n<\/ul>\n<\/li>\n <\/ul>\n'; _AC_p2_0[1]=(_A_p2_0[0]+_nl_p2_0[1]+_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0[4]+_AC_p2_0[5]+_AC_p2_0[6]+_AC_p2_0[7]+_AC_p2_0[8]+_AC_p2_0[9]+_AC_p2_0[10]+_AC_p2_0[11]+_AC_p2_0[12]+_AC_p2_0[13]+_AC_p2_0[14]+_AC_p2_0[15]+_AC_p2_0[16]+_AC_p2_0[17]+_AC_p2_0[18]+_AC_p2_0[19]+_AC_p2_0[20]); Another part that I'm not so worried about but that still takes up a ton of space is the corresponding variables that need to be set as blank, this one being for a instead of 0(zero) like in the previous example. Code: var _nl_a =new Array() var _img_a =new Array() var _h_a =new Array() var _r_a =new Array() var _i_a =new Array() var _A_a =new Array() var _AC_a =new Array() _nl_a[1] = 1; _img_a[1] = 'nocontent7'; _h_a[1] = ''; _r_a[1] = ''; _i_a[1] = ''; _nl_a[2] = 2; _img_a[2] = 'nocontent7'; _h_a[2] = ''; _r_a[2] = ''; _i_a[2] = ''; _nl_a[3] = 3; _img_a[3] = 'nocontent7'; _h_a[3] = ''; _r_a[3] = ''; _i_a[3] = ''; _nl_a[4] = 4; _img_a[4] = 'nocontent7'; _h_a[4] = ''; _r_a[4] = ''; _i_a[4] = ''; _nl_a[5] = 5; _img_a[5] = 'nocontent7'; _h_a[5] = ''; _r_a[5] = ''; _i_a[5] = ''; _nl_a[6] = 6; _img_a[6] = 'nocontent5'; _h_a[6] = ''; _r_a[6] = ''; _i_a[6] = ''; _nl_a[7] = 7; _img_a[7] = 'nocontent5'; _h_a[7] = ''; _r_a[7] = ''; _i_a[7] = ''; _nl_a[8] = 8; _img_a[8] = 'nocontent5'; _h_a[8] = ''; _r_a[8] = ''; _i_a[8] = ''; _nl_a[9] = 9; _img_a[9] = 'nocontent5'; _h_a[9] = ''; _r_a[9] = ''; _i_a[9] = ''; _nl_a[10] = 10; _img_a[10] = 'nocontent5'; _h_a[10] = ''; _r_a[10] = ''; _i_a[10] = ''; _nl_a[11] = 11; _img_a[11] = 'nocontent8'; _h_a[11] = ''; _r_a[11] = ''; _i_a[11] = ''; _nl_a[12] = 12; _img_a[12] = 'nocontent8'; _h_a[12] = ''; _r_a[12] = ''; _i_a[12] = ''; _nl_a[13] = 13; _img_a[13] = 'nocontent8'; _h_a[13] = ''; _r_a[13] = ''; _i_a[13] = ''; _nl_a[14] = 14; _img_a[14] = 'nocontent8'; _h_a[14] = ''; _r_a[14] = ''; _i_a[14] = ''; _nl_a[15] = 15; _img_a[15] = 'nocontent8'; _h_a[15] = ''; _r_a[15] = ''; _i_a[15] = ''; _nl_a[16] = 16; _img_a[16] = 'nocontent6'; _h_a[16] = ''; _r_a[16] = ''; _i_a[16] = ''; _nl_a[17] = 17; _img_a[17] = 'nocontent6'; _h_a[17] = ''; _r_a[17] = ''; _i_a[17] = ''; _nl_a[18] = 18; _img_a[18] = 'nocontent6'; _h_a[18] = ''; _r_a[18] = ''; _i_a[18] = ''; _nl_a[19] = 19; _img_a[19] = 'nocontent6'; _h_a[19] = ''; _r_a[19] = ''; _i_a[19] = ''; _nl_a[20] = 20; _img_a[20] = 'nocontent6'; _h_a[20] = ''; _r_a[20] = ''; _i_a[20] = ''; var _nl_p2_a =new Array() var _img_p2_a =new Array() var _h_p2_a =new Array() var _r_p2_a =new Array() var _i_p2_a =new Array() var _A_p2_a =new Array() var _AC_p2_a =new Array() _nl_p2_a[1] = 1; _img_p2_a[1] = 'nocontent9'; _h_p2_a[1] = ''; _r_p2_a[1] = ''; _i_p2_a[1] = ''; _nl_p2_a[2] = 2; _img_p2_a[2] = 'nocontent9'; _h_p2_a[2] = ''; _r_p2_a[2] = ''; _i_p2_a[2] = ''; _nl_p2_a[3] = 3; _img_p2_a[3] = 'nocontent9'; _h_p2_a[3] = ''; _r_p2_a[3] = ''; _i_p2_a[3] = ''; _nl_p2_a[4] = 4; _img_p2_a[4] = 'nocontent9'; _h_p2_a[4] = ''; _r_p2_a[4] = ''; _i_p2_a[4] = ''; _nl_p2_a[5] = 5; _img_p2_a[5] = 'nocontent9'; _h_p2_a[5] = ''; _r_p2_a[5] = ''; _i_p2_a[5] = ''; _nl_p2_a[6] = 6; _img_p2_a[6] = 'nocontent7'; _h_p2_a[6] = ''; _r_p2_a[6] = ''; _i_p2_a[6] = ''; _nl_p2_a[7] = 7; _img_p2_a[7] = 'nocontent7'; _h_p2_a[7] = ''; _r_p2_a[7] = ''; _i_p2_a[7] = ''; _nl_p2_a[8] = 8; _img_p2_a[8] = 'nocontent7'; _h_p2_a[8] = ''; _r_p2_a[8] = ''; _i_p2_a[8] = ''; _nl_p2_a[9] = 9; _img_p2_a[9] = 'nocontent7'; _h_p2_a[9] = ''; _r_p2_a[9] = ''; _i_p2_a[9] = ''; _nl_p2_a[10] = 10; _img_p2_a[10] = 'nocontent7'; _h_p2_a[10] = ''; _r_p2_a[10] = ''; _i_p2_a[10] = ''; _nl_p2_a[11] = 11; _img_p2_a[11] = 'nocontent10'; _h_p2_a[11] = ''; _r_p2_a[11] = ''; _i_p2_a[11] = ''; _nl_p2_a[12] = 12; _img_p2_a[12] = 'nocontent10'; _h_p2_a[12] = ''; _r_p2_a[12] = ''; _i_p2_a[12] = ''; _nl_p2_a[13] = 13; _img_p2_a[13] = 'nocontent10'; _h_p2_a[13] = ''; _r_p2_a[13] = ''; _i_p2_a[13] = ''; _nl_p2_a[14] = 14; _img_p2_a[14] = 'nocontent10'; _h_p2_a[14] = ''; _r_p2_a[14] = ''; _i_p2_a[14] = ''; _nl_p2_a[15] = 15; _img_p2_a[15] = 'nocontent10'; _h_p2_a[15] = ''; _r_p2_a[15] = ''; _i_p2_a[15] = ''; _nl_p2_a[16] = 16; _img_p2_a[16] = 'nocontent2'; _h_p2_a[16] = ''; _r_p2_a[16] = ''; _i_p2_a[16] = ''; _nl_p2_a[17] = 17; _img_p2_a[17] = 'nocontent2'; _h_p2_a[17] = ''; _r_p2_a[17] = ''; _i_p2_a[17] = ''; _nl_p2_a[18] = 18; _img_p2_a[18] = 'nocontent2'; _h_p2_a[18] = ''; _r_p2_a[18] = ''; _i_p2_a[18] = ''; _nl_p2_a[19] = 19; _img_p2_a[19] = 'nocontent2'; _h_p2_a[19] = ''; _r_p2_a[19] = ''; _i_p2_a[19] = ''; _nl_p2_a[20] = 20; _img_p2_a[20] = 'nocontent2'; _h_p2_a[20] = ''; _r_p2_a[20] = ''; _i_p2_a[20] = ''; PLEASE PLEASE HELP ME FIGURE OUT HOW I CAN CUT THIS DOWN! It's been driving me insane for awhile now and I can't go any further until this is taken care of. I have a site that works just fine in fire fox but surprise surprise, there is a lot of problems in IE8 that dont make sense at all. Here is my link: http://paperlesswasp.com/royalvillicus/recompare.php Code: <span class="menu1" id="menu1"> <map name="menu1" id="menu1"> <area alt="memberships" shape="rect" coords="134, 143, 176, 166" href="http://realtor.com"/> <area alt="memberships" shape="rect" coords="188, 143, 231, 166" href="http://realestate.yahoo.com/"/> <area alt="memberships" shape="rect" coords="243, 143, 285, 166" href="http://realestate.com"/> <area alt="memberships" shape="rect" coords="297, 143, 340, 166" href="http://frontdoor.com"/> <area alt="memberships" shape="rect" coords="351, 143, 394, 166" href="http://homes.com"/> </map> <img src="image/rsummary.png" alt="site comparison" usemap="#menu1" width="" height="" vspace="5" hspace="1"/><br><br> </span> <span id="ex_10" style="display:none;"> <img src="image/rranking.png" name="ex_4" id="ex_4" alt="ranking" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_9" style="display:none;"> <img src="image/relistings.png" name="ex_5" id="ex_5" alt="listings" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_6" style="display:none;"> <img src="image/relistingsearches.png" name="ex_6" id="ex_6" alt="listings searches" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_7" style="display:none;"> <img src="image/recalculators.png" name="ex_7" id="ex_7" alt="calculators" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_8" style="display:none;"> <img src="image/reresources.png" name="ex_8" id="ex_8" alt="resources" width="" height="" vspace="5" hspace="1"/><br> </span> <span id="ex_11" style="display:none;"> <img src="image/remarketdata.png" name="ex_8" id="ex_8" alt="resources" width="" height="" vspace="5" hspace="1"/><br> </span> if you look under: http://paperlesswasp.com/royalvillicus/calculator.php IE8 will only show 2 out of the 7 drop down menu bars that are suppose to be there. works in IE8 and firefox Code: <img src="image/wroi.png" onmouseover="rollOn(this)" onmouseout="rollOff(this)" onclick="showMe(12)" vspace="1" hspace="1" class="position"><br><br> works only in firefox Code: <img src="image/wtax.png" onmouseover="rollOn(this)" onmouseout="rollOff(this)" onclick="showMe(11)" vspace="1" hspace="1" class="position"><br><br> Fire fox handles these just fine, but IE8 doesnt. I appreciate any siggestions Hi Im new to javascript and need some help with a project I have, the task I have is: Create a page that can take a bloke of text and out put the following o How many times each letter occurs o How many spaces o How many words o How many times each word occurs o A list of things that are not words or special characters I think maybe use an array but im not sure, like I said im new to this so not too sure on how to do it. I know it would read into a file say a txt file and sort through it this way, possibly using some kind of loop to read through all of the text before sorting it and I know it might use variables. I know how to kind of work through the task I have, but to actually implement the mechanics of the javascript is something that I then struggle with Thanks to all that help. Specifically i was wondering if anyone had any ideas on how to select the specific character when hovering over a word? I have not been able to find any documentation on this however, there is a demo site i found for a plugin that allows character selection. http://labs.bitmeister.jp/moamoa/demo.html i dont need anything that large and elaborate... Edit I'm pretty wel experinced with jquery, I know it's possible with jquery Hello all, I need assistance checking for valid characters in a username/password set up. I have been reading up on form validation but can't find exactly what I am looking for and need help deciphering what's going on. I have a list of accepted characters: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_@" a-z, A-Z, 0-9, dot, dash, underscore, and at. I want to then check an inputed string against that set and if a character is notin the accepted set, to send an alert. Here is what I have gathered so far: a for loop that increments through the values' .length - this is what checks each individual character. Then use of indexOf() can tell me which character is unacceptable. Now is where I am stuck and coming to you. Please help Hi all, I cant get this code to work because I do not know how to include the % character. Any help would be appreciated. My line break isnt working either Cheers, Adrian Code: rightButton.innerHTML = (rightOutcome1Prob+" chance of "+rightOutcome1+"\r\n else "+rightOutcome2); |