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
2,164,235
2,164,236
How to refresh android GridView
<p>I'm doing GridView activity that first show default image, then i start a new thread for netowrk task to download image from datatbase, and i would like that after the thread is finished, the GridView will automatically refresh the images in grid.</p> <p><a href="http://stackoverflow.com/questions/8053919/how-can-i-dynamically-add-images-to-a-gridview">from this question</a> i took the following code:</p> <pre><code>ImageAdapter adapt = (ImageAdapter)gridView.getAdapter(); adapt.setBitmap(bitmaps); adapt.notifyDataSetChanged(); </code></pre> <p>which update the adapter of the grid. I'm doing this 3 lines inside the onResume() method but after the thread finish i need to call the onResume() method somehow (by pausing the activity or somthing simillar).</p> <p>now if i'm moving to another acitivity (like one of the grid images) and then press the back button i can see the grid view image that i just downloaded from the database. (because it calls onPause() method and then onResume() )</p> <p>Doe's anyone have a solution to this problem?</p> <p>Thanks</p> <p>Edit: The thread is running through AsyncTask</p>
java android
[1, 4]
714,188
714,189
function for each element
<p>Ive got a function:</p> <pre><code>setInterval ( doSomething, 100 ); function doSomething ( ) { $("#i_msl").animate({ top: "-150px",}, 1000 ).delay(1000); $("#i_msl").animate({ top: "-300px",}, 1000 ).delay(1000); $("#i_msl").animate({ top: "0px",}, 1000 ).delay(1000); } </code></pre> <p>but it works only for one element. How can I make it work for all elements with #i_msl on page?</p>
javascript jquery
[3, 5]
4,862,054
4,862,055
Dataview rowfilter has message AgreedToDisclaimer='True' AND Deleted = 'false'
<p>who can explain for me the message <code>"AgreedToDisclaimer='True' AND Deleted = 'false'" of Rowfilter option in Dataview</code>.</p> <pre><code>DataView view = new DataView(set.Tables[0], "AgreedToDisclaimer='True' AND Deleted = 'false'", string.Empty, DataViewRowState.OriginalRows); </code></pre> <p>Thank you so much !</p>
c# asp.net
[0, 9]
3,477,381
3,477,382
Extracting contents from a webpage and comparing using Java
<p>I am developing a Java project in which i have a sub-module where i need to extract contents [text, image, color] from a webpage and compare it with another webpage. I am planning to use WinHTTrack software for downloading the webpage locally, but the problem is it doesn't save it as HTML. How can i download a webpage with HTML extension using softwares such as WinHTTrack [or just saving the webpage through ctrl+s is enogh.?]. Also i am planning to use HTML Parsers to extract the 3 content types[text, image, color],after downloading the webpage locally. So which parser to go with.? </p>
java javascript
[1, 3]
2,789,401
2,789,402
How can I read Directory and its contents
<p>I am having 1 directory and it consists of many folders around 12K + Folders . Each folder consists two Files:</p> <p>1) .ini File </p> <p>2).Xml File .</p> <p>I want to read all file in 1 shot with bulk insert into Sql Server Table . </p> <p>Currently I have finished till :</p> <p>I am able to read particular records from .xml and .ini file and also inserting particular records into sql server .But I want to insert all records in One shot one by one ..</p> <p>how can i Write a code for bulk record insetion from Windows Directory Folders , and also if a new folder is created it should be automatically inserted into Sql server .</p>
c# asp.net
[0, 9]
1,960,504
1,960,505
ASP.NET HtmlInputHidden control - stop name from changing?
<p>I have an asp.net page and I'm trying to add a couple of hidden HTML input controls. I will be submitting this form to another site (PP) so I need the names of the controls to NOT change when rendered. Is there a way to make ASP.NET honor the name property that I set in the code-behind?</p> <p>As an alternate, I don't need to dynamically create these controls, I can also just assign the value to an existing HTML field but I don't know how to do that with ASP.NET/C#</p>
c# asp.net
[0, 9]
1,203,344
1,203,345
How to write this in a simpler less ridiculous way
<p>This just seems absurd to me. Should I use array instead or is there some other better solution?</p> <pre><code>$('.hoursRange').change(function() { if ('0' == $(this).val()) { $(this).val('00'); return false; } if ('1' == $(this).val()) { $(this).val('01'); return false; } if ('2' == $(this).val()) { $(this).val('02'); return false; } if ('3' == $(this).val()) { $(this).val('03'); return false; } if ('4' == $(this).val()) { $(this).val('04'); return false; } if ('5' == $(this).val()) { $(this).val('05'); return false; } if ('6' == $(this).val()) { $(this).val('06'); return false; } if ('7' == $(this).val()) { $(this).val('07'); return false; } }); </code></pre>
javascript jquery
[3, 5]
962,776
962,777
How to Generate TouchEvent?
<p>I Have drawn a set of images(balls) on a SurfaceView. Now am trying to make the image(ball) i touch to disappear. Am having those images in a collection. Am not understanding how to generate touch event on individual image. Can any one provide some help on this?</p> <p>Thank You Yashwanth.B </p>
java android
[1, 4]
415,684
415,685
Disable spacebar
<p>I have created an <strong>image gallery</strong> in php using mysql. It has the capability to <strong>add comments</strong> by user. </p> <p><a href="http://i.stack.imgur.com/kUZpm.png" rel="nofollow">screenshot</a></p> <p>My problem here is that whenever i try <strong>pressing a spacebar</strong> in my message box, it changes the image and im not able to enter more than one word in my message box.</p> <p>Is it because of my code?? Or is it a default behavior?? If so, how can i stop it??</p>
php javascript jquery
[2, 3, 5]
147,872
147,873
creating a plugin return this question
<p>it says in the documentation to allways return the this object in all cases i've seen so far you return this.each() function. So are there anyother cases other than this.each that you would return</p>
javascript jquery
[3, 5]
2,142,663
2,142,664
play mp3 file using jquery
<p>Dear all, How can i play an mp3 file using jquery in website.I m using servlets or http to play a song.Also how can i calculate total time of song played.</p> <p>Regards Angelina</p>
javascript jquery
[3, 5]
5,491,575
5,491,576
SelectedValue is invalid - doesn't exist in list - C#/ASP.NET
<p>Exception is: 'Country' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value</p> <pre><code>UserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, "Country"); Country.DataSource = dsCountry.tblDropDownValues; Country.DataTextField = "AttrValue"; Country.DataValueField = "Id"; Country.DataBind(); </code></pre> <p>The values held within dsCountry.tblDropDownValues are:</p> <pre><code>Id AttrValue AttrName aefa28e0-a118-11dd-ad8b-080c210c9a66 PLEASE SELECT Country 213a743e-ea0b-419c-bd44-03b1c35241b3 USA Country eefa1387-8dc0-11d8-975f-13da67a41a5d CANADA Country </code></pre>
c# asp.net
[0, 9]
3,263,651
3,263,652
How to put a JavaScript timer in a box?
<p>I have this JavaScript code:</p> <pre><code>&lt;script type="text/javascript"&gt; function timeMsg() { var t=setTimeout("doRedirect()",10000); } function doRedirect() { window.location.replace( "http://www.codemeh.com/" ); } timeMsg(); &lt;/script&gt; </code></pre> <p>But I want to show how much time is left in a box that floats at the top right, and with my l;ittle knowledge of JavaScript i have no idea where to start :(</p> <p>Can someone help me?</p>
javascript jquery
[3, 5]
2,650,989
2,650,990
having trouble with the slideUp method in jquery
<p>I am using a show hide slider which works for the slide down but doesn't respond for the slide up, can anyone explain where Im going wrong with this:</p> <pre><code>var moreServicesList = $('#more-services-list').hide(); $('#more-services').on('click', function(e) { var flag = 0; if( flag === 0) { flag = 1; moreServicesList.slideDown('slow'); $(this).html('Hide'); } else { moreServicesList.slideUp('slow'); $(this).html('Show'); flag = 0; } e.preventDefault(); }); </code></pre> <p>Thanks in advance Kyle</p>
javascript jquery
[3, 5]
1,137,237
1,137,238
C# How invoke this Javascript In c#?
<p>I want to invoke this javascript.</p> <pre><code> //&lt;BUTTON id="TestID" class="My_Test button small" type="submit"&gt;&lt;SPAN class="account"&gt;By&lt;/SPAN&gt;&lt;/BUTTON&gt; </code></pre> <p>How can I send this command without use the mouse an click the button on the form??</p> <p>There is alott of invoke examples but I cant figure out how to make this click event trigger by code...</p>
c# javascript
[0, 3]
2,353,284
2,353,285
Loading new version of jQuery without removing all bound to $ functions in async way
<pre><code>(function($){ if(typeof $=='undefined' || $.fn.jquery!='1.6.4') { // Save jQuery var old_jquery=window.jQuery; var head=document.getElementsByTagName('head')[0]; var script=document.createElement('script'); script.type='text/javascript'; // script.async=true; script.src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'; head.appendChild(script); var loaded=false; script.onload=script.onreadystatechange=function(){ if(loaded) { return; } loaded=true; // console.log('old jQuery:',old_jquery,old_jquery.fn.jquery); // Avoid conflicts and previous functions erase $=window.widget$=window.$.noConflict(); window.jQuery=window.$=old_jquery; // console.log('new jquery version:',window.widget$.fn.jquery); self.init(); } } })((typeof jQuery=='undefined') ? undefined : jQuery); </code></pre> <p>Here is sync example of doing it, but how to do it in async way? Is there a way to do some stuff before jQuery will take it's jQuery variable and $ as well? If only it could support some flags, so that it won't overwrite current $ and jQuery if there is a variable set as a flag.</p>
javascript jquery
[3, 5]
618,155
618,156
how to insert output of a javascript command into pdf report created by java application
<p>I am working on a java application, which asks for a url as input, and outputs some analyses on that site url, into a pdf report.</p> <p>I want to add the number of facebook likes for that url/domain, to the pdf report.</p> <p>At the facebook site, I searched and found the following code sample (in javascript) that obtains this data--</p> <p>Javascript code--</p> <pre><code>&lt;h1&gt;Number of likes-&lt;/h1&gt; &lt;fb:like href="http://www.fbrell.com"&gt;&lt;/fb:like&gt; </code></pre> <p>The output looks like this (in a regular web page)--</p> <pre><code>Number of likes- Like 14,296 people like this. Be the first of your friends. </code></pre> <p>Note that for 'Like' an image with Like written on it, is shown.</p> <p>I just want to put the number of people figure for number of likes, to be shown in my pdf report. Currently the java application is a desktop application, but can be converted into java web application with minimal effort. I am using the itext library for creation of pdf.</p> <p>Is there some way to obtain the data as shown above, for output into the report.</p>
java javascript
[1, 3]
3,914,907
3,914,908
Why does IE complain about this js line?
<p>Why does IE complain about this javacript call?</p> <pre><code>$.get("profile_completeness.php?id=&lt;?php echo($user_id); ?&gt;", function(data) { var percentage = data.match(/id="percentage_complete" value="(\d+)"/)[1]; alert(percentage); }) </code></pre> <p>This works fine in Chrome, and FF but IE throws an exception.</p> <p>Here is the error I get:</p> <pre><code>Unable to get value of the property '1': object is null or undefined. </code></pre> <p>If I remove the var percentage line the error is gone.</p> <p>Any ideas why?</p>
javascript jquery
[3, 5]
1,856,588
1,856,589
How to get value of a selected radio button?
<p>I have a <code>&lt;div&gt;</code> with radioboxes:</p> <pre><code>&lt;div id='RB-01'&gt; &lt;span&gt;Item_1&lt;/span&gt;&lt;input type='radio' name='RB01' value='1'&gt;&lt;br /&gt; &lt;span&gt;Item_2&lt;/span&gt;&lt;input type='radio' name='RB01' value='2'&gt;&lt;br /&gt; &lt;span&gt;Item_3&lt;/span&gt;&lt;input type='radio' name='RB01' value='3'&gt;&lt;br /&gt; &lt;/div&gt; </code></pre> <p>Then with <code>jQuery</code> I want to get number on an account a radiobox that was checked:</p> <pre><code>var obj; var tempId = "RB-01"; if ($('div[id=' + tempId + ']')) { $('div[id=' + tempId + '] input').each(function() { ...here I need save in the variable obj the number on an account input that was checked... }); } </code></pre>
javascript jquery
[3, 5]
1,431,173
1,431,174
Integrating ASP.NET app with Rbsworldpay.com
<p>Has anybody worked on integrating an asp.net application with Rbsworldpay.com using the direct model of transaction? Can I get the detailed procedure on how to go about it?</p>
c# asp.net
[0, 9]
2,479,679
2,479,680
How do incoporate some javascript within php to pass data?
<p>I am trying incorporate some javascript within the php below to pass a variable to the next page (checkout.php). It worked initially, but now I am having trouble executing this properly. Any tips?</p> <pre><code> echo '&lt;div class = "row"&gt;&lt;div class = "span 4 offset6"&gt;&lt;select style="width: 130px;" name="shipping" class="span2"&gt; &lt;option value="0"&gt;7-9 days: FREE&lt;/option&gt; &lt;option value="7"&gt;3-5 days: $7&lt;/option&gt; &lt;option value="17"&gt;2 days: $17&lt;/option&gt; &lt;option value="22"&gt;1 day: $22&lt;/option&gt; &lt;/select&gt;&lt;/div&gt;&lt;/div&gt;'; } echo '&lt;script language="javascript"&gt; function test() { var val=document.getElementById("select").value; var hrf="checkout.php?options="+val; document.getElementById("a_link").href=hrf; } &lt;/script&gt; &lt;a href ="#" id="a_link" onclick="test();" class="btn btn-success" type="submit"&gt;&lt;i class="icon-shopping-cart icon-white"&gt;&lt;/i&gt; Add to Cart&lt;/a&gt;'; </code></pre> <p>EDIT: The problem I having is that when I click on the button, it stays on the same page instead of going to checkout.php with the option parameter.</p> <p>Even when I change the first line of the javascipt to: var val=document.getElementByName("shipping").value;<br> The page still stays the same. I'm assuming this is where the issue is but I odn't know how to fix it. </p>
php javascript
[2, 3]
2,773,730
2,773,731
In Android I am Getting BuildConfig.java but not R.java File
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6133186/r-java-missing-in-android-project-in-netbeans">R.java Missing in Android Project in NetBeans</a> </p> </blockquote> <p>In Android I am Getting <code>BuildConfig.java</code> file but it can not generate <code>R.java File</code>. </p> <p>Please Help me this regards. I tried with <code>Android Tool -&gt; fix project properties</code>. but still failed to run.</p> <p>I also tried Clean and build but again failed to generate R.Java.</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,015,355
2,015,356
Cloned content editable div not retaining keydown event
<p>I'm very new to Jquery and looking to solve the reason a keydown event on a content editable div isn't cloning. I thought I had solved things when I discovered clone(true), but no my code still isn't working. The code below is a simplified version of what I'm trying to achieve. </p> <p>Basically I'm attaching a keydown event to a content editable div then cloning it. However the cloned div isn't working like the original div. </p> <p>I've been searching for a solution for a good while now and was hope someone could give me an answer so I can move on - many thanks.</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;untitled&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var mymax1 = 10; $('#List_1').keydown(function(e){ check_charcount(mymax1, e); }); function check_charcount(mymax1, e) { &lt;!--prevent line breaks, that is the enter key from working--&gt; if(e.keyCode==13){ e.preventDefault(); } if(e.which != 8 &amp;&amp; $('#List_1').text().length &gt; mymax1{ $("#List_1").css("background-color","yellow"); e.preventDefault(); } } &lt;!----&gt; var $cloned = $('#hope').clone(true); $('#placeHere').append($cloned.html()); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="hope"&gt; &lt;div id="List_1" contentEditable="true"&gt;TEXT&lt;/div&gt; &lt;/div&gt; &lt;/br&gt; &lt;div id="placeHere"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
1,419,606
1,419,607
what is the same class of StreamConnection(javax.microedition.io.* ) fit for android?
<p>i got a API provided like below: </p> <pre><code> public class HeadsetConnection extends Connection { private StreamConnection conn; private InputStream input; private OutputStream output; public boolean openConnection(String deviceID, int channel) throws IOException { String inURL = "btspp://" + deviceID + ":" + channel; conn = (StreamConnection)Connector.open(inURL); input = conn.openInputStream(); output = conn.openOutputStream(); return true; } } </code></pre> <p>i don't know how to change this J2ME codes fit for Android? </p>
java android
[1, 4]
5,461,749
5,461,750
Jquery Queue Change in HTML?
<p>I have a piece of jquery code:</p> <pre><code> $('#my_span_id').fadeOut(200).html(new_count).fadeIn(600); </code></pre> <p>My expectation is that this code would work as follows: Fade out element in .2 seconds Then change text instantly Then fade in over .6 seconds</p> <p>However it works like this: Change text instantly Fade out in .2 seconds Fade in over .6 seconds</p> <p>Clearly I've misunderstood how chaining works. Any suggestions on how to get this working as expected/desired?</p>
javascript jquery
[3, 5]
513,989
513,990
jquery how to select all the class elements start with "text-"?
<p>I have got some classes</p> <pre><code>.text-1 .text-2 .text-3 </code></pre> <p>I want to select them all, how to do that? Thanks for the help</p>
javascript jquery
[3, 5]
1,664,919
1,664,920
How to properly parse Result Array from database with Jquery?
<p>I have codeigniter application which fetches data from database and this data is manipulated by Jquery. Result array from database used to look like this:</p> <pre><code> { "result":[ {"name":"John","surname":"Smith"}] } </code></pre> <p>And I use to parse it using code below:</p> <pre><code>$.get("index.php/getResult",{f_name: $('#fn').val()} ,function(data) { var list= ""; $.each(data, function(index, element) { if (index &gt; 0) {list;} list+= element.name; }); $('#myid').html(list); },"json"); </code></pre> <p>My result array has changed to the format below, how can I parse it now? Any help is appreciated.</p> <pre><code>{ "count": 8, "result":[ {"name":"John","surname":"Smith"}] } </code></pre>
php javascript jquery
[2, 3, 5]
2,762,456
2,762,457
dynamic jQuery Effects
<p>Was wondering if there is a way in Javascript to call function/method names by string?</p> <p>Scenario, writing a bit of jQuery that runs an Effect on target(s). I'd like to make this Effect Dynamic (Changeable by the user). </p> <p>I guess, ideally i would be looking for something like <code>jQuery('target').Effect('slideDown','slow');</code></p> <p>Or anything that could produce the same results, with out having to have some overbearing Switch Statements like <code>switch(vEffect){ case 'slideDown': jQuery().slideDown(); break; }</code> which to me seems redundant...</p>
javascript jquery
[3, 5]
2,762,926
2,762,927
Jquery to javascript conversion help
<p>I'm trying to convert the following jquery to javascript syntax, but being not familiar with either, I'm getting stuck</p> <pre><code>var div = $('&lt;div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"&gt;&lt;div style="height:100px;"&gt;&lt;/div&gt;'); // Append our div, do our calculation and then remove it $('body').append(div); var w1 = $('div', div).innerWidth(); div.css('overflow-y', 'scroll'); var w2 = $('div', div).innerWidth(); $(div).remove(); </code></pre>
javascript jquery
[3, 5]
1,212,994
1,212,995
how to set button to be visible only after i made changes in 2 dropdownlists in javascript
<p>in aspx file I have </p> <pre><code>&lt;asp:DropDownList ID="DropDownList1" runat="server" &gt; &lt;/asp:DropDownList&gt; &lt;asp:DropDownList ID="DropDownList2" runat="server"&gt; &lt;/asp:DropDownList&gt; &lt;asp:Button ID="load_data" runat="server" Text="&lt;%$ Resources : load_data %&gt;" onclick="load_data_class_Click" Visible="False"/&gt; </code></pre> <p>Now I want to set button to be visible only after i made changes in 2 dropdownlists in javascript</p> <p>how to do this?</p>
javascript asp.net
[3, 9]
1,210,889
1,210,890
Problem using Javascript to redirect to a URL with a query string
<h3>Javascript</h3> <pre><code>&lt;script type="text/javascript"&gt; function Edit(id) { if(confirm("Are you sure to edit?")==true) { location.href='employee_set.php&amp;edit='+id; } } &lt;/script&gt; </code></pre> <h3>PHP</h3> <pre><code>&lt;?php if(isset($_GET["edit"])==false) { echo "no response"; } else { echo "link success"; } ?&gt; </code></pre> <p>My problem is the Javascript is OK. The location href example. <a href="http://localhost/employee_set.php&amp;edit=30" rel="nofollow">http://localhost/employee_set.php&amp;edit=30</a> ...</p> <p>The PHP code is not working. Error is not found.</p>
php javascript
[2, 3]
5,699,773
5,699,774
JQuery function only works on browser refresh
<p>The problem i am having with me JQuery function is that it only works when i refresh the webpage, it is working this way on every browser. What i am trying to do is once all of the textfields in enclosed in a specific div container all have data inside them, i want the the container to insert the checkmark image. but currently this image only becomes visible after i have entered all of the data in the textfields AND refreshed the brower. </p> <p>.rightbilling is the class of the div container whose textfields im trying to evalute and '#step1' is the fieldset that contains .rightbilling. </p> <p>I have been trying to solve this for hours..help is greatly appreciated. if you need more info, let me know.</p> <pre><code>$(document.body).ready(function() { var all_complete = true; $(".rightbilling").find("input:text").each(function(){ if ($(this).val() == '' ) { all_complete = false; return true; }; if (all_complete) { $("#step_1") .animate({ paddingBottom: "120px" }) .css({ "background-image": "url(images/check.png)", "background-position": "bottom center", "background-repeat": "no-repeat" }); $("#step_2").css({ opacity: 1.0 }); $("#step_2 legend").css({ opacity: 1.0 // For dumb Internet Explorer }); }; }); </code></pre>
javascript jquery
[3, 5]
5,306,784
5,306,785
Fetching data from different table in asp.net
<p>I want to fetch data from separate tables in sqlserver and display them together in GridView, Is that possible? if so then please suggest. Thank you.</p>
c# asp.net
[0, 9]
4,265,260
4,265,261
How to create a javascript debugger c#
<p>I'm making an html editor but now i have a "little" problem. I need to create a javascript debugger. How can i do it? It's possible add firebug debugger in my program(as webbrowser i'm using cefsharp).</p> <p>i'm grateful for any suggestions or hints on how to get started and recommended action. </p>
c# javascript
[0, 3]
1,357,078
1,357,079
Best Javascript tutorial so i can get started on JQuery?
<p>Sorry if this is in the wrong stack exchange, wasn't sure if I should post it here, or overflow.</p> <p>Just wanted to know of a few good online tutorials or a book I can do to get me started with Javascript (I know the small basics, alerts, css styles) and then maybe it branches to JQuery, or at least will give me enough of a base to start JQuery, and still understand the underlining language.</p> <p>Thanks (eventually will be using JQuery for UI and interactions)</p>
javascript jquery
[3, 5]
5,501,508
5,501,509
How do I extract data from this URL using javascript?
<p>I need to build a string from the data contained in this url using javascript/jQuery:</p> <pre><code>http://www.example.com/members/admin/projects/?projectid=41 </code></pre> <p>The string returned should look as follows:</p> <pre><code>/ajax/projects.php?projectid=41 </code></pre> <p>Obviously if there is no query string present, the method should still return a string of the same format minus the query string. e.g.</p> <pre><code>http://www.example.com/members/admin/messages/ </code></pre> <p>should return...</p> <pre><code>/ajax/messages.php </code></pre> <p>I've made numerous attempts, all met without success due to my poor grasp of regular expressions, and it feels as though the ore I rad on the subject the more I am confusing myself.</p> <p>If someone could help it would be greatly appreciated.</p> <p>EDIT: The 'admin' portion of the url is a users 'username' and could be anything.</p>
javascript jquery
[3, 5]
1,962,649
1,962,650
How to use html() of jquery over specific child element
<p>I am trying to use <code>html()</code> function of jquery over the specific child like:</p> <pre><code>&lt;div id="main"&gt; &lt;p&gt;I am p tag&lt;/p&gt; &lt;span&gt; i am span tag&lt;/span&gt; &lt;/div&gt; </code></pre> <p>Now if we use <code>$("#main").html()</code> it gives both <code>p</code> and <code>span</code> but if i want only <code>p</code>, what should i do?</p>
javascript jquery
[3, 5]
3,791,075
3,791,076
jQuery's .isWindow method?
<p>I was trying to understand what I could from jQuery's animation functions, but ended up running into all sorts of internal functions I didn't understand, and ultimately landed on isWindow. The code for isWindow checks to see if an object has the property <code>setInterval</code>, and returns false otherwise.</p> <p>Of course, any object could have the property <code>setInterval</code> without being the window, and although it would almost have to be a deliberate attempt to sabotage jQuery's functionality to have an object with that exact property name, I can imagine some reasonable cases where it could be unintentional. </p> <p>Is there not a better way to check if an object is a window object? Couldn't they use something along the lines of</p> <pre><code>obj.setInterval &amp;&amp; obj.setInterval.toString() == 'function setIternval(){ [native code] } </code></pre> <p>I know the return of <code>toString</code> of an internal function isn't going to be standard across all browsers, but the writers of jQuery seem to have a great understanding of these cross-browser differences. I'm also aware that this isn't a fool-proof method either, as someone could easily override the <code>toString</code> method to return that same string, but this would still prevent the problem of having an object mistaken for a window. </p> <p>I wouldn't ask if I thought that <code>isWindow</code> was only used on internal objects by jQuery, but it was part of <code>isPlainObject</code>, which is used in <code>.extend</code>, which can be used on external objects. </p>
javascript jquery
[3, 5]
4,749,609
4,749,610
Best method for a PHP script to communicate with an application?
<p>I'm currently writing a c++ application for a linux server which basically handles requests (I haven't coded the part handling the requests yet, as I'm not sure of the best method).</p> <p>Basically I have a PHP page that when fired (client hits the page) needs to communicate with the above mentioned application.</p> <p>Now I can't fire off this application each time it's needed, as it's a rather complex application that needs to load data before it can do any processing (so it should just stay loaded forever as a daemon).</p> <p>How would you suggest I have the PHP page make requests to the application? Should I just use socket programming with TCP/IP?</p> <p>Thanks in advance!</p>
php c++
[2, 6]
4,022,840
4,022,841
Can I pass $(this) to the .getJSON callback function? any workaround?
<p>I tried to get the value of rel on each li and pass it to the .getJSON function. I then want to add the thumbnail_url value from the callback to the image tag of the li descendants . My question is how could I pass the $(this) object to the callback function. It seems the $(this) is null.</p> <pre><code>$('ul.sample li').each(function () { var url = 'http://sampleurl/api/url?' + $(this).attr('rel'); $.getJSON(url, function (data){ $(this).find('img').attr('src') = data.thumbnail_url; }) }); </code></pre> <p>HTML:</p> <pre><code>&lt;ul class="sample"&gt; &lt;li rel="value1"&gt; &lt;img src=""&gt; &lt;/li&gt; &lt;li rel="value2"&gt; &lt;img src=""&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
5,226,080
5,226,081
How can I put the index number as a value in a foreach?
<p>I have the following code:</p> <pre><code>foreach (var SubTopic in Model.SubTopic.Description) { &lt;option value="xxx"&gt;SubTopic&lt;/option&gt; } </code></pre> <p>I would like to find a way to insert the index number into xxx as value. 01 for the first, 02 for the second option line etc. </p> <p>Is there an easy way to do this?</p>
c# asp.net
[0, 9]
1,173,704
1,173,705
Math['random']() javascript in php
<p>How to write <code>Math['random']()</code> javascript in php version?</p>
php javascript
[2, 3]
2,264,238
2,264,239
Menu item fail to show what is in CSS
<pre><code>&lt;td class="style22" align="center"&gt; &lt;asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"&gt; &lt;Items&gt; &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/&gt; &lt;asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/&gt; &lt;/Items&gt; &lt;/asp:Menu&gt; &amp;nbsp;&lt;/td&gt; &lt;td align="center"&gt; div.menu { padding: 4px 0px 4px 8px; } div.menu ul { list-style: none; margin: 0px; padding: 0px; width: auto; } div.menu ul li a, div.menu ul li a:visited { background-color: #465c71; border: 1px #4e667d solid; color: #dde4ec; display: block; line-height: 1.35em; padding: 4px 20px; text-decoration: none; white-space: nowrap; } div.menu ul li a:hover { background-color: #bfcbd6; color: #465c71; text-decoration: none; } div.menu ul li a:active { background-color: #465c71; color: #cfdbe6; text-decoration: none; } </code></pre>
c# asp.net
[0, 9]
5,461,356
5,461,357
Jquery syntax for javascript code
<p>i have the following code written in normal js:-</p> <pre><code>var trCat = document.getElementById('trCat'); var tr_1 = document.createElement('tr'); tr_1.id = 'trCat_'+val; tr_1.style.width = '100%'; trCat.parentNode.insertBefore( tr_1 , trCat ); tr_1.attachEvent('onclick' , function() { DeleteRow(val) }); </code></pre> <p>How Can i replicate the above code in JQUERY? Any Suggestions are most welcome..</p>
javascript jquery
[3, 5]
3,798,321
3,798,322
setting a var and return new value at once
<p>I run in to a problem whan i do somthing like this</p> <pre><code>var abc = false; function doSomthing(){ abc = true; return abc; } </code></pre> <p>and it returns false, but if i run the function twice (in console), the second time returns true.</p> <p>Thanks</p> <p>the orignal function</p> <pre><code>var session_id_resualt = false; function islogdin() { if (localStorage.email == undefined) { localStorage.email = ""; } if (localStorage.session_id == undefined) { localStorage.session_id = ""; } $.post(server + "loginCheck.php", { loginCheck: "", cookie: readCookie("h"), session_id: localStorage.session_id, email: localStorage.email }, function (json) { json = $.parseJSON(json); if (json.logdin) { if (json.logdin == "1") { //var s_id = json.session_id; session_id_resualt = json.session_id; //return s_id; } else { session_id_resualt = false; // return false; } } else { session_id_resualt = false; // return false; } }); return session_id_resualt; } </code></pre>
javascript jquery
[3, 5]
5,881,451
5,881,452
Session of ASP.net page gets expired even I have made changes in web.config's session timeout value
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/648992/session-timeout-in-asp-net">Session timeout in ASP.NET</a> </p> </blockquote> <p>Hello Guys, In my ASP.net Application, my Session get expired if a page remains open untouched for 10-15 minutes, even through my web.config file i have changed the session timeout property to 60.</p> <p>Can u suggest some solution.</p>
c# asp.net
[0, 9]
215,872
215,873
load an event on a finished redirected page after an AJAX call
<p>How do I load an event after a redirected page has finished loading, following an ajax call?</p> <p>For the sake of simplicity, here is some sample code:</p> <pre><code>$.ajax({ type: "POST", url: "some_page.php", success: function() { window.location.href="new_page.php"; // redirect to this page $(window).load(function() { alert("test"); }); // load after redirect } }); </code></pre> <p>the "alert" box does not load for me, but the redirect works.</p>
php javascript jquery
[2, 3, 5]
3,302,878
3,302,879
jquery getting all the values of the nearest element
<pre><code>&lt;ul&gt;&lt;li class="rjust"&gt; &lt;a href="#" class="edit-video-lightbox" id="4f80a4b5"&gt;Edit&lt;/a&gt; &lt;input type="hidden" class="video_title" value="test123"&gt; &lt;input type="hidden" class="video_description" value="Sample Description"&gt; &lt;input type="hidden" class="video_tags" value="Adjust"&gt; &lt;input type="hidden" class="video_tags" value="TXV"&gt; &lt;/li&gt; &lt;li class="rjust"&gt; &lt;a href="#" class="edit-video-lightbox" id="235235"&gt;Edit&lt;/a&gt; &lt;input type="hidden" class="video_title" value="another_test"&gt; &lt;input type="hidden" class="video_description" value="descriptme agian"&gt; &lt;input type="hidden" class="video_tags" value="tag1"&gt; &lt;input type="hidden" class="video_tags" value="tag2"&gt; &lt;/li&gt;&lt;/ul&gt; </code></pre> <p>When I click on the "Edit" a href, I want to get all the values of the class "video_tags" nearest to it. <br> Example when the 1st "Edit" is being click (id="4f80a4b5"), I want to get all the value of the "video_tags" which is "Adjust", "TXV". <br> On the other hand, when I click on the other "Edit" (id="235235"), all the value of "video_tags" that I should get is "tag1","tag2" since it obviously it is near to it.<br> <br>Take note that the class "video_tags" is flexible, it could have many classes, my example has just only 2 video_tags per li.</p> <p><br> Kindly please help me with this matter.<br> Any help would be greatly appreciated and rewarded! Thanks :)</p>
php javascript jquery
[2, 3, 5]
5,303,441
5,303,442
Plugin to process change log for a rendered html form
<p>today I got an assignment from my school and I am bit confused about it, what this assignment ask me to do, here I paste the same </p> <p>Assignment: Design and code a jQuery Plugin to process change log for a rendered html form.</p> <p>1) You need to store the initial values set to the form inputs.</p> <p>2) On submit of form, you need to calculate the changes made to the form values.</p> <p>3) Add the change log object as "changelog" parameter to the form.</p> <p>can anyone figure out what this assignment ask to do? Thanks in advance </p>
javascript jquery
[3, 5]
4,881,743
4,881,744
Insert new JS method from JS
<p>I need call from JavaScript file php like example </p> <pre><code>$.post("my.php", function(data) { data; // data is string "function Alert(){ alert("text"); };" } ); </code></pre> <p>so from php I get new JS function. Like example function Alert(){ alert("text"); };</p> <p>Can I insert that functionality into loaded js file? And how to do it?</p>
javascript jquery
[3, 5]
2,026,848
2,026,849
How to find missing lines in a file in python or c++?
<p>I have a big file in which every line begins with a number. I have around 4000 lines and they all begin with a number in order. Like this :</p> <blockquote> <p>1: bla bla bla</p> <p>2: the cat is mine</p> <p>3: programming issue</p> </blockquote> <p>and so on until 4000. How can i found out which lines are missing related to the number? How to implement that in a script so that if line no. 2134 is missing, it would print : "missing lines are :..." ? Thanks!</p>
c++ python
[6, 7]
1,314,998
1,314,999
How to unzip code on nexus7
<p>How to unzip programming android from asset to /sdcard/, my code in below not success in nexus7, but if it is run in addition to nexus7 will be fine, will be able to extract the data.</p> <p>To running unzip.</p> <pre><code>new Thread(new Runnable() { @Override public void run() { UnZip.start(); } }).start(); private Thread UnZip = new Thread() { @Override public void run() { try { final int BUFFER = 8192; ZipInputStream inputStream = new ZipInputStream(getAssets().open("file.zip")); for (ZipEntry entry = inputStream.getNextEntry(); entry != null; entry = inputStream .getNextEntry()) { String innerFileName = "/sdcard/" + File.separator + entry.getName(); File innerFile = new File(innerFileName); if (entry.isDirectory()) { innerFile.mkdirs(); } else { FileOutputStream outputStream = new FileOutputStream( innerFileName); BufferedOutputStream bufferedOutputStream = new BufferedOutputStream( outputStream, BUFFER); int count = 0; byte[] data = new byte[BUFFER]; while ((count = inputStream.read(data, 0, BUFFER)) != -1) { bufferedOutputStream.write(data, 0, count); } bufferedOutputStream.flush(); bufferedOutputStream.close(); } } inputStream.closeEntry(); inputStream.close(); } catch (Exception e) { } } }; </code></pre>
java android
[1, 4]
3,129,844
3,129,845
catch url by javascript
<p>catch url by javascript</p>
java javascript
[1, 3]
2,417,378
2,417,379
javascript / jquery: create and post virtual form
<p>In javascript, I have some data that I want send as a post (NOT ajax). It should act the same as if the user had clicked a submit button. However, I do not have an actual form. The data is collected from the page into various variables, including an array that I encode as json.</p> <p>I could create an html form with display:none, place the values into this form, and then trigger the invisible submit button. Is there a better way?</p>
javascript jquery
[3, 5]
937,560
937,561
In Android project include another project
<p>I'm just starting my long way to Android programming and building app where I would like to use this library <a href="https://github.com/cfgxy/DevsmartLib-Android/tree/" rel="nofollow">https://github.com/cfgxy/DevsmartLib-Android/tree/</a></p> <p>This is another Android project, how should I include this in my project using Eclipse?</p>
java android
[1, 4]
340,705
340,706
how to change textbox textmode using jquery
<p>i have a login component and within it the password field has a textmode of singlline </p> <p>what i am trying to do is on focus the textmode will change to password</p> <p>i tried this :</p> <pre><code>$(function () { $(".PassTextBox").focus(function (pas) { $(".PassTextBox").attr("TextMode", "Password"); }); }); </code></pre> <p>but it didn't work</p> <p>using asp.net 3.5 , thanks</p>
jquery asp.net
[5, 9]
3,219,305
3,219,306
SOAP request XML
<pre><code> var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", "http://service.project-development-site.de/soap.php",true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4) { alert(xmlhttp.responseText); // http://www.terracoder.com convert XML to JSON var json = XMLObjectifier.xmlToJSON(xmlhttp.responseXML); var result = json.Body[0].GetQuoteResponse[0].GetQuoteResult[0].Text; // Result text is escaped XML string, convert string to XML object then convert to JSON object json = XMLObjectifier.xmlToJSON(XMLObjectifier.textToXML(result)); alert(symbol + ' Stock Quote: $' + json.Stock[0].Last[0].Text); } } xmlhttp.setRequestHeader("SOAPAction", "http://service.project-development-site.de/soap.php"); xmlhttp.setRequestHeader("Content-Type", "text/xml"); var xml = '&lt;?xml version="1.0" encoding="utf-8"?&gt;' + '&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"&gt;' + '&lt;soapenv:Header/&gt;'+ '&lt;soapenv:Body&gt;'+ '&lt;tem:loginUserSoapInPart&gt;'+ '&lt;tem:userName&gt;user&lt;/tem:userName&gt;'+ '&lt;tem:passWord&gt;pwd&lt;/tem:passWord&gt;'+ '&lt;tem:accesToken&gt;acktoken&lt;/tem:accesToken&gt;'+ '&lt;/tem:loginUserSoapInPart&gt;'+ '&lt;/soapenv:Body&gt;'+ '&lt;/soapenv:Envelope&gt;'; xmlhttp.send(xml); </code></pre> <p>I have used this code with the soap request xml but it is not giving me response.i am checking it in alert but i am getting empty alert message.</p>
java javascript
[1, 3]
989,461
989,462
iPhone calling python functions from server
<p>I have a back end set up with python functions. I want python to do a lot of location based work instead of have objective-c do the computations and everything else. There are reasons for this.</p> <p>However, I have no idea how to connect to the server and call the python functions from objective-c. Does anyone have any knowledge of this?</p> <p>Thanks!</p>
iphone python
[8, 7]
4,583,515
4,583,516
automatically infer class name as T for generics
<pre><code>public class TestClass1 { public void TestMethod1() { new Logger&lt;TestClass1&gt;().Log(LogType.Info, "FROM TESTCLASS1.TESTMETHOD1"); } } </code></pre> <p>When instantiating <strong>Logger</strong> and passing in <strong>TestClass1</strong> as <strong>generic T</strong>, there could be a problem if the developer types in some thing else as opposed to TestClass1. For example, following line of code could be an <strong>issue</strong>. </p> <pre><code>new Logger&lt;Test123&gt;().Log(LogType.Info, "FROM TESTCLASS1.TESTMETHOD1"); </code></pre> <p>How can I write the following line of code that it would automatically infer <strong>TestClass1</strong> and pass it?</p> <pre><code>new Logger&lt;TestClass1&gt;().Log(LogType.Info, "FROM TESTCLASS1.TESTMETHOD1"); </code></pre> <p>I have tried the following 2 lines of code but no luck. </p> <pre><code>new Logger&lt;this&gt;().Log(LogType.Info, "FROM TESTCLASS1.TESTMETHOD1"); new Logger&lt;this.GetType&gt;().Log(LogType.Info, "FROM TESTCLASS1.TESTMETHOD1"); </code></pre> <p><strong>UPDATE</strong> Through out my application, I could be passing in any class whats so ever such as TestClass1, MyClass123 etc. etc. so I may not be able to put any generic constraints. </p> <p>Please help.</p>
c# asp.net
[0, 9]
2,284,467
2,284,468
jQuery Pagination plugin with ASP.NET gridview
<p>Can we implement pagination for an asp:gridview which has 'n' number of records retrieved from a database using a <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow">jQuery</a> pagination plug-in. If so how can we implement it?</p>
c# asp.net
[0, 9]
451,243
451,244
Jquery - Accessing nested child elements
<p>Assume I have the following HTML - </p> <pre><code>&lt;DIV id="ParentDiv"&gt; &lt;DIV id="SubDiv1"&gt;&lt;/DIV&gt; &lt;DIV id="SubDiv2"&gt; &lt;INPUT id="input"&gt; &lt;/DIV&gt; &lt;/DIV&gt; </code></pre> <p>To access the input element using jquery, it would be simply $("#input"). What I'm trying to do is access it, assuming I only know the ID of the top level div. </p> <p>Currently I have </p> <pre><code>$($($("#ParentDiv").children()[1]).children()[0]) </code></pre> <p>Which does seem to work. Is there a cleaner way of writing this, or is the way I am doing it ok?</p>
javascript jquery
[3, 5]
4,348,960
4,348,961
jQuery slideUp slideDown help, it's slideToggle
<p>If i click a division it will slidUp and if i click that division again it will slideDown. How can i do this ?</p> <pre><code>$("#id_color_tags").click(function(){ $("#rightsidefive").slideToggle(); }) </code></pre> <p>Tried that but that didn't work.</p>
javascript jquery
[3, 5]
3,206,372
3,206,373
javascript alternative to php seralize
<p>hello I have a javascript array and I would like to use a function for javascript that will take my array and serialize it.</p> <p>Thanks</p>
php javascript
[2, 3]
5,570,089
5,570,090
how to check if a checkbox has been selected?
<p>Given the following HTML content:</p> <pre><code>&lt;div class="a_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="a_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="a_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="a_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="a_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="b_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="b_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="b_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="b_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; &lt;div class="b_list"&gt;&lt;input type="checkbox"&gt;&lt;/input&gt;&lt;p&gt;Testing A list &lt;/p&gt;&lt;/div&gt; </code></pre> <p>and this jQuery:</p> <pre><code>if($(".a_list, .b_list").is(":checked")) { } else { alert("Please make a selection"); } </code></pre>
javascript jquery
[3, 5]
1,700,983
1,700,984
How to desable and Enable TextBox acording to checklbox
<pre><code>&lt;asp:CheckBox ID="htmlChkNotify" runat="server" OnCheckedChanged="ToggleTextBox(this,'htmlTxtNotifyemailaddress')" /&gt; &lt;asp:TextBox ID="htmlTxtNotifyemailaddress" runat="server" Enabled="false"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>function ToggleTextBox(CheckBox, TextBoxID) {</p> <pre><code> var TextBox = document.getElementById(TextBoxID); if (CheckBox.checked) { TextBox.disabled = false; TextBox.value = ""; } else { TextBox.disabled = true; TextBox.value = ""; } } </code></pre> <p>i have write like but when i run the code then error message comeing " can't be pass this literal" something like that </p> <p>so how can i do it ?</p> <p>actually u can also see demo in stackover flow "Notify daily of any new answers" i want to fire event like.</p> <pre><code> Thank U </code></pre>
javascript asp.net
[3, 9]
4,531,973
4,531,974
can't see my picture on the form - asp.net
<p>i add Image control to my WebForm.</p> <p>i insert picture to App_Data.</p> <p>i connect the picture to my Image control in the ImageUrl</p> <p>it seen like this: </p> <pre><code>&lt;asp:Image ID="Image1" runat="server" Height="94px" ImageUrl="~/App_Data/Tulips.jpg" Width="209px" /&gt; </code></pre> <p>in the design i see this picture, but when i run the project i dont see the picture.</p> <p>what can be the problem ?</p>
c# asp.net
[0, 9]
1,422,682
1,422,683
Inserting a variable into jQuery .css
<p>I have a JavaScript Variable that stores the width of an element ,called popupWidth, in px, e.g. '200px'. The '' are part of the variable, because jQuery needs them. How can I insert the variable into jQuerys .css?</p> <pre><code>$(this).css({ width: + popupWidth, }); </code></pre> <p>The code above doesn't work. </p>
javascript jquery
[3, 5]
2,576,136
2,576,137
How to write custom event which gets fired when user click three times
<p>i am trying to write a custom event which should get fire when user click three times on any html node.</p> <p>i know that i can create even using </p> <pre><code>var evt = document.createEvent("Event"); evt.initEvent("myEvent",true,true); </code></pre> <p>but i am not getting how i will capture that three times click event.</p> <p>I will be appreciated if some one can suggest me the write approach for this.</p> <p>Thanks!!!</p>
javascript jquery
[3, 5]
2,259,338
2,259,339
Javascript checking date
<p>I am trying to use JavaScript to validate that the date selected is not earlier than today, but when I select today's date it's showing the alert box. </p> <p>JavaScript:</p> <pre><code>function checkDueDate(sender, args) { var td = new Date(); td.setMinutes(59); td.setSeconds(59); td.setHours(23); //to move back one day td.setDate(td.getDate() - 1); if (sender._selectedDate &lt; td) { alert("You can't select day from the past! " + td + ""); sender._selectedDate = new Date(); // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } </code></pre> <p>ASP.NET:</p> <pre><code> &lt;asp:TextBox ID="txtDueDate" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:CalendarExtender ID="txtDueDate_CalendarExtender" runat="server" TargetControlID="txtDueDate" OnClientDateSelectionChanged="checkDueDate"&gt; &lt;/asp:CalendarExtender&gt; </code></pre> <p><img src="http://i.stack.imgur.com/RX9R8.png" alt="Image"></p>
javascript asp.net
[3, 9]
1,598,984
1,598,985
Ways to check if an ArrayList contains only null values
<p>I was looking through the code for an old Android application of mine, and I saw one thing I did to the effect of this:</p> <pre><code> boolean emptyArray = true; for (int i = 0; i &lt; array.size(); i++) { if (array.get(i) != null) { emptyArray = false; break; } } if (emptyArray == true) { return true; } return false; </code></pre> <p>There has to be a more efficient way of doing this -- but what is it?</p> <p>emptyArray is defined as an ArrayList of Integers, which are inserted with a random number of null values (And later in the code, actual integer values).</p> <p>Thanks!</p>
java android
[1, 4]
119,371
119,372
Asp.net Session Variable from SQL DB
<p>I created a custom login page using Forms Authentication and using a sQL DB to store user data. I am able to create a session variable from the username, but wondering if it is possible to pull a separate field and create a session variable based on that. I would like the session variable to be based off a SalesNumber a 5 digit decimal field. Please give me any comments or suggestions.</p> <pre><code>cmd = new SqlCommand("Select pwd,SalesNumber from users where uname=@userName", conn); cmd.Parameters.Add("@userName", System.Data.SqlDbType.VarChar, 25); cmd.Parameters["@userName"].Value = userName; Session["userName"] = userName; </code></pre> <p>Thanks....</p>
c# asp.net
[0, 9]
5,355,052
5,355,053
Android notification types with BuzzBox sdk
<p>I'm developing a weather alarm application on Android. I've integrated the buzzbox scheduler and I've written a task to check the weather condition every 3 hours using the cron string "0 */3 * * 1,2,3,4,5,6,7" as described here <a href="http://hub.buzzbox.com/android-sdk/quickstart" rel="nofollow">http://hub.buzzbox.com/android-sdk/quickstart</a></p> <p>I have 2 notification types: "bad-weather" and "weather-alert" and I'm creating the messages like this:</p> <pre><code>if (ALERT == type) { notification = new NotificationMessage("weather-alert","Weather Alert!","Tomorrow: Severe Weather",weatherDetails,R.id.icon_weather_alert); } else { notification = new NotificationMessage("bad-weather","Bad Weather","Tomorrow: Bad Weather",weatherDetails,R.id.icon_weather_bad); } </code></pre> <p>How can I set up vibration for the first notification and a sound for the second type? Also, I only see one configuration section in the settings activity. Can I open up a different configuration settings for each type of notification?</p>
java android
[1, 4]
4,590,537
4,590,538
regex between two special characters
<p>Is there a way to replicate this PHP snippet in JQuery or Javascript...</p> <pre><code>&lt;?php $A = preg_match_all('#{.*(.*)}#U', $value, $B); //matches all between {} put it into array "B" $C = $B[1]; // array[0] = "{content}" --- array[1] = "content" ?&gt; </code></pre> <p>I have been trying to find something similar for like 4 hours or so to no avail. The goal is basically to find everything between <code>{</code> and <code>}</code> and then pull that information out to be useful. </p> <p>I am no Javascript expert so I would appreciate any help. Thank you in advance.</p>
php javascript jquery
[2, 3, 5]
4,536,461
4,536,462
parsing Unix timestamp to date string in the client side
<pre><code>res.SentTime.substring(6,19) </code></pre> <p>"1318319100000"</p> <pre><code>var date = new Date(); date.setTime(res.SentTime.substring(6,19)); </code></pre> <p>1318319100000</p> <p>why doesn't it parses to date string?</p>
c# javascript
[0, 3]
239,165
239,166
Android / Java - How do I call upon a function in a separate *.java file?
<p>I do an import of the full package name / java file, and if I do a <code>&lt;classname&gt;.&lt;method&gt;</code>, SOMETIMES I can get it to access - other times I get a lot of <code>can't use a static in a non static</code> bunch of talk.</p> <p>I'll admit I'm new to Java, so what do I need to do? Call a class instance first, then call my methods? I'm rather confused by this, as I want to put all of my 'functions' into a FunctionsList.java file, and all of my main Activity (UI) into a MyActivity.java file.</p> <p>For example:</p> <pre><code>&lt;MyActivity.java&gt; import com.example.FunctionsList; private class MyActivity extends Activity { FunctionsList.function(); } </code></pre> <p>9/10 times I get that static/non-static error.</p> <p>If I put all of my functions into MyActivity.java, I have zero problems! Anyone help me on what I presume is a basic Java newbie issue?</p>
java android
[1, 4]
2,651,593
2,651,594
javascript to jquery conversion for a code that is working fine for dynamic appearance and disappearance of a text field with radio buttons
<p>guys I tried a lot for this code but nothing come up for conversion from javascript to jquery..</p> <p>This code is irrelevant cuz u find this in working fiddle.. I added this chunk of code cuz stackoverflow dont allow me to post without a code..</p> <pre><code>&lt;div class="rButtons"&gt; &lt;input type="radio" name="numbers" value="10" onclick="uncheck();" /&gt;10 &lt;input type="radio" name="numbers" value="20" onclick="uncheck();" /&gt;20 &lt;input type="radio" name="numbers" value="other" onclick="check(this);"/&gt;other &lt;input type="text" id="other_field" name="other_field" onblur="checktext(this);"/&gt; &lt;/div&gt; </code></pre> <p>Check this fiddle</p> <p><a href="http://jsfiddle.net/gDxqj/" rel="nofollow">http://jsfiddle.net/gDxqj/</a></p> <p>It is working well. on clicking "other" radio button the text field comes up and on clicking any other radio button it disappears.. This is the function of this script and it is working well..</p> <p>Now when i tried changing it to jquery code it died.. I can show what code i made in jquery but to no help.. </p> <p>Fiddle for the same will help a lot..</p> <p>Thanks in advance..</p> <p>This is what i did</p> <pre><code>&lt;script&gt; var $radios = $('input:radio[name=numbers]'); if ($radios.is(':checked') === true) { $("#other_field").show(); } else { $("#other_field").hide(); } &lt;/script&gt; </code></pre> <p>I put it put that in a function and invoke it in "onchange" of radiobutton but not worked</p>
javascript jquery
[3, 5]
3,719,570
3,719,571
Delete from Link Dynamically named form
<p>I want to pass the form name to the function and then confirm they are read to delete it after that I want to change the action then submit the form.</p> <pre><code>function deletePhone(myForm){ var r=confirm('Are you sure you want to delete this phone?'); if(r==true){ $(myForm).attr("action","index.cfm?deleteThis=1"); $(myForm).submit(); } } </code></pre> <p>currentrow is a variable that I am using because I am creating multiple forms and it holds the currentCount for the form.</p> <pre><code> &lt;a href="javascript:deletePhone('EditPhone_form_#currentrow#');"&gt;X Delete Phone&lt;/a&gt; </code></pre> <p><strong>Example:</strong></p> <ul> <li>EditPhone_form_1 </li> <li>EditPhone_form_2 </li> <li>EditPhone_form_3 </li> <li>EditPhone_form_4</li> </ul>
javascript jquery
[3, 5]
4,360,625
4,360,626
onClientClick event
<p>when i used onClientClick event for calling a javascript function in .aspx file. but it's not working at all.how can i get alert for input of data within "&lt;>" in textbox. pls help me</p>
asp.net javascript
[9, 3]
4,181,282
4,181,283
Make a table of layouts jumping the line automatically
<p>Is there some kind of class / method / technique that allows to automatically "jump the line" when the right side of the screen is reached when filling a layout ?</p> <p>I have about 30 images and I want to put them in a table <strong>without resizing</strong> so for some screens each row should contain 6 images and maybe in a tablet maybe all can fit in a single row.</p> <p>Thanks</p>
java android
[1, 4]
1,148,385
1,148,386
Return true if key is down in javascript loop?
<p>I want to add a condition inside a loop that tests if the right arrow is pressed and if it is move a div a bit to the right. However I don't know how to check for they keydown. </p> <p>I'm using a code to do it but it is really long and I'm sure there is an shorter way to do it.</p> <p>This is the code:</p> <pre><code> &lt;div id="char"&gt;&lt;/div&gt; &lt;script&gt; setInterval(function() { // here it should check if RIGHT (keycode 39) is down and move char 10px to the right if it is; }, 20); &lt;/script&gt; </code></pre> <p>How can I check for keydown inside the loop? Btw I'm also using jQuery on the site.</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,957,822
1,957,823
how do I add items to listview dynamically in android
<p>Can anybody help me? I'm trying to create a ListView in Android, and I'm trying to load items into it using code (not using XML)</p> <p>Here's the code that I have so far</p> <pre><code>tweetList = (ListView)this.findViewById(R.id.tweetListView); TextView tv; for(int i=0;i&lt;20;i++) { tv = new TextView(this); tv.setText("I'm a textView"); tweetList.addHeaderView(tv); } tweetList.invalidate(); </code></pre> <p>What am I doing wrong? The items are not showing in runtime</p> <p>EDIT: I changed the code as per the answers below and here's the code I have now</p> <pre><code> tweetList = (ListView)this.findViewById(R.id.tweetListView); ArrayAdapter&lt;TextView&gt; aa = new ArrayAdapter&lt;TextView&gt;(this, R.id.tweetListView); tweetList.setAdapter(aa); TextView tv; for(int i=0;i&lt;20;i++) { tv = new TextView(this); tv.setText("I'm a textView"); //tweetList.addHeaderView(tv); aa.add(tv); } tweetList.invalidate(); </code></pre> <p>I'm getting an exception now</p> <pre><code>11-10 01:32:16.002: ERROR/AndroidRuntime(867): android.content.res.Resources$NotFoundException: Resource ID #0x7f050030 type #0x12 is not valid </code></pre> <p>Why am I not able to add them dynamically now?</p>
java android
[1, 4]
1,931,553
1,931,554
jquery closest() tree traversal
<p>I'm having trouble getting my jQuery to work correctly. I have this HTML structure:</p> <pre><code>&lt;div class="hide"&gt;&lt;!-- form --&gt;&lt;/div&gt; &lt;div class="button-hide"&gt;&lt;a href="#"&gt;Hide Form&lt;/a&gt;&lt;/div&gt; &lt;div class="button-show"&gt;&lt;a href="#"&gt;Show Form&lt;/a&gt;&lt;/div&gt; </code></pre> <p>When the 'button-show' anchor is clicked, it should hide it's own div, show the above 'button-hide' div and toggle the above 'hide' div:</p> <pre><code>$(document).ready(function(){ $(".hide").hide(); $(".button-hide").hide(); $("div.button-show a").click(function(){ $(this).closest("div.hide").slideToggle(); $(this).closest("div.button-hide").show(); $(this).hide(); }); }); </code></pre> <p>None of this works for me, am I mis-using the 'closest()' command here?</p>
javascript jquery
[3, 5]
4,620,659
4,620,660
cross-browser async uploader?
<p>Anyone looked into this recently?</p> <p>12 months ago i was using <a href="http://www.uploadify.com/" rel="nofollow">Uploadify</a></p> <p>6 months ago i switched to <a href="http://www.plupload.com/" rel="nofollow">Plupload</a> which was the best i could find,</p> <p>what are people's thoughts, is Plupload still the best uploader for multibrowser async image uploads?</p> <p>I'm about to start a new site...</p>
php javascript jquery
[2, 3, 5]
2,749,977
2,749,978
why counting wrong when i click select all checkbox
<p>I have got a problem. I have some checkbox. I want to select them at once, but counting result is wrong. when If I use firefox, opera then ok but when i use crome,safari, IE then It gives me a wrong result. why? please help me.</p> <p><a href="http://jsfiddle.net/Taslimkhan/kdEmH/2/" rel="nofollow">http://jsfiddle.net/Taslimkhan/kdEmH/2/</a></p> <p>some code I have set here:</p> <pre><code> // add multiple select / deselect functionality $("#selectall").click(function () { $('.case').attr('checked', this.checked); }); // if all checkbox are selected, check the selectall checkbox // and viceversa $(".case").click(function(){ if($(".case").length == $(".case:checked").length) { $("#selectall").attr("checked", "checked"); } else { $("#selectall").removeAttr("checked"); } }); }); $(document).ready(function () { $("input[type=checkbox]").each(function () { $(this).change(updateCount); }); updateCount(); function updateCount () { var count = $("input[type=checkbox]:checked").size(); $("#count").text(count); $("#status").toggle(count &gt; 0); }; }); </code></pre>
javascript jquery
[3, 5]
1,055,368
1,055,369
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]
4,842,573
4,842,574
Observing Applications via Heartbeat in Asp.net
<p>I have seen an article in code project regarding <a href="http://www.codeproject.com/KB/dotnet/heartbeat.aspx" rel="nofollow">Observing Applications via Heartbeat</a> i would like to implement the same for asp.net web forms how can i do this with out creating a wcf service and all. When i run the application i would like to have the same functionality as per he does can any one help me</p>
c# asp.net
[0, 9]
288,683
288,684
.push breaking in for loop
<p>I have the following loop that adds an object to an array if certain criteria are met. </p> <pre><code>var form = $('form[id^="product-form"]'), submit_button = $('#add-to-cart'), attr_fields = $('.additional input[type=text]'), attr_fields_default = {}; // Get the default values for each attribute field and place into an obj attr_fields.each(function () { var field = $(this), field_id = field.attr('id'), field_val = field.val(); attr_fields_default[field_id] = field_val; }); var extra_attr = []; for (var i = 0; i &lt; attr_fields.length; i++) { var _field = $(attr_fields[i]); if (_field.val() != attr_fields_default[_field.attr('id')]) { var jsonStr = { 'add': _field.attr('id'), 'quantity': 1 }; extra_attr.push(jsonStr); console.log(jsonStr); } else { _field.attr('disabled', 'disabled').val('None'); } } console.log(extra_attr); </code></pre> <p>The code works perfectly until the last loop, although console.log( jsonStr ) outputs the last object as expected, console.log( extra_attr ) does not. It does not push the last item into the array. I even tried changing jsonStr to a dummy string 'test' and i still get the same result. </p> <p>Here is a screenshot of my chrome developer console <a href="http://cl.ly/GdHw" rel="nofollow">http://cl.ly/GdHw</a></p> <p>I should also note that I originally tried to use .each() to loop through the selectors with the exact same results</p> <pre><code> attr_fields .each(function(){ if ( $(this).val() != attr_fields_default[ $(this).attr('id') ] ) { var jsonStr = {'add': $(this).attr('id'), 'quantity': 1}; extra_attr.push( jsonStr ); console.log( jsonStr ); } else { $(this).attr('disabled', 'disabled').val('None'); } </code></pre>
javascript jquery
[3, 5]
2,654,653
2,654,654
What is meaning of "(function(window, undefined){})(window)" in JavaScript?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2716069/how-does-this-javascript-jquery-syntax-work-function-window-undefined">How does this JavaScript/JQuery Syntax work: (function( window, undefined ) { })(window)?</a> </p> </blockquote> <pre><code>(function(window, undefined){})(window); </code></pre> <p>What is the meaning of this code? I have seen it in many documents, especially in jQuery documents.</p> <p>How does this work, and why is it defined thus?</p>
javascript jquery
[3, 5]
3,979,425
3,979,426
Organizing script files
<p>I usually have jQuery code that is page specific along with a handful of functions that many pages share. One approach is to make seperate files for organizing, but i'm thinking that putting all the script in one file and making comments in the file for readability would also work. Then when the site goes live I can minify and obfuscate if needed.</p> <p>I think the question comes down to limiting http requests or limiting file size. Is one of these a bad habit?</p>
javascript jquery
[3, 5]
4,818,415
4,818,416
Calling javascript after dom is finished
<p>We use an outside system to serve ads on our site. Currently in our header files, we have some js which uses jquery to insert the data to our ad holder which is a div that appears on every page, i.e.</p> <pre><code>$("#adSpot").prepend('put my ad here'); </code></pre> <p>Our third party ad system just started using Google Ad Server another system to serve ads so now have given us some JS to call. I'd like to use our header files and not have to touch every file but I'm not having luck inserting js that is then executed so:</p> <pre><code>$("#adSpot").prepend('GA_googleFillSlotWithSize("ca-pub-981", "Page_1", 468, 60)'); </code></pre> <p>Basically, I'd like to use the header file so when the page is loaded, it injects this js code into the div where we want the image placed and then the js is executed so the image will appear in the spot. Now it does push the code to the div but the js isn't executed.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
5,899,044
5,899,045
Accessing custom HTTP Response Header via C#
<p>I've created an HTTP Response Header in IIS 7. I can see it in Fiddler but I can't get its value in C#. Response.Headers.ToString() doesn't show the custom HTTP Response Headers.</p> <p>How can I access its value?</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
600,966
600,967
Android - Update a notification every time that changes the value of the variable
<p>I have a small notification application which view a variable "int a" into status notification. At the time when I start the application, the value of the variable is taken and displayed in the status bar. Since this variable varies continuously (approximately every 1-2 minutes), can you tell me how can I do so that the status bar automatically updates the value of this variable to avoid having to reload each time the application? I hope I was clear. thanks A.</p>
java android
[1, 4]
3,725,265
3,725,266
NullPointerException - onPause()
<p>This is goign to be very simple i expect to sort out and just me being a newbie going about in circles. </p> <p>I have multiple tabs across my screen. The following code should read a text input and assign its value to Shared Preferences when another tab is selected. However, whenever i change to another tab my code fails with a NullPointerException - I believe i have tracked it down to the onPause() of the below code, and I believe it is because i am failing to pass the data within the variable correctly.</p> <p>Any pointers appreciated!</p> <pre><code>package com.androidbook.epcsn; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.os.Environment; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; @SuppressWarnings("unused") public class jobActivity extends Activity { public static final String SN_PREFERENCES = "SiteNotePrefs"; SharedPreferences mPrefSettings; String jobID; String jobAddress ; String jobPostcode ; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.joblayout); final SharedPreferences mPrefSettings = getSharedPreferences (SN_PREFERENCES, Context.MODE_WORLD_WRITEABLE); initjobID(); initjobaddress(); initjobpostcode(); } private void initjobpostcode() { EditText jobPostcode = (EditText)findViewById(R.id.jobPostcodeText); } private void initjobaddress() { EditText jobAddress = (EditText)findViewById(R.id.jobAddressText); } private void initjobID() { EditText jobID = (EditText)findViewById(R.id.jobIDText); } @Override protected void onPause(){ super.onPause(); String strjobID = jobID; String strjobAddress = jobAddress; String strjobPostcode = jobPostcode; Editor editor = mPrefSettings.edit(); editor.putString("jobID", strjobID); editor.putString("jobAddress", strjobAddress); editor.putString("jobPostcode", strjobPostcode); editor.commit(); } } </code></pre>
java android
[1, 4]
4,386,060
4,386,061
Easily Validate a CheckBoxList
<p>Am trying to elegantly validate a CheckBoxList in ASP.NET webforms. </p> <p>Problem: Unknown server tag 'cc:ValidateableCheckBoxList'. </p> <pre><code>namespace fmwebapp1.UserControls { [ValidationPropertyAttribute("ValidateableProperty")] public class ValidateableCheckBoxList : CheckBoxList { public string ValidateableProperty { get { return (this.Items.Cast&lt;ListItem&gt;().Where(i =&gt; i.Selected).Count() &gt; 0) ? "something was selected" : ""; } } } } </code></pre> <p>In the same namespace as my aspx file:</p> <pre><code> &lt;%@ Register Namespace="fmwebapp1.UserControls" Assembly="ValidateableCheckBoxList" TagPrefix="cc" %&gt; &lt;cc:ValidateableCheckBoxList runat="server" ID="cblFindTheSite"&gt; &lt;asp:ListItem&gt;The Press&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;blah1&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;blah2&lt;/asp:ListItem&gt; &lt;/asp:CheckBoxList&gt; &lt;div class="validators"&gt; &lt;asp:RequiredFieldValidator runat="server" ID="rfvTest" ControlToValidate="cblFindTheSite" Text="Failed validation" &gt;&lt;/asp:RequiredFieldValidator&gt; &lt;/div&gt; </code></pre>
c# asp.net
[0, 9]
3,048,748
3,048,749
How to add a field validator and set it programmatically
<p>I need to add a field validator, the admin of the website sets the number of characters of a textbox in admin and then... in the front side users can only type upto the number of characters specified by the admin.</p> <p>In the fron end i aleady pull the number from the database but now i am not sure how to create a validator where i can set the value say:</p> <pre><code>pseudocode Get the validator set the validator to validate these maximum number of characters myValidator.setamaxnumber = mydbvalue; error message = Only + mydbvalue + charaters are accepted. </code></pre> <p>I hope you understand what i want to do. If not, no need to do a negative vote post your question and i will try my best to supply more information</p> <p>Thanks a million</p>
c# asp.net
[0, 9]
5,749,538
5,749,539
how to use Switch with a string
<p>I have the code below that I wrote to get rid of a huge mess of if then else statements. The only problem is, I just found out that the Switch statement cannot be used with a string.</p> <p>Is there a trick to get around this?</p> <p>Thanks</p> <pre><code>switch(xpp.getName()) { case("creature") : attribID = Integer.parseInt(xpp.getAttributeValue(0)); case("name") : elName = xpp.getName(); break; case("race") : elName = xpp.getName(); break; case("gender") : elName = xpp.getName(); break; case("alignment") : elName = xpp.getName(); break; case("age") : elName = xpp.getName(); break; case("condition") : elName = xpp.getName(); break; case("skinColor") : elName = xpp.getName(); break; case("hairColor") : elName = xpp.getName(); break; case("size") : elName = xpp.getName(); break; case("height") : elName = xpp.getName(); break; case("weight") : elName = xpp.getName(); break; case("hitPoints") : elName = xpp.getName(); break; case("armorClass") : elName = xpp.getName(); break; case("actionPoints") : elName = xpp.getName(); break; case("magicPoints") : elName = xpp.getName(); break; case("strength") : elName = xpp.getName(); break; case("dexterity") : elName = xpp.getName(); break; case("intelligence") : elName = xpp.getName(); break; case("weapon") : elName = xpp.getName(); break; case("armor") : elName = xpp.getName(); break; case("magicItem") : elName = xpp.getName(); break; case("attackSpell") : elName = xpp.getName(); break; case("defenseSpell") : elName = xpp.getName(); break; case("item1") : elName = xpp.getName(); break; case("item2") : elName = xpp.getName(); break; } </code></pre>
java android
[1, 4]
3,041,770
3,041,771
IE select not appending options
<p>I created a currency converter object and it works great except in IE. None of options get appended to the select element. I have been trying to find a solution for hours but can't figure out what is going on. I am new to javascript so I may be doing something completely wrong just not sure what. It seems like the render method is not getting called from within fetch. Thanks</p> <pre><code>var CurrencyConverter = { // Initialize Currency Converter // total: jQuery wrapped object that contains the price to convert // select: jQuery wrapped select element to render the options tag in init: function (total, select) { var that = this; this.total = total; this.base_price = accounting.unformat(this.total.text()); this.select = select; this.fetch(); select.change(function () { var converted = '', formated = ''; fx.settings = { from: fx.base, to: this.value }; converted = fx.convert(that.base_price); formated = accounting.formatMoney(converted, { symbol: this.value, format: "%s %v", precision: "0" }); $(that.total).text(formated); }); }, // Render Currency Options render: function () { var that = this, accumulator = [], frag = ''; for (var propertyName in fx.rates) { accumulator.push(propertyName); } $.each(accumulator, function ( i, val ) { var the_price = $(document.createElement('option')).text(val); if (val == fx.base) { the_price.attr('selected', 'true'); } // TODO: not optimal to run append through each iteration that.select.append(the_price); }); }, // Fetch &amp; set conversion rates fetch: function () { var that = this; // Load exchange rates data via the cross-domain/AJAX proxy: $.getJSON( 'http://openexchangerates.org/latest.json', function(data) { fx.rates = data.rates; fx.base = data.base; that.render(); } ); } }; if ($('#currency-select')) { CurrencyConverter.init($('#price'), $('#currency-select')); } </code></pre>
javascript jquery
[3, 5]
37,615
37,616
How to disable form button click function for X seconds
<p>I have a form with a submit button. I want to disable the submit button for 10 seconds, and show a countdown, at the end of which the button becomes clickable.</p> <p>How would I do that? Im using jquery on the site, but Im not a JS programmer. </p>
javascript jquery
[3, 5]
71,926
71,927
new tab issue in google chrome
<p>I want to open page new tab in button click event. Here is my code:</p> <pre><code>&lt;asp:ImageButton ID="imgPropertyImage" CommandArgument='&lt;%#Eval("pro_id") %&gt;' runat="server" Height="90px" Width="130px" CssClass="imgborder" ImageUrl='&lt;%#Eval("display_photo") %&gt;' OnCommand="imgPropertyImage_Command" BorderColor="#00CCCC" AlternateText="" onclick="imgPropertyImage_Click" /&gt; protected void imgPropertyImage_Click(object sender, ImageClickEventArgs e) { ImageButton img = sender as ImageButton; Session["Pro-ID"] = img.CommandArgument; Response.Redirect("PropertyDetails.aspx"); } </code></pre>
c# asp.net
[0, 9]
4,396,080
4,396,081
Import yahoo Contacts using Javascript
<p>our website use all contacts from yahoo,gmail,hotmail.but in gmail,and hotmail have JavaScript code get me . but how to get all contacts from yahoo using JavaScript .</p> <p><strong>How To Get All Contact From Yahoo Using JavaScript ?</strong></p> <p>Please help me .....</p>
javascript jquery
[3, 5]