558 Posted Topics
Re: fast fix [input].match(/[\d/]+/g).join('.'); might do the trick... | |
Re: $ and _ are two (and only) non-alpha characters that don't have any special or reserved meaning in js and are safe for use in names or for names as single char pointers or as leading ones. So the choice is more like a matter of convenience -using $ or … | |
Re: Of course you can... Try: time="10.29"; if ( time < 10.30 ){console.log("it is")} else {console.log("it isn't")}; >>"it is" time="10.31"; if ( time < 10.30 ){console.log("it is")} else {console.log("it isn't")}; >>"it isn't" | |
Re: 1. you will need to link that jQuery file to the modal window code also. 2. or find a way to correct the reference it on jQuery methods. p.s.: the second is 'probable' or 'less likely', -so I'd try my luck with the first one. So good luck with it. | |
| |
Re: do you have a link | |
Re: use: str.match(/d+/g); in var ids = str.match(/d+/g); ids wil be a ready array, so you can... for(var i=0,j=ids.length; i<j;i++) task.logmsg("ids = ["+i+"] = "+ ids[i]); | |
Re: you won't need to search for the correct input value, you could do this instead: ... var q = parseInt( qty ); if( q != q ) { document.getElementById("cost").value = q; alert("You have entered " + qty + "Please enter a number"); }... | |
Re: replace this: function loadLink(siteList) { if (this.selectedIndex > -1) alert(this.options[this.selectedIndex].value) else alert('Nothing selected') } with: function loadLink(siteList) { if (this.selectedIndex > -1) location=this.options[this.selectedIndex].value; } | |
Re: you answer is here: http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/419150/onclick-problems | |
We know we already have built-in [I]Trim methods[/I], but trimming doesn't get rid of internal, (and unwanted) extra spaces. -So this is where Normalize method comes to play. It trims left, it trims right, but most importantly it also trims on the inside, one could say: "it trims inside-out". In … | |
Re: a quick patch: reg.onclick = function(){createReg(cell7.id)} | |
Re: this will work: document.writeln( "<a href='#' onClick='popUpInfo(" +subject[i]+ ")'>" +subject[i]+ "</a>" ); easy yeah? | |
Re: The terminology used is not exact, but we could call it *a contextual script element*, or something. Such thing was possible in Explorer. <div id=div1> div1 content </div> <script for=div1 event=onlouseover src=div1.js></script> But it becomes expensive, I never used it.. | |
Re: that would be: navigator.language and that would indicate the client language used in the system by that client on that terminal. | |
Re: I would have most probably hit the ESC key before all this collateral code is loaded [CODE] <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script> <script type="text/javascript" src="js/process.js"></script> <script type="text/javascript" src="js/jquery.ui.core.js"></script> <script type="text/javascript" src="js/jquery.ui.widget.js"></script> <script type="text/javascript" src="js/jquery.ui.mouse.js"></script> <script type="text/javascript" src="js/jquery.ui.slider.js"></script>[/CODE] Just looking at it makes me go click on the x sign … | |
Re: Assuming there are no scripting errors on your code you should try it with a defer attribute: [CODE]<script type="text/javascript" [COLOR="Green"][B]defer[/B][/COLOR]> $(function() { var dates = $( "#from, #to" )....[/CODE] | |
Re: I think this demo and template might help you a lot [url]http://www.daniweb.com/web-development/web-design/html-and-css/code/226127[/url] | |
Re: The only browser that doesn't support the original innerText property and method is firefox. It's not IE's fault that someone else took its feature and called it "my invention" by changing its original name. Never mind that it will cause the web to break! Which in return is its exact … | |
Re: [QUOTE=;][/QUOTE] you have an image with an ID = "next" on your document collection and you are not declaring it as a variable, meaning you are referencing to an already defined existing image object and trying make it a string on the fly, you cannot nullify that image and reassign … | |
Re: Your question was: [I]"... if the time is more than 10.. the page will be directed to a another specific page .... anyone can help on this ?"[/I] The answer is [CODE]<html> <body> <p>This example demonstrates the If statement.</p> <p>If the time on your browser is less than 10, you … | |
Re: [url]http://i44.tinypic.com/dr9vlh.png[/url] I cant even see the "show more" anywhere on your supposedly working browser let alone be able to fix it in explorer. p.s: 1. linked scripts on the header load async., you slideto.js may be loading faster! 2.I suggest you always use ";" in front of self invoking functions, … | |
Re: [QUOTE=;][/QUOTE] [code] document.referrer=="that location string" yourLinkElement.click(); [/code] | |
Re: [QUOTE=;][/QUOTE] Nope, you are correct all the way. :) | |
Re: [QUOTE=;][/QUOTE] There's none I'm afraid. Or at least not a coder-friendly one. Other browsers have just recently stared supporting some of rich-text html editor commands and already made a mess out of it. There are to many stunt steps required and hope for the best in the end for it … | |
Re: [QUOTE=;][/QUOTE] Here is a working function for IE versions [code] function colorPick(x){ var marked,color={}; showColorPicker(x,color); if(document.selection){ marked=document.selection.createRange();} else{marked=null/*try satisfy W3C bitchiness here*/} color_picker_content.onclick= function(){ return color.value ? setColor(color.value,marked) : false } function setColor(color,marked){ marked.text? marked.text=marked.text.fontcolor(color) : 0; } } [/code] In case you decide to use html/rich-text editor in the … | |
Re: [QUOTE=thepanther;1776870]hi i would like to change just part of my code to change the color of my answer to my maths game see the code [CODE]document.write("<br>3+2 = " + answer1 + " is incorrect - the correct answer is 5");[/CODE] see where it says the answer is 5 i would … | |
Re: [QUOTE=raredesign;1758835]I know there are more accurate geolocation methods, but I want to have it transparent to the user rather than ask them to "allow". I am using a very simple method and it works great on most of the computers I have tried, but on some such as my grandmothers … | |
Re: [indent][code] thisDay= /*b.b. Troy III p.a.e*/{ get Date(){return new Date().toLocaleDateString()}, get Time(){return new Date().toLocaleTimeString()} }[/code][/indent] [indent][code] thisDay.Date >> "Thursday, March 08, 2012" thisDay.Time >> "09:49:38" or "9:49:38 AM" (IE) //will depend on a browser! [/code][/indent] | |
Re: [QUOTE=;][/QUOTE] What do you mean by: [icode]form.elements.value = input;[/icode] (me confused!?!) or, which element exactly? And you won't need this: "grade = Math.round((grade * 0.2));" unless you are interested to return F on all inputs from 100 down to 0, (at least not with the route taken). Anyway, you can … | |
Re: [QUOTE=;][/QUOTE] have you tried to spell the "lentgh" correctly? | |
[I][COLOR="Green"]!below is the code snippet [/COLOR][/I] This is a multi-use property toggler. In the given example we are toggling a sub property of an element. e -is the property owner to be targeted; p - is the property name to be set; v - is the property value; henceforward changing … | |
Re: [QUOTE=;][/QUOTE] [selector][icode]{ position : fixed; ... }[/icode] | |
Re: [QUOTE=;][/QUOTE] What is the value of the v pointer? Try alert(document.getElementById(v)) before your if conditional and see whats being returned first. | |
Re: [QUOTE=trickist17;1767730][CODE] /*the ø stands for document.getElementById*/ function conwidth(){ var a=document.getElementsByClassName('dropdown'); var e=[]; for(i=0;i<=a.length;i++){ if(a[i].innerHTML.length>28){ /*Safari Error (only if I bypass the setwid(j,k)command): TypeError: 'undefined' is not an object (evaluating 'a[i].innerHTML')*/ e.push(a[i].innerHTML); var j=ø(a[i].parentNode.id).parentNode.id; var k=200+8*(a[i].innerHTML.length-28); setwid(j,k); } } } function setwid(b,c){ var dr=document.getElementsByClassName('dropdown');var st=document.getElementsByClassName('strich');var a=function(a){return ø(a.parentNode.id).parentNode.id;}; /*Safari Error: TypeError: 'undefined' … | |
Re: [QUOTE=chandub;1768292]hai everybody am using following code to preview the image before uploading it. but am unable to display the image please help me. [code=html]<SCRIPT type="text/javascript"> function preview(what){ document.getElementById("previewField").src=what.value; } </SCRIPT> <INPUT type="file" id="picField" onchange="preview(this)"> <IMG id="previewField" alt="Preview">[/code] thank you.[/QUOTE] Image preview before upload, is possible (up until now) only on … | |
Re: [QUOTE=softDeveloper;1765116]Hi all, I'm using scrollintoview to scroll to the element but it's very quick, do you know anything like this but smooth?[/QUOTE] That's not because it is quick. The 'scrollIntoView' method doesn't actually scroll. It only makes the target jump strait into view. | |
Re: Now it's a literal JS object. Convert it with JSON parser and it's a tree. Although you are not clear I couldn't understand what you were trying to do there | |
Re: [QUOTE=Milutz94;1764123]Many people are searching for this code, and not all codes are working for them :) So, this is a bit easyer, ussualy a .js and/or .css file are required, but this one is simple! [B]STEP 1[/B] Paste this into your page header: [CODE]<script type="text/javascript"><!-- function setFirstChildImgDisplay(el,vis) { if(!el || … | |
Re: This thing is Browser Implementation Dependent, so you'll need to hunt after specific browser solutions and if. | |
Re: uninstall the plugin asap or better more try a restore point (but the exact one if it is created) also, than try this code: [CODE]<audio controls> <source src="sound_5.ogg" type="audio/ogg"><!--firefox--> <source src="sound_5.mp3" type="audio/mpeg"> <img dynsrc="sound_5.mp3" height=30 width=120 controls> </audio>[/CODE] | |
Re: [QUOTE=sam230;1762518]I want to check the image size in JavaScript.. for example if image size is more than 500kb and other format instead of jpg.. it should not get uploaded.. i want to check these validation before form submit.. thanks in advance.. waiting for positive ans. Regards[/QUOTE] This will do your … | |
Re: of course there is, what part of it do you need exactly? | |
Re: [CODE]var p = "one, two, three".split(',') ;for(i in p)fn(p[i]);[/CODE] | |
Re: [QUOTE=fusionking;1760829]In an XSLT file, I am calling a function to a javascript file (.ascx) and trying to pass parameters. One parameter is a Date() object. The only way I've found to successfully pass it is to pass it as a string. Here's the code from the XSLT file. [CODE]<script> grouping("<xsl:value-of … | |
Re: use javascript to grab the "ondrop" event; The "event object" keeps x,y coordinate values updated at all times, assign to variables like: var x = ["event object"].clientX; var y = ["event object"].clientY; and use your ready handler to post them by referencing x,y variables. | |
Re: [QUOTE=FALL3N;1753861]I know this is a basic question. I asked the same question a while ago, even then thinking it was a simple question. The answer I got seemed to be what I already know and was obvious.. however, when I tried it, it did not work, so I just worked … | |
Re: ...but perhaps you need an explanation, for why is it happening -so you'll know it before it happens in the future. No html element will ever contain other data-type except a text, which when returned is of type string. therefore a returned 5 is not a number, its a literal, … | |
Re: remove the join() part and try again. [CODE]n.split(' ')[COLOR="Red"].join('')[/COLOR]; //get rid of extra white space;[/CODE] -you are not getting rid of the white space, because there already isn't any. What you are doing there there is that you are taking the 'John P Smith' and converting it into a; [for … | |
Re: who's calling the check function? |
The End.