1,330 Posted Topics

Member Avatar for jQueryLover

Could be the line feed in the ...googleapis/jquery... url. If that doesn't fix it, try this: [CODE] $(document).ready(function(){ $('#charts li').each(function(){ var $this = $(this); var pc = Math.max(0, Math.min(100, parseInt($this.attr('title'), 10))); var len = $this.width() * pc / 100; $this.find('.percent').html(pc + '%').end().find('.bar').animate({width:len}, 1500); }); }); [/CODE] I haven't really changed …

Member Avatar for Airshow
0
145
Member Avatar for maxxxx

No. Javascript manipulates CSS properties to achieve its effects. Please mark solved topics as Solved even if the answer is not what you wanted to hear. There's a link somewhere near the bottom of the page. [B]Airshow[/B]

Member Avatar for Airshow
0
80
Member Avatar for maxxxx

There's no point involving javascript if you don't have to. Standard HTML hyperlinks are good for most site navigation menus. Use CSS to make them pretty. Use javascript for pullout/dropdown sub-menus or other effects that cannot be achieved with CSS. [B]Airshow[/B]

Member Avatar for Airshow
0
63
Member Avatar for vigneshd90

Vignesh, Making multiple handles is easy : [CODE]$(function() { $mySlider = $( "#slider-range" ); $mySlider.slider({ // range: true,//don't set range min: 0, max: 1000, values: [ 75, 125, 175, 225 ], slide: function( evt, ui ) { a = []; for(var i=0; i<ui.values.length; i++) { a.push(ui.values[i]); } $( "#amount" ).val( …

Member Avatar for _superted
0
1K
Member Avatar for talisien

[QUOTE=ddymacek;1714268]try to assign your get function to a variable... [CODE] function test() { var data data = $.getJSON('singleday.php?dld='+ id+'&chkdag=' + 1, function(json) {sday=json}); OtherFunction(data); } function OtherFunction(data) { for (var i in sday) { // do somthing } } [/CODE][/QUOTE] I'm afraid that won't work because $.getJSON returns jqXHR, not …

Member Avatar for talisien
0
200
Member Avatar for Violet_82

Sounds like a typesetting error by the book's publishers. Some natural languages (eg. Greek, Russian) use angled quotes but, as far as I know, no computer languages - certainly not js. [B]Airshow[/B]

Member Avatar for Fest3er
0
162
Member Avatar for jQueryLover

jQl, For each image you want to have this behaviour, give it a class (below I use [iCODE]someclass[/iCODE]), then attach the behaviour as follows: [CODE] $('img.someclass').click(function(){ var $row = $(this).closest('tr'); alert('Row id: ' + $row.attr('id')); }); [/CODE] [ICODE].closest()[/ICODE] is safer than [ICODE].parent()[/ICODE] and increasingly safer than [ICODE].parent().parent()[/ICODE] etc. as there …

Member Avatar for jQueryLover
0
97
Member Avatar for hiyatran

Hiyatran, It's easier with a [ICODE]found[/ICODE] variable inside the outer loop to track of whether the inner loop has found the current x[i]. [CODE=javascript] function getValue(id){ var x = ["a","b","c","d","e"]; var y = ["a","b","3","d","e"]; var i, j, found, notFound = []; for(i=0; i<x.length; i++){ found = false; for(j=0; j<y.length; j++){ …

Member Avatar for Airshow
0
86
Member Avatar for Romil797
Member Avatar for towerrounder

Tower-Rounder, Thoughts, nothing definitive ..... As far as I am aware, browser-based javascript interpreters don't do any optimisation; they simply execute exactly what you wrote in the way you wrote it, warts and all. Other incarnations of javascript, eg NODE, may be different but I have no specific knowledge. The …

Member Avatar for towerrounder
0
160
Member Avatar for Behi Jon

Be sure to [ICODE]return true;[/ICODE] when execution drops through the validation trap(s) otherwise the returned value is falsy and the form will not sumbit.

Member Avatar for Airshow
0
162
Member Avatar for Airshow

For several days now, Daniweb pages are appearing here with most if not all images missing, eg. DANIWEB in the masthead, avatars, topic status icons, editor icons (except [ICODE], which I know was a recent addition). Facebook and Twitter logos are OK. Right-click>reload image has no effect. The problem appeared …

Member Avatar for Airshow
0
365
Member Avatar for AMADH

Aaron, Assuming this [URL="http://plugins.jquery.com/project/Cookie"]cookie plugin[/URL] is installed, I think you want something like this: [CODE] $(document).ready(function(){ var $widget_FB = $("#widget_FB"); $('#Facebook').click(function(){ var checked = $(this).is(':checked'); $widget_FB[checked?'show':'hide'](); $.cookie('Facebook', checked?1:null);//session cookie for current path. //$.cookie('Facebook', checked?1:null, {expires:7});//peristent 7-day cookie. //$.cookie('Facebook', checked?1:null, {path:'/'});//cookie for all paths in the domain. }); $widget_FB.find('a.close').click(function(){ $('#Facebook').click(); }); …

Member Avatar for Airshow
0
272
Member Avatar for phoenix_2000

Phoenix, First (unlikely but simple), check that the filename on the server has a lower case .js extension. After that it's likely to be a character encoding issue. If so then it could be caused at any of the following levels: [LIST] [*]Keyboard - some language settings generate odd codes. …

Member Avatar for Airshow
0
141
Member Avatar for malcolm p
Member Avatar for malcolm p
Member Avatar for malcolm p

How does this differ from your earlier question to which I provided a response? [B]Airshow[/B]

Member Avatar for Airshow
0
64
Member Avatar for malcolm p

Malcolm, You need two groups of buttons, _A (alphabetic) and _B (boolean), and you need to hide those you don't want to show. For A,B,C buttons: [CODE] $('.answerBtns_A').each(function(index){ (index < clickedNumber) ? $(this).show() : $(this).hide(); }); $('.answerBtns_B').hide(); [/CODE] For true/false buttons: [CODE] $('.answerBtns_A').hide(); $('.answerBtns_B').show(); [/CODE] [B]Airshow[/B]

Member Avatar for Airshow
0
93
Member Avatar for talisien

Leon, [QUOTE=talisien;1707939]How do I create an javascript array from json?[/QUOTE] It depends entirely on what is JSON-encoded server-side. If you get the php script right then it should be as simple as: [CODE] $.getJSON('checkDates.php?dld='+id, function(json){$myBadDates=json;}); [/CODE] To achieve this, return a JSON-encoded php array of "start" dates. [B]Airshow[/B]

Member Avatar for Airshow
0
2K
Member Avatar for ctoz
Member Avatar for carlbrooks

Carl, I haven't got time to give a full answer but here are some pointers: [LIST] [*]The current value of your first select element is given by [iCODE]optionDrop[0][optionDrop[0].selectedIndex].value[/iCODE]. [*]Select elements are [iCODE]display:inline[/iCODE] by default so, unless you specifically want "block", use [iCODE]numberDrop[0].style.display = "inline";[/iCODE]. [*]Dynamically manipulating a select element's options …

Member Avatar for Airshow
0
213
Member Avatar for anand01
Member Avatar for Virangya

Virangya, Unless you need to specifically exclude elements in the document's head, then you can simplify to [iCODE]$('div[class^="suf-"]');[/iCODE]. But as they point out in the jQuery documentation, this form of selector is slow (because internally jQuery has to use a regExp). It's better to separate out the prefix "suf" as …

Member Avatar for Airshow
0
302
Member Avatar for Mbot

JSON encoding is unnecessary here because regular GET or POST serialisation will do the job. Simply use jQuery's [iCODE]form.serialize()[/iCODE] method to encode all fields in the form. [CODE] $(document).ready(function() { $('#submit').click(function(e){ e.preventDefault(); $.ajax({ url: "save.php", type: "POST", data: $(this.form).serialize(), success: function(result){ alert(result); } }); }); }); [/CODE] If necessary you …

Member Avatar for Airshow
0
2K
Member Avatar for Behseini

Behseini, Other than the screen, cookies and making HTTP requests, client-side javascript has no output capabilities. Specifically, it cannot read/write files other than the afore-mentioned cookies (which are severely constrained). Any amount of jQuery isn't going to help. So even if you could get javascript to generate a "pdf string", …

Member Avatar for Airshow
0
79
Member Avatar for iinviktus

Iinviktus, First, the HTML: [CODE=HTML] <a href="#" class="imgSwap"><img src="path/to/image/far_east_button.gif" class="buttonImage" /></a> <a href="#" class="imgSwap"><img src="path/to/image/middle_earth.gif" class="buttonImage" /></a> <a href="#" class="imgSwap"><img src="path/to/image/europe.gif" class="buttonImage" /></a> [/CODE] Then, buttonData: [CODE=javascript] var buttonData = [ //titles added {src:'fareast.gif', href:'http://google.com', title:'Far East'}, {src:'middlearth.jpg', href:'http://yahoo.com', title:'Middle Earth'}, {src:'europe.jpg', href:'http://chappo.cc', title:'Europe'} ]; [/CODE] Then, the click handler: …

Member Avatar for Airshow
0
197
Member Avatar for pbracing33b

[QUOTE=pbracing33b;1702262]Does JavaScipt methods work with any web page elements?[/QUOTE] Yes, assuming you mean browser-borne javascript, then you could say that its sole raison d'etre is to work with web page elements. This is implicit in maybe +95% of everything written on javascript. Another incarnation of javascript, [URL="http://nodejs.org/"]NODE[/URL], also works with …

Member Avatar for Airshow
0
102
Member Avatar for exidez

"em" is the width of an "M" in whichever font is being used (or browser's default font if nothing overrides it). There are at least two things wrong in your code: [LIST=1] [*][ICODE]left[/ICODE] and [ICODE]top[/ICODE] have no meaning unless the element to which they are applied also has [ICODE]position:absolute[/ICODE] or …

Member Avatar for Airshow
0
148
Member Avatar for rahul bora
Member Avatar for azegurb

Hi Aze, If I understand the question correctly ... The condition [iCODE]if (ip && ip.value.replace(/\D/g,'')!='')[/iCODE] exploits the "protective" characteristic of logical operartor [iCODE]&&[/iCODE]. [iCODE]&&[/iCODE] protects its right argument by not testing it and returning [iCODE]false[/iCODE] immediately if the left argument is falsy. This is safe coding and good practice even …

Member Avatar for Airshow
0
300
Member Avatar for azegurb

Aze, The code appears to be a nonsense. I would be surprised if it works. [ICODE]imageItem[/ICODE] is a constructor function designed to preload images. It returns the src (location) of the image that it preloads. However the function [ICODE]get_ImageItemLocation()[/ICODE] assumes that [ICODE]imageItem[/ICODE] has returned an object. The whole thing should …

Member Avatar for azegurb
0
161
Member Avatar for Violet_82

Animated gif or animated sprite as Troy III suggests. [I]Attached gif was made here: [url]http://tools.dynamicdrive.com/animatedgif/[/url][/I] [B]Airshow[/B]

Member Avatar for Violet_82
0
505
Member Avatar for oblo10
Member Avatar for andarivaadu1

Easiest way is to write the hrefs like this: [CODE=HTML] <a href="update.php?q=text1">text 1</a> <a href="update.php?q=text2">text 2</a> [/CODE] Then read [iCODE]$_GET['q'][/iCODE] in php (or the equivalent in other server-side languages) and build your SQL accordingly. [B]Airshow[/B]

Member Avatar for Airshow
0
148
Member Avatar for gikonyo

You could try this approach: [CODE] function getDiscount(x, containerId){ var menu = document.getElementById('discount_code'); var container = document.getElementById('containerId'); if(menu && container){ var discount = Number(menu[menu.selectedIndex].value)/100;//option value must be "15", not "SE15". container.innerHTML = x * (1 - discount); } } [/CODE] Then control the detailed behaviour by supplying suitable arguments where …

Member Avatar for Airshow
0
85
Member Avatar for gorleone

That approach can be made to work but it is generally considered better to attach event handlers in javascript rather than HTML. [CODE=php] <?php if(isset($_POST['bu'])){ $data = 'text <a href="#">alert</a>'; echo $data; } ?> [/CODE] [CODE=javascript] function getdatafromfile(){ var bu = 'bu'; $.ajax({ type: 'POST', url: 'phpfile.php', data: {bu: bu}, …

Member Avatar for Airshow
0
374
Member Avatar for Danny159

You should be able to do something like this : [CODE=javascript] $(document).ready(function(){ $('#sidebar .head').each(function(){ var $this = $(this); var key = $this.html(); var action = $.cookie(key) ? 'slideDown' : 'slideUp'; $this.next('ul')[action]('fast'); }).click(function(){ var $this = $(this); var key = $this.html(); $this.next('ul').slideToggle('fast', function(){ $.cookie(key, $(this).is(':hidden')); }); }); }); [/CODE] [I]untested[/I] [B]Airshow[/B]

Member Avatar for Danny159
0
111
Member Avatar for klemme

I understand that hentPosition() works when urlKey() is omitted but it's not clear - does urlKey() work when hentPosition() is omitted? By the way [iCODE]this.value[/iCODE] will not work for select elements in all browsers. [iCODE]this[this.selectedIndex].value[/iCODE] is the cross-browser solution. [B]Airshow[/B]

Member Avatar for klemme
0
2K
Member Avatar for Biglis35

1. Back up your local copy of the source. Burn it to CD for safe keeping. 2a. Use an FTP client to uploaded the source in its current state. The Godaddy site provides a help on FTP upload. 2b. If the files include .sql exports then there's a good chance …

Member Avatar for MartinRinehart
0
251
Member Avatar for anjibman

Anjibman, This may not be exactly what you want but should get you started. First put the report HTML in a div wrapper and convert it to a template with spans in each place you want to insert text, like this: [CODE=HTML] <div id="http_report"> <h1>HTTP Status: <span class="status"></span> - <span …

Member Avatar for Airshow
0
2K
Member Avatar for 3thal

[QUOTE=3thal;1695437]ooh I'm so sorry , but I'm new here and i thought that if the solution doesn't work just click on down arrow ![/QUOTE] What a giggle :icon_cheesygrin: I appreciate the misunderstanding. Glad to see we're all friends again :icon_cool: [B]Airshow[/B]

Member Avatar for stbuchok
0
180
Member Avatar for oblo10

Oblo10, document.write() can only be used during the document load phase. Any attempt to use document.write() after the [ICODE]window.onload[/ICODE] event has fired (or thereabouts) will cause the whole document (doctype, head, body - EVERYTHING) to be overwritten, as you have seen. For this reason, document.write() is not the right approach …

Member Avatar for Airshow
0
748
Member Avatar for mcwebalizer

Mcwebalizer, Please post your source for the popup window - HTML and any javascript that you have already written. Also, need to know the id of the textarea in the main document. [B]Airshow[/B]

Member Avatar for Airshow
0
123
Member Avatar for Pravinrasal

You have a long road ahead of you. [LIST=1] [*]Learn HTML [*]Learn javascript [*]Learn jQuery [*]Write Calculator [/LIST] Ask specific question along the way. [B]Airshow[/B]

Member Avatar for Airshow
0
281
Member Avatar for cb0058385

PERMISSION DENIED normally arises from like a cross-domain issue, which would be like something outside the code you like posted, like. [B]Airshow[/B]

Member Avatar for cb0058385
0
337
Member Avatar for Airshow

[B]Environment[/B] Development: Amazon EC2 instance. Operational: Unknown at this time [B]Scenario[/B] This is a *nix question but things start out in php, so please bear with me. I'm trying to get php script (php_script_1) to to run another php script (php_script_2) in the background. This will allow php_script_1 to complete …

Member Avatar for Airshow
0
404
Member Avatar for domh87

Parsing out a URL's query string is quite simple if you approach it th right way. My [URL="http://www.daniweb.com/web-development/javascript-dhtml-ajax/code/217357"]QueryParser()[/URL] will save you a lot of heartache. Not only does it parse out the query string but also includes a bunch of useful methods, and it only puts a maximum of two …

Member Avatar for Airshow
0
149
Member Avatar for jemz

JemZ, No point going into great detail here - someone has done a great review: [URL="http://www.designlabelblog.com/2009/03/20-ways-to-create-javascript-modal.html"]20+ ways to create javascript modal windows and dialog boxes[/URL] [B]Airshow[/B]

Member Avatar for jemz
0
102
Member Avatar for louie540

[QUOTE=Troy III;1675325]The working group on xhtml is discontinued. They've dropped it completely.[/QUOTE] This needs to be qualified Troy. "The working group on xhtml is discontinued" - True. The W3C XHTML working group's charter lapsed in 2010. "They've dropped it completely" - False. The reason that the XHTML working group's charter …

Member Avatar for Troy III
0
215
Member Avatar for smartness

Poor smartness - advice overload I expect ...... ..... but please let me join in. This code: [LIST=1] [*] will validate as many [U]independent[/U] groups of checkboxes as you like. [*]will, on failure to validate : [LIST=a][*]set a message in an HTML element of your choosing (by id), for each …

Member Avatar for Troy III
0
3K

The End.