JavaScript - My Script Is Acting Weird
Hello guys,
My script is used to check some text field before the user upload some text, below you can see the code: Code: // JavaScript Document function Check() { var no_error=true; var pattern=/^[A-Za-zΑ-ΩΆΈΉΊΌΎΏα-ωάέήίόύώ!%()-:,.;(\s)]$/; //oi xaraktires p dikaioute na eisagei o xristis--> http://www.evolt.org/node/36435 txt_quote=document.getElementById('add_quote').value; if(txt_quote.length>0 && txt_quote.length<2000) { for(var i=0;i<txt_quote.length;i++) { if(!txt_quote.charAt(i).match(pattern)) { document.getElementById('add_quote').style.backgroundColor='#FF3333'; no_error=false; } else { document.getElementById('add_quote').style.backgroundColor='white'; } } } else { //is bigger than 2000 characters or is null document.getElementById('add_quote').style.backgroundColor='#FF3333'; no_error=false; } txt_quote=document.getElementById('add_name').value; pattern=/^[A-Za-zΑ-ΩΆΈΉΊΌΎΏα-ωάέήίόύώ!%()-:,.;]$/; //No space if(txt_quote.length>0) { for(var i=0;i<txt_quote.length;i++) { if(!txt_quote.charAt(i).match(pattern)) { document.getElementById('add_name').style.backgroundColor='#FF3333'; no_error=false; } else { document.getElementById('add_name').style.backgroundColor='white'; } } } else { document.getElementById('add_name').style.backgroundColor='#FF3333'; no_error=false; } txt_quote=document.getElementById('add_links').value; pattern=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; // if(txt_quote.length>0) { if(!pattern.test(txt_quote)) { document.getElementById('add_links').style.backgroundColor='#FF3333'; no_error=false; } else { document.getElementById('add_links').style.backgroundColor='white'; } } else { document.getElementById('add_links').style.backgroundColor='white'; } return no_error; } function countChars() { var text=document.getElementById('add_quote').value; document.getElementById('count_characters').innerHTML=text.length.toString() + " από 2000"; if(text.length>2000) { document.getElementById('add_quote').style.backgroundColor='#FF3333'; } else { document.getElementById('add_quote').style.backgroundColor='white'; } } function restore_color(id) { document.getElementById(id).style.backgroundColor='white'; } function restore_color_to_all() { document.getElementById('add_quote').style.backgroundColor='white'; document.getElementById('add_name').style.backgroundColor='white'; document.getElementById('add_links').style.backgroundColor='white'; document.getElementById('add_quote').focus(); } After that i call the check() function like this Code: ...onsubmit="return Check()"> This script works just fine with internet explorer but it doesnt work with chrome or firefox. Any ideas? (i guess something is wrong since internet explorer works and chrome/firefox not ) Similar TutorialsHey, I've written a function that slides in a sidemenu when hovering over a div. The function is working great, but i need to "disable" the slide part when the menu is already visible. So i added an if statement and a global bool. (menuactive) My Problem Is: Even if menuactive is false the function will still run as if menuactive was true?? Code: $(document).ready(function(){ var menuactive = false; $('.nav_left').mouseover(function(){ if(menuactive = false){ $(".nav_left_menu").show(); $(".nav_left_menu").animate({ width: '164px' }, 400); $(".nav_left_menu ul").animate({ opacity: '1.0' }, 800); menuactive = true; } else{ alert("Menu is already visible!"); return; } }); }); Thanks, How can I make the code tell the webpage whether or not I clicked yes or no? the code i have here wont work. I NEED the yes & no button to remain in the div, there's a reason for that. Code: <script> function uninstall(){ if(document.forms.formtest.test1.onClick){ alert('blah!'); }else if(document.forms.formtest.test2.onClick){ alert('naw!'); }else{ alert('fail!'); } } function check() { document.getElementById("uninstall").innerHTML = "Are you sure? Once you uninstall the database, you will have to reinstall this program.<br><br><input id=\"test1\" type=\"button\" onclick=\"uninstall()\" value=\"Yes\"> <input id=\"test2\" type=\"button\" onclick=\"uninstall()\" value=\"No\">"; } </script> <a href="javascript:check()">Uninstall Database</a> <form name="formtest"> <div id="uninstall"></div> </form> ANY help is GREATLY appreciated! =) Thanks! =) Shadow~ Hi, I am writing a basic app for a client where the customer puts in their order ID and phone number and press submit. When testing it on my PC it worked flawlessly. When I tested on a desktop PC where the screen was a touch screen as well as on Android devices, it seems the browser is a bit slow to respond. If you press each number slowly (waiting 0.5 second per press) it works fine. However if use it normal to fast then the browser does not catch every button press. Any and all advice is appreciated to heklp make this work. Code: <title>DLUX Order alert system</title> <head> <center><font color="blue"><b>DLUX Order alert system</b></font></center></br></br> <body onload="empty_to_do();"> <script type="text/javascript"> function addOrderID(key){ var order_id = document.forms[0].order_id; order_id.value = order_id.value + key; } function setToDo(key){ var to_do = document.forms[0].to_do; to_do.value = key; setTimeout(submitForm,100); } function addPhoneNumber(key){ var phone_number = document.forms[0].phone_number; var phone_number_real = document.forms[0].phone_number_real; phone_number.value = phone_number.value + key; phone_number_real.value = phone_number_real.value + key; phone_number_real.value = phone_number_real.value.substr(0,10); if(phone_number_real.value.length <1){ phone_number.value = ''; } if(phone_number_real.value.length >0 && phone_number_real.value.length < 3){ phone_number.value = '(' + phone_number_real.value.substr(0,3) ; } if(phone_number_real.value.length >2 && phone_number_real.value.length < 6){ phone_number.value = '(' + phone_number_real.value.substr(0,3) + ') ' + phone_number_real.value.substr(3,3); } if(phone_number_real.value.length > 5){ phone_number.value = '(' + phone_number_real.value.substr(0,3) + ') ' + phone_number_real.value.substr(3,3) + '-' + phone_number_real.value.substr(6,4); } } function delOrderID(key){ var order_id = document.forms[0].order_id; order_id.value = order_id.value.substring(0, order_id.value.length - 1); } function delPhoneNumber(key){ var phone_number = document.forms[0].phone_number; var phone_number_real = document.forms[0].phone_number_real; phone_number_real.value = phone_number_real.value.substring(0, phone_number_real.value.length - 1); if(phone_number_real.value.length <1){ phone_number.value = ''; } if(phone_number_real.value.length >0 && phone_number_real.value.length < 3){ phone_number.value = '(' + phone_number_real.value.substr(0,3) ; } if(phone_number_real.value.length >2 && phone_number_real.value.length < 6){ phone_number.value = '(' + phone_number_real.value.substr(0,3) + ') ' + phone_number_real.value.substr(3,3); } if(phone_number_real.value.length > 5){ phone_number.value = '(' + phone_number_real.value.substr(0,3) + ') ' + phone_number_real.value.substr(3,3) + '-' + phone_number_real.value.substr(6,4); } } function resetOrderID(key){ var order_id = document.forms[0].order_id; order_id.value = ''; } function resetPhoneNumber(key){ var phone_number = document.forms[0].phone_number; var phone_number_real = document.forms[0].phone_number_real; phone_number.value = ''; phone_number_real.value = ''; } function submitForm(){ document.forms[0].submit(); } function emptyCode(){ document.forms[0].order_id.value = ""; document.forms[0].to_do.value = ""; document.forms[0].phone_number.value = ""; document.forms[0].phone_number_real.value = ""; } function empty_to_do(){ document.forms[0].to_do.value = ""; } function empty_order_id(){ document.forms[0].order_id.value = ""; } function empty_phone_number(){ document.forms[0].phone_number.value = ""; document.forms[0].phone_number_real.value = ""; } </script> <style> body { text-align:center; background-color:#D3D3D3; font-family:Verdana, Arial, Helvetica, sans-serif; } #keypad {margin:auto; margin-top:20px;} #keypad tr td { vertical-align:middle; text-align:center; border:1px solid #000000; font-size:18px; font-weight:bold; width:180px; height:160px; cursor:pointer; background-color:#666666; color:#CCCCCC } #keypad tr td:hover {background-color:#999999; color:#FFFF00;} .display { width:130px; margin:10px auto auto auto; background-color:#000000; color:#00FF00; font-size:18px; border:1px solid #999999; } #message { text-align:center; color:#009900; font-size:14px; font-weight:bold; display:none; } #submit { width: 10em; height: 5em; } </style> <form action="" method="post"> <font color="red"><b>Order ID: </b></font> <input type="text" name="order_id" value="9" maxlength="10" class="display"/> <table id="DOVID_keypad" cellpadding="15" cellspacing="5"> <tr> <td><input type="button" style="width:75;height:75" value="1" onclick="addOrderID('1');"></td> <td><input type="button" style="width:75;height:75" value="2" onclick="addOrderID('2');"></td> <td><input type="button" style="width:75;height:75" value="3" onclick="addOrderID('3');"></td> </tr> <tr> <td><input type="button" style="width:75;height:75" value="4" onclick="addOrderID('4');"></td> <td><input type="button" style="width:75;height:75" value="5" onclick="addOrderID('5');"></td> <td><input type="button" style="width:75;height:75" value="6" onclick="addOrderID('6');"></td> </tr> <tr> <td><input type="button" style="width:75;height:75" value="7" onclick="addOrderID('7');"></td> <td><input type="button" style="width:75;height:75" value="8" onclick="addOrderID('8');"></td> <td><input type="button" style="width:75;height:75" value="9" onclick="addOrderID('9');"></td> </tr> <tr> <td><input type="button" style="width:75;height:75" value="RESET" onclick="resetOrderID('');"></td> <td><input type="button" style="width:75;height:75" value="0" onclick="addOrderID('0');"></td> <td><input type="button" style="width:75;height:75" value="BACK" onclick="delOrderID('');"></td> </tr> </table> <br/> <font color="red"><b>Phone Number: </b></font> <input type="text" name="phone_number" value="" maxlength="15" class="display"/><input type="hidden" name="phone_number_real" value="" maxlength="10" class="display"/></tr> <table id="keypad" cellpadding="5" cellspacing="3"> <tr> <td onclick="addPhoneNumber('1');">1</td> <td onclick="addPhoneNumber('2');">2</td> <td onclick="addPhoneNumber('3');">3</td> </tr> <tr> <td onclick="addPhoneNumber('4');">4</td> <td onclick="addPhoneNumber('5');">5</td> <td onclick="addPhoneNumber('6');">6</td> </tr> <tr> <td onclick="addPhoneNumber('7');">7</td> <td onclick="addPhoneNumber('8');">8</td> <td onclick="addPhoneNumber('9');">9</td> </tr> <tr> <td onclick="resetPhoneNumber('');">RESET</td> <td onclick="addPhoneNumber('0');">0</td> <td onclick="delPhoneNumber('');">Back</br>Space</td> </tr> </table> <br> <table id="keypad" cellpadding="10" cellspacing="3"> <td onclick="setToDo('submit');">Submit</td> </table> <input type="hidden" name="to_do" value="" maxlength="100" readonly="readonly" /></tr> </form> </html> I had this filterable thing working perfectly but seem to have done something that just makes all the items flash constantly when you try and filter (click the blue section All | Illustration | Animation). Can someone take a look and help at all? http://bit.ly/4yWiDZ Now this is really stumping me otherwise i wouldnt be here. I have a Javascript that i have that runs in a php site, i have a section where i can save the code to a part in my admin section for loading special images in diffrent locations. So i used java script for rotation on those images. The funny thing is it loads up in a few pages where it calls the php code. but in other pages it doesnt load anything at all. The call function works. in all pages but where the javascript doesnt work the static image i can place works. But i need it to use the javascript code so i can rotate them aswell. For example: Code: <div id="footads"> <div id="fad"> <? echo $foot1 ?> </div> <div id="fad2"> <? echo $foot2 ?> </div> <div id="fad1"></div> </div> the $foot1 and 2 are footer call function which pulls the java script. I have no problem running multi versions of this script as i change the vars etc in java to make them run. How ever like i said its not loading in some pages. but others it will? here is some linked examples. Working - Default advert images set on 10 sec delays Working diff page - Default advert images set on 10 sec delays not Working - Default advert images set on 10 sec delays Its like its not calling the code from the function, But it is because if you view source. Quote: <div id="footads"> <div id="fad"> <script language="JavaScript" src="/adverts/addbanner1.js" type="text/javascript"></script> <div class='addbanner1'><div id='addbanner1'></div></div><div style="clear:both;"></div> </div> <div id="fad2"> <script type= "text/javascript" src="/adverts/addbanner2.js" type="text/javascript"></script> <div class='addbanner3'><div id='addbanner3'></div></div><div style="clear:both;"></div> </div> <div id="fad1"></div> </div> Hello guys, I'm currently writing an web application using java servlets and javascript. Today i ran into this weird problem. The servlet sends to the client an html page which has an javascript in it and a form. Upon completion of the form and pressing the submit button the javascript does not execute(but the form is sent, function is called with the onclick tag). If i view-source this page from my browser and save it to an .html file locally the javascript function executes just fine. Any help greatly appreciated so my code is Code: function more(){ alert("You can't eat more apples then you have"); } function apple(){ var apples = prompt('How many apples do you have'); var eat = prompt('How many did you eat'); if(eat > apples){ more(); } if(eat <= apples){ var eaten = apples - eat; alert('You ate '+ eaten + ' apples!'); } } My problem is unless you enter 1 for how much did you eat, it goes to the more function. So I have the following code in javascript that creates an iframe: Code: var iframe = document.createElement("iframe"); iframe.id = 'offerframe'; iframe.name = 'offerframe'; iframe.width = '975'; iframe.height = '650'; iframe.align = 'center'; iframe.src = 'http://example.com'; document.getElementById("offer-frame-div").appendChild(iframe); It works fine in Firefox and Safari but in IE8 it generates the iframe name attribute to "submitName" Code: <iframe width="975" height="650" align="center" id="offerframe" submitName="offerframe" src="http://example.com"> Notice how it sets all the other attributes fine, however the name attribute is now called "submitName". This issue only happens in IE. This there any alternatives to setting my iframe name dynamically with javascript. I am new here. I've been trying to learn javascript, php, ajax, and others on my own, through the help of researching. I can't seem to manage figuring this out. I'm using a string "A B C" for sake of example. Variable d goes through a for loop checking for capital letters, to make substrings. d=0 finds A and makes the substring A. d=1 finds B and makes the substring AB. d=2 finds C and makes the substring ABC. It seems to me that: d=0 should be A d=1 should be B d=2 should be C. (which is what I want) Here's the actual code (obviously, the actual string being worked with is not 'A B C'): Code: response = response.replace(/([A-Z])(?![A-Z])/g, " $1") ; response1 = new Array(); caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; a=0 ; q=0 ; for (a=0 ; a<=response.length-1 ; a++) { for (q=0 ; q<caps.length ; q++) { if (response.charAt(a) == caps.charAt(q)) { response1[response1.length] = response.substring(a,' ') ; }}} response1 = response1.filter(function(){ return true}) ; b=1 ; for (b=1 ; b<=response1.length-1 ; b++) { document.write(response1[b] + "<br />") ; } } Code: <html> <script> function doit(){ document.write(document.getElementById('myIMG').getAttribute('src')); } </script> <body onLoad="doit()"> <img src="blabla.jpg" id="myIMG"> My question is, why is it, that after loading the page, the image that should be displayed at the page is not being displayed. The only thing that can be seen is text generated by the document.write function. Hi folks, I'm updating code that's been in use for years now. Consider the following: Code: <script language="javascript"> function submitForm() { frm.submit(); } </script> ....//body tag, etc <form name="frm" action="blahblah"> //button here that calls submitForm() on click; </form> This is, of course, a highly stripped down version but you get the idea. The problem, this site was not a standalone site before, i.e. www.mysite.com, but was in a subdirectory of our intranet. We've since upgraded it to ColdFusion 8 and made it a standalone site. frm.submit() no longer works and required us to change it to document.frm.submit(). Any ideas why? Some people claim that the window.onload does not fire in some browsers, under some OS, when the page is re-loaded using the back button of the browser. The simple code is: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> onload=function(){ alert('foo') } </script> </head> <body> <a href="http://www.google.com">go Google then press the back button</a> </body> </html> Open the document, click the link, then press the Back button of the browser. Surprisingly, in FF 3.6.3 (at least) the window.onload event is not read again, thus it does not fire the function. That is a severe issue, as a lot of JavaScript codes are based on onload event. Is it a bug? Does that happen only locally (I can not test it on a server this moment)? Are there any other browsers or other browsers' versions which act in the same way? Any thoughts? Hi, I used the code on the following example: http://www.w3schools.com/php/php_ajax_livesearch.asp Instead of xml I use mysql but it works the same way. My problem is with this character '#' (shift 3 - on my keyboard, or otherwise known as 'sharp'). Some of the words in my database table contain this character but when I type it, it acts like nothing was typed. Any idea on what to do to make this work like any other character? Thanks Hey guys. I have a weird issue (you kind of have to see it for yourself to understand). If you double click on the next or previous button quickly (within 500 miliseconds of each other) it creates a double of the next slide. http://insidehb.com/imageofday/ Let me know if you can help. Thanks. I use this code to clone an object. At the end I test the properties: Code: //cloning codes function Clone(){} function clone(obj) { Clone.prototype = obj; return new Clone(); } // var Orange={natu 'fruit',color:'orange'} var Banana=clone(Orange); for(a in Banana){ alert(a) } So far so good. I see: nature - > color But now I want to change a property of the Banana object, the color, then test again the properties: Code: Banana.color='green'; for(a in Banana){ alert(a) } Surprisingly, the changed property becomes the first in the loop, which is curious. I see now: color - > nature Can anyone explain me why? I understand that the last new created property comes always first (which I don't like, but I take it as it is), but I suppose that, in the case above, the property was already defined, and I did nothing but changing its value. Is there a way to keep the order within the prototype? Hello there, Problem: I was able to see problem only in IE6 Form input fields not clickable and not accepting inputs + Can't even select text or perform most right-click functions. URL: http://www.webhostingkit.com/a/cgi/p...usercontactall Was wondering if anyone can help me out with this weird problem. Not sure why, but none of the input form fields are able to accept values or even clickon them. Site displays just fine in IE, however anywhere on the site, when user tries to input, it just won't show happen, any idea on what is wrong or how to fix this? Thanks again. ** Edit ** If anyone has IE6 installed can you please test it, cuz I am thinking it might be just the standalone version of IE I have might be having the issue, as in that IE, some major sites (including yahoo.com) are having the same issues. This might be a little complicated. I'll try to be as clear as possible. I got some help from Old Pedant a little while ago and the code worked great. The problem came after I tried some code that will highlight (select) text in a DIV: Code: <script type="text/javascript"> function selectNode (node) { var selection, range, doc, win; if ((doc = node.ownerDocument) && (win = doc.defaultView) && typeof win.getSelection != 'undefined' && typeof doc.createRange != 'undefined' && (selection = window.getSelection()) && typeof selection.removeAllRanges != 'undefined') { range = doc.createRange(); range.selectNode(node); selection.removeAllRanges(); selection.addRange(range); } else if (document.body && typeof document.body.createTextRange != 'undefined' && (range = document.body.createTextRange())) { range.moveToElementText(node); range.select(); } } </script> Code: <div id="bb1"></div> <form> <input type="button" value="Click Here to Highlight Data" onclick="window.selectNode(document.getElementById('bb1'));" style="margin-left:4px; font-weight:bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;"> </form> It works great with Firefox and Internet Explorer, but there is a problem with Opera. The contents of the DIV is selected, but so is everything after the DIV. Below is a link to the page, but be sure to turn down your speaker volume before you visit the page so you won't have a heart attack: http://www.randomterrain.com/atari-2...music-toy.html The DIV is empty when the page loads. To put content in the DIV, jump down to All Sounds and left click on a couple of the numbers than run from 0 to 31, then jump down to the DIV. When you click on the "Click Here to Highlight Data" button, you'll see that more than the contents of the DIV is selected. I hope someone can figure out how to make the code work properly with Opera. Thanks. So i have this weird problem that only occurs in IE, in combination with Adsense. I also tried FF and Chrome and it does not occur in those browsers. I use javascript to swap around divs, since css 'order' is not supported in every browser (at least not working for my iphone 4). The swapping is working fine in IE when you resize from a screen larger than 1024 to a screen smaller than 1024 and then to a screen larger than 1024. However it does not work well when you open the page/script in a screen smaller than 1024 and then make it larger (in IE). The sidebar 'aside' stays on the right side after 'article' instead of moving to the left. This only happens when i use adsense in the sidebar.. Otherwise it all works fine... Very weird to me.. Anyone who can help out? See this weird problem he JS Bin Here is the code: Code: <html> <head> <style> html, body { padding: 0; margin: 0; background: #eee; } body { padding: 0 3% } header, footer, .slogan, .page-wrapper, .headline-wrapper, aside, article { box-sizing: border-box } .slogan, aside, article { background: #fff } aside, article { padding: 20px; border-radius: 10px; margin: 10px 0 0 0; -webkit-box-shadow: 0px 0px 2px 0px rgba(50, 50, 50, 0.5); -moz-box-shadow: 0px 0px 2px 0px rgba(50, 50, 50, 0.5); box-shadow: 0px 0px 2px 0px rgba(50, 50, 50, 0.5); } header, footer { padding: 20px } @media (min-width:1024px) { .page-wrapper, header, footer { width: 100%; margin: 0 auto; max-width: 1200px; } .page-wrapper { display: table; width: 100%; padding-top: 50px; max-width: 1200px; margin: 0 auto; } .page-wrapper > aside, .page-wrapper > article { display: table-cell; padding: 20px; } .page-wrapper aside { width: 30% } article { position: relative } .slogan { padding: 0 20px; border-bottom: 0px; width: 100%; margin: 0; line-height: 50px; height: 50px; position: absolute; left: 0; top: -50px; } .slogan { border-radius: 10px 10px 0 0; -webkit-box-shadow: 0px -2px 2px 0px rgba(50, 50, 50, 0.3); -moz-box-shadow: 0px -2px 2px 0px rgba(50, 50, 50, 0.3); box-shadow: 0px -2px 2px 0px rgba(50, 50, 50, 0.3); background: #ddd; } article { border-radius: 0 0 10px 0 } aside { border-radius: 10px 0 0 10px } } </style> <script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script> <script type='text/javascript'> function handleMargins() { var width = (window.innerWidth > 0) ? window.innerWidth : screen.width; if(width < 1024) { $(".page-wrapper").each(function() { var detach = $(this).find("aside").detach(); $(detach).insertAfter($(this).find("article")); }) } if(width >= 1024) { $(".page-wrapper").each(function() { var detach = $(this).find("article").detach(); $(detach).insertAfter($(this).find("aside")); }) } } jQuery(document).ready(handleMargins); $(window).resize(handleMargins); </script> </head> <body> <header>header</header> <div class="page-wrapper"> <aside> sidebar <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- N_Responsief_Alle_CTR_AlleAdsenseSites --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3961745091197220" data-ad-slot="3968514626" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></aside> <article> <h3 class="slogan">One line slogan only </h3> <p>This is the articlediv</p> </article> </div> <footer>footer</footer> </body> </html> Reply With Quote 12-23-2014, 03:35 PM #2 sunfighter View Profile View Forum Posts Senior Coder Join Date Jan 2011 Location Missouri Posts 4,830 Thanks 25 Thanked 672 Times in 671 Posts You need a doctype! maybe add <!DOCTYPE html> at the top of this code. IE needs a doctype or it is screwy. For some reason i cant get this bit of code to work. You can ignore the php and html if its getting in your way. Thanks: Code: <div id="pl"> <? if($edit == true){ ?> <script type="text/javascript"> $("#add_playlist_form").css({display:"none"}); $("#add_playlist").click(function(){ alert($("#add_playlist").html()); if($("#add_playlist").html() == "Add a Playlist >>"){ $("#add_playlist").html("Hide <<"); $("#add_playlist_form").css({display:"block"}); } else{ $("#add_playlist").html("Add a Playlist >>"); $("#add_playlist_form").css({display:"none"}); } }); </script> <a href="#" id="add_playlist">Add a Playlist >></a> <form id="add_playlist_form" method="POST" action=" "> <input type="text" name="pl_name" class="add_playlist"/> <textarea name="pl_dsec" maxlength="200"></textarea> <input type="submit" name="submit_playlist" value="Add Playlist" class="submit_playlist"/> </form> <? } ?> <ul class="vList"> Find it really hard to understand these random variable names and what they are doing, can anyone explain what is going on exactly in the bolded parts. I have a rough idea but the 3 arrays confuse me somewhat im sure the random variable names are pointers and counts but id love to hear an expert explain them for sure thanks if you can help or are willing to take the time |