1,330 Posted Topics

Member Avatar for Airshow

Made a PayPal donation several days ago and am wondering at what point the adverts actually disappear? Getting rid of the ads is not exactly the most important thing in my life but it would be nice to know that the money got through. Come to think of it, I …

Member Avatar for Airshow
0
196
Member Avatar for clerisy

[B]Indexed arrays[/B]: [iCODE].length[/iCODE] property is one greater than the highest index used. Sequentially indexed arrays can be traversed with [iCODE]for(var i=0; i<arr.length; i++){...}[/iCODE]. Sequentially and non-sequentially indexed (sparse) arrays can be traversed with [iCODE]for(var prop in arr){...}[/iCODE]. [B]Associative arrays[/B]: [iCODE].length[/iCODE] property stays at zero. Traverse with [iCODE]for(var prop in arr){...}[/iCODE]. …

Member Avatar for Airshow
-1
101
Member Avatar for Virangya

Yes, you can use try/catch but remember that this will only handle otherwise uncaught javascript errors. It won't handle socalled "silent failures" as can arise in jQuery which is, to a certain extent, error tolerant. For example, if jQueryUI was not installed on the page, then [ICODE]try { $('#myDiv').dialog('open'); }[/ICODE] …

Member Avatar for Airshow
0
198
Member Avatar for Troy III

Troy, Have you found this: [url]http://perfectionkills.com/detecting-event-support-without-browser-sniffing/[/url] allowing tests of the type [iCODE]isEventSupported("eventname")[/iCODE]? isEventSupported won't, in itself, produce a list of events but might offer a way ahead. [B]Airshow[/B]

Member Avatar for Troy III
0
113
Member Avatar for javadano
Member Avatar for jonnyboy12

Jonnyboy12, In your original post, the problem is with [iCODE]onclick='work('word')'[/iCODE] which will throw javascript error due to single-quotes inside single-quotes. Try [iCODE]onclick="work('word')"[/iCODE]. You may like to consider [iCODE]onclick="work('word'); return false;"[/iCODE], which will completely suppress the <a> tag's natural href action. This is useful even with href="#". [B]Airshow[/B]

Member Avatar for Airshow
0
209
Member Avatar for dsladev

Submit buttons are a feature of HTML, not javascript. They work in association with the <form>...</form> in which they are embedded. [LIST] [*]The form tag's [iCODE]action[/iCODE] attribute determines the URL that is requested [*]The form tag's [iCODE]method[/iCODE] attribute (GET or POST) determines how the form data (user inputs and selections) …

Member Avatar for Airshow
0
109
Member Avatar for ebiti

I generally build query strings like this: [CODE=javascript] queryString = []; queryString.push('project_name=' + project_name); queryString.push('cat=' + val); queryString.push('prj_desc=' + project_desc); location.href = 'Add_New_Project.php?' + queryString.join("&"); [/CODE] Thus the line number in any js error message will be more specific than when the url is built in one line. [B]Airshow[/B]

Member Avatar for fobos
0
218
Member Avatar for anubhavk

Anubhavk, Develop classnames and associated CSS directives to give the various visual effects you want. Test out your CSS with hard-coded HTML. Build your real table with : [LIST] [*]<table class="highlightTable"> [*]<td class="time"> (your time cell in each row) [*]<td class="aaaa"> (your other key data cell in each row) [/LIST] …

Member Avatar for Airshow
0
289
Member Avatar for azegurb

Hi Aze, [QUOTE=azegurb;1736166][CODE] done:function(f){ postaction = f || postaction //remember user defined callback functions to be called when images load }[/CODE][/QUOTE] This is a very convenient javascript shorthand but use it with caution. In full (pseudocode) [LIST] [*]if(f is not falsy), then postaction = f; [*]if(f is falsy), then leave …

Member Avatar for azegurb
0
112
Member Avatar for evangelion89

Evan.., To understand what is going on here, you must first understand the tricky topic of [URL="http://jibbering.com/faq/notes/closures/"]closures[/URL]. In version A, each time it is called, [ICODE]function addMarker()[/ICODE] forms a closure containing its own [ICODE]marker[/ICODE]. In version B, there is only one closure formed by the outer scope (also a function …

Member Avatar for Airshow
0
244
Member Avatar for asif49

Asif, you have done 98% of the work and the final 2% is quite easy: Amend showRSS to accept a second argument: [CODE=javascript] function showRSS(url, containerId) [/CODE] Amend the line that inserts the ajax response into the document: [CODE=javascript] document.getElementById(containerId).innerHTML = xmlhttp.responseText; [/CODE] Now call showRSS twice, with different parameters, …

Member Avatar for asif49
0
193
Member Avatar for RykeTech

The natural choice is [URL="http://code.google.com/apis/maps/index.html"]Google Maps[/URL]. It's API is public and well documented and the feature list is as long as your arm. [B]Airshow[/B]

Member Avatar for Airshow
0
62
Member Avatar for Violet_82

Violet, you're not lost at all, because everything you observe is correct. checkBounds() effects direction reversals by negating the deltas but the current iteration's deltas have already been applied, immediately before checkBounds() was called in moveSprite() (though the DOM has not yet been updated). The deltas are [U]not[/U] re-applied after …

Member Avatar for Violet_82
0
120
Member Avatar for ivan3510

[CODE=javascript] setTimeout(calculate,1000); [/CODE] In a setTimeout() or setInterval() statement, either define an anonymous function or provide a reference to a named function, but (typically) [I]don't execute it[/I]. Execution happens when the time period has expired. "Typically" above: Javascript functions are first class objects. You might one day encounter a function …

Member Avatar for ivan3510
0
123
Member Avatar for patk570

Pat, eval() :icon_eek: It's part of javascript but seldom needs to be used; arguably never. Number() returns a floating point conversion of its argument. [CODE] function doMath() { var one = Number(document.theForm.elements[0].value); var two = Number(document.theForm.elements[1].value); ans = one * two; outp = " " + "$" + ans.toFixed(2) + …

Member Avatar for Airshow
0
217
Member Avatar for Julia25

Julia, The following will operate on any block element given [iCODE]class="maintain_aspect_ratio"[/iCODE] : [CODE=javascript] $(function(){ var $mar = $('.maintain_aspect_ratio'); $(window).resize(function(){ var $w = $(this);//or maybe $(document); var $this, height_ratio, width_ratio; $mar.each(function(){ $this = $(this); width_ratio = $this.width() / $w.width(); height_ratio = $this.height() / $w.height(); if (height_ratio > width_ratio){ $this.width("auto"); $this.height('100%'); } …

Member Avatar for Julia25
0
398
Member Avatar for lemur

Functions can call other functions, so you might want something like this: [CODE=javascript] function takeOrder(num) { var url=new Array(); url[0]="confirm.html"; var details = takeDetalis(num);//pass num in case takeDetails() needs it if(details){ window.location = url[num] + '?' + details; } } [/CODE] Where takeDetalis() is a function that displays a dialog …

Member Avatar for Airshow
0
79
Member Avatar for HelenLF

Helen, jStars isn't particularly well written. It's not in jQuery's currently preferred plugin pattern and allows nothing more than for the visual effect to be attached to an element. However, its lack of the means to remove it should not be an obstacle in this case because, as I understand …

Member Avatar for Airshow
0
102
Member Avatar for lifeworks

If you really want to know about emulating "classes" in javascript, then read [URL="http://www.crockford.com/javascript/inheritance.html"]this article[/URL] on Inheritance. I have read it every 3 months or so for the last 4 years in the hope that it will eventually sink in. [B]Airshow[/B]

Member Avatar for stultuske
0
173
Member Avatar for Pravinrasal

[url]http://javascript.open-libraries.com/utilities/drawing/10-best-javascript-drawing-and-canvas-libraries/[/url]

Member Avatar for Airshow
0
246
Member Avatar for maxxxx

[LIST] [*]Javascript does not allow a quoted string definition to be broken by line feeds. [*]There's no need to use [ICODE]eval()[/ICODE]. It should be fairly easy to find a work-around to avoid it. [*][ICODE]id[/ICODE] is undefined unless it is in an outer scope (eg the global scope). [/LIST] [B]Airshow[/B]

Member Avatar for Airshow
0
202
Member Avatar for z3o

If you Google "cant view my adsense ads", you will find that the syndrome is not exactly unique. I read through a few of the discussions but couldn't find a sensible, coherent diagnosis. [B]Bluish Smurf Airshow[/B]

Member Avatar for Airshow
0
519
Member Avatar for vizz

Hi Vizz, [iCODE]return false[/iCODE] from the click handler suppresses the natural hyperlink action of the clicked <a>. Try removing the statement or returning true. Most people do this sort of thing with CSS. [iCODE]#navlist a:active {...}[/iCODE] will style the clicked link but only while mouse is down. What you are …

Member Avatar for vizz
0
183
Member Avatar for jchoudhury

1. In your browser, View Source of the served page. Is the source what you expect, with <%= myControl.xxxxx %> directives successfully substituted, and do these ids correspond to those of the element(s) in the HTML? 2. The current value of your <select> menu should be given by :- [CODE=javascript] …

Member Avatar for Airshow
0
133
Member Avatar for suhaildawood

I think the main problem is setting the opacity values to strings. Should be numeric values [ICODE]0.47[/ICODE], [iCODE]1[/iCODE] not [ICODE]"0.47"[/ICODE], [ICODE]"1"[/ICODE]. But there's another potential problem that css opacity values are not guaranteed, in all browsers, to read back from the DOM at exactly the same value they were set …

Member Avatar for suhaildawood
0
1K
Member Avatar for PomonaGrange

Here's a jquery solutuon: [CODE=javascript] $(function(){ $r = $("#calculator").find("#result"); $ip = $("#calculator").find("#input"); $("#calculator").find("button").click(function(){ try{ $r.html( eval($ip.val()) ); } catch(e){ $r.html('Error'); } }).click(); }); [/CODE] [CODE=CSS] * { font-family:verdana; font-size:10pt; } #calculator { width:650px; padding:10px; border:2px solid #999; } #calculator input { margin-right:10px; } #calculator button{ margin-right:10px; } #calculator span { …

Member Avatar for niranga
0
339
Member Avatar for divsok

Because that's what [ICODE].bold()[/ICODE] does - wraps a string in [ICODE]<b>...</b>[/ICODE] tags. Creating a WYSIWYG device is not trivial. Personally I would install something ready-written. [URL="http://www.tinymce.com/."]TinyMCE[/URL] is quite popular but it's certainly not the only one. [B]Airshow[/B]

Member Avatar for divsok
0
318
Member Avatar for jahanas

To all you guys trying to help Jahanas (OP), Reading between the lines, this is the scenario: [LIST] [*]OP has used Adobe ImageReady (not Photoshop I suspect) to slice up a screenshot, and used the "Save as HTML" option to save a <table>...</table> structure plus corresponding individual image slices. I …

Member Avatar for Dandello
0
144
Member Avatar for jpknoob

It's easier to pass a reference to the form element from the onclick handler. This avoids having to discover the form in the DOM with [ICODE]document.all[/ICODE], [ICODE]document.getElementById()[/ICODE], document.forms[] etc. [CODE=javascript]function multiply(form){ form.result.value = ((form.inputA.value * form.inputB.value * form.inputC.value * 150) / 1000000) ; } [/CODE] [CODE=HTML]<form action=""> <fieldset> <input type="text" …

Member Avatar for jpknoob
0
293
Member Avatar for Airshow

Can anyone explain the "Filter Below Quality Threshold" setting in the "Threads that match your interests" panel on the Daniweb home page. I'm sure it has some carefully considered logic behind it, but thus far impenetrable by yours truly. [B]Airshow[/B]

0
135
Member Avatar for eawade
Member Avatar for nizam27391

If you mean [URL="http://www.adidas.com/home/uk"]this page[/URL], then the answer must be YES, because all the effects are already achieved with jQuery. If you mean [URL="http://www.adidas.com/my/homepage.asp"]this page[/URL], then mmmm, PROBABLY but there would be a lot of work in it. It's very imaginative. Maybe the flash author devised a generalised algorithm but …

Member Avatar for Airshow
0
200
Member Avatar for rievan

Method-chained jQuery executes left to right. There's no point setting a delay with nothing to its right; it won't affect anything to its left. You can try the following but it doubt it will work because .cookie() isn't in the effects queue or a custom queue. [CODE] $.delay(thisdelay).cookie("myppix", "<?php echo …

Member Avatar for Airshow
0
240
Member Avatar for Dauthuzen

Dauthutzen, You could approach this in several different ways depending on exactly what you are trying to achieve. One approach is to build HTML markup. Here's a couple of utility functions, plus a demo of how they might be used: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html …

Member Avatar for Airshow
0
188
Member Avatar for strRusty_gal

Try this, based on fobos' post : [CODE=javascript] onload = function(){ var field = document.getElementById('myField'); field.onkeyup = function(){ var val = parseInt(this.value); this.value = (!val) ? '' : Math.min(50,val); } } [/CODE] [CODE=HTML] <input type="text" id="myField" name="myField" maxlength="2" /> [/CODE]

Member Avatar for Troy III
0
3K
Member Avatar for minitauros

Easy, two choices: [LIST=1] [*]Don't replace the button, just change the properties of the existing button. [*]Attach the hover etc. functionality to the new button [/LIST] [B]Airshow[/B]

Member Avatar for Airshow
0
178
Member Avatar for paresh_thummar

pThu, You will find it easier to build the input element in a more jQuery way. There's no unique solution but something like this should work: [CODE] ... $input = $('<input type="text">').attr('id','txt'+j).focus(function(){ prePopulate(this.id, InfoArray, 'Hello', 'Hi'); }); $('#selectorName').after($input); ... [/CODE] You may want to pass [ICODE]this[/ICODE] to prePopulate() rather than …

Member Avatar for Troy III
0
147
Member Avatar for Virangya

V, I expect jQuery chokes on a full document with <!DOCTYPE ...> and a <head> full of metas etc. Try stripping [iCODE]data[/iCODE] down to <body>...</body> before submitting it to jQuery. Stripping is best done with a regular expression, which you will need to develop or find. Searching the web for …

Member Avatar for link_umer
0
1K
Member Avatar for Pravinrasal

Formal definitions don't always help to penetrate "closure", though they do make sense once you understand. If you learned about closures from PHP5, then you almost need to unlearn all that stuff first. PHP's implementation of closures is as bad and confusing as it gets (you actually need to use …

Member Avatar for Airshow
0
387
Member Avatar for tqmd1

On insertion of comma-separators numbers become strings, therefore for display purposes only. If further arithmetic operations are necessary, keep an unformatted, true Number representation of the original value in javascript. Approached the right way, you should never need to convert comma-separated number-strings back to true Numbers. [B]Airshow[/B]

Member Avatar for Troy III
0
301
Member Avatar for ferrari77

[QUOTE=hielo;1726664]If that is the case, it typically means that the server is not configured to execute php files.[/QUOTE] Or the file extension is wrong. Typically only .php files are sent to the php engine, but potentially any other extension. For Apache, this is established in httpd.conf. [B]Airshow[/B]

Member Avatar for Airshow
0
134
Member Avatar for eawade

eawade, Please forgive me if I'm wrong.. Whereas I've done lots of JSON, I only know about JSONP from what I have read. Things are made difficult in the jQuery documentation in that JSONP is detailed under "jQuery.ajax()" with only a scant reference under "jQuery.getJSON()". For me, the only scenario …

Member Avatar for Airshow
0
139
Member Avatar for sanityhien
Member Avatar for rad1964

Yes, I think your problems are 99% to do with getting the HTML correct. As far as I can see jQuery.delegate() is at most a secondary issue. It's only necessary to use jQuery.delegate() if you need to attach javascript behaviour to dynamically inserted elements and even then, there are other …

Member Avatar for rad1964
0
183
Member Avatar for kaosjon

This is not a javascript issue. AV scanning is something to be performed/initiated by a server-side technology eg. PHP, PERL, JSP. [B]Airshow[/B]

Member Avatar for Airshow
0
106
Member Avatar for jacob21

As one of the posters in itpragan's link says, it's better to use [URL="http://www.w3schools.com/jsref/jsref_obj_regexp.asp"]regular expressions[/URL] for these types of test. The "charAt" approach is bulky and not as capable. [B]Airshow[/B]

Member Avatar for Airshow
1
143
Member Avatar for Martin C++

Use spans, each with a unique id, for error messages: [CODE=HTML] Username: <input type="text" name="username" id="username_reg" />&nbsp;<span id="username_msg"></span><br /> [/CODE] [CODE=javascript] validate(form){ rtnVal = true;//Assume true (OK) initially, then if one or more validation test yields false, false will be returned and the form will not be submitted. var username_msg …

Member Avatar for Airshow
0
133
Member Avatar for maxxxx

Maxxxx, You will get "back" failure in most (all?) major browsers except IE due to the fact that they re-render the page from a special "back/forward" cache (bfcache). This is desirable for rapid forward/back action but, incorrectly in my opinion, a select menu onchange event is also re-fired if (I …

Member Avatar for charisma
0
184
Member Avatar for Pravinrasal

Difficult however you do it. The original was made with Adobe Flash. A javascript solution would not be so smooth. If you want it in a hurry then find a Flash expert. [B]Airshow[/B]

Member Avatar for fobos
0
203

The End.