1,330 Posted Topics

Member Avatar for rajandass65

In jQuery, you can address the two divs collectively as follows: [CODE] $("div.myclassname").hide(); [/CODE] Or individually as follows: [CODE] $("div.myclassname").eq(0).hide(); //first div $("div.myclassname").eq(1).hide(); //second div //etc. [/CODE] In these examples, the div(s) are hidden. For some other action, change [iCODE]hide()[/iCODE]. [B]Airshow[/B]

Member Avatar for Airshow
0
90
Member Avatar for Joe34

Joe, I expect you are seeing a comma between each entry of the array. Try outputting [iCODE]css_code.join('')[/iCODE] to join the elements without commas. You can also simplify the code slightly as follows: [CODE]var css_code = [];//shorthand for new Array() css_code.push("<div style='height: "+square_height+"; width: "+square_width+"; "+square_rounded+" border: "+border_width+" "+border_type+" "+border_color+"; position: …

Member Avatar for Airshow
0
165
Member Avatar for Aeterna

Aeterna, The javascript [iCODE]Date[/iCODE] object is essentially a variable representing a number of milliseconds since midnight 1 January 1970, plus a raft of methods for setting and getting this value in a variety of formats. Date subtraction is very simple. [CODE=javascript]var difference = date2 - date1;//where date2 and date1 are …

Member Avatar for Airshow
0
173
Member Avatar for Pinchanzee

jQuery's noConflict method allows jQuery to coexist with other libs (eg. Prototype), which use $ as ana alias. As these libs all install themselves in the global namespace, there's no point calling [iCODE]jQuery.noConflict();[/iCODE] anywhere other than in the global namespace (ie not inside a function). [B]Airshow[/B]

Member Avatar for Airshow
0
242
Member Avatar for sunny124

Sunny, It's hard to see what this loop is supposed to do: [CODE] while(current_plan_id < ('.sample_plan').length){ [/CODE] It may be at least part of your problem. [B]Airshow[/B]

Member Avatar for sunny124
0
2K
Member Avatar for WolfShield

WolfShield, The main thing is that the javascript runs as the page loads before the browser has had a chance to convert the HTML into DOM elements and then rendered them. You need to cast the code inside an "onload handler", which runs [U]after[/U] the page has loaded. Another thing …

Member Avatar for WolfShield
0
4K
Member Avatar for Aksel

Aksel, If I understand correctly, you put a (jquery?) plugin in place on the page then try to attach that plugin's functionality (colorbox) to links that are dynamically inserted, with ajax, into the DOM. The first question is whether colorbox functionality can be successfully attached to links with class="modal" (etc) …

Member Avatar for Airshow
0
193
Member Avatar for metalix

Metalix, That's all you have to do sometimes. Post your problem on Daniweb and it sorts itself :icon_idea: [B]Airshow[/B]

Member Avatar for Airshow
0
168
Member Avatar for Violet_82

Violet, The reason the transitions are not smooth is due to the size of the images. At 300k to 400k the fadeout/fadein effects give browser and graphics card a lot of work to do. Zero 13 is probably driving something ritzy, at least ritzier than this 9 year old machine. …

Member Avatar for Airshow
0
174
Member Avatar for Soben

Soben, There's essentially two ways to do this, depending on whether or not you need the form to be submitted. [LIST=1] [*]To submit the form to a dynamically determined url: In the onsubmit handler, include a line of the format [ICODE]form.action = url;[/ICODE], and return true to allow form submission. …

Member Avatar for Airshow
0
98
Member Avatar for jeffcogswell

Jeff, nice article. I just have to ask two questions. Would the sentence "The original array contains the divs in the document" better read "The original jQuery object contains the divs in the document", or to be really picky, "The original jQuery object contains [U]references to[/U] the divs in the …

Member Avatar for twiss
2
583
Member Avatar for tycoonz

Four widths are specified in the CSS. Try subtracting 20px from each of these widths. If 20px is not enough, try subtracting another 10px and so on ... Before you start, make a note of the original values in case it all goes wrong. [B]Airshow[/B]

Member Avatar for tycoonz
0
151
Member Avatar for Inny

Inny, The whole page really needs to be tidied up. [list][*]Indenting/line feeds [*]Head should contain only metas, script(s) and stylesheet(s), no content/markup [*]Scripts should only be placed inline when they use document.write to create markup.[/list] I can't find checkOnClick on the page. If you want no onclick action then disassociate …

Member Avatar for Airshow
0
229
Member Avatar for BlueCharge

I can't see that you would want the Google control to be part of your own form, which will submit to a different (non-Google) server. In fact, as far as I can tell, you positively shouldn't try to merge the two. However, you can adapt the code you were given …

Member Avatar for BlueCharge
0
237
Member Avatar for cutexxbaby

CutexxBaby, I think you just need to move the code around a bit, to do all the esri. stuff inside the for loop instead of concatenating the coordinate strings: [CODE] ... var books = eval(mygetrequest.responseText); //retrieve result as an JavaScript object var rssentries = books.places; var stX, stY, pt, attr, …

Member Avatar for Airshow
0
192
Member Avatar for Fibinacci85

Fibinacci, Everything urtrivedi said, plus you might consider using some ready-developed software rather than writing your own from scratch, which would be time consuming and prone to security issues. I have not used it myself, but I think [URL="http://wordpress.org/"]Wordpress[/URL] must be a prime candidate for your application. In my opinion, …

Member Avatar for almostbob
0
145
Member Avatar for Inny

Inny, I think you want a toggle action to show/hide the geckos div and simultaneously to switch the button's value. [CODE=javascript] function toggle_geckos(button) { var buttonText = ['Lock Up Geckos', 'Release Geckos']; var el = document.getElementById("geckos"); el.style.display = (button.value==buttonText[0]) ? 'none' : 'inline'; button.value = (button.value==buttonText[0]) ? buttonText[1] : buttonText[0]; …

Member Avatar for Airshow
0
151
Member Avatar for Sogo7

Surely, these limits are not the issue. It's the involvement of a 3rd party in the provision of a "security layer". That said, this is something I was unaware of, so I am grateful for the post. [B]Airshow[/B]

Member Avatar for Airshow
0
224
Member Avatar for prem2

Mmmm, I don't really know much about this topic area but found a discussion here: [url]http://www.infoq.com/news/2007/07/pushvspull[/url] [B]Airshow[/B]

Member Avatar for Airshow
0
74
Member Avatar for Dean_Grobler

Must say, Alloy looks good but the documentation is severely lacking. I can't find any tutorials either. [B]Airshow[/B]

Member Avatar for Airshow
0
83
Member Avatar for ari$av3s

ari$av3s, I think it's easy (but I have said that before). (untested) In the demo script, try adding right at the bottom of the [iCODE]$(function() {...});[/iCODE] a line, which stimulates a click on the first menu item: [CODE] /* call the init method of Menu */ Menu.init(); $("#mb_menu a").eq(0).click();//this is …

Member Avatar for Airshow
0
195
Member Avatar for divyakrishnan

Divyakrishnan, This will allow you to add text fields progressively. [CODE] function add() { var mydiv = document.getElementById("my_div"); var div = document.createElement("div"); mydiv.appendChild(div); div.className ="dynamicDiv"; div.innerHTML = "<input type='text' name='mytext[]' value='mytext' />"; } [/CODE] [B]Airshow[/B]

Member Avatar for manu555
0
4K
Member Avatar for SaroGFX

I think your best bet is to try a jQuery plugin. [URL="http://timeglider.com/jquery/"]Timeglider[/URL] - not quote as you describe but may do the job. [URL="http://plugins.jquery.com/plugin-tags/timeline"]Here[/URL] are some more. If none of these is suitable, then you could try customising a [URL="http://jqueryui.com/demos/slider/"]jquery UI slider[/URL]. You could also look at other frameworks. [URL="http://www.prototypejs.org/"]Prototype[/URL] …

Member Avatar for SaroGFX
0
174
Member Avatar for cdes1145
Member Avatar for Airshow
0
503
Member Avatar for anandhikrishnan

Anandhikrishnan, += is very inefficient when used to aggregate a string from many component strings. Never ever do it this way. Instead, aggregate the component strings in an array then use [ICODE]array.join(glue)[/ICODE] to put the pieces together. By default the "glue" is ',' (comma). [CODE] function(result_arr) { var reason_ids = …

Member Avatar for anandhikrishnan
0
96
Member Avatar for BlackKite

BlackKite, Try: [CODE] echo (" <form action='#' method='POST' name='update_song' onSubmit='return updateSong(\"$song\")'> [/CODE] Note, I have changed the form tag's name and added [iCODE]return[/iCODE] to the onsubmit statement. [B]Airshow[/B]

Member Avatar for BlackKite
0
206
Member Avatar for realnsleo

Realnsleo, The bulamu.net example is really just one page, but organised into a set of "tiles" to give the appearance of separate pages. The transitional slide effect is achieved with mootools. I am not a mootools expert. You can find out more by viewing the source then penetrating the various …

Member Avatar for TySkby
0
165
Member Avatar for crazycat503

Your simplemodal/thickbox approach should work but you should be able to achieve it with just one modal div (plus its contents) in total. This should work providing you want just one video to play at a time. Accommodate the various videos with DHTML/DOM scripting (javascript). I can't help with the …

Member Avatar for Airshow
0
136
Member Avatar for Nathan Campos

Nathan, View the page's source and search for "fillsdfkalsjdfak". You will find the function that writes the dots on the page. You will also need a small stylesheet, slightly higher up in the source. Search for "img.zerosafdfasd". You might like to grab your own copy of the dot image and …

Member Avatar for Airshow
0
226
Member Avatar for prem2

[URL="http://en.wikipedia.org/wiki/JSONP"]JSONP[/URL] JSONP is supported by jQuery. Neither you nor your users should have security concerns if all servers involved are members of a "mutually trusted group". [B]Airshow[/B]

Member Avatar for Airshow
0
191
Member Avatar for oggiemc

Oggiemc, Scopes here are maybe not obvious. The outer function forms a "closure" giving each instance of the inner function access to [ICODE]numAray[/ICODE], [ICODE]resultArray[/ICODE] and [ICODE]result[/ICODE]. In javascript, objects (including arrays) are equated and passed by reference (not by value). Consequently: [LIST] [*]the formal parameters [ICODE]numArray[/ICODE] and [ICODE]resultArray[/ICODE] are actually …

Member Avatar for Troy III
0
123
Member Avatar for newbie14

There's nothing to prevent raw javascript and jquery co-existing. You just need to invoke appropriate code in response to relevant user events. The code will typically be organised in functions, each of which can contain raw js or jquery or a mixture of the two. You probably just need to …

Member Avatar for Airshow
0
660
Member Avatar for Whilliam

Whilliam, It may be as simple as putting the value in single or double quotes: [CODE] <input type="hidden" id='sessio' value="<?php echo $_SESSION['iden']; ?>"> <script type="text/javascript"> var x = document.getElementById('sessio').value; window.location="index.php?link=2&var=" + x; </script> [/CODE] Alternatively, you can write $_SESSION['iden'] directly into javascript without needing to retrieve it from the DOM. …

Member Avatar for Airshow
0
182
Member Avatar for benjaminFowl87

Benjamin, Why is the dialog fetched by ajax and not hard-coded on the page? [B]Airshow[/B]

Member Avatar for benjaminFowl87
0
1K
Member Avatar for gambit_1607

Hi Gambit, I've never seen [ICODE]$(document).ready(...)[/ICODE] inside a function before. Can you explain the reasoning behind that please? To answer your question, there are two ways to access your data: [LIST=1][*]Declare the member, [ICODE]var match_groups = [][/ICODE], in an outer namespace, (eg. as a global, though this should be avoided), …

Member Avatar for gambit_1607
0
160
Member Avatar for thekiddy

tK, I'm in guesswork territory here......... I think I'm right in saying that [iCODE]$('img.faded').live('click', ...[/iCODE] and [iCODE]$('img.highlighted').live('click', ...[/iCODE] will only keep up with matching elements at the time they are inserted, not when their highlighted/faded classnames are changed. If so then the workaround would be to put in place a …

Member Avatar for Airshow
0
678
Member Avatar for klemme

Klemme, That's just about correct. Here's the HTML/javascript in full (sans php): [CODE] <a href="process_delete_page.php?pid=999" onclick="return confirm('Are you sure you want to delete the page?')">Delete page!</a> [/CODE] [B]Airshow[/B]

Member Avatar for klemme
0
139
Member Avatar for tom_benton

You could try [url]www.geonames.org[/url] but I think it gives just a centrepoint for each post code area, not the whole locus. [B]Airshow[/B]

Member Avatar for Airshow
0
78
Member Avatar for xiiopao

xiiopao, It's more likely something to do with your Tomcat configuration than the javascript. Maybe the server is not set up to respond to the .html extension. [B]Airshow[/B]

Member Avatar for Airshow
0
133
Member Avatar for BenJaYin
Member Avatar for Airshow
0
162
Member Avatar for kokfui

Kokfui, The question appears to be about an HTML table but the answer is about a database table - very different animals. Which is it? [B]Airshow[/B]

Member Avatar for kokfui
0
158
Member Avatar for Joe34

Joe, Used that way, document.write will blitz the entire document. Thereafter Build_Blog no longer exists. document.write is generally only used in inline scripts embedded in the HTML, or to write the contents of a child window or iframe. [B]Airshow[/B]

Member Avatar for Airshow
0
83
Member Avatar for turpentyne

Turpentyne, By constructing the leaf images as "masks", it should be possible to do something like this: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Demo by Airshow</title> <style type="text/css"> #leafImage { width: 70px; height: 70px; border: 2px solid #666; } #controls { margin: 5px 0px; padding: …

Member Avatar for Airshow
0
231
Member Avatar for jdavenport

If it's a question of security, then there's no way to absolutely guarantee that a determined user will not somehow discover the testID/userID parameters. Any data that goes client-side is vulnerable. If it's just a question of hiding something rather ugly, then you can suppress the opened window's address bar …

Member Avatar for Airshow
0
6K
Member Avatar for filch

Filch, There's no point using javascript unless it is necessary to dynamically show/hide fields on the page after it has been served, in response to user events. Anything that the user will never see (except be re-serving the page) can be excluded at the php level. As far as I …

Member Avatar for Airshow
0
1K
Member Avatar for rovis
Member Avatar for Tarkenfire
0
176
Member Avatar for serdas
Member Avatar for Airshow
0
81
Member Avatar for msqueen082

Msqueen, Javscript written in an HTML onclick/onchange/onblur etc. is nothing more than the contents of an anonymous function. Therefore, simply separate statements with semicolons. [CODE] <... onclick="guess(); setFocus();" ...> [/CODE] [B]Airshow[/B]

Member Avatar for msqueen082
0
116
Member Avatar for asg333

ASG, Form submission makes a regular (non-ajax) HTTP request so if you want ajax, ensure that the form is not submitted. If the submit button performs ajax, then the code for onKeyUp should be similar. [B]Airshow[/B]

Member Avatar for Airshow
0
161
Member Avatar for sunny124

There's no need to remove anything. Instead just .hide(), then the elements are right there in the same place in the DOM and can be shown again with .show(). [CODE] $("input[name='online_only_bus']").click(function(){ if($(this).is(':checked')){ $('.detach_field').hide(); } else{ $('.detach_field').show(); } }); [/CODE] [B]Airshow[/B]

Member Avatar for sunny124
0
120

The End.