558 Posted Topics

Member Avatar for felix001
Member Avatar for Troy III
0
326
Member Avatar for VenusCrystal

$ 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 …

Member Avatar for Troy III
0
159
Member Avatar for trektrak

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"

Member Avatar for trektrak
0
141
Member Avatar for singularity~

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.

Member Avatar for Troy III
0
140
Member Avatar for kevindougans
Member Avatar for vizz
Member Avatar for yellowSnow

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]);

Member Avatar for Troy III
0
200
Member Avatar for drogba123

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"); }...

Member Avatar for Troy III
0
235
Member Avatar for willpollock

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; }

Member Avatar for Troy III
0
310
Member Avatar for mavis310

you answer is here: http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/419150/onclick-problems

Member Avatar for Troy III
-1
161
Member Avatar for Troy III

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 …

Member Avatar for Troy III
0
324
Member Avatar for mavis310
Member Avatar for Troy III
0
190
Member Avatar for InS@NiTy

this will work: document.writeln( "<a href='#' onClick='popUpInfo(" +subject[i]+ ")'>" +subject[i]+ "</a>" ); easy yeah?

Member Avatar for Troy III
0
158
Member Avatar for sanket044

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..

Member Avatar for pzuurveen
0
177
Member Avatar for DarkMonarch

that would be: navigator.language and that would indicate the client language used in the system by that client on that terminal.

Member Avatar for DarkMonarch
0
115
Member Avatar for jdgieschen

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 …

Member Avatar for jdgieschen
0
623
Member Avatar for showman13

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]

Member Avatar for showman13
0
191
Member Avatar for Violet_82

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]

Member Avatar for Violet_82
0
200
Member Avatar for Que336

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 …

Member Avatar for Troy III
0
1K
Member Avatar for Cornwell

[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 …

Member Avatar for Cornwell
0
1K
Member Avatar for trektrak

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 …

Member Avatar for Troy III
0
212
Member Avatar for dschuett

[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, …

Member Avatar for dschuett
-1
219
Member Avatar for simplypixie
Member Avatar for simplypixie
0
918
Member Avatar for VenusCrystal
Member Avatar for kurtzky

[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 …

Member Avatar for Troy III
0
224
Member Avatar for Ztruker

[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 …

Member Avatar for Troy III
0
247
Member Avatar for thepanther

[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 …

Member Avatar for thepanther
0
139
Member Avatar for raredesign

[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 …

Member Avatar for chrislim2888
0
244
Member Avatar for tqmd1

[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]

Member Avatar for Troy III
0
186
Member Avatar for toldav

[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 …

Member Avatar for Troy III
0
532
Member Avatar for pbracing33b
Member Avatar for Troy III
0
97
Member Avatar for Troy III

[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 …

Member Avatar for Airshow
0
246
Member Avatar for kukula
Member Avatar for philspotter

[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.

Member Avatar for philspotter
0
257
Member Avatar for trickist17

[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' …

Member Avatar for trickist17
0
204
Member Avatar for chandub

[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 …

Member Avatar for Troy III
0
97
Member Avatar for softDeveloper

[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.

Member Avatar for Troy III
0
156
Member Avatar for zackh123

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

Member Avatar for Troy III
0
508
Member Avatar for Milutz94

[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 || …

Member Avatar for stultuske
0
270
Member Avatar for dremes

This thing is Browser Implementation Dependent, so you'll need to hunt after specific browser solutions and if.

Member Avatar for dremes
0
141
Member Avatar for ankit.pandey3

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]

Member Avatar for ankit.pandey3
0
174
Member Avatar for sam230

[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 …

Member Avatar for Troy III
0
278
Member Avatar for vizz
Member Avatar for vizz
0
82
Member Avatar for trickist17
Member Avatar for Troy III
0
180
Member Avatar for fusionking

[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 …

Member Avatar for Troy III
0
243
Member Avatar for jbennet

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.

Member Avatar for Troy III
0
103
Member Avatar for FALL3N

[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 …

Member Avatar for FALL3N
0
215
Member Avatar for asif49

...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, …

Member Avatar for asif49
0
80
Member Avatar for Heinz Stapff

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 …

Member Avatar for Heinz Stapff
0
595
Member Avatar for Que336

The End.