- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 37
- Posts with Upvotes
- 21
- Upvoting Members
- 15
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
Re: Hi someone5, If you keep this pattern `tr/td/input` this will be ok. The snippet supposed you start at input. I also have a JSFiddle made, here's the link: [JSFiddle Example](http://jsfiddle.net/PehPj/) //Colors the input.child's closet TR.menu $("input.child").parent().parent().each(function(){ var $this = $(this), $target = $this.prev(); //looks for previous sibling with menu class … | |
Re: Hi Faisal, You can show the loading image right in the click event and use jquery's deferred method `always()` to hide the loading image. Here's a sample script: $(document).ready(function() { $("#submit").click(function(){ var acc = $("#accountNumber").val(); src = "pass.php"; //show your loading image $("#loading").show(); $.ajax({ url: src, data: 'action=account&type=viewDetail&accNo='+acc, cache: false, … | |
Re: Looking at the aspect of seeing only a function for checking if the user's loggedin, and if not would redirect, clearly, there's no problem. :) Can you show us the logout script and your login? Specifically in the logout script the part where you unset the "user" variable in the … | |
Re: Although there are numerous ways to insert multiple records in a database, the easiest way is this: INSERT INTO [TABLE] ( [COLUMN1], [COLUMN2], [COLUMN3]) VALUES ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]), ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]), ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]), ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]), ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]), ( [COLUMN1_VALUE], [COLUMN2_VALUE], [COLUMN3_VALUE]) | |
Re: Try this: **HTML** <div id="element-to-be-commented"> <div>Some div...</div> <div>Inspect the element underneath this</div> </div> **JS** var commentContainer = document.getElementById("element-to-be-commented"); var data = {name: "gon1387", notAnotherArray: [2,4,1]}; // Convert the object to string through JSON api // then create a comment out of the result var convertedData = document.createComment(JSON.stringify(data)); // Put the … | |
Re: Why not put it in a set? | |
Re: Hi ethan, Though not the same as your request, you can do it through css alone. Having this kind of html structure: <div class="checkBox"> 1 <input type="checkbox" /> <div> 1.1 <input type="checkbox" /> 1.2 <input type="checkbox" /> <div> 1.2.1 <input type="checkbox" /> </div> </div> 2 <input type="checkbox" /> <div> 2.1 … | |
Hi! I would like to know if anyone here have attempted installing Redmine V2.3.\* on IIS? If you did, can you please direct me to the right direction. What are the things should be done? I had tried it on my own, but I kept on having errors like "Gem::Installer::ExtensionBuildError: … | |
Re: If you wanted a redirect through JS you can either do it like this: window.location.href = "http://www.google.com"; OR this window.location.replace("http://www.google.com"); OR this window.location = "http://www.google.com"; Let me know if that's what you want or not. | |
Re: What's the result in your console everytime you click the submit button? | |
Re: You can use this: [setQueryTimeout](http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html) If I get you right and you don't want to set it on a DB level; if so, you have to configure it base on what DBMS you're using. | |
Re: I'm not a fan of synchrounous request in JS. Everytime I see this in someone elses code I'd always think of browser's code execution limit, especially when it's inside a loop (which really is not a good practice). Hopefully these references might help you: [Browser Execution Limit](http://www.sitepoint.com/javascript-execution-browser-limits/) [Recursive SetTimeout](http://www.erichynds.com/blog/a-recursive-settimeout-pattern) | |
Re: Hi Sabyre, >Problem is, I don't have much of any experience with JS. >Is this a possibility? Is there another more effective/efficient was to accomplish this? Yes, I believe, you see php and javascript has interworked in one script file in the client side. To make it clear, php are … | |
Re: Can you please make it clear if this one's intentional? `// function setCookie('TheCookieName', 'MyValue', '3', '/', '.mywebsite.com', ")` It's located at line 3 of your second example. Currently, it's commented and wouldn't run the function. | |
Re: Hi DamzWildfire, There was no issue with regards to your keydown event, as your keydown event are captured anywhere on the document. It will be a much help for us and mostly to you if you'll show your code on your "moveSelection" function. | |
Re: Hi GraficRegret, Hope this helps. //Container for the image sources var images = ["img/image1.jpg","img/image2.jpg","img/image3.jpg"], //temporary counter ctr, //Container for the images within an A element imgElem=[], //Temporary storage for the element $tempElem; for(ctr in images){ //Creates an image tag $tempElem = $("<img>"); //Assign the image source to the IMG tag … | |
Re: Hi azegurb, Hope this doc will explain it: [Replace Doc](https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/replace) Please look into the **Specifying a function as a parameter** section for explanation of the 4 parameters sent to a anonymous func from *replace* | |
Re: Hi saadi06, JPGraph purely uses php for graph rendering. Please move this thread to php, as you might get a better answer from there. | |
Re: Hi riahc3, you can do the following to parse your string result, hopefully this will give you an idea on how to implement one. var dataStr = "Name: Bob Last: Han Ken Age: 36#Name: George Last: Alan Age: 45#Name: Amy Last: James Age: 36#", storage; // Split the string using … | |
Re: That problem typically occurs when you use `setRequestHeader` before `open`. To make it short, you have a typo at line 10, on your posted code: var vars="deets="+deets; //change this to this // hr.open("POST",url,true); hr.open=("POST",url,true); hr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); hr.onreadystatechange=function(){ This should be the correct snippet: var vars="deets="+deets; hr.open("POST",url,true); hr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); hr.onreadystatechange=function(){ | |
Re: Hi chr.s, Prototype and jQuery both uses the '$'. You have to relieve the dollar sign from jQuery for prototype and assign another identifier or use the jQuery var for jQuery operations. I can be done like this. <script src="[PROTOTYPE_URL]" type="text/javascript"></script> <script src="[JQUERY_URL]" type="text/javascript"></script> <script type="text/javascript"> //Relieves the '$' identifier … | |
Re: In JS you can, like in C. But it's a bad practice messing with the global directly under the local scope of a function, although on some instances it's ok. But as much as possible try to hesitate from doing so; you have to seperate concerns and responsibility. In a … | |
Re: In javascript you can encode your url like this: var DWUrl = "http://www.daniweb.com"; //output: http://www.daniweb.com console.log(encodeURI(DWUrl)); //output: http%3A%2F%2Fwww.daniweb.com console.log(encodeURIComponent(DWUrl)); here's the description for the two func: [Encode URI](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI) [Encode URI Component](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent) [Decode URI](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURI) [Decode URI Component](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/decodeURIComponent) | |
Re: Hi Violet_82, Here's a dissection of the regexp. /\B - Look for any zero-width character within a word (?= - that follows (\d{3})+ - a 3 digit number (?! - and doesn't follow \d)) - another digit /g - should look globally | |
Re: This is just a hack. You have to look for the part of the script in your external js that has connection with the anchor tag, and edit it. <a href="site/contact.php" onclick="event.preventDefault();$(this).closest('form').submit()" class="button"> You have to look at your external js for the part of the code that causes the … | |
Re: jQuery thinks you're looking for `#cart` with attributes `[1223686][qty]`. if you want to look for that element, you have to specify the id attribute and value instead. Like this : $j("[id='cart[1223686][qty]']").click(function() { alert("Handler for .click() called."); }); | |
Re: Hi delta_frost, You have to do it this way, as on the initial load of the page, it can't find any set $_FILE["file"], in the $_FILE global. Why? there where no form submissions yet. if(isset($_FILES['file'])){ $filename = $_FILES['file']['name']; $tempname = $_FILES['file']['tmp_name']; //echo $filename; $directory = 'E:/php_uploads/'; | |
Re: Hi Venter, Here you are :) for (var i=0;i<fruits.length; i++) { if(fruits[i]==y) { localStorage[fruits[i]]="SELECTED"; } } Let me know if you have questions. | |
Re: Hi Mehar89 here you go, let me know if you have questions. var form = document.getElementById("myForm"), incInput = form["formitemquantity[]"], len = incInput.length, ctr = 0; for(;ctr < len; ctr++){ incInput[ctr].value = ctr; } | |
Re: Hope this explains it: In a simple sense, webservice is a standardized way for you to provide data and communication to your other software or a 3rd party software. Like in your php code and your js code, how will the js code understand your php code? |