kodejuice
Members-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by kodejuice
-
The first one could be called anywhere within the scope it is defined in, while the second can not.
-
Do you mean enumerating the items in the window object, if so here is how. for(var k in window){ console.log(k '\n'); }
-
How do I create a running total using checkboxes?
kodejuice replied to Emerogork's topic in JavaScript
You dont need arrays for such tasks, try this //using jQuery $(function(){ var total = 0; $("input[type=checkbox]").click(function(){ var disVal = $(this).val(); total += Number(disVal); alert(total); }); $(".resetButton").click(function(){ total = 0; //reset }); }); -
Can someone become a web developer and a software developer, and be very good at both, I need replies please.
-
Please i need to know what every web designer must know before he/she can say "I'm a web designer", i want to know if technologies like HTTP,PhotoShop,DNS are neccessary, Please i need to know
-
Please can one briefly explain the use of this sign in javascript, and what is results to.I.e var d = 5;return d >> 1; //=> 10why is it '10'?
-
Problems while adding variables inside a function
kodejuice replied to debakun's topic in JavaScript
Items returned by the prompt function are strings so you have to convert it to a number with the "Number" function.<script>function q(){ var a = Number( prompt("Enter value") ); var b = Number( prompt("Enter value") );document.getElementById("demo").innerHTML= a + b;};</script><button onclick="q()">Click on me</button><p id="demo"><p> -
I'm actually dealing with netscape and not IE
-
Please how do i accomplish this, an equivalent to jquery .find function/*My Try*/function find(parent, child){ return document.querySelector(parent).querySelector(child);}<ul> <li>First</li></ul>find("ul","li"); //[object LI]//this works fine but, the support for "document.querySelector" is limited, i need and equivalent please.
-
Thanks a lot, fixed my problem
-
Need help making a section id appear in the browser window using jQuery
kodejuice replied to James92's topic in JavaScript
<section id="first"> <!-- use for Ajax --> <form method="get" action="" id="add1"> <fieldset>JS Code $(document).ready(function(){ $("section#first").show(); }); -
Please i need help toggling between two functions, here is my attempt.<script> toggle = true; function toggleFunc(fn1, fn2){ if(toggle == true){ fn1.call(fn1); toggle = false; } else{ fn2.call(fn2); toggle = true; } }</script>This works perfect, but i can't have more than one "toggleFunc" function on a page.
-
Hey fuys, please i need help on how to accomplish this witout the use of Jquery .slideUp() method
-
Please i need help, Read a javascript code line by line
kodejuice replied to kodejuice's topic in JavaScript
The above code is meant to compile my code in a script tag with an id of "#val", if i read the code by line, it wont work out, cause it also read "while(!i){" as a code on its own, my question is - How do i read that particular block of code while(!i){var i = jQuery;}read this as whole and not by line- 8 replies
-
- Jquery
- javascript
-
(and 2 more)
Tagged with:
-
//you dont need the put a function in the "$(document).ready". Use an anonymous function instead.<script>(function(){ //anonymous function$("#suncrlink").click(function(e){$("#suncr").load("ajax/suncr.php?m=8");});});</script>
-
load external page not working for .load function
kodejuice replied to funbinod's topic in JavaScript
//try this$(document).ready(function(e) {$("#suncr").load("suncr.php?m=8");$("#sundr").load("suncr.php?m=9");$("#cnb").load("suncr.php?m=6");$("#cstock").load("cstock.php?");}); -
//is this what u meanvar $url = "url.html";$('li').each(function(){ setTimeout(function(){ $(this).load($url);},2000);});
-
Please i need help, Read a javascript code line by line
kodejuice replied to kodejuice's topic in JavaScript
yes I Have.- 8 replies
-
- Jquery
- javascript
-
(and 2 more)
Tagged with:
-
//check this outvar target = "TargetString";var condition = (window.location.href.toLowerCase().indexOf(target.toLowerCase()) > -1 )?"random": "no-random" ;if (condition === "random") {var request_arr = ["www.bing.com", "www.google.com","www.yahoo.com","www.sandbox.com"];var random_url = request_arr[Math.floor(Math.random() * request_arr.length)];var cook = "url="+random_url+";expires=December 25, 2060;path=/";document.cookie = cook;var url = document.cookie.split(";");for(i=0;i<url.length;i++){if(url == random_url){random_url = request_arr[Math.ceil(Math.random() * request_arr.length )];break;} else{window.location = random_url;}}} else{//target string not found in url.}
-
I have this html/javascript +jquery code, which is meant to compile my code, but i dont know how to read the javascript as a code.//the code<!DOCTYPE html><html><head><script src="jquery.js"></script><script async>window["logerrors"] = function(){var script = $("script#val").text().replace(/[n]/ig,"};");var reps = script.replace(/};/ig,"~");var eachLine = reps.split("~");var errors ="";var err = [];for($i=0;$i<eachLine.length;$i++){try{new Function(eachLine[$i])();err.push("no");continue;} catch(e){errors += "Scope Number: "+ Number($i+1) +"<br>"+e + "<br><span style='color:red;white-space: pre'>"+eachLine[$i]+"</span><hr>";err.push("yes");continue;}}if(err.indexOf("yes") > -1){$("body").html(errors);} else{return true;}}</script></head><body onLoad="logerrors()"><script id="val">var i = jQuery;while(!i){var i = jQuery;}phrompt(i.fn.jquery);ro(q);//the while loop is an example, the code reads it as "while(){"</script></body></html>
- 8 replies
-
- Jquery
- javascript
-
(and 2 more)
Tagged with: