Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,037,450
1,037,451
send the img id to another file with ajax
<p>I am trying to make this work, I have some images each one of them has this link with its own id. </p> <p>this is the link: <code>&lt;a href="#" class="remove_img" data-id="'.$img-&gt;g_id.'"&gt;x&lt;/a&gt;</code></p> <p>this is the script: </p> <pre><code>&lt;script&gt; $(document).ready(function() { $(".remove_img").click(function() { e.preventDefault(); var id = $this.data('id'); $.ajax({ url: 'remove_img.php', type: 'POST', data: { bild : id }, success: function(data) { alert("Gespeichert!"); } }); }); }); &lt;/script&gt; </code></pre> <p>and I receive the id in the remove_img.php like this: <strong>$_POST['bild']</strong></p> <p>in the chrome console I see this error: </p> <blockquote> <p>$this is not defined (repetead 2 times)</p> </blockquote>
javascript jquery
[3, 5]
2,998,364
2,998,365
jQuery slide down toggle, impossible?
<p>I want to do a slide down with jQuery, but I can't find it anywhere. </p> <p>I do <strong>not</strong> want it to <a href="http://api.jquery.com/slideDown/" rel="nofollow">scale as it slides</a><br> I do want it to perform <a href="http://see.weareinto.com/3tyP" rel="nofollow">this action</a> ( click slide ), but vertically down, not horizontally right.</p> <p>UPDATE :</p> <p>So here's the final functional code!</p> <pre><code>$(this).toggle( "slide", { direction: 'up', duration: 'slow', easing: 'easeOutQuart' } ); </code></pre>
javascript jquery
[3, 5]
2,791,000
2,791,001
Android: adding progress bars?
<p>What would be the best way to use a progress dialog in the following circumstance..</p> <pre><code> //start progress dialog here. RequestInfoFormServer(); ProcessThatInfo(); return; </code></pre>
java android
[1, 4]
4,772,524
4,772,525
Double click needed in firefox (JQUERY)
<p>I was advised to used this because i was having a problem, a link worked in FireFox ONLY when clicked the second time. This is to display an external html in a div called leftColumn.</p> <pre><code>$(function(){ $('#ulWithAllTheLinks').delegate('li a', 'click', function(e){ e.preventDefault; $('#leftColumn').load(this.href); }); }); </code></pre> <p>My question is, that this displays the html with the content in a NEW page, I know that it has something to do with this:</p> <pre><code>&lt;ul id="one"&gt; &lt;li&gt;&lt;a href="content.html"&gt;First Link&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>yet i don't know how to link this to the function</p>
javascript jquery
[3, 5]
3,402,344
3,402,345
How to check which argument has been passed to a function
<p>I'd like to make a call to another jQuery function and pass another argument - the argument I pass depends on the name of the argument that was passed to the original function. So i might have something like this:</p> <pre><code>matchedNumbers1 = compareArrays(userNumbers, winningNumbers1, matchedNumbers1); matchedNumbers2 = compareArrays(userNumbers, winningNumbers2, matchedNumbers2); matchedNumbers2 = compareArrays(userNumbers, winningNumbers3, matchedNumbers2); //COMPARE INPUTTED ARRAY OF NUMBERS TO WINNING ARRAYS OF NUMBERS function compareArrays (userInput, winningNums, matches) { matches = 0; allMatchedNumbers.length = 0; $(userInput).each(function(i) { $(winningNums).each(function(j) { if (userInput[i] == winningNums[j]) { allMatchedNumbers[matches] = userInput[i]; matches++; } }); }); switch (winningNums) { case 'winningNumbers1': alert("!!!!!"); markMatches(ListItems1); break; case 'winningNumbers2': markMatches(ListItems2); break; case 'winningNumbers3': markMatches(ListItems3); break; } return matches; } </code></pre> <p>Hopefully the code above makes it clear what i'm trying to do. I tried using a <code>switch</code> statement but this only compares the value and not the name of the original argument that was passed to the function. Any help would be appreciated.</p>
javascript jquery
[3, 5]
882,344
882,345
Why can I not set my data attribute with jQuery?
<p>I have the following:</p> <pre><code>editCity: "/Admin/Citys/Edit?pk=0001I&amp;rk=5505005Z" $('#editCity') .attr('title', "Edit City " + rk) .data('disabled', 'no') .data('href', editCity) .removeClass('disabled'); </code></pre> <p>When I check the HTML with developer tools I see this:</p> <pre><code>&lt;div class="button dialogLink" id="editCity" data-action="EditCity" data-disabled="yes" data-entity="City" title="Edit City 5505005Z" &gt;&lt;/div&gt; </code></pre> <p>Everything is updated except the href. Anyone have an ideas what I am doing wrong?</p>
javascript jquery
[3, 5]
3,098,531
3,098,532
What is the meaning of "$" sign in javascript
<p>In the following JavaScript code there is a dollar sign <code>$</code>. What does it mean?</p> <pre><code>$(window).bind('load', function() { $('img.protect').protectImage(); }); </code></pre>
javascript jquery
[3, 5]
3,823,400
3,823,401
What is the equivalent of CPython string concatenation, in C++?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/13013442/simple-string-concatenation">Simple string concatenation</a> </p> </blockquote> <p>Yesterday, as I'm writing this, someone asked on SO</p> <blockquote> <p>if i have a string <code>x='wow'</code> applying the function <code>add</code> in python :</p> <pre><code>x='wow' x.add(x) 'wowwow' </code></pre> <p>how can i do that in C++?</p> </blockquote> <p>With <code>add</code> (which is non-existent) corrected to <strong><code>__add__</code></strong> (a standard method) this is a deep and interesting question, involving both subtle low level details, high level algorithm complexity considerations, and even threading!, and yet it&rsquo;s formulated in a very short and concise way.</p> <p>I am reposting <a href="http://stackoverflow.com/questions/13013442/simple-string-concatenation">the original question</a> as my own because I did not get a chance to provide a correct answer before it was deleted, and my efforts at having the original question revived, so that I could help to increase the general understanding of these issues, failed.</p> <p>I have changed the original title &ldquo;select python or C++&rdquo; to &hellip;</p> <ul> <li>What is the equivalent of CPython string concatenation, in C++?</li> </ul> <p>thereby narrowing the question a little.</p>
c++ python
[6, 7]
368,251
368,252
Javascript onKeyPress event not working?
<p>Why does this statement work with OnKeyPress event of Javascript in C#. </p> <pre><code> txtPassword.Attributes.Add("OnKeyUp", "CheckPasswordStrength(\"" + txtPassword.ClientID.ToString() + "\",\""+ lblMessage.ClientID.ToString() +"\")"); </code></pre> <p>this code is working correctly, my problem is that i want to run keypress event not keyup event</p>
c# asp.net javascript
[0, 9, 3]
345,803
345,804
Is it possible to show all active jQuery bind()'s?
<p>Is it possible to show all active jQuery <code>bind()</code>'s?</p>
javascript jquery
[3, 5]
2,262,845
2,262,846
Hide HTML with jquery
<p>I have html written on a page like this that I can not control and I can only get access to it using jquery, which I need your help to solve.</p> <pre><code>&lt;span class="breadcrumb"&gt; &lt;a href="http://www.example.com" class="breadcrumb"&gt;&lt;/a&gt;Home / &lt;a href="http://www.example.com" class="breadcrumb"&gt;Home&lt;/a&gt; / &lt;/span&gt; </code></pre> <p>I would like to hide only the "Home /" text from the first line that has the empty link. This issue is the text is not wrapped in the link, but is plain text.</p> <p>But I want to keep the second line visible that contains the link</p> <pre><code>&lt;a href="http://www.example2.com" class="breadcrumb"&gt;Home&lt;/a&gt; / </code></pre>
javascript jquery
[3, 5]
552,088
552,089
Using unbind, I receive a Javascript TypeError: Object function has no method 'split'
<p>I've written this code for a friend. The idea is he can add a "default" class to his textboxes, so that the default value will be grayed out, and then when he clicks it, it'll disappear, the text will return to its normal color, and then clicking a second time won't clear it:</p> <pre><code>$(document).ready(function() { var textbox_click_handler = function clear_textbox() { $(this).removeClass('default'); $(this).attr('value', ''); $(this).unbind(textbox_click_handler); }; $(".default").mouseup(textbox_click_handler); }); </code></pre> <p>The clicking-to-clear works, but I get the following error:</p> <pre> Uncaught TypeError: Object function clear_textbox() { ... } has no method 'split' </pre> <p>what is causing this? How can I fix it? I would just add an anonymous function in the mouseup event, but I'm not sure how I would then unbind it -- I could just unbind everything, but I don't know if he'll want to add more functionality to it (probably not, but hey, he might want a little popup message to appear when certain textboxes are clicked, or something).</p> <p>How can I fix it? What is the 'split' method for? I'm guessing it has to do with the <code>unbind</code> function, since the clearing works, but clicking a second time still clears it.</p>
javascript jquery
[3, 5]
3,663,682
3,663,683
Which is the 'correct' way to do this (if statement)
<p>I've got plenty of these lying around, and I'm wondering if I'm going to face any trouble - or performance problems.</p> <p>I have method A: <pre><code> MyClass monkey; ... if(monkey != null) { ... } </pre></code></p> <p>Or method B: <pre><code> boolean hasMonkey; //This is set to TRUE when monkey is not null MyClass monkey; ... if(hasMonkey) { ... } </pre></code></p> <p>On a functional level, they both do the same thing. Right now, I'm using method A. Is that a bad way of doing things? Which is going to perform better?</p>
java android
[1, 4]
5,380,151
5,380,152
Why does javascript replace only first instance when using replace?
<p>I have this</p> <pre><code> var date = $('#Date').val(); </code></pre> <p>this get the value in the textbox what would look like this</p> <p>12/31/2009</p> <p>Now I do this on it</p> <pre><code>var id = 'c_' + date.replace("/", ''); </code></pre> <p>and the result is </p> <p>c_1231/2009</p> <p>It misses the last '/' I don't understand why though.</p>
javascript jquery
[3, 5]
2,392,235
2,392,236
location.href doesn't work locally on machine?
<p>Forget iframes and cross site scripting and all sorts, none of those issues are related to my specific problem.</p> <p>The problem is in internet explorer (the code works FINE in firefox and similar). Running on a Windows 7 Machine.</p> <p>Any code like:</p> <pre><code>window.location.href = "http://google.com"; document.assign("http://google.com"); </code></pre> <p>Even when the location is a html doc in the current directory (eg: <code>....href = "nextpage.html"</code>) it won't allow it.</p> <p>The error is "permission denied" or sometimes "access denied".</p> <p>Any reasons why this is happening? Are there any alternatives?</p> <p><strong>context</strong> - this is a local html file to be run in a web view in a C# program, so its using IE's engine which is why there is such an issue.</p> <p>Thanks</p>
c# javascript
[0, 3]
2,296,410
2,296,411
Jquery select table rows and group them
<p>I have a table that has a list of employees. I want to be able to create a new department and drag and drop employees into each department. Once an employee has been assigned to a dept, the dept column in the "employeedept" table has to get updated with the dept value. </p> <pre><code>&lt;table id="employeedept" border="1"&gt; &lt;THEAD&gt; &lt;tr&gt; &lt;th&gt; Dept&lt;/th&gt; &lt;th&gt; Name&lt;/th&gt; &lt;/tr&gt; &lt;/THEAD&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; John &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; Tom &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt; Smith &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input style="margin-top:20px;" name="deptname" id="deptname" /&gt; &lt;input type="button" id="dtnDept" value="Add New Dept" onclick="createDept()" /&gt; </code></pre> <p>Is there any JQuery plugin around that can help me achieve this?</p>
javascript jquery
[3, 5]
4,696,034
4,696,035
Why is wrong with this JS function? Firefox does work but Chrome doesn't
<p>Hi, I have been coding a little Js function that manipulates certains divs and elements. On firefox it works great, but it does not work in Chrome and halts all the Javascript. I simply don't find what is wrong. Could you be kind enough to let me know? Cookies were tested and work fine. Using Jquery. Thanks!</p> <pre><code>function RememberMe(addr, bycookie = false) { // Cookie name cookiename = "LBETS"; // Should we reset? reset = false; changed = false; // See if button pressed if($(".star_"+ addr).hasClass("active")) { $('#recent_tx').addClass("table-striped"); $(".star_"+ addr).removeClass("active"); reset = true; } else { $(".favstar").removeClass("active"); } // Iterate rows $('#recent_tx tr').each(function(){ if($(this).hasClass(addr)) { if(reset) { $(this).removeClass('warning'); } else { $(this).addClass('warning'); changed = true; } } else { $(this).removeClass('warning'); } }) // Change class if(changed) { $('#recent_tx').removeClass("table-striped"); $(".star_"+ addr).addClass("active"); setCookie(cookiename, addr, 20*365); } // Reset if(reset) { delCookie(cookiename); } } </code></pre>
javascript jquery
[3, 5]
4,450,169
4,450,170
insert text between 2 controls
<p>I want insert ":" between 2 dropdownlist in a cell.</p> <pre><code>tableCell.Controls.Add(DropDownListOraInizio); tableCell.Controls.Add(DropDownListMinutoInizio); </code></pre> <p>How can i do?</p> <p>thanks</p>
c# asp.net
[0, 9]
137,345
137,346
Call string attribute from asp.net in a <div> tag
<p>It might be a simple question but I am confused. I would like to call a particular string attribute in codebehind from a <code>&lt;div&gt;</code> in markup. </p> <p>How am I able to do this?</p>
c# asp.net
[0, 9]
2,429,017
2,429,018
Sending JavaScript code from c# windows application to a running instance of IE does not work?
<p>I'm working on a project in which I need to send a JavaScript function from c# windows application to a running instance of internet explorer and then the IE run the script and return the result to my c# application. (Very confusing? =) )</p> <p>Just to make it more clear, here is the case:</p> <p>I get the <code>IHTMLDocument2</code> of the running instance of internet explorer like this:</p> <pre><code> htmlDocument = ObjectFromLresult(lResult,typeof(IHTMLDocument).GUID, IntPtr.Zero) as IHTMLDocument2; </code></pre> <p>Then I want to send a JavaScript function to the IE instance, the code can be something like this:</p> <pre><code>string code = "function myTest() { alert('ready'); } myTest();"; </code></pre> <p>I use the following code to send the JavaScript code:</p> <pre><code>htmlDocument.Script.GetType().InvokeMember("eval", System.Reflection.BindingFlags.InvokeMethod, null, htmlDocument.Script, new object[] { code }); </code></pre> <p><strong>now here is the question:</strong></p> <p>Sending the above simple JavaScript code to IE works fine, but if I want to send codes that work with events (like <code>onmouseover</code>, <code>onmouseclick</code> ,etc), it does not work and results in the following exception:</p> <p><em>TargetInvocationException was unhandled. Exception has been thrown by the target of an invocation.</em></p> <p>Q: how I can send JavaScript codes that use events like :</p> <pre><code>document.body.onmouseover = function(mEvent){...}; </code></pre> <p><strong>note:</strong> It's not ASP.net or web application, It's desktop application.</p> <p>I always appreciated the knowledge and great ideas of you. Thanks in advance. :)</p>
c# javascript
[0, 3]
2,192,094
2,192,095
JSoup works in an Android Activity, but not as an object in the Activity
<p>I have created an Android app that I would like to supply with some info scraped from a page. I used JSoup, and was succesfully able to scrape all of the HTML, and place them into the proper data structures in a console project, with a single class name Scraper.java.</p> <p>My next step was to port this Scraper.java into my Android app. To do this I simply wanted to make a Scraper object in my activity that I need the html info for. This didn't seem to work, and I was getting an error that seems as if it was trying to tell me that Android didn't like this external class trying to connect to the internet.</p> <p>Giving up I very dirtily dumped all of the code from Scraper.java into my Activity class and got it to scrape the data fine, and it connected without any issue.</p> <p>The problem now is that I realize I want to access that complex data in other Activities, and it really would be much simpler for me to just go back to trying to have an external Scraper.java file so I can share an object of it rather than all of the data types inside of it.</p> <p>So my question is, what do I need to do to let Android know that it doesn't need to freak out, and can let my external Scraper.java file connect.</p> <p>I have allowed the permission for internet in the manifest so I am lost as for what to do from here.</p>
java android
[1, 4]
4,320,072
4,320,073
Errors of other java package
<p>Android,</p> <p>Will you do favor to me? have these following questions. These errors are not coming in Mainactivity.java but these errors are coming in other java(Not an activity) package And everything are imported.</p> <p>1.I want to split a sentence by space. </p> <pre><code> messages = message.split(" "); </code></pre> <p><br/> 2. trim() funcion is not working.</p> <pre><code> messages[0].trim(); </code></pre> <p><br/> 3."AlertDialog.Builder(this)" is underlined red color.</p> <pre><code> final AlertDialog.Builder alert = new AlertDialog.Builder(this); </code></pre> <p><br/> 4.Cant resolve "getApplicationContext()"</p> <pre><code> Toast.makeText(getApplicationContext(), "You have abourted SMS &amp; FMS will not reply automatically", Toast.LENGTH_LONG).show(); </code></pre> <p><br/> 5."NOTIFICATION_SERVICE" &amp; "new Intent(this, fmsActivity.class" are underlined in red color</p> <pre><code> NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Intent notificationIntent = new Intent(this, fmsActivity.class); </code></pre> <p>Thanks in advance..:)</p>
java android
[1, 4]
3,866,818
3,866,819
Problems with jquery selector
<p>I have a trouble with selecting element attributes with jquery here is my HTML:</p> <pre><code>&lt;a class="myselector" rel="I need this value"&gt;&lt;/a&gt; &lt;div class="someClass" id="someID"&gt; ...bunch of elements/content &lt;input type="button" name="myInput" id="inputID" title="myInput Title" /&gt; ...bunch of elements/content &lt;/div&gt; </code></pre> <p>...bunch of elements/content</p> <p>Here I'm trying to get the rel value of myselector here is how I tried but its not working :</p> <pre><code>$('#inputID').live('click',function(){ console.log($(this).closest('a.myselector').attr('rel')); }); </code></pre> <p>Also tried this since all is wrapped in wrapper div :</p> <pre><code>$('#inputID').live('click',function(){ console.log($(this).parent('div.wrapper').find('a.myselector').attr('rel')); }); </code></pre> <p>I get <code>undefined</code> value in firebug in both cases, I use live because <code>div#someID</code> is loaded in the document its not there when page first loads. Any advice, how can I get my selector rel value?</p> <p><strong>EDIT:</strong></p> <p>However when I look for <code>('a.myselector')</code> without rel attribute, I alert <code>Object object</code> and get console.log something <code>[]</code></p>
javascript jquery
[3, 5]
113,279
113,280
Formatting numbers like 10000 as 10k
<p>I have a 5-digit number, like <code>10000</code>, and I want to display it as <code>10k</code>, as I'll eventually have 6 digits (I'm talking about Twitter counts, actually). I suppose I have to substring, but I'm not that used to JavaScript just yet.</p> <p>Here's just about what I'm trying to use. It basically gets the count of the followers by JSON.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $.ajax({ url: 'http://api.twitter.com/1/users/show.json', data: { screen_name: 'lolsomuchcom' }, dataType: 'jsonp', success: function(data) { $('#followers').html(data.followers_count); } }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,045,429
4,045,430
Multiple Android IntentService at one time?
<p>I am using IntentService to grab data in the background for my application. Now I have three services that all pull data from different sources. I launch all of these services at once but it seems that they wont run concurrently. The first service starts and the next service doesn't seem to start until the first one is complete. How can I have three different IntentService classes running at the same time?</p>
java android
[1, 4]
538,375
538,376
Javascript Konami Code, FadeIn/FadeOut Div
<p>Any JavaScript pros out there? I've got a div that I've managed to fade in after entering the konami code, and a button that you can click to fade out the div, but I have to refresh in order to re-enter the konami code. I want to be able to continually enter in the konami code without having to refresh the page. Ideally, I'd like to remove the button, but I can't seem to get things to work just using if statements. </p> <p>Here's what I have so far:</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type= "text/javascript"&gt; var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65,13"; $(document).keydown(function(e) { kkeys.push( e.keyCode ); if ( kkeys.toString().indexOf( konami ) &gt;= 0 ) { $(document).unbind('keydown',arguments.callee); $(document).ready(function() { $(".konami").fadeIn(1000); }); } }); &lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".btn1").click(function(){ $(".konami2").fadeOut(1000); }); }); &lt;/script&gt; &lt;div class ="konami" style="display: none"&gt; &lt;p class ="konami2"&gt; Hello! Type "bye" to remove! &lt;/p&gt; &lt;button class="btn1"&gt;Fade out&lt;/button&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,500,521
3,500,522
Android - New language font
<p>I need to support malayalam(South Indian language) font for my application. </p> <p>I found a way of changing the typeface of a textView/edittext, but it is working only for default supported languages. For malayalam, it is showing square boxes. Is there a way to do that without rooting. Please refer myalpha multiling keyboard apps. Please help.</p>
java android
[1, 4]
5,271,262
5,271,263
Could Not Write File on FTP server using FTPClient in Java
<p>I am reading files on a FTP server and writing that data into another file. But after properly reading the data I couldn't write the file on to the FTP server.</p> <p>I can retrieve files using "retrieve file", but can not store file using the <code>storefile</code> function.</p> <p>My code is:</p> <pre><code>import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; public class FtpDemo { public static void main(String args[]){ FTPClient client=new FTPClient(); try { if(client.isConnected()){ client.disconnect(); Boolean isLog=client.logout(); System.out.println(isLog); } client.connect("server"); Boolean isLogin=client.login("user","password"); if(isLogin){ System.out.println("Login has been successfully"); FTPFile[] files=client.listFiles(); System.out.println("Login has been successfully"+files.length); for(int i=0;i&lt;files.length;i++){ if(files[i].getName().equals("rajesh.txt")){ System.out.println("match has been successfully"); InputStream is=client.retrieveFileStream("/rajesh.txt"); BufferedReader br=new BufferedReader(new InputStreamReader(is)); String str; String content=""; str=br.readLine(); while(str!=null){ content+=str; str=br.readLine(); } System.out.println(content); Boolean isStore=client.storeFile("/rajesh.txt",is); System.out.println(isStore); } } } } catch(Exception e){ System.out.println(e.getMessage()); } } } </code></pre>
java android
[1, 4]
5,361,627
5,361,628
Jquery closing in click
<p>im having a problem in a script that i download it in the web, basically what i need is a FAQ question whit the collapse panel interaction, but in this case different in the other out there i want when i click in one question it opens, and when i click in another question the question before closes and open the one i clicked.</p> <p>I found this <a href="http://feloliveira.com.br/blog/faq-de-perguntas-e-respostas-com-jquery/" rel="nofollow">Collapse panel script</a></p> <p>It works well, but is missing one detail, if i click in the same link (question), the question doesn´t collapse back to normal normal mode, its only possible to close him chosing another link. I want to be able to close the question when i chose another question and when i click the same question again.</p> <p>the javascript code in the main page:</p> <pre><code>&lt;script type="text/javascript"&gt; &lt;!– $(function() { var $h2; var $answer; $(‘.answer’).hide(); $(‘#faq h2′).bind( ‘click’, function() { if ($h2 &amp;&amp; $h2[0] != this) { $answer.slideUp(); $h2.removeClass(‘open’); } $h2 = $(this); $answer = $h2.next(); $answer.slideDown(); $h2.addClass(‘open’); } ) }); –&gt; &lt;/script&gt; </code></pre> <p>Hope for some help</p>
javascript jquery
[3, 5]
4,209,058
4,209,059
Stop animation on last element
<p>I have a sliding panel and on the last element I want the animation to stop i've tried using the .is(':last') and it doesn't stop. here is my code. the current var is set to the first element when the form loads. It animates to the left and keeps animating when you click the next button i just want to stop it on the last element</p> <pre><code>jQuery('.wikiform .navigation input[name^=Next]').click(function () { if (current.is(':last')) return; jQuery('.wikiform .wizard').animate({ marginLeft: '-=' + current.width() + "px" }, 750); current = current.next();}); &lt;div id="formView1" class="wikiform"&gt; &lt;div class="wizard"&gt; &lt;div id="view1" class="view"&gt; &lt;div class="form"&gt; Content 1 &lt;/div&gt; &lt;/div&gt; &lt;div id="view2" class="view"&gt; &lt;div class="form"&gt; Content 2 &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="navigation"&gt; &lt;input type="button" name="Back" value=" Back " /&gt; &lt;input type="button" name="Next " class="Next" value=" Next " /&gt; &lt;input type="button" name="Cancel" value="Cancel" /&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,959,385
1,959,386
textarea to output p - max length or height
<p>I have a <code>textarea</code> text box and a viewable <code>p</code> area which displays the input. <br /> I am trying to control the the amount of text input based on <code>p</code> height or <code>textarea</code> max string length. <br /> There are 2 issues im facing:<br /><br /></p> <p>1) Once <code>p</code> goes beyond max height or <code>textarea</code> gets max length, <code>textarea</code> should stop accepting input.<br /><br /> 2) After the max from above happens, pressing backspace or delete in <code>textarea</code> does not change <code>p</code>.<br /><br /> <a href="http://jsfiddle.net/nalagg/sPeas/9/" rel="nofollow">here is my fiddle </a></p> <p><strong>edit</strong>: <a href="http://stackoverflow.com/questions/10414420/how-to-prevent-user-to-enter-text-in-textarea-after-reaching-max-character-limit">this helps</a> with part 1 but had to use <code>keydown</code> (textarea stops accepting input), but then hitting backspace still does not reflect on <code>p</code></p> <pre><code> if (this.value.length == max || height&gt;50) { e.preventDefault(); } else if (this.value.length &gt; max) { // Maximum exceeded this.value = this.value.substring(0, max); }else{ recField.html(this.value); height = recField.height() $('.temp').text(height); } </code></pre> <p><strong>after more tests</strong>, <code>keydown</code> has issues, <code>p</code> does not reflect input from <code>textarea</code> like <code>keyup</code> does.<br /> : ( <br />back to square 1</p>
javascript jquery
[3, 5]
5,612,038
5,612,039
jquery- how to obtain the text shown on screen in a radio button/check box/list/drop down
<p>I am working to parse a form and obtain the values of all elements, including the text boxes, radio buttons, check boxes, list boxes and drop down boxes.</p> <p>I am currently able to obtain the values for all of the above... By values I mean the value as assigned to that element (eg radio button)... However in some cases the text shown on screen for a value (in a radio/check box/drop down/list) is different from the text actually assigned to that value (when the form is submitted).</p> <p>For your reference, I am using code similar to the following for obtaining all the 'options' of a list/drop down text box-</p> <pre><code> if($(this).is('select')) { $(this).find('option').each(function(){ alert( " Option value=" + $(this).val() ); }); } </code></pre> <p>For check box/radio button I am using val() which obtains all the assigned values.</p> <p>Code that does this is given below--</p> <pre><code> textmsg= textmsg + "...Also, for this element, the value is " + $(this).val() + " and type =" + $(this).attr('type'); alert (textmsg); </code></pre> <p>How do I obtain the text value shown on screen (for radio buttons/check boxes/lists /drop down boxes)??</p>
javascript jquery
[3, 5]
2,257,260
2,257,261
How to convert string into float value in android
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4229710/string-from-edittext-to-float">String from EditText to float</a> </p> </blockquote> <p>In application I want to convert the entered string in edit box to the corresponding value like <code>233243664376347845.89</code> to corresponding float value. But it returns like IE10 after some number for example <code>23324366IE10</code> Please help me. My code is -</p> <pre><code>NumberFormat format = NumberFormat.getInstance(Locale.US); try { number = format.parse(e1.getText().toString()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>The edit text length is greater then 20 digits,also i want to minus two edit text float values...</p>
java android
[1, 4]
5,397,905
5,397,906
Manual sort objects with anonymous type?
<p>I have the following code:</p> <pre><code>var categories = catList.Select(c =&gt; new { Title = c.Web.Title, Byline = c[Constants.FieldNames.Byline], Url = c[SPBuiltInFieldId.FileRef] }); </code></pre> <p>I will always have maximum three items but could be less. The Title will always be either (simplified) america, europe or africa</p> <p>What I need to do is to sort them but not alphabetically before I add databind them to a repeater</p> <p>The order I need to display them in is</p> <pre><code>europe africa america </code></pre> <p>How can I achieve this?</p> <p>thanks in advance.</p>
c# asp.net
[0, 9]
644,679
644,680
onchange event - IE error
<p>In my code behind, I have - </p> <pre><code>tbWhatIfBeginDate.Attributes.Add("onchange", "checkDates(" + tbWhatIfBeginDate.ClientID + ", " + tbWhatIfEndDate.ClientID + ")"); tbWhatIfEndDate.Attributes.Add("onchange", "checkDates(" + tbWhatIfBeginDate.ClientID + ", " + tbWhatIfEndDate.ClientID + ")"); </code></pre> <p>and here is my javascript function - </p> <pre><code>function checkDates(BeginDateId, EndDateId) { if (BeginDateId.value &gt; EndDateId.value) { var beginDt = new Date(BeginDateId.value); var endDt = new Date(EndDateId.value); var newDt = new Date(endDt.getTime() - (24 * 60 * 60 * 1000)); var y = newDt.getFullYear(), m = newDt.getMonth() + 1, // january is month 0 in javascript d = newDt.getDate(); BeginDateId.value = [pad(m), pad(d), y].join("/"); } } </code></pre> <p>when I run through Visual Studio 2010, it works.</p> <p>When I deploy to my test server, I get an error message. "Object expected - Line:176,Char:1"</p> <p>line 176 is - input name="ctl00$cpMain$tbWhatIfBeginDate" type="text" value="8/1/2012" id="ctl00_cpMain_tbWhatIfBeginDate" onchange="checkDates (ctl00_cpMain_tbWhatIfBeginDate, ctl00_cpMain_tbWhatIfEndDate)" style="width:70px;"</p> <p>I don't see an error.</p> <p>Ideas?</p>
c# javascript
[0, 3]
3,853,346
3,853,347
RadioButton value to be changed everytime a linkbutton is clicked
<p>I have 5 radio buttons and a link in my page. Everytime when the linkbutton is clicked, i want my radiobutton to be changed to other. I mean, when a link is clicked, radiobutton check has to move onto rd2 from rd1. Is that possible.</p> <p>Below is my piece of code for link button and radiobutons.</p> <pre><code>protected void lnkAddLoc_Click(object sender, EventArgs e) { } </code></pre> <p><br></p> <pre><code>&lt;asp:RadioButton ID="rdoLoc1" runat="server" Text="None" TextAlign="left" GroupName="rdoLocation" Checked="true" Width="68px" OnCheckedChanged="rdoLoc1_CheckedChanged" Visible = "true"/&gt; &lt;asp:RadioButton ID="rdoLoc2" runat="server" Text="1" TextAlign="Left" GroupName="rdoLocation" OnCheckedChanged="rdoLoc2_CheckedChanged" Width="68px" Visible = "true" /&gt; &lt;asp:RadioButton ID="rdoLoc3" runat="server" Text="2" TextAlign="Left" GroupName="rdoLocation" Width="68px" Visible = "true" /&gt; &lt;asp:RadioButton ID="rdoLoc4" runat="server" Text="3" TextAlign="Left" GroupName="rdoLocation" Width="66px" Visible = "true"/&gt; &lt;asp:RadioButton ID="rdoLoc5" runat="server" Text="4" TextAlign="Left" GroupName="rdoLocation" Width="62px" Visible = "true"/&gt; </code></pre>
c# asp.net
[0, 9]
5,719,097
5,719,098
call the input element through the value instead of id or name of the element in javascript method
<p>i want to disable the textarea onclick of value=1 and enable it back by clicking of radio button value=0. however i have a condition that i have to use the same name and id for both the radio buttons.i have the existing code something like this ..is there is any possibilty that i can call the radio button through their values in js method.</p> <p>HTML:</p> <pre><code>&lt;input type="radio" name="disabilityflag" id="disabilityflag" value="0"/&gt; &lt;span&gt;Yes&lt;/span&gt; &lt;input type="radio" name="disabilityflag" id="disabilityflag" value="1"/&gt; &lt;span&gt;No&lt;/span&gt; &lt;textarea type="text" name="disabilityspecification" id="disabilityspecification"&gt; &lt;/textarea&gt; </code></pre> <p>Javascript:</p> <pre><code>$('#disabilityflag').click(function(){ checkeddisabilityclick(); }); function checkeddisabilityclick(){ $('#disabilityspecification').attr("disabled",true); $('#disabilityspecification').addClass('disabled'); } $('#disabilityflag').click(function(){ $('#disabilityspecification').removeAttr("disabled"); $('#disabilityspecification').removeClass('disabled'); }); if($('#disabilityflag').attr('checked')) { checkeddisabilityclick(); } </code></pre>
javascript jquery
[3, 5]
772,116
772,117
Use jQuery to select a specific element with arbitrary data
<p>Hi I'm new to jQuery and I am trying to figure out how I can select a particular element with class <code>organizer_listing_checkbox_container</code> and whose parent <code>.organizer_listing</code> has arbitrary data <code>data-listing_id=1234</code>. There are many elements with class <code>organizer_listing_checkbox_container</code> but the <code>data-listing_id</code> is unique.</p> <p>I want to select that particular element and do a <code>.addClass()</code>.</p> <p><strong>HTML</strong></p> <pre><code>&lt;div id="organizer_listings_container"&gt; &lt;div class="organizer_listing" data-listing_id=1234&gt; &lt;div class="organizer_listing_checkbox_container_container unselectable"&gt; &lt;div class="organizer_listing_checkbox_container"&gt; &lt;input type="checkbox" class="organizer_listing_checkbox" /&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
2,557,514
2,557,515
The use of "?" and ":"
<p>I've read through a lot of code where they have if statements, i've noticed other languages use this to. Asp being one. Tried googling but couldn't find a answer for it.</p> <p>What exactly does <code>?:</code> stand for and when to use it.</p> <p>As far as I'm aware <code>?</code> is equal to <code>if()</code> and <code>:</code> being equal to <code>}else{</code>.</p>
php javascript asp.net
[2, 3, 9]
3,489,913
3,489,914
IE8 javascript debugger
<p>Is it possible using IE8 javascript debugger from ie8 dev tools to debug javascript on a page that runs locally from within VS2008 or you would have to run the page on a server against iis? Currently I am getting an error "Unable to attach to process" if I try to debug javascript on a local page. </p>
javascript asp.net
[3, 9]
1,192,399
1,192,400
any libraries which can help to convert excel, word, pdf, to image format?
<p>any libraries which can help to convert excel, word, pdf, to image format ?<br> Please point me to the right direction, thanks in advance ! </p>
c# java
[0, 1]
5,540,991
5,540,992
Back navigation with pushstate and load in jQuery
<p>I'm currently using jQuery to dynamically load content into a holder div and then updating the url with pushstate.</p> <p>I have the following code so far (some excluded for example simplicity):</p> <pre><code>$("body").on("click", "a:not(.noclick)", function(){ history.pushState({path: $(this).attr("href")}, "", $(this).attr("href")); $("#main").load($(this).attr("href")); return false }); </code></pre> <p>It works as expected and the url changes to what it should be on new content load but the back button is currently unfunctional, when back is pressed the url changes to the previous but nothing else happens.</p> <p>I have pages built in a way that you can either use the site with jQuery to load content without headers or without any javascript and pages display from their urls so there's no issue in that part.</p> <p>Is there a way I could use load on back navigation to load the last pushstate history? I'd prefer to not use hashing but not sure if it's possible without?</p> <p>Facebook seems to do this with their navigation if that helps?</p>
javascript jquery
[3, 5]
2,438,400
2,438,401
ajax success response load to divs
<p>I have three forms and using this jquery function</p> <pre><code>$('form').submit(function() { $.ajax({ type: $(this).attr('method'), url: $(this).attr('action'), data: $(this).serialize(), success: function(response) { $('#setInfo').fadeOut('500').empty().fadeIn('500').append(response); } }); return false; }); </code></pre> <p>to submit the form datas, but with this function i am stuck at loading the response at one particular div.</p> <p>The data i send always have <strong>action=email</strong>, <strong>action=settings</strong>, etc depending on the form.</p> <p>So how i can use it to load the response of settings in another div and email in another div and all other default in current div.</p> <p>Thank You.</p>
javascript jquery
[3, 5]
3,331,015
3,331,016
nanoScroller and IE9
<p>I trying to use the nanoScroller JS script, and it works on Chrome and Firefox except in IE9. I don't know the problem, 'cause I've made a test in a teste page and it works, but in my project it doesn't work. Here it goes the script:</p> <pre><code>$(".lista-noticia").click(function () { $(".noticia-completa:visible").hide("slow"); if ($(this).closest("li").find(".noticia-completa").is(':visible')) { $(".noticia-completa").hide("slow"); $(".lista-noticia").removeClass("ativo"); } else { $(this).closest("li").toggleClass("ativo").find(".noticia-completa").slideToggle(1200, function(){ $(this).nanoScroller(); }); $(".lista-noticia").not(this).removeClass("ativo"); } }); </code></pre> <p>and the HTML</p> <pre><code>&lt;div class="noticia-completa nano"&gt; &lt;div class="content"&gt; &lt;p&gt;Lorem ipsum dolor sit amet.....&lt;/p&gt; &lt;img src="images/index/foto-noticia.png" alt="Imagem Noticia"&gt; &lt;p&gt;Donec non egestas magna....&lt;/p&gt; &lt;p&gt;Donec non egestas magna....&lt;/p&gt; &lt;p&gt;Donec non egestas magna....&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,463,202
1,463,203
Submit method by enter key?
<p>I'd like to submit a method when the user hits the ENTER key inside a editText field.</p> <pre><code>&lt;EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:imeOptions="actionDone" android:singleLine="true" /&gt; </code></pre> <p>Atm this results in going to the next UI element on screen if the user hits done. But i'd like to fake-submit a button?</p>
java android
[1, 4]
5,541,139
5,541,140
ForeColor with codes color
<p>I have created dynamically <code>HyperLink</code>. And I want to change the color by adding a color code.</p> <pre><code>HyperLink hpl = new HyperLink(); hpl.Text = "SomeText"; hpl.ForeColor = "#5BB1E6"; //Cannot implicitly convert type 'string' to 'System.Drawing.Color </code></pre> <p>But I can't. </p> <p>How to add codes color to <code>ForeColor</code> ?</p> <p>Is it possible?</p>
c# asp.net
[0, 9]
4,462,442
4,462,443
Limitations of string variable
<p>I have a Base64 jpeg image string which is a simple signature image. I can store the string in SQL Server and retreive it, but when I try to pass it to a method or save in a Session variable I get null value. Is there a limit to the string you can pass to a method or save in a session var?</p> <p>Here is the code; </p> <p>I get the string from db,</p> <pre><code> string VSignature = ds.Tables[0].Rows[0]["SignatureB64"]; // VSignature gets valued ok // then passed to a class with method to handle image, Write.GetPageOneReadyToBeAltered(f_older + "\\FDD.PDF", f_older + @"\N.PDF", CertID, VSignature); </code></pre> <p>//here VSignature is null</p> <pre><code> public static void GetPageOneReadyToBeAltered(string PageNReader, string PageNStamper, string CertificateNo, string VSignature) { // prepare page one's copy to be altered by user PdfReader pdfreader = new PdfReader(PageNReader); PdfStamper pdfStamper = new PdfStamper(pdfreader, new FileStream(PageNStamper, FileMode.Create)); /* some pdf stuff done here, irrelevant */ var pdfContentByte = pdfStamper.GetOverContent(1); byte[] bytSig1 = Convert.FromBase64String(VSignature); MemoryStream msSig1 = new MemoryStream(bytSig1); iTextSharp.text.Image sig1 = iTextSharp.text.Image.GetInstance(msSig1); sig1.SetAbsolutePosition(23, 76); sig1.ScaleToFit(60f, 60f); pdfContentByte.AddImage(sig1); } </code></pre> <p>thanks</p>
c# asp.net
[0, 9]
1,128,509
1,128,510
toggle- hide item when click outside of the div
<p>I am using jquery's slidetoggle, want to learn how to make the <code>showup</code> class hide when click anywhere outside of the DIV. thanks!</p> <p>Online SAMPLE: <a href="http://jsfiddle.net/evGd6/" rel="nofollow">http://jsfiddle.net/evGd6/</a></p> <pre><code>&lt;div class="click"&gt;click me&lt;/div&gt; &lt;div class="showup"&gt;something I want to show&lt;/div&gt;​ </code></pre> <pre><code>$(document).ready(function(){ $('.click').click(function(){ $(".showup").slideToggle("fast"); }); });​ </code></pre> <pre><code>.showup { width: 100px; height: 100px; background: red; display:none; } .click { cursor: pointer; } ​ </code></pre>
javascript jquery
[3, 5]
224,348
224,349
Is there a list like operator in javascript?
<p>I'm now implement such a task:I need to convert PHP variables to javascript</p> <pre><code>$arr['name1'] = 'value1'; $arr['name2'] = 'value2'; </code></pre> <p>so that after processing,should be:</p> <pre><code>&lt;script type="text/javascript"&gt; var name1 = 'value1'; var name2 = 'value2'; ... </code></pre> <p>I hoped to do it this way:</p> <pre><code>&lt;script&gt; list(&lt;?php echo join(',',array_keys($arr)?&gt;) = &lt;?php echo json_encode(array_values($arr));?&gt; </code></pre>
php javascript
[2, 3]
5,603,495
5,603,496
Adding google account to my website in asp.net using c#
<p>i have a job portal website project in that i need to signup user by using his google account .. so that i can retrieve his/her account details like firstname,lastname,emailid, mobile number etc .. similarly to yahoo also in asp.net using c# with sql server 2008</p>
c# asp.net
[0, 9]
1,836,070
1,836,071
Using Java as a backend and PHP as a front end
<p>There are already a few posts on SO discussion whether this architecture is a good idea or bad idea. For many reasons within our company including the existing programming talent, we've decided to use Java for the backend and PHP for the front end. Our objective is something like...</p> <p>Java - Models/Controllers</p> <p>PHP - Views</p> <p>We're working on building a prototype of the interaction between Glassfish and Apache. One thing we're still working on is when a user visits <a href="http://domain.com/login.html">http://domain.com/login.html</a> and they login, that login will be sent to the Glassfish controller which exists somewhere like <code>/login.java</code>. We can do that no problem, the trouble is getting the view to be rendered at that URL.</p> <p>Has anyone does this with PHP or any other technologies?</p>
java php
[1, 2]
2,399,927
2,399,928
Can i use Response.Write() in try block of a aspx Page in ASP.NET
<pre><code>try { Response.Write("&lt;script language='javascript' type='text/javascript'&gt;"); Response.Write("window.opener.parent.SetDocumentValues(); Response.Write("self.close();"); Response.Write("&lt;/script&gt;"); } catch (System.Web.Services.Protocols.SoapException ex) { throw ex; } </code></pre>
c# asp.net
[0, 9]
2,936,243
2,936,244
How to call a function in jquery?
<p>I wanted to my code a bit cleaner so I wanted to put a very long function in it's own method.</p> <p>Right now I have</p> <pre><code>$('#Id').submit(function() { // lots of code here }); </code></pre> <p>now I wanted to break it up like</p> <pre><code> $('#Id').submit(MyFunction); function MyFunction() { // code now here. } </code></pre> <p>but I need to pass in some parms into MyFunction. So I tried</p> <pre><code>$('#Id').submit(MyFunction(param1, param2)); function MyFunction(param1, param2) { // code now here. } </code></pre> <p>But when I do this nothing works. Firebug shows me some huge ass error about F not being defined or something. So I am not sure what I need to do to make it work.</p>
javascript jquery
[3, 5]
1,080,910
1,080,911
The best way to check is mouse move outside window?
<p>So I have to check 4 sides if I want to limit mouse in window to take action like</p> <pre><code>$(document).on('mousemove',function(e){ if (e.pageX &gt; 10 &amp;&amp; e.pageX&lt;$(window).width-10 &amp;&amp; e.pageY&lt; $(window).height()-10&amp;&amp; e.pageY &gt;10){ //are there any better way? } }); </code></pre>
javascript jquery
[3, 5]
3,140,548
3,140,549
How to disable linkbutton with JavaScript
<p>I am trying to disable a linkbutton but no luck! I tried every possible solution, However I can not limit users click on that link button. End users should not be able to click the link button more than one. One click and that is it! Button must go right away! How can I achieve this? My button is on ModalPopupExtender and it is a <strong>Make Payment</strong> button so image the user click that button more than one makes multiple payments :( please help me!</p> <p>My solutions were similar to this:</p> <pre><code>function returnFalse() { return false; } function disableLinkButton(clientID) { document.getElementById(clientID).disabled = "disabled"; document.getElementById(clientID).onclick = returnFalse; } </code></pre>
javascript asp.net
[3, 9]
5,054,236
5,054,237
JQuery Syntax Problem?
<p>I am using JQuery to insert divs into a page but i cant seem to get the quotation marks correctly setup.</p> <p>For example the code below works fine: </p> <pre><code>var newDiv_1 = '&lt;div id="event_1"&gt;&lt;b&gt;Hello World 01&lt;/b&gt;&lt;/div&gt;'; $('#mon_Events').append(newDiv_1); </code></pre> <p>But when i try to use variable in place of the normal text, i doesnt seem to work:</p> <pre><code>var eventname = 1; var newDiv_1 = '&lt;div id="event_' . eventName . '"&gt;&lt;b&gt;Hello World 01&lt;/b&gt;&lt;/div&gt;'; $('#mon_Events').append(newDiv_1); </code></pre> <p>How do i use variable inside this statement?</p>
javascript jquery
[3, 5]
4,837,506
4,837,507
Reload html element
<p>I have a page which opens another page using window.open and does some work and refreshes whole parent page . Is it possible to refresh content of a div/table on parent page using JQuery/Javascript ?</p> <p>FYI : Here the content of the div is not changing there is an image inside div which is edited by child window which I want to update but that image does not have unique id so I want to refresh whole div . </p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,777,127
2,777,128
Parse url from javascript popup in ASP.net
<p>I am developing web app using ASP.NET and i am also using javascript in the gridview header as TemplateField to open a window like this,</p> <pre><code>&lt;a href="javascript:var popup = window.open('PopUp.aspx?+Value','Popup','width=200,height=200'); </code></pre> <p>What I need to do in the "PopUp.aspx" code behind is to parse "Value" from "PopUp.aspx?+Value" in order for display a text based the value of "Value".</p> <p>How do I get the "Popup.aspx?+Value from the PopUp.aspx?</p> <p>Thanks.</p>
javascript asp.net
[3, 9]
1,356,059
1,356,060
Will this code replace the existing database file with new file or not?
<p>I'm copying my db file to sd car using this methode please tell me if file at sdcard is already existing then whether it will replace or will not copy?</p> <pre><code>public boolean copyDbToSDCard() { boolean success = false; String SDCardPath = Environment.getExternalStorageDirectory() .getAbsolutePath(); final String DBPATH = SDCardPath + "/BD/"; final String DBNAME = "Mydb3.db"; this.getReadableDatabase(); File directory = new File(DBPATH); if (!directory.exists()) directory.mkdir(); close(); try { InputStream mInput = new FileInputStream(DB_PATH + DB_NAME); OutputStream mOutput = new FileOutputStream(DBPATH + DBNAME); byte[] buffer = new byte[1024]; int length; while ((length = mInput.read(buffer)) &gt; 0) { mOutput.write(buffer, 0, length); } mOutput.flush(); mOutput.close(); mInput.close(); success = true; } catch (Exception e) { Toast.makeText(myContext, "copyDbToSDCard Error : " + e.getMessage(), Toast.LENGTH_SHORT).show(); e.fillInStackTrace(); } return success; } </code></pre>
java android
[1, 4]
2,507,398
2,507,399
Why would javascript work embedded in html page, but not in external script?
<p>I am using a simple script, and when the script is embedded into the actual html page it works just fine, but when it is thrown into an external .js the script no longer works, i am not seeing any errors in the console, it is a jquery delegate function, and i know that the external script is working, because there are other scripts in it that are currently working just fine.</p> <p>just wondering if there is a cause to this problem, or if anyone else has encountered this.</p>
javascript jquery
[3, 5]
3,027,208
3,027,209
File upload and delete
<p>I'm trying to upload a file, and have the name of the uploaded file displayed along with a "remove" link to remove the uploaded file (in order to uploaded another one). <a href="http://jsfiddle.net/kTNuB/2/" rel="nofollow">Here</a> is what I've got so far. Everything works fine except that when I remove the uploaded file, and try to upload another one by clicking on "Choose file" button, the same file name pops up. How can I remove the file name from the memory (I guess), so button works like new, and also no file gets sent when the form is submitted WITHOUT the file name, but if the uploaded file ISN'T DELETED, it should be available for submit. Many thanks for your help in advance.</p>
javascript jquery
[3, 5]
3,569,266
3,569,267
Javascript embedded in PHP's echo
<p>I am trying to embed javascript in php's echo. I want to have a button saying "Continue??". If the user presses "Ok" then <code>upload.php</code> should execute. If the user presses "Cancel" then he should get a popup. Could you let me know where's the error in the following code. I see a button saying "Continue" but the <code>onclick</code> event doesn't work.</p> <pre><code>echo "&lt;form name=myform&gt;"; echo "&lt;input type=button value=\"Continue? \""; echo "onClick=\"if(confirm('Sure to continue'))"; echo "&lt;form enctype=\"multipart/form-data\" action=\"upload.php\" method=\"POST\"&gt; &lt;/form&gt;"; echo "else alert('As you wish')\"&gt;"; echo "&lt;/form&gt;"; </code></pre>
php javascript
[2, 3]
478,797
478,798
return values from sql query when ajaxform is applied
<p>I got a </p> <p>$.ajax({</p> <pre><code>type: "get", url: "detail.php", data: "iq="+q, success: function() { $('#Title').text('value',''); } </code></pre> <p>and a sql query select statement. I want to return the value from the sql statement to #Title on the php page.</p> <p>Thanks Jean</p>
php jquery
[2, 5]
4,368,844
4,368,845
Use Javascript to return as a php variable
<p>I'm not sure if this is possible since javascript is client side and php is server side, but what I have is a series of javascript functions that give a real time total to orders in a form. To clarify that, as the user selects items in the form it gives a total. On submission of the form php is submitting the order to the database. What I need to achieve is a way to submit the total (created by javascript) of the order to the database (via php obv). The javascript function that creates the total is:</p> <pre><code>function calculateTotal(){ var Price = getDropPrice() + getverifyPrice() + getmiscPrice(); var divobj = document.getElementById('totalPrice'); divobj.style.display='block'; divobj.innerHTML = "$"+Price; } </code></pre> <p>The html where this is produced is pretty simple:</p> <pre><code>&lt;div id="totalPrice"&gt;&lt;/div&gt; </code></pre> <p>If you need me to post the other <code>functions(getDropPrice, getverifyPrice, getmiscPrice)</code> let me know, but basically drop is a drop down, verify and misc are radio buttons, I'm just adding their totals together to get the order total in the function above. My searches on SO and google have only shown me how to get php variables into javascript not the other way around so I certainly hope this can be done. Thanks!</p>
php javascript
[2, 3]
2,699,612
2,699,613
Need help with a JavaScript function to determine ascending numbers
<p>I have table rows, which have a <em>start</em> number and an <em>end</em> number (input fields).</p> <p>Per row, the end <strong>must</strong> be larger than the start.</p> <p>From inputs left to right, top to bottom the numbers must be larger than the last.</p> <p>So there are 2 inputs per row, and 4 (for example) rows. Each number is bigger than the last.</p> <p>I've been trying to validate this using this function</p> <pre><code> var maxDepth = 0, didValidate = true; // I assume this reads from left to right top to bottom as they are that way in the markup $('.input-start-depth, .input-end-depth').each(function(i) { maxDepth = Math.max(maxDepth, parseFloat($(this).val(), 10)); var isStart = ($(this).hasClass('input-start-depth')); var value = $(this).val(); if (isStart &amp;&amp; value &gt; maxDepth) { didValidate = false; return false; }; lastValue = value; }); </code></pre> <p>I've been racking my head to get this to work. The other important thing is the number of rows is dynamic, there could be 1 or 10,000 or any in between.</p> <p>Basically it is meant to say if the start depth is larger than the max depth so far, it should fail. </p> <p>But it is validating numbers when they shouldn't be valid.</p> <p>What am I doing wrong?</p> <p>Cheers.</p>
javascript jquery
[3, 5]
5,947,263
5,947,264
how to display treeview in php
<p>CAn anyone tell me is it is possible to display the files in computer using a tree view in php? It should be fast enough to display either in jQuery or anyother method that gives speed.</p>
php jquery
[2, 5]
217,521
217,522
Product Class Design
<p>Hi I have a class called product, my problem is that I handle products in various ways, either through a list of products, the product itself and inserting a product into the database. Each handle different properties.</p> <p>For example, displaying the product on a page will consist of name, discription, id, price, brand name, category, image but a list of products would just display just name, thumbnail. Each will have their own methods, for example one would get top 5 products but the other only displays one product.</p> <p>My question is how would go go about creating classes for this, do I create a different classes for each product variation, or create a class consisting of every method and properties thus would consist of a very bulky class.</p> <p>Any help?</p>
c# asp.net
[0, 9]
5,908,237
5,908,238
$('#<%=nameLabel.ClientID%>') does not work when in .js file and works when in script is in the page
<p><code>$('#&lt;%=nameLabel.ClientID%&gt;')</code> is being used in my script for jquery.</p> <p>When this is in ... block in tha page , it works fine ,as its a content page it is evaluated to <code>$('#ctl00_contentPanel1_nameLabel')</code> properly, i can see it while debugging scripts. </p> <p>however , when i keep the same script in .js file it does not evaulate to <code>$('#ctl00_contentPanel1_nameLabel')</code> hence does not work.</p> <p><strong>It is sure that .js script is loaded as i can debug &amp; some other functions also work.</strong> I am using ScriptManagerProxy. </p> <p>Please help ? </p> <p>Thanks in advance.</p>
asp.net jquery
[9, 5]
3,052,801
3,052,802
C# .NET equivalent to PHP time()
<p>I am working with C# .NET and PHP and need some standard way of recording time between the two. I want to use seconds since 1970 = <code>&lt;?php echo time(); ?&gt;</code> because I'm already using some of php's cool functions like: date() &amp; strtotime() in my project. Is there something in .net that is equivalent to PHP time()?</p> <p>Thanks in advance.</p>
c# php
[0, 2]
514,967
514,968
How to clear a Asp.net tree view control in javascript?
<p>How to clear a Tree View control in javascript ? I am looking for something like treeview.nodes.clear();</p>
c# asp.net
[0, 9]
2,962,698
2,962,699
How to send message through net to mobile?
<p>currently we are developing website which send sms alert to user for perticular service but i am not able to set script which will do the same</p> <p>Please somebody tell me what will be solution.... Please tell any script or site for this problem</p> <p>thanks...</p>
php javascript
[2, 3]
3,266,470
3,266,471
Pass this object into event handler
<p>I got the code below how do I pass the current object "this" into the event handler so that I can pass it to the object Foo:</p> <pre><code>btn.setOnClickListener(new View.OnClickListener(this) { public void onClick(View view) { new Foo(this).AlertBox("Hello Lennie!"); } }); </code></pre> <p>Where "this" is: android.app.Activity</p> <p>i get an error that it can't find the constructor:</p>
java android
[1, 4]
4,054,560
4,054,561
How to get number of words on a web page?
<p>I need to get total number of WORDS on a web page. I know about the <code>System.Net.WebClient</code> class. But it's <code>DownloadString()</code> method return the whole HTML markup where as what I need is only the TEXT so that I can figure out the number of words.</p> <p>Any ideas/suggestions welcome.</p>
c# asp.net
[0, 9]
2,875,832
2,875,833
android event after landscape calculation
<p>I enabled onConfigChanges event and properly handling when device turns from portrait into lanscape. However, after onConfigChanges, when page is calculated again and finishes it, which event is fired? Thank you</p>
java android
[1, 4]
5,698,032
5,698,033
No Collapse/Expand icon in TreeView when using ASP.NET and C#
<p>I have a trouble with Expand / Collapse icon in TreeView</p> <p>What I get : <a href="http://i.imgur.com/dl5Lg.jpg" rel="nofollow">http://i.imgur.com/dl5Lg.jpg</a></p> <p>What I did :</p> <p>C# code :</p> <pre><code>public static void TreeLoad(TreeView tree, string @source) { XmlDocument document = new XmlDocument(); //TreeView tree = new TreeView(); try { if (File.Exists(source)) { document.Load(source); tree.Nodes.Clear(); XmlNodeList category = document.SelectNodes("/parent/Categories"); //XmlNodeList links = document.SelectNodes("/parent/Categories/link"); foreach (XmlNode node in category) { TreeNode t1 = new TreeNode(node.Attributes["Name"].Value); tree.Nodes.Add(t1); //t1.ShowCheckBox = true; if (node.HasChildNodes) { //foreach (XmlNode nod in links) foreach (XmlNode nod in node.ChildNodes) { TreeNode t2 = new TreeNode(nod.Attributes["name"].Value); tree.Nodes.Add(t2); } } } //tree.Nodes[0].CollapseAll(); //document.Save(source); } else { messages = NOTFOUND; } } catch (Exception ect) { //exist.InnerText = ect.Message; messages = ect.Message; } finally { // document.Save(source); } //return tree; } URLStorageCtrl.TreeLoad(tree, "example.xml"); </code></pre> <p>ASP.NET code</p> <pre><code>&lt;asp:TreeView ID="tree" runat="server"&gt;&lt;/asp:TreeView&gt; </code></pre> <p>I'm using 4-tier architecture so please do not redirect me to design page, I use only coding.</p>
c# asp.net
[0, 9]
2,792,631
2,792,632
Multiple asp:Repeater DataBind
<p>I am 90% certain I have acheived this before, but I cannot remember how I did it.</p> <p>I have a repeater which I would like to use twice on a page as the structure and databinding events are the same, but the data binding to the repeater is obviously different.</p> <p>In the past I believe I set the datasource on the repeater then databinded, and then did the same again but with another datasource, so effectively:</p> <pre><code>MyRepeater.DataSource = DataSourceOne; MyRepeater.DataBind(); MyRepeater.DataSource = DataSourceTwo; MyRepeater.DataBind(); </code></pre> <p>Now this would have produced the html twice on the page. In this instance two lists, with different data contained inside of them.</p> <p>Thinking about it, it could possibly the <em>type</em> of datasource used. Before it might of been a dataset/table I was binding to the repeater, but this time I am using an ArrayList.</p> <pre><code>ArrayList Items = new ArrayList(); Items = this.GetMenu(this._ProductsPageID); this.rep_ProductsPortfolio.ItemDataBound += new RepeaterItemEventHandler(ProdPortItemDataBound); this.rep_ProductsPortfolio.DataSource = Items; this.rep_ProductsPortfolio.DataBind(); // Get portfolio Items = this.GetMenu(this._PortfolioPageID); this.rep_ProductsPortfolio.ItemDataBound += new RepeaterItemEventHandler(ProdPortItemDataBound); this.rep_ProductsPortfolio.DataSource = Items; this.rep_ProductsPortfolio.DataBind(); </code></pre> <p>I have also tried using a different ArrayList for each repeater, but that didn't work either.</p> <p>At the moment all that happens is the second databind is rebinding over the old repeater and I only have one on the page.</p> <p>Any ideas? Thanks in advance</p>
c# asp.net
[0, 9]
4,892,709
4,892,710
Casting object from Drop Down Into Nullable type
<p>I have the following drop down in my aspx:</p> <pre><code>&lt;aspx:DropDownList ID="ddl1" runat="server"/&gt; </code></pre> <p>In the code-behind (C#), I want to retrieve the value from the DropDownList.</p> <p>I populated my dropdown as such:</p> <pre><code>ddl1.DataSource = LocationOfData; ddl1.DataBind(); </code></pre> <p>LocationOfData returns of type CustomType. EDIT: CustomType is an enum.</p> <p>I want to be able to accomplish the following:</p> <pre><code>CustomType? myvar = ddl1.Text </code></pre> <p>In other words, create a nullable variable using my CustomType and set it equal to the variable from the drop down. But the type that I can only retrieve Text (String) from ddl1.</p>
c# asp.net
[0, 9]
5,251,518
5,251,519
Prior jQuery UI Dialogs become nonresponsive after opening a new Dialog
<p>I'm having issues with multiple jQuery dialogs. The first one opens fine - is resizable, draggable, etc. However, when I open a second the first becomes unresponsive to dragging/moving/closing, even after the second one is closed. What is the reason for this and how can it be fixed? </p> <p>According to the jQuery documentation this should work fine (since stacking is supported).</p>
javascript jquery
[3, 5]
846,090
846,091
javascript doesn't correctly return from the loop
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1900172/jquery-each-method-does-not-return-value">jQuery each method does not return value</a> </p> </blockquote> <p>It seems the return statement does not break the loop and return the function. The following code keeps return false....</p> <pre><code>var __in__ = function(elem, array){ // $.each(array, function(index, item) { array.forEach(function(index, item) { if (item == elem) return true; }); return false; }; console.log(__in__(3,[1,2,3])); </code></pre>
javascript jquery
[3, 5]
5,040,119
5,040,120
How to upload data using POST-query?
<p>I have following problem: I'm developing the application which need to authorize on server and upload data from my mobile into it. The server side is ready and works correctly. So, for authorizing I use the following code:</p> <pre><code>URL url = new URL(VALIDATING_URL); URLConnection connection=url.openConnection(); connection.setDoOutput(true); PrintWriter out=new PrintWriter(connection.getOutputStream()); out.print(POST_QUERY_EMAIL+email); out.print("&amp;"); out.print(POST_QUERY_PASS+password); out.print("&amp;"); out.print(POST_QUERY_CHANNEL+channel); out.close(); Scanner in=new Scanner(connection.getInputStream()); StringBuilder result=new StringBuilder(); while (in.hasNextLine()) { result.append(in.nextLine()); result.append("\n"); } in.close(); </code></pre> <p>It works correctly, and the application will get needed result if I enter correctly data. So, now I need to upload data into server using POST-query, but I don't know how I can do it. Using HTML forms, video is usually uploaded using 'userfile' variable and will be got from $_FILES array in PHP scipts. How can I upload do it from Java? Can I just print data into PrintStream from InputStream?</p> <p>Thank you, I hope you can help me</p>
java android
[1, 4]
2,154,700
2,154,701
Remove all instances of class when button clicked
<p>I'm trying to remove all instances of a given class on the page when a button is clicked. The code works fine on its own, just not from within a click function. The code I have is:</p> <pre><code>$('#myButton').click(function() { $("#wrapper").removeClass("myClass"); }); </code></pre>
javascript jquery
[3, 5]
556,064
556,065
Access javascript document in asp.net code behind
<p>I am trying to access javascript document from ASP.net page code behind. How do I do same thing as below in c# code behind?</p> <pre><code>document.getElementById(id).src = "myurl.com" </code></pre> <p>Thank you for your help.</p>
javascript asp.net
[3, 9]
5,331,876
5,331,877
what's the best way to add a class to the div with a class of post every 4 seconds using jquery?
<p>what's the best way to add a class to the div with a class of post every 4 seconds using jquery?</p> <pre><code>&lt;div class="34 post"&gt; &lt;img width="311" height="417" src="#" class="#" alt="newspapers" /&gt; &lt;h2&gt;&lt;a href="#"&gt;Headline News Part 2&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;testing new content&lt;/p&gt; &lt;/div&gt; &lt;div class="9 post"&gt; &lt;img width="311" height="417" src="#" class="#" alt="newspapers" /&gt; &lt;h2&gt;&lt;a href="#"&gt;Headline News Part 2&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;testing new content&lt;/p&gt; &lt;/div&gt; &lt;div class="6 post"&gt; &lt;img width="311" height="417" src="#" class="#" alt="newspapers" /&gt; &lt;h2&gt;&lt;a href="#"&gt;Headline News Part 2&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;testing new content&lt;/p&gt; &lt;/div&gt; </code></pre> <p>so i want the first to have a class of "display" then after 4 seconds, i want to remove the class on that one and add it to the second one. and then after 4 more seconds, remove it from the second and add it to the third. when it gets to the end it loops back around.</p>
javascript jquery
[3, 5]
4,643,486
4,643,487
simple jquery event handler
<p>having some real problems with jquery at the moment. Basically what I have so far is. The form is submitted once the form is submitted a grey box pop's up with the relevant infomation.</p> <p>What I need to do though is refresh the whole page then allow the grey box to appear.</p> <p>I have the following code</p> <pre><code> $("#ex1Act").submit(function() { //$('#example1').load('index.php', function() $("#example1").gbxShow(); return true; }); </code></pre> <p>the line which is commented out load's the page again after the form is submitted the other code makes the grey box pop-up.</p> <p>Is their a way to say once the:</p> <pre><code>$('#example1').load('index.php', function() </code></pre> <p>has been exucted do this:</p> <pre><code> $("#example1").gbxShow(); </code></pre> <p>hope this makes sense.</p>
javascript jquery
[3, 5]
4,321,425
4,321,426
How to tell which element number i'm clicking on?
<p>I have a table with 6 elements.. How can I know which one in the dom have I clicked on? Meaning.. I want to know that I click on tag #3 as it is the 3rd (or 4th if you count 0) in the dom..</p> <p>I was thinking of just assigning an ID to each tag and that id would contain a number designating which is being clicked.. but there must be a cleaner way...</p> <p>hope this is clear enough - sorry i'm tired.</p>
javascript jquery
[3, 5]
736,848
736,849
Javascript - Want to jump to new div at scroll event
<p>I'm building a one-page site with the content area as large content boxes stacked down the page. </p> <p><a href="http://salondoreen.com/lowercasemenu.html" rel="nofollow">http://salondoreen.com/lowercasemenu.html</a></p> <p>I'm looking for ideas on a way to use javascript to jump to each content box. With a one-page site like this, it takes a lot of scrolling to get to the bottom.</p> <p>My idea is to somehow make this easier. If you are in one box, and you scroll down just a single click, I want the next box to scroll all the way up the page in one jump. That way the content stays easy and readable, and a box will never be half-on half-off the page. Theoretically you could scroll to the bottom of the page in less than ten clicks.</p> <p>Does that make sense? I'm thinking of something similar to the home screen on android phones. It jumps horizontally between screens, no matter how little you swipe. There will only be one box on the page at time.</p> <p>Disclaimer: I am a noob web developer, any and all help is appreciated. Thanks!</p>
javascript jquery
[3, 5]
3,553,321
3,553,322
Custom source handler for Jquery plugin Levitip
<p>I am developing an application using Jquery and the levitip plugin. I need to write a new source handler in jquery.levitip.js this kind of call to levitip to be possible:</p> <pre><code>$("Tag").leviTip({sourceType: 'pertsonalizatua', source: '#Mached_Tag_atribute' , addClass: ''}); </code></pre> <p>I want the levitip to show the element with the same id as <code>$(this).attr(Mached_Tag_atribute)</code></p> <p>I dont know how the handler would look. I am a newbie in jquery. Thank you.</p> <p>The handler I wrote so far is this:</p> <pre><code>$.LeviTip.addSourceHandler({ type: 'pertsonalizatua', prepare: function(levitip) { if ( levitip.settings.hideSourceElement ) { $(levitip.settings.source).hide(); } }, get: function(levitip) { var $e = []; if ( levitip.settings.source ) { $e = $(levitip.target).attr(levitip.settings.source); if ( $e.length ) $e = $e.clone(true).show(); } return $e; } }); </code></pre>
javascript jquery
[3, 5]
1,545,066
1,545,067
ASP.NET vs. PHP
<p>What is the biggest advantage of ASP.NET over the PHP. Why should I switch to ASP.NET?</p> <p>EDIT: I just want to understand the point behind the Joel's example: If ASP.NET is a Lexus, then PHP is a bicycle.</p>
php asp.net
[2, 9]
1,038,604
1,038,605
How to do a GET on a PHP page to get a JSON object?
<p>How do I accomplish the following: User clicks on "Start" button on an HTML page makes a GET to a getnumber.php page, that returns the number 10 in the following form: {count: 10}</p>
php jquery
[2, 5]
1,725,270
1,725,271
Which Language I Should Learn After Python?
<p>I'm 14. I'm currently learning Python Language. Now What Should I Learn After Python ? Here are the options:</p> <ol> <li>C++0x</li> <li>C# or .Net</li> <li>Java or any other like Scala, Groovy, etc.</li> <li>D</li> </ol> <p>Sorry For First Post. Plz Help me this time.</p>
java c++ python
[1, 6, 7]
5,386,587
5,386,588
How to make a sign light up
<p>Apologies if this doesn't qualify as a StackOverflow question.</p> <p>I have a jpg of a sign that's made up of 100 light bulbs. I'd like to use jQuery to animate the bulbs so that they flicker on after a moment's hesitation.</p> <p>I'm thinking that it would require two images and that I would animate hiding/showing them back and forth to produce the flicker, but I wanted to ask if there was a more elegant solution first.</p>
javascript jquery
[3, 5]
3,053,452
3,053,453
Javascript regexp using val().match() method
<p>I'm trying to validate a field named phone_number with this rules:</p> <p>the first digit should be 3 then another 9 digits so in total 10 number example: 3216549874</p> <p>or can be 7 numbers 1234567</p> <p>here i have my code:</p> <pre><code> if (!($("#" + val["htmlId"]).val().match(/^3\d{9}|\d{7}/))) missing = true; </code></pre> <p>Why doesnt work :( when i put that into an online regexp checker shows good.</p>
javascript jquery
[3, 5]
1,944,812
1,944,813
Problem with jquery button click
<p>I am facing a problem in the jquery click event.</p> <p>My web page involves creating a button through javascript and assigning a class to the button ( call it A ). Now I want to detect the click of that button and I have written the following code for it :</p> <pre> $(".A").click( function () { // do something }); </pre> <p>To my surprise, this click event never gets called.</p> <p>But when I make the button statically on the webpage ( during design time ), the same code works.</p> <p>Is there a different approach to bind a button click with jquery in case a button is created dynamically?</p>
javascript jquery
[3, 5]
277,238
277,239
Dynamically creating controls based on variable
<p>First off I'm actually a DBA and not a web developer so... what I write will probably look ugly. I am building a website (they asked me if I'd try /shrug) and I have 168 checkboxes that have the same action when checked. But these actions, though the same, are performed on different controls (related to the checkbox). Instead of having a switch statement with 168 conditions can I do something like the following?</p> <pre><code>CheckBox myCB = (CheckBox)(sender); String mySTR = myCB.ID.ToString(); String myGVstr = “gv” + mySTR.Substring(mySTR.IndexOf(‘cb’) + 1); String myBTNstr = “btn” + mySTR.Substring(mySTR.IndexOf(‘cb’) + 1); GridView myGV = myGVstr; Button myBTN = myBTNstr; // Do what I need to do with these controls ... </code></pre>
c# asp.net
[0, 9]
5,190,101
5,190,102
Where can I find advanced jQuery/JavaScript resources/tutorials?
<p>I'm reading some tutorials now about jQuery.. function creating,plugin creation etc. but these tutorials are missing some basic explanations like they mention things like </p> <p>function prototype, anonymous functions, umm putting (jQuery) after the }); .. and stuff like that .. is there a tutorial/website/book that explain these I'm not sure how to call them "terms" from beginner level to advance. I'm mean I have a knowledge of some jquery syntax but not enough to understand this, can anyone recommend useful resource?</p> <p>Google doesn't help much, I googled "advance features of jquery" don't really get me the things I wanna know.</p> <p><strong>EDIT</strong></p> <p>Also if someone can share his/her <strike>story</strike> steps on how to become comfortable with javascript, how to overcome this "terminology" or whatever is called</p>
javascript jquery
[3, 5]
979,277
979,278
Unable to ping host from app but can otherwise
<p>Here's my code:</p> <pre><code>InetAddress address = InetAddress.getByName("www.whyoceans.com"); if (!address.isReachable(3000)) { Toast.makeText(this, "Unable to ping host", Toast.LENGTH_SHORT).show(); } </code></pre> <p>The isReachable always fails, yet I can open a shell and ping it just fine (from both my PC and my phone):</p> <pre><code>ping www.whyoceans.com PING www.whyoceans.com (69.163.249.123) 56(84) bytes of data. 64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123): icmp_seq=1 ttl=55 time=38.3 ms 64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123): icmp_seq=2 ttl=55 time=40.9 ms ^C --- www.whyoceans.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 38.319/39.654/40.989/1.335 ms </code></pre> <p>Why? </p>
java android
[1, 4]
119,053
119,054
How can you tell if an HTML dropdown is displaying the list of options
<p>Is there a way to determine if a given drop down is currently active and displaying it's list of options?</p> <p>I am currently binding to the mousedown event of the dropdown and populating the options when the user clicks on it. Unfortunately the mousedown event fires when the user selects the option as well.</p> <p>If I can determine if the drop down is already displaying it's options, then I can skip populating the options.</p>
javascript jquery
[3, 5]
4,322,981
4,322,982
Scope of variables inside of javascript
<p>I have the following code sample that im trying to wrap my head around</p> <pre><code> $(document).ready(function () { test("load json", function () { length = 0; // length = 0 $.getJSON("plugins/form.json", function (data) { length = data.fields.length; // length = 4 }); ok(length == 4, "length = " + length.toString()); // length = 0? wtf? }); }); </code></pre> <p>the 'length' variable does not persist when the $.getJSON runs. I cant figure out if its because its asynchronous or because the variable is out of scope.</p>
javascript jquery
[3, 5]
3,473,097
3,473,098
No validation functionality when using System.Net.Mail
<p>It seems that when I configure my email settings in the code behind for a contact page the validation controls no longer work. I have required field validation and regular expression validation to validate email addresses. Validation works on click event before I insert email configurations which requires me to use System.Net.Mail. Here is the code behind:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Net.Mail; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Contact : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { MailMessage mail = new MailMessage(); mail.To.Add("[email protected]"); mail.From = new MailAddress(EmailAddressTextBox.Text); mail.Subject = SubjectTextBox.Text; mail.Body = "email address: " + EmailAddressTextBox.Text + "&lt;br /&gt;" + MessageTextBox.Text; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address smtp.Credentials = new System.Net.NetworkCredential ("[email protected]", "password"); //Or your Smtp Email ID and Password smtp.EnableSsl = true; smtp.Port = 587; smtp.Send(mail); EmailAddressTextBox.Text = String.Empty; SubjectTextBox.Text = String.Empty; MessageTextBox.Text = String.Empty; } } </code></pre>
c# asp.net
[0, 9]
3,121,734
3,121,735
Replace String while enter into textfield in android
<p>While entering String in EditText for example "Love Is Life" , after entering word "Love" enter space , then after if click the letter 'i' it automatically need to change it as Uppercase letter 'I' .</p> <p>Which means the character after every Space of String need be in Uppercase and make the change dynamically while entering character in EditText to stimulate Camel case format.</p> <p>If anyone knows means help me out.</p> <p>Thanks.</p>
java android
[1, 4]