1,330 Posted Topics
Re: Borillion, Try applying [ICODE]id="mycarousel" class="jcarousel-skin-ie7"[/ICODE] to the UL element rather than its containing div. [B]Airshow[/B] | |
Re: Will they be randomly mixed, some jpgs and some gifs? If so then you can't do this simply with a rule-based function. [B]Airshow[/B] | |
Re: The simple answer is to put the ajax call inside a function, then add an error handler to the ajax options, like this: [CODE] ... error: function() { checkopapstock();//try again } ... [/CODE] But then you have to consider a number of other things: [LIST] [*]do you want to limit … | |
Re: Quetions: Where do you want the file to be saved? Why not ask the user to choose from the 3 formats [I]before[/I] sending the request? [B]Airshow[/B] | |
| |
Re: Prasath03, try this: [CODE=javascript] function payNow() { var el; el = document.checkout.free_prod_color; if(el.selectedIndex === 0) { alert("Please select color for FREE product"); return false; } el = document.checkout.free_prod_size; if(el.selectedIndex === 0) { alert("Please select size for FREE product"); return false; } return true; } [/CODE] [B]Airshow[/B] | |
Re: The [ICODE]false[/ICODE] in [ICODE]xhttp.open("GET",dname,false);[/ICODE] makes the request [U]synchronous[/U]. Most browsers' javascript only handle asynchronous requests (ie AJAX). The code pattern will need to be modified. It's more involved than just changing [ICODE]false[/ICODE] to [ICODE]true[/ICODE] (though not unduly complex). I'm sure W3Schools must cover this. [B]Airshow[/B] | |
Re: Cossay, To gain insight, you could try exploring the node names and values as you go down through the tree, eg like this: [CODE] ... if(xml.readyState == 4 && xml.status == 200) { var txt = [];//array inwhich to accumulate text fragments txt.push(xml.responseXML.childNodes[0].nodeName + ' : ' + xml.responseXML.childNodes[0].nodeValue); txt.push(xml.responseXML.childNodes[0].childNodes[0].nodeName … | |
Re: Aeterna, This is tricky. I'm not sure why the code works at all because [ICODE]setTimeout(getUsers(column, id), 5000);[/ICODE] appears to be invalid. I would choose to use [ICODE]setTimeout(function()(getUsers(column, id);), 5000);[/ICODE]. This might in itself fix the bug. Thoughts .... Strictly speaking there's no recursion, as setTimeout starts a fresh call-stack at … | |
Re: Try it with a submit button: [CODE=javascript] function gs_download2xl_c(f) {//f is the form node f.name1.value = "yes"; } [/CODE] [CODE=HTML] <form name="global_search" action="test_1.php" method="POST"> <input type="text" id="name1" name="name1" /> <input type="submit" value="Download2excel" onclick="gs_download2xl_c(this.form);" /> </form> [/CODE] I think there's no point resetting name1 to "" because the page will be … | |
Re: [CODE] <script type="text/javascript"> var items = <?php echo count('item'); ?>; if (items <= 10) { alert('There is less than 10 items.') } </script> [/CODE] [B]Airshow[/B] | |
Re: There are essentially two ways to achieve what you want - IFRAME or AJAX. IFRAME will most probably do what you want. [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> {} </style> <script> function loadContent(url){ var content = document.getElementById('content'); if(content){ content.src = … | |
Re: I think it's working. To find out, try a longer timeout. At 200 milliseconds it will be barely noticable. [B]Airshow[/B] | |
Re: I can't quite follow the logic in [ICODE]getServer[/ICODE]. Just one [ICODE]li[/ICODE] is created with the statement [ICODE]var li = document.createElement("li");[/ICODE], then it is appended, at least potentially, many times over in the three while loops. This may be what you intend but are you aware that [ICODE].appendChild(li)[/ICODE] will hijack that … | |
Re: You don't even need to use the intermediate php variable [ICODE]$city_text[/ICODE] if you don't want to. This should build the javascript statement in one line: [CODE] var locations = ['<?php echo implode("','", $city); ?>']; [/CODE] [B]Airshow[/B] | |
Re: [QUOTE=Ender330;1423444]Ok I understand the issue of having the password in the URL so how can I pass the password to the form field?[/QUOTE] You should never send a password back from server to client and you should never need to. [B]Airshow[/B] | |
Re: Stevo, You should be able to do all that setinterval stuff inside $(document).ready(...) without any global variables, like this: [ICODE] $(document).ready(function() { var container = $("#container"); var refreshId; function loadwall() { container.load("php/functions.php?page=wall&r="+Math.random()); } container.bind('onfocus', function() { clearInterval(refreshId); }); container.bind('onblur', function() { refreshId = setInterval(loadwall, 1000); }); loadwall();//Immediate, initial load ... … | |
Re: At the risk of telling you what you already know, the problem is caused by an interaction between "jQuery UI Tabs" and "ajaxtabs". The error "uncaught exception: jQuery UI Tabs: Mismatching fragment identifier." occurs when Tab 2 is clicked. Would take a lot of investigation to diagnose and may need … | |
Re: Ovidette, Look at your browser's javascript error messages/error console. You will proably find an error occurs before the menu has rendered. [B]Airshow[/B] | |
Re: Drako12, Try it like this ... [CODE] <script type="text/javascript"> var nplaca = <?php echo $nplaca; ?> var defeito = <?php $defeito; ?> var posicao = <?php $posicao; ?> var data = <?php $_POST['datep'] ?> fnClickAddRow(nplaca,defeito,posicao,data); </script> [/CODE] If it still gives trouble then use your browser's "view source" to see … | |
Re: Pub_img, [CODE] <head> .... <script> ... onload = function(){ var myDiv = document.getElementById('bla'); handy_little_script(myDiv);//or similar, or longhand-out the script here. }; </script> .... </head> [/CODE] [B]Airshow[/B] | |
Re: Dolphin, The twitter API provides for this. Try the following: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> body { background-color: #e0e0e0; } /* ul container */ #twitter_update_list { margin: 0; padding: 0; list-style-type: none; } /* a single line entry */ … | |
Re: Yes, you can put an image anywhere you can put text. You can even embed an image in text. You may need some css to style it correctly (eg. border, position). [B]Airshow[/B] | |
Re: Nicosa, The simplest strategy is to disable the all three select menus when "TIKI ONS" is selected. This will leave their options intact in case the user returns to "TIKI Regular". Use [ICODE]element.disabled = true;[/ICODE] and [ICODE]element.disabled = false;[/ICODE] If you really must neutralise the menus, then one possible strategy … | |
![]() | Re: BBen, CSS in document HEAD: [CODE=CSS] .siteCheckMsg { display: none; } [/CODE] Javascript in document HEAD: [CODE=javascript] onload = function() { var siteCheckMsg1 = document.getElementById('siteCheckMsg1'); var siteCheckMsg2 = document.getElementById('siteCheckMsg2'); var siteCheckMsg3 = document.getElementById('siteCheckMsg3'); siteCheckMsg1.style.display = 'block'; var siteCheckImg = new Image();//This is a socalled "off-screen image". siteCheckImg.onerror = function() { … |
Re: Miganper, Using AJAX to revieve an image src is OTT. Unless there is very good reason to involve the server, then it's an unnecessary level of complexity. Also, it is generally recommended (and ultimately easier) to attach all event handlers in javascript rather than HTML. For this reason, onLoad="..." should … | |
Re: Youlichika, Your page sticks on "loading". If you can develop it to the point where it shows Page 1 without images, then I should be able to explain how to show images and go to page 3. [B]Airshow[/B] | |
Re: Dylan, I always wondered what "quantitative easing" looked like in javascript!?!? :-/ Function [ICODE]hideCustomComp[/ICODE] doesn't follow the same pattern as the other three hide functions. In its callback, it hides [ICODE]".contact_outerPosition"[/ICODE], not [ICODE]".customComp_outerPosition"[/ICODE]. [B]Airshow[/B] | |
Re: [URL="http://www.amazon.com/dp/0596101996?_encoding=UTF8&tag=davidflanagancom&linkCode=as3&camp=15041&creative=373501"]"JavaScript: The Definitive Guide" by David Flanagan, O'Reilly[/URL] [URL="http://www.amazon.com/Dynamic-HTML-Definitive-Reference-2nd/dp/0596003161"]"Dynamic HTML: The Definitive Reference" by Danny Goodman, O'Reilly[/URL] I have both and they are invaluable. I plan on upgrading to the latest versions when funds permit. Online [URL="http://www.w3schools.com/js/default.asp"]w3Schools[/URL] is pretty good but certainly not the only one. Read everything you can … ![]() | |
Re: Chris, If my understanding is correct, then you first need to fix MYSETTINGS.PHP (and any other pages) to make its output suitable for insertion into the document. You don't need, and should not have, all the page-structure stuff, which is already in place in index.php. Content is inserted into a … | |
Re: ServerMan, You need to use jQuery [URL="http://api.jquery.com/category/selectors/attribute-selectors/"]attribute filtering[/URL], which provides a limited but highly usable regex notation. [CODE] $(document).ready(function() { $('div[id][id*="search"]'). ... }); [/CODE] If the search term is variable, then you can build the selector with a bit of string handling, eg.: [CODE] $(document).ready(function() { var str = "search"; … | |
Re: ThatGuy2, First, [ICODE]/search_option/[/ICODE] makes a regex from the string [ICODE]"search_option"[/ICODE], not the variable [ICODE]search_option[/ICODE]. The // form is only good for hard-coded strings. To dynamically create a regex, you have to use new RegEx() : [CODE=javascript]var myRegExp = new RegExp(search_option);[/CODE] Next, options don't have events of their own. I know … | |
Re: Subhankar02dey, Apply styles in a stylesheet (CSS). You can specify styles for screen, print and several other media types, with [URL="http://www.w3.org/TR/CSS2/media.html#at-media-rule"]CSS @media directives[/URL]. Style directives specified in this way follow the normal cascading rules for order and specificity. Thus, you can have a general group (with no @media{)) for all … | |
Re: Genzoman, Toggle acts on the css "display" property, not "visibility". As the categories are mutually exclusive, radio buttons are more appropriate than checkboxes. This also allows for much simpler javascript as radio buttons are self managing (no need to disable/enable). In addition, move [ICODE]style="visibility:hidden;"[/ICODE] from the div tag to the … | |
Re: [QUOTE=Archenemie;1405770]Is my interpretation of what this script is doing correct?[/QUOTE] Nothing wrong with your understanding thus far, Archenemie. Some notes ... [B]with[/B] [ICODE]with[/ICODE] is unloved and deprecated. I don't understand the full reason but most people avoid it. [B]Purpose[/B] Javascript's main [I]raison d'etre[/I] is to interact with (X)HTML/XML documents and … | |
Re: Sanchow, Can only think that Moz browsers aren't reading the [ICODE]value[/ICODE] attribute in the [ICODE]<a>[/ICODE] tags. Suggest you try this: [CODE]//-- replace //echo '<a href="#" value="'.$XENOID.'" onclick="display_data(this.value)">'.$XENOID.'</a>'; //-- with echo "<a href=\"\" onclick=\"display_data('$XENOID');return false\">$XENOID</a>";[/CODE] May be enough to make it work. [B]Airshow[/B] | |
Re: Firewall | |
Re: [ICODE]const[/ICODE] does not exist in JavaScript. Use [ICODE]var[/ICODE]. [B]Problem[/B]: Translating selectedInexes into values in javascript will work, but consider then adding/removing an item to/from a select menu. The javascript would need to be amended in sympathy. [B]Solution[/B]: Put price data in the options (eg. in a custom "price" attribute) such … | |
Re: I can't quite penetrate your requirement here lf.gene. As it stands you have two different versions of jQuery (the second would overwrite the first), two identical versions of jQuery-ui served from different directories (again, the second would overwrite the first), and one version of fullcalendar (that's fine). The way you … | |
Re: Luke, I can't immediately see why both ajax responses should not appear unless [ICODE]parent[/ICODE] in the first call and [ICODE]parent[/ICODE] in the second call both address the same element, in which case it is a matter of chance as to which response arrives first and which arrives second (you may … | |
Re: To use document.write() successfully, the statement must execute immediately. Any call to document.write() after the page has fully loaded will cause the entire page DOM, CSS, Javascript - everything - to be completely blitzed, and replaced with the argument passed to document.write(). Your document.write() is embedded in a function which … | |
Re: The probelm would appear to be caused by one of two things, maybe both: [LIST=1] [*]OnClientClick and onClick in the same tag (several times), where OnClientClick calls the recursive jQuery function [ICODE].show[/ICODE]. I'm pretty certain that OnClientClick wasn't conceived (by the gnomes of Redmond) with this type of usage in … | |
Re: I would definately use a javascript lib which offers draggability. You will save yourself loads of time and your code will be very concise. The advantages are speed of development and cross-browser compatibility. I just tried it with jQuery/jQueryUI - 11 lines of CSS plus seven lines of javascript including … | |
Re: Eduard, ArbitroWeb is a PHP application. PHP runs under Apache in one of two ways; as an Apache Module or as a CGI Binary. Some applications contain features that make them specific to one or other of these options. It would appear that ArbitroWeb is one such application. Web hosting … | |
Re: [QUOTE=WebKoller;1402113]Now, i'm thinking of a different strategy. I'm thinking since it works fine if I remove the Ajax, what if I send the data to another PHP, process it, and then send it (all processed) again to an Ajax script which would then just update the div with the response? … | |
Re: Saad749, You will hate me for telling you that you don't need to use switch/case, and that the code will simplify significantly by working out efficient strategies for: [LIST] [*]populating the two select meus [*]storing the conversion factors [*]performing the calculations. [/LIST] [U]Populating the Select Menus[/U] Both menus get exactly … | |
Re: The structure of the code is basically fine. It just needs debugging and tidying up. Your browser's error console (or error messages) will help you. [B]Airshow[/B] | |
Re: Moerkel, It may not be the only thing but .... Client-side: [ICODE]xmlHttp.open('POST', 'phpsqlinfo_addrow.php', true);[/ICODE] ... Server-side: [ICODE]$colour = $_GET['colour'];[/ICODE] etc. are incompatible. Try: [ICODE]$colour = $_POST['colour'];[/ICODE] etc. [B]Airshow[/B] | |
Re: NonShatter, Try this: [CODE=HTML] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> {} </style> <script> function getItem(id) { return (document.getElementById) ? document.getElementById(id) : (document.all) ? document.all[id] : (document.layers) ? document.layers[id] : null; } function toggleItem(sectionRef) { var imgNode = getItem("image_" + sectionRef); var … |
The End.