- 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
120 Posted Topics
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? | |
Re: Hi awfootball7, I tweaked your code and here it is, let me know your questions. class Money { int dollars, cents; Money(int dollars, int cents) { this.cents = cents%100; this.dollars = dollars + (int)cents/100; } Money(int cents) { this(0,cents); } Money() { this(0,0); } int getDollars() { return dollars; } … | |
Re: Hi welshly_201, The data you recieved are parsed as an array. You can use it like this: $(document).ready(function(){ $.ajax({ url: "dropdown.php", data: data_str, type: "POST", // You should put the type inside double or single quotes dataType: 'json', success: function(d) { // Alert shows "please select XML to load" alert(d[0]); … | |
Re: Actually it's not that simple to get the size of the the window on different browsers, it can give you a lot of headache. :D For FF, if you're after the browser window size, then use `window.outerWidth` and `window.outerHeight`. But then, if you want to get the viewport, it's `document.documentElement.clientHeight` … | |
Re: Hi Martin C++, You can match each operator and operand using regex, like this. var str = "11+4+9-5.5/5*10"; var arr = []; var cur; // result of match for str // ["11", "+", "4", "+", "9", "-", "5.5", "/", "5", "*", "10", ""] arr = str.match(/[\*\/+-]|[0-9.]{0,}/g); // get each value … | |
Re: Hi Priti_P, A newline escape character would do for an inline and your sample would also do it. example: <?php $myString = "MULTILINE: hi this is for test"; echo "<textarea rows='6'>" . $myString . "</textarea>"; $myString2 = "INLINE:\nhi\nthis\nis\nfor\ntest"; echo "<textarea rows='6'>" . $myString2 . "</textarea>"; | |
Re: I guess the best way to explain the the trivialities of this problem is this: var myArray = [0,1,2,3,4,5]; ARRAY: length = 6 index value [0] 0 [1] 1 [2] 2 [3] 3 [4] 4 [5] 5 myArray.splice(3,1) ARRAY: length = 5 index value [0] 0 [1] 1 [2] 2 … ![]() | |
Re: Do you mean normalize further your table? COUNTRY country_id | country_name COUNTRY_STATE country_id | state_id STATE state_id | state_name STATE_CITY state_id | city_id CITY city_id | city_name This one's requires joins, and lesser the size as yours; but I would prefer your design than this cause, a DB for location … | |
Re: HI praveen_dusari, I can't grok on the whole point in the middle of your thought, but I'll just isolate and answer this "is there to any way store my data." Until you gave and clarify your whole point. If you're looking for a persistent data storage, you can use the … | |
Re: The way you describe it was obscure, hopefully I understand it the way you do and my answer would enlighten you to give you a better explanation for your thought. First, let me put it this way; JQuery in the basic sense was created due to inconsitencies of browser vendors … | |
Re: Hi cgull, It can't find the "mask" plugin. Have you checked if the plugin file's downloaded by your browser? There's an inconsistency in your script, unlike the first two, the src attribute in your modernizr external script has a an additional forward slash before "javascript". Can be the cause of … | |
Re: Hi Techyworld, again. Hehe. :) Here, you review and tweak this code as you like: [JSFiddle Live Example](http://jsfiddle.net/HcZUQ/) /** * Converts the tabel value in an array * @param elementNode first table row * @return array the retrieved value of each rows and cells in 2d array */ function retreiveTableValue(firstRow){ … | |
Re: Hi Techyworld, I'm quite not sure what kind of retrieval you're after but, I hope this helps. It geneerates a 2d array, based from given config and generate an html table, and append to html body. I also have a JSFiddle prepared Here's the link [JSFiddle Example](http://jsfiddle.net/bSaSj/) var twoDArrayGenerator, generateTable, … | |
Re: Hi riahc, Basing from your ajax URL(using cookies for session id storage),one way for it not to be updated is wrong session ID, or with a browser with a setting of not saving cookies; also assuming you referenced jQuery to `$j` variable. So let's start first with encoding your data, … | |
Re: Hi Soapuillusion, I'm really puzzled by what you mean? Can you please elaborate, explain it further? | |
Re: Hi biswa2ray, Here's a simple sample vanilla javascript and jQuery I created on how to add, delete and view the values of a dynamic input elements. You can review the sample on this link: [JSFiddle Vanilla JS Sample](http://jsfiddle.net/tXNwe/1/) [JSFiddle jQuery Sample](http://jsfiddle.net/apcSf/) Here's also the code: **VANILLA** //get the form element … | |
Re: If by what you mean "explicit website blocker" is programmatically blocking sites in your list; then, there goes the cons. I can't thought of any other pros except you have more control or options on this one. For manually editing the host file, it's a systemwide approach, all users will … | |
Re: Hi riseguim, can you please explain further? Also when you say, "at the very last elem it stops", it doesn't: for (i = 0, allElems = $('.FadingBanner').length, elemNoFade = allElems - 1; i < allElems; i+=1) { fadingElem = "#elem" + i; if (i === 0) { $(fadingElem).fadeIn(fadeTime).delay(delayTime).fadeOut(fadeTime); // Once … | |
Re: Hi pin89, Here's a sample implementation and extraction from the data format you have. var jsonData = [ {"ID":10,"Duration":24235}, {"ID":21,"Duration":9034}, {"ID":12,"Duration":13681}, {"ID":1,"Duration":23053}, {"ID":13,"Duration":22863}, {"ID":22,"Duration":57163} ]; //container for the idList and duration in array var idList = []; var durationList = []; //Extract data from the recieved json data for(var i=0, … | |
Re: Hi NoUserNameHere, Yes, `$(this).val() != ""` this is a correct way on how to check if the value is empty in jQuery. It seems you have a problem with your each. Should it be this instead? $.each($(':input'), function() { if ($(this).val() != "") { $('#submit_button').removeAttr('disabled'); } }); The code you … | |
Re: I found no errors in the script, nor any culprit in the script for it not to run; even problems with older IE versions. My guess here is, maybe there is/are extentions in your IE that perturbs its execution; or misconfigurations. ![]() |
The End.