JavaScript - Coloring Book Script
Hi,
I'm looking for a coloring book script and ... I'm trying to understand, how does it work: http://www.coloringpageskids.org/onl...ls-butterfly,5 It's HTML5, JavaScript or something else? Similar Tutorials1 Textfield counter problem. I have this counter (in javascript) that counts the characters in my textarea, and displays the amount of characters left to type. When a limit is reached, the last typed character gets deleted automatically. Now the counting goes fine everywhere, but when a page loads, the counters do not count the amount of characters in it, only when the script is activated by a 'onkeydown'. Now the thing is, I would use an onload, but the problem is that the ID's of these things are random, so I don't know how to do this... Here's the code: Code: <script type='text/javascript'> function textCounter(field, counter) { var max='140'; if (field.value.length > max) field.value = field.value.substring(0, max); else counter.value = max - field.value.length; } </script> PHP Code: <?php while($row = mysql_fetch_array($result)) { echo "<form name='form".$row['photoid']."'>"; echo "</td><td>"."<textarea rows='5' cols='30' onkeydown=\"textCounter(this.form.a".$row['photoid'].",this.form.counter);\" onkeyup='textCounter(this.form.a".$row['photoid'].",this.form.counter);' id='a".$row['photoid']."' name='".$row['photoid']."' \">".$row['description']."</textarea>"; echo "U heeft nog <input readonly type='text' name='counter' size='3' maxlength='3' value='140' /> tekens over."; echo "</form>"; } ?> Short extra explanation: onkeydown and onkeyup activate the counter of that form. The photoid's get loaded from a directory, and can be fully random. 2 Coloring problem on change This problem is in the same script as the previous problem, but I've torn the code separate so that is easier for you to inspect and understand it's function. So it is about the same textarea as the previous problem. The textaera is in a table, and there is another cell in that table that changes it's color. When the page is loaded, all the colors are green. When you click a textarea, the color turns orange, but if you click somewhere else it turns orange again. But when you are focused on the textarea (and the color is orange) and you press a key, the color changes red and stays red even when you lose focus on that element. Now what I want is that when you activate the textarea and press an arrow on your keyboard (and thus you don't change the contents of the textaerea) the color stays orange, and doesn't change red... How should this be done? Here's the simplified code: Code: <script type='text/javascript'> function changeColor(id,color,type) { if(type== 'focus' || type == 'keydown'){ document.getElementById(id).style.borderColor=color; }else if(type=='blur' && document.getElementById(id).style.borderColor == 'orange'){ document.getElementById(id).style.borderColor='green'; }else{document.getElementById(id).style.borderColor='red';} } </script> PHP Code: <?php while($row = mysql_fetch_array($result)) { echo "<form name='form".$row['photoid']."'>"; echo "<table>"; echo "<tr><td>"."<img src='fotos/" . $row['photoid'] . $row['type'] . "' />"; echo "</td><td>"."<textarea rows='5' cols='30' onkeydown=\"changeColor('c".$row['photoid']."','red','keydown');\" id='a".$row['photoid']."' name='".$row['photoid']."' onfocus=\"changeColor('c".$row['photoid']."','orange','focus')\" onblur=\"changeColor('c".$row['photoid']."','red','blur')\">".$row['description']."</textarea>"; echo "</td><td id='c".$row['photoid']."' style='border:2px solid green;' >This cell get's colored"; echo "</td><td></tr></table>"; echo "</form>"; } ?> Hi there i wanted some sugessions on good books out there for AJAX as a whole for beginners familiar in programming. I donot know java scripting. Should i learn that before AJAX? Please suggest good books for both
So I am looking for a book that basically goes from the very basics to middle level of java programing, but one that is up to date, and that explains everything, not like some of the books that just throws code at you and expects you to understand why you are making the class public and why it extends javaplugins, just something in depth that really explains why for everything.
Hello, I was just wondering if anyone knows of a great javascript book to buy. I am looking for something super duper hard core. I would love it to have documentation galore that includes all of the AJAX and DOM and XML. You know... like a javascript BIBLE. Something thick and comforting. Something that makes you feel all warm and toasty inside just knowing that it is there. So if I start running into some problem I can just glance at the book and rest assured that if the problem exculates not to fear. I have .... THE BOOK. Does anyone have any suggestions? Thanks, Michael Would like to start learning JavaScript and would appreciate any books based on JavaScript that forum members would care to recommend. Thanks all
Hi, I have a very old book on JavaScript, and just wondering if it would be wise to start from it. The book is: SAMS Teach yourself JavaScript in 24 hours - Second Edition (covers JavaScript 1.5) Let me know guys because I can get cracking on with it if so! What I need to know is whether or not JS has been updated since? I have come to the conclusion that this book title sux "New Perspectives on JavaScript, 2nd Edition " Is there a better book I can use where I can copy the sample programs that the book uses, that actually has good modern javascript technique, and has the other code that goes along with it like the html, the css, and the .jpgs all on the cd that comes with the book or something? "Professional JavaScript for Web Developers (Wrox Programmer to Programmer)" by Nicholas C. Zakas is a good book title it definitely clarified that crappy text book that my university gave me, but I'm ready to take the next step and start using sample code and apply the concepts I learned from that book. Please recommend anything I would need to be ubber programmers like all of you guys.
I use a bookmarklet that looks like this: Code: try{ sl_el_wrapper.go(); } catch(e){ var%20s=document.createElement('script'); s.id='sl_el_BMSCRIPT'; s.type='text/javascript'; document.body.appendChild(s); s.src='http://EXAMPLE.com/marklet.js.php?v='+(new%20Date().getTime()); } void(0); This was all on one line, but I added a return after each ;. I want to make this a function so I can click a button on my page and have it run. I've tried a lot of things but cant seem to make it work. Any thoughts? I am studying Javascript from the Headfirstlabs book. Please see my coding below as per the instructions on page 26, the only thing that happens is the onload alert [Hello, I am your per rock] when the page loads, nothing else and no touchrock function or smiling face, I have the images where they should be. Can anyone tell me why it's not working on my end please? Code: <html> <head> <title>irock -The virtual Pet Rock</title> <script type="text/javascript"> function touchrock () { var username = prompt ("What is your name?", "Enter your name here."); if (username) { alert ("It is good to meet you, " + username + "."); document.getElementByID ("rockImg").src = "rock_happy.png"; } } </script> </head> <body onload="alert ('Hello, I am your pet rock.');"> <div style="margin-top: 100px; text-align: center;"> <img id="rockIMG" src="rock.png" alt="irock" /> </div> </body> </html> AMAZON has some nice future for book preview and they can display book cover/back like real book. For instance Rational Astrology: as a physical model (Chinese Edition): Julian J.-L. Ting: 9781493734559: Amazon.com: Books Presumably that is done by javascript? Is there any free code available for doing such business? I have to take more javascript programming classes and I'm really not good at it. I desperately need help. I own Visual Basic, but it's a little difficult to use. What is the best book, online resource, and software for programming in javascript?
I typed this code straight out of the book and it just doesn't seem to work. I have the headlines on the left side and when clicked the contents of the headline is supposed to show up in the text box on the right. Well, needless to say, nothing appears. Please someone tell me what I am doing wrong. I am not the only person in the class having this issue. Thanks a million. Code: <!DOCTYPE HTML> <!--mwelborn--> <!--Chapter 8 Page 475--> <!--October 25, 2011 --> <html> <head> <title>News Items</title> <script type="text/javascript"> /* <![CDATA[ */ var newsItem1 = "L'AQUILA, ITALY (AP) - L'Aquila's chief prosecutor announced an investigation into allegations of shoddy construction as people sill missing after a devastating earthquake five days ago. http://in.reuters. com/article/ idUSWBT01103020090411; var newsItem2 = "WASHINGTON (Reuters) - President Barack Obama said on Friday the recession- hit US economy was showing 'glimmers of hope' despite remaining under strain and promised further steps in coming weeks to tackle the financial crisis. http://in.reuters.com/article. idUSWBT01103020090411"; var newsItem3 = "(eweek.com) - Apple is close to hitting 1 billion downloads from its App Store and plans on a prize giveaway fo whoever downloads the billionth application that includes a MacBook Pro and an iPod Touch. http://www.eweek.com/c/a/ Application-Development/eWeek-Newsbreak -April-13-2009/"; var newsItem4 = "ATLANTA (AP) - Chipper Jones drove in two runs, including a tiebreaking single, and the Atlanta Braves beat Washington 8-5 on Sunday to hand the Nationals their sixth straight loss to start the season. http://www.newsvine.com/_news/2009/04/11 2667835-jones-braves-beat-winless -nationals-8-5?category=sports"; /* ]] */ </script> </head> <body> <form name="newsHeadlines" action="" method="get"> <table style="border: 0; width: 100%"> <tr valign="top"> <td> <select name="newsHeadlines" multiple="multiple" style="height: 93px"> <option onclick="document.newsHeadlines .news.value=newsItem1"> Investigation of building standards in quake zone</option> <option onclick="document.newsHeadlines .news.value=newsItem2"> Obama sees signs of economic progress</option> <option onclick="document.newsHeadlines .news.value=newsItem3"> Apple App Downloads Approach 1 Billion</option> <option onclick="document.newsHeadlines .news.value=newsItem4"> Jones, Baves beat winless Nationals 8-5</option> </select> </td> <td> <textarea name="newsHeadlines" cols="50" rows="10" style="background-color: Transparent"></textarea> </td> </tr> </table> </form> </body> </html> Hi All, I have two scripts which I want to try and integrate. I am using a nice gallery script to show thumbnails which are appended to a an image wrapper which on click of the thumbnail shows the larger image in the image wrapper, I am trying to implement cloud zoom which is a plugin which uses image srcs to then point to an anchor href to show another larger zoom image either in the same place.. which is what I am trying to do or in another div beside. I have had to set me img srcs up in a certain way to easily enter some product details. and I need to try an manipulate the code to make it work to suit my file layout. I am using a var= images [ with a series of file locations and info such as below { src: 'romanticabride/thumbs/tn_Shauna.jpg', srcBig: 'romanticabride/images/Shauna.jpg', title: 'Shauna', longDescription: '<b><H1>Shauna</H1></b><br><b>Romantica Of Devon <br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:tracy@cherishbridal.co.uk?subject=Web Enquiry Regarding Romantica Shauna Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>' }, what I need is for cloud zoom to work when the main image wrapper is hovered over which means it will need to add a class or when the whichever srcBig: is hovered over it gets wrapped by href to make the script work . one of my pages is http://www.cherishbridal.co.uk/romaticabride.html the cloud zoom script is at http://www.professorcloud.com/mainsite/cloud-zoom.htm.. I am happy to share a jsfiddle with someone or explain further or post some code. Thank you in advance does any expert know how to pass parameters in the <script ..> tag? for instance; Code: <script type="text/javascript" src="script.js ?param1=val1¶m2=val2&etc "> in the javascript script.js, how would we read the params after the question mark? for example, google this; google shopping cart /v2_2/cart.js I have a script that works in seamonkey(my html editor) but when I use it in IE8 it says errors happen. Here's the code (the first line is on line 7 of the html file): Code: <script type="text/javascript"> function enlarge(imageNum) { var numToString = ""; if(parseInt(imageNum) < 10){ numToString = "0" + imageNum; } else { numToString = imageNum + ""; } window.open("images/LgScreenshot"+numToString+".jpg","Screenshot "+imageNum,"status=0,height=675,width=900,resizable=0"); } </script> And the errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.3; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 14:58:16 UTC Message: Object expected Line: 150 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Message: Invalid argument. Line: 18 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html I need to assign a key in the javascript to actually make the javascript work,. I have a bookmark in chrome , a javascript , which actually works when clicked on it .,. but how can i edit it so that i can actually make it work on click a key or combination of keys. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. Thanks in advance ., Nani On this website: http://evancoleman.net/index.php I really like on the top how the menu has like 5 or 6 icons, and when you hover over them it shows a bubble with the name in them. Does anybody know where I can find this script? Thanks. Hello again . If these questions concerning Regular Expressions are inappropriate in this forum please let me know . Thank You. This expression <script[^>]*>.*?</script> matches ... Code: <script type="text/javascript">var cnnIsHomePage = true;</script> but not ... Code: <script type="text/javascript"> var cnnIsHomePage = true; </script> Please , how can i match the latter ? Hi there, I'm not too familiar with js, so I'm asking for help I have this script below which loads flash object after clicking fb like button. My question is how to do it after clicking the fb like button automatically to recognize youtube flash object or an object from another tube site? Is it possible? Thank you in advance! Code: <script type='text/javascript'> window.fbAsyncInit = function() { FB.init({appId: "0000000000000", status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement("script"); e.async = true; e.src = document.location.protocol + "//connect.facebook.net/en_US/all.js"; document.getElementById("fb-root").appendChild(e); }()); FB.Event.subscribe('edge.create', function(href, widget) { setTimeout("playvideo1();", 0); }); function playvideo1() { document.getElementById('playvideo1').innerHTML = '<object ....... </object>'; } </script> Hi everyone: I need help taking this pop under script: <script language="JavaScript"> var popunder="URL GOES HERE" function loadpopunder(){ win2=window.open(popunder) win2.blur() window.focus() } loadpopunder() </script> and making it so that I can set it so it only pops up one time and then will not pop up again until after a certain time period. Also, is there a way to make it so it can avoid pop up blockers? Thank you! |