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
5,306,344
5,306,345
Refreshing JS code to display correct data on screen
<p>I'm using script below to countdown from given time and display how many hours+minutes+seconds left for timeout on the script in real-time.</p> <p>Counting down woks perfectly fine but the problem I'm facing is, when using <strong>next</strong> and <strong>previous</strong> buttons on browsers, the time doesn't get refreshed and I see old time instead. It either shows previous time or later.</p> <p>I'm aware that <strong>next</strong> and <strong>previous</strong> buttons on browsers don't refresh pages but how can I overcome this issue?</p> <p><strong>JS</strong></p> <pre><code>function timeout_warning(login_timeout) { var counter = 0; var total_seconds = 0; var colour = ''; var interval_id = ''; interval_id = setInterval(function () { counter++; total_seconds = login_timeout - counter; hours = parseInt(total_seconds / 3600 ) % 24; minutes = parseInt(total_seconds / 60 ) % 60; seconds = parseInt(total_seconds % 60, 10); remaining = (hours &lt; 10 ? "0" + hours : hours) + ":" + (minutes &lt; 10 ? "0" + minutes : minutes) + ":" + (seconds &lt; 10 ? "0" + seconds : seconds); if (minutes == 0 &amp;&amp; seconds == 0) { document.getElementById('font_timeout').innerHTML = 'Timeout'; window.clearInterval(interval_id); } else { document.getElementById('font_timeout').innerHTML = remaining + 'sec'; } }, 1000); } </code></pre> <p><strong>HTML BODY</strong></p> <pre><code>&lt;body onload="timeout_warning('1800')"&gt; </code></pre>
javascript jquery
[3, 5]
3,179,230
3,179,231
How to express jquery ajax call with only javascript?
<p>Can you help me convert this jquery to javascript? Thanks.</p> <pre><code> &lt;script&gt; $(document).ready(function() { $("a.false").click(function(e) { $(this).closest("tr.hide").hide("slow"); var main_id = this.title; var display = "false"; e.preventDefault(); $.ajax({ url: "/useradminpage", data: {main_id: main_id, display: display}, success: function(data) { //display_false(); } }); }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,013,261
3,013,262
Setup a global loading animation istead on every div. Javascript - Jquery
<p>How can I setup a global loading instead on every div? The loading pic appears until all pages are loaded.</p> <pre><code> $(document).ready(function() { $('#termid').change(function() { var val = $(this).val(); $('#firstresult').empty().addClass('loading').load(val + '.php', function(){$('#firstresult').removeClass('loading') }); $('#secondresult').empty().addClass('loading').load(val + 'b.php', function(){$('#secondresult').removeClass('loading') }); }); }); </code></pre>
javascript jquery
[3, 5]
4,311,524
4,311,525
coin slider jquery --> how do I pass 100% width argument to this? Only seems to allow pixel configuration of images?
<p>I am using the jQuery coinslider, and would like to pass a 100% width argument (rather than the current pixel size arguments). Is there a way to do this?</p> <p>Thanks!</p> <pre><code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[ (function($) { $(document).ready(function() { $('#coin-slider').coinslider({ effect: 'rain',width:680,height:275, delay: 5000,navigation: true, pause:200 }); }); })(j142); // ]]&gt;&lt;/script&gt; &lt;div id="coin-slider"&gt;&lt;a href="#" target="_blank"&gt; &lt;img src="img1.jpg" alt="" /&gt; &lt;/a&gt; &lt;a href="#"&gt; &lt;img src="#" alt="" /&gt; </code></pre> <p>Rather than pass width 680, I want to pass width 100% (or anything so that it sizes for width of the browser. Does anyone know how to do this?</p> <p>thanks much in advance!!</p>
javascript jquery
[3, 5]
2,719,115
2,719,116
Simple Login using C# in ASP.NET
<p>I just started programing in ASP.NET and I'm currently making a simple Login page. I already have a database for the users and their password so what I want to do is when a user enter a username and password I want the program to check if theres a matching records in the database and allow the user to login (like any login page would do). I know the logic but I really need a head start in this.</p> <p>I just dont like the built in Login control nor applying a Custom Membership Profile. Took me a month figuring those and I still couldnt get it and my boss doesn't like it either.</p> <p>Any help would be much appreciated ;) </p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
5,774,211
5,774,212
PHP structure changed into a jQuery
<p>As this structure changed into a jQuery? And if this is possible at all?</p> <pre><code>$path=$_SERVER["REQUEST_URI"]; $pathkor = substr(strrchr($path, "/"), 1); $var = "/актеры/женщины/"; if(strstr($pathkor, '%D0%B6%D0%B5%D0%BD%D1%89%D0%B8%D0%BD%D1%8B') or strstr($pathkor, '98+99+100+101')){ print '&lt;div class="punkt active"&gt;&lt;a alt="А-Б-В-Г" title="А-Б-В-Г" href="'.$var.'98+99+100+101"&gt;А-Г &lt;/a&gt; &lt;/div&gt;'; } else { print '&lt;div class="punkt "&gt;&lt;a alt="А-Б-В-Г" title="А-Б-В-Г" href="'.$var.'98+99+100+101"&gt;А-Г &lt;/a&gt; &lt;/div&gt;'; } </code></pre> <p>The meaning of this code. Find the latest entries in an alias, and compare them. And if there is a match then appoint a special class.</p>
php jquery
[2, 5]
2,544,519
2,544,520
Jquery remove and add back click event
<p>Is it possible to remove than add back click event to specific element? i.e </p> <p>I have a <strike><code>$("#elem").click(function{//some behaviour});</code>,</strike> <code>$(".elem").click(function{//some behaviour});</code>(there are more than 1 element) while my other function <code>getJson</code> is executing I'd like to remove the click event from the <code>#elem</code>, and add it again onsuccess from getJson function, but preserve both mouseenter and mouseleave events the whole time?</p> <p>Or maybe create overlay to prevent clicking like in modal windows? is that better idea? </p> <p><strong>edit :</strong></p> <p>I've seen some really good answers, but there is one detail that I omitted not on purpose. There are more than one element, and I call the click function on the className not on elementId as I stated in the original question</p>
javascript jquery
[3, 5]
5,281,677
5,281,678
Run function after mouse down for set time jQuery/JS
<p>Basically when you hold down any of the buttons with the class of <code>block_delete</code> for more than 1 second, the <code>OpenLoader()</code> should run. I googled and looked around on here and then made this, it kind of works:</p> <pre><code>var functionDeleteBlockDia = function() { $(".block_delete").mouseup(function (){ event.preventDefault(); }); $(".block_delete").mousedown(function (){ setTimeout(function(){ OpenLoader(); }, 1000); }); } </code></pre> <p>The problem I'm having is that on mouseup the <code>OpenLoader();</code> dies, I tried to unbind mouseup even though there's no function attached to it, I tried to attach <code>event.preventDefault();</code> on it as you can see above, but it still didn't work. </p>
javascript jquery
[3, 5]
1,949,089
1,949,090
Strict Mode Scope Error on SetInterval call
<p>Below is an pseudo example of what I am trying to doing</p> <p>In non strict mode this works, but in strict mode I get a not defined error when the setInterval fires. This script is called from another jquery script as a plugin which then makes the call to the init section.</p> <p>From reading here it appears to be a global scope / context problem but I don't know how to proceed</p> <pre><code>(function($, window, document) { 'use strict'; // remove and things work var opts,test; test = function(options) { opts = $.extend(test.prototype.opts, test.prototype.defaults, options); }; test.prototype.Save = function () { console.log('hi'); }; test.prototype.defaults = { _interval_id: null }; test.prototype.opts = {}; $.bla.plugins.foobar = function() { var base = this, bar; base.init = function() { bar = new test(); opts = test.prototype.opts; bar.Save(); // works opts._interval_id = setInterval('bar.Save();', 10000); // called but bar is not defined }; }; })(jQuery, window, document); </code></pre>
javascript jquery
[3, 5]
434,739
434,740
How to listen for a key press in Android
<p>I want to listen for an Android key press. For example when I press the Menu key on the phone, I will get this key press and start an application.</p> <p>And I don't know in <code>Phonewindowmanager.java</code> when I pressed a key, the <code>interceptKeyTq()</code> come to twice.</p>
java android
[1, 4]
262,395
262,396
Passing URL parameter with JavaScript
<p>I have some JavaScript that creates Forward and Back buttons. However, I need to pass a parameter in the URL (<code>?id=$idd</code>):</p> <pre><code>&lt;a href="javascript:submitForm('mainForm','back');" title="Go back to the kit home page" style="float: left;"&gt;&lt;img src="images/back.gif" alt="Go back to the kit home page" border="0" /&gt;&lt;/a&gt; &lt;a href="javascript:submitForm('mainForm','proceed');" title="Submit the order details" style="float: right;"&gt;&lt;img src="images/proceed.gif" alt="Proceed to the next page" border="0" /&gt;&lt;/a&gt; </code></pre> <p>The JavaScript is below:</p> <pre><code>// Used in all pages to submit a form and optionally set a hidden // form varaible called 'navigate' to direct navgiation function submitForm(formName, navigateValue) { if (navigateValue != null &amp;&amp; navigateValue != "") { document.forms[formName].navigate.value = navigateValue; } document.forms[formName].submit(); } </code></pre> <p>Thanks.</p>
php javascript
[2, 3]
3,129,325
3,129,326
Separate a java listener to its own function?
<p>Can I break the set-listener line into smaller pieces?</p> <p>Here is the code I have:</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { Preference button = (Preference)getPreferenceManager().findPreference("exitlink"); button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { finish(); return true; } }); </code></pre> <p>I would like this to look something like:</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Preference button = (Preference)getPreferenceManager().findPreference("exitlink"); if(button != null) { button.setOnPreferenceClickListener(onPreferenceClick); } } public boolean onPreferenceClick(Preference arg0) { finish(); return true; } </code></pre>
java android
[1, 4]
2,911,178
2,911,179
javascript Running a function under another function
<p>I have 3 functions, with the third function under the first that I want to run in the second.</p> <pre><code>function first () { function third () { } } function second () { third (); } </code></pre> <p>How can I make second run third correctly?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
1,779,837
1,779,838
Alligator tags(<% %>) inside js string?
<p>I am trying to redirect a page reading the url from the config file.</p> <p>However, when I try this:</p> <pre><code> &lt;script type="text/javascript"&gt; &lt;%string redirectUrl = System.Web.Configuration.WebConfigurationManager.AppSettings["RedirectURL"];%&gt; window.parent.location.replace("&lt;%=redirectUrl%&gt;"); &lt;/script&gt; </code></pre> <p>the alligator tags &lt;% %> are Not being highlighted, and when I run I get the following error in the yellow screen:</p> <pre><code>the controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;). </code></pre> <p>What am I doing wrong??</p> <p>Thanks!</p> <p>Edit:</p> <p>It does work if I just put the url straight into the code, as in </p> <pre><code>window.parent.location.replace("http://theurl.com"); </code></pre> <p>but I need to change this depending on other things, so I need it to be in the config :S</p>
asp.net javascript
[9, 3]
5,007,979
5,007,980
jQuery submit ajax form with 2 submit buttons
<p>im trying to achieve the following, in php i have a form like this:</p> <pre><code>&lt;form method="post" id="form_1" action="php.php"&gt; &lt;input type="submit" value="add" name="sub"/&gt; &lt;input type="submit" value="envoi" name="sub"/&gt; &lt;/form&gt; </code></pre> <p>the form action file is:</p> <pre><code>&lt;?php if( $_POST["sub"]=="add"){ ?&gt; &lt;script&gt; alert("") &lt;/script&gt; &lt;?php echo "ZZZZZZ"; ?&gt; &lt;?php } ?&gt; </code></pre> <p>so this means if i press sub with value add an alert prompt will come up, how can i do the same thing(differentiate both submit) but using a Ajax request:</p> <p>the following code so does not work:</p> <pre><code> $(function(){ $('form#form_1').submit(function(){ var _data= $(this).serialize() $.ajax({ type: 'POST', url: "php.php?", data:_data, success: function(html){ $('div#1').html(html) } }) }) }) &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="1" style="width: 100px;height: 100px;border: 1px solid red"&gt;&lt;/div&gt; &lt;form method="post" id="form_1" action="javascript:;"&gt; &lt;input type="submit" value="add" name="sub"/&gt; &lt;input type="submit" value="envoi" name="sub"/&gt; &lt;/form&gt; &lt;/body&gt; </code></pre>
php javascript jquery
[2, 3, 5]
5,707,776
5,707,777
get the html element after created
<p>i'm creating a img when i click in a input, then i get the html or anyelse from the created img.</p> <p>but i dont know why this is not working!</p> <p>always return <code>null</code></p> <p>my js:</p> <pre><code>$("#click").click(function(){ var $imgDone = $('&lt;img/&gt;').attr('src', 'someImage/insomewhere.jpg'); $(this).after($imgDone); setTimeout(function(){ alert($(this).next().html()); }, 1000); }); </code></pre> <p>i mande a exp.: <a href="http://jsfiddle.net/frGpx/14/" rel="nofollow"><strong>Demo</strong></a></p>
javascript jquery
[3, 5]
1,698,828
1,698,829
Showing contents of a word document file in a textarea
<p>I've a asp.net web page which has a textarea control on it. In this control, I need to show contents of a word document file which is sitting on the server. Can someone please help me with the C# code ?</p> <p>Thanks for reading.</p>
c# asp.net
[0, 9]
2,851,329
2,851,330
Need to modify the SelectCommand parameter for SqlDataSource from C#
<p>I have a SqlDataSource that I am trying to modify in C# ASP.NET from my code behind page. The code in the page is:</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:TEST_SERVER %&gt;" ProviderName="&lt;%$ ConnectionStrings:TEST_SERVER.ProviderName %&gt;" &lt;/asp:SqlDataSource&gt; </code></pre> <p>I want to dynamically modify the SelectCommand parameter for SqlDataSource1 but in the codebehind page it does not seem to be available. </p> <p>Am I just doing it wrong?</p>
c# asp.net
[0, 9]
5,311,044
5,311,045
Using variables in a jQuery function
<p>This line $(''+fullId+'') is giving me problems. I've created an array in a different function that gets the #id's of all the inputs in the DOM. </p> <p>Now with this function i'm trying to create a blur and focus jQuery function. I've set the variable fullId to prepend the '"#' and append the '"' to the variable name, but how do I get it to work?</p> <p>$(''+fullId+'') is not doing the trick and neither does $(fullId)</p> <pre><code>function focusBlur () { var inputId = 0; var fullId = 0; for(var i=0; i&lt;size; i++) { inputId = arr.shift(); fullId = "\"#"+inputId+"\""; $(''+fullId+'').blur(function() { }); $(''+fullId+'').focus(function() { }); } } </code></pre>
javascript jquery
[3, 5]
4,882,556
4,882,557
$(form).submit not working in any IE version
<p>I have a upload file function that triggers a form submit event after the file has been choosed, however the function doesn't seem to trigger that event in any IE version.</p> <pre><code> var fromPCFunc = function() { var Iframe = '&lt;iframe id="uploadiframe"&gt;&lt;/iframe&gt;', formElement = '&lt;form name="uploadForm" style="display:none;" enctype="multipart/form-data" method="post" action="scripts/imageUpload.php" target="uploadiframe"&gt;', fileField = '&lt;input name="imageFile" type="file" value="" /&gt;'; $('body').append(formElement); $('form[name="uploadForm"]').append(fileField); $('body').append(Iframe); $('iframe#uploadiframe').css('display', 'none'); $('form[name="uploadForm"]').find('input[name="imageFile"]').click(function() { this.value = ""; }); $('form[name="uploadForm"]').find('input[name="imageFile"]').click(); $(window).focus(function() { if ($('form[name="uploadForm"]').find('input[name="imageFile"]')[0].value === "") { $('iframe#uploadiframe').remove(); $('form[name="uploadForm"]').remove(); } else { $('#imageEditor_mainImage').trigger('imgLoading'); $('form[name="uploadForm"]').submit(); } $(this).unbind('focus'); }); $('iframe#uploadiframe').load(function() { var _this = this; removeFunc = function() { var imageFile = $.trim($(_this).contents().find('body').text()); $('#imageEditor_mainImage').trigger('imageOpen', imageFile); $(_this).remove(); $('form[name="uploadForm"]').remove(); } removeFunc(); }); } </code></pre> <p>Is there any way to fix this? Thanks in advanced.</p>
javascript jquery
[3, 5]
4,980,053
4,980,054
How can I create my custom properties on xml for Android?
<p>We have in our project a keyboard with "Key" elements, this Key elements have attributes such as android:codes="119", android:keyLabel="w" and so on.</p> <p>My question is how can I include an custom attribute like a "android:alternativeKeyLabel" to do something else.</p>
java android
[1, 4]
120,946
120,947
inline image captions plugin?
<p>Is there such thing as an inline image caption plugin for jquery?</p> <p>So a user can someone select a point on an image, and then insert a text caption. Whenever someone hovers over the image, the caption displays.</p> <p>Flickr has this type of functionality.</p>
javascript jquery
[3, 5]
183,451
183,452
Is it possible to access client harddisk using asp.net or any client side technology
<p>Actually I want to store a file on a client PC.</p> <p>I know that asp.net does not allow to access client harddisk but by using any trick or any idea?</p> <p>For security reasons I want to save a file on client's computer containing user information. I does not want to save a cookie in a user's browser. </p> <p>Scenario. I want to store something on client's PC permanently by using which I identify the user. Everytime when user login to mysite I will check that file on client's PC. If file is present then user will login sucessfully if file is deleted by the user or by any reason file is deleted or user comes from another PC then again save a file on client's PC. I does not want to save something on browser bcz user may delete the cookies and other histroy.</p> <p>Don't mark my question as negative, I don't have any harmful intention.</p>
javascript asp.net
[3, 9]
340,259
340,260
Javascript For loop doesn't always work in IE
<p>After two days of searching, I'm stuck and could really use some assistance.</p> <p>I have a javascript array that when iterated through will give me the key to each subsequent array. This works in all browsers except for some versions of IE. In some versions of IE, it appears that it first reorders the array in ascending order before returning the key. Jquery's each function does the same. Is there an equivalent to the javascript for loop that will not reorder the array and would still work for everyone?</p> <pre><code>var db = new Array(); db[259] = new Array(3); db[259][0] = "John Smith"; db[259][1] = "Los Angeles"; db[259][2] = "Chicago"; db[917] = new Array(3); db[917][0] = "Jane Smtih"; db[917][1] = "New York"; db[917][2] = "Tampa"; db[208] = new Array(3); db[208][0] = "Jack Johnson"; db[208][1] = "Baltimore"; db[208][2] = "Milwaukee"; for(var i in db){document.write(i + " ");} </code></pre> <p>In most browsers, the above will output 259 917 208. This is the outcome that I would like.</p> <p>In some versions of IE, the above will output 208 259 917. It looks like it orders the keys in ascending order first. The key is important here as it is the person's ID # and the rank is important (ie, 259 should come before 208). Other functions make reference to db[i] where i is the person's ID #.</p> <p>Can anyone help?</p>
javascript jquery
[3, 5]
1,949,666
1,949,667
How to give the same link to multiple auto-generated buttons with the same ID
<p>How to give the same link to multiple auto-generated buttons with the same ID?</p> <p>I've tried, but it only gives the first button the link, the rest of the buttons remain empty</p> <pre><code>$('#Button').click(function() { window.location='aaa.html'; }); </code></pre>
javascript jquery
[3, 5]
5,740,286
5,740,287
What is the initial step to start with android? How does java programming help?
<p>I am a Java professional. Now I'd like to write an application for the Android platform. </p> <ul> <li>What is the initial step I need to take?</li> <li>How does my Java programming experience help in this case?</li> </ul>
java android
[1, 4]
1,241,569
1,241,570
Remove all other list items except the one that is clicked using jQuery
<p>I have list of this kind</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;div class="pname"&gt;Name1&lt;/div&gt;&lt;div class="pid"&gt;ID1&lt;/div&gt;...&lt;/li&gt; &lt;li&gt;&lt;div class="pname"&gt;Name2&lt;/div&gt;&lt;div class="pid"&gt;ID2&lt;/div&gt;...&lt;/li&gt; &lt;li&gt;&lt;div class="pname"&gt;Name3&lt;/div&gt;&lt;div class="pid"&gt;ID3&lt;/div&gt;...&lt;/li&gt; ... &lt;/ul&gt; </code></pre> <p>If I click on any of the list item, rest all other list items should be removed. Can anyone suggest how I could do this?</p>
javascript jquery
[3, 5]
1,636,415
1,636,416
Performing click event on a disabled element? Javascript jQuery
<p>I would like to perform the click event of a element:</p> <pre><code>jQuery('input#submit').click(function() { if ( jQuery('input#submit').attr("disabled") ) { alert('SUP'); } }); </code></pre> <p>However this will not work as the element is required to be enabled for the click even to be executed.</p> <p>Any help would be appreciated,</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,986,701
2,986,702
jquery, write a function to get both new and old window.width
<p>how do i write a function that detects and caches the start and the end of a window.width resize</p> <p>the width in the the .resize(funciton{}) changes instantly when resizing, but I'm after the differences between the old and new size every time it resizes.</p> <p>update---</p> <p>I Need to catch the diffeence so that I can do a width: '+=diff' to an element </p>
javascript jquery
[3, 5]
4,178,593
4,178,594
exception of type 'system.outofmemoryexception' was thrown
<p>My page throws error exception of type 'system.outofmemoryexception' was thrown .</p> <p>This happens when i press submit button in submit button there are sqlconnections with stored procedure as im populating grid with data .</p> <p>It gives error when i put code in submit button. But when i put tht on page load it works good .</p> <p>Can anyone help me on this .</p> <p>Thanks, Smartdev</p>
c# asp.net
[0, 9]
321,036
321,037
php $FILES is empty
<p>i try to insert a row to db with php and jquery</p> <p>I have this code</p> <pre><code>$.post('/json/management/AddArtistAjax', { "artistName": $("#nameSurnameID").val() , "Country": $("#country").val() , "bDate" : $("#demo1").val() , "dDate" : $("#demo2").val() , "bio" : $("#bioID").val() }, function(response){ alert(response); }); </code></pre> <p>I can send php side all of above.However, i cannot send files to php side</p> <p>print_r($_FILES) array is empty why ? </p>
php jquery
[2, 5]
5,484,225
5,484,226
JavaScript - jQuery toggle option
<p>I have a script to execute some tasks based on an option variable. Option has a default value 1. The value can be toggled by clicking some links. Then a set of operations are set, for that operations to execute. The sample layout will be like;</p> <p>HTML</p> <pre><code>&lt;a id="opt1"&gt;1&lt;/a&gt;&lt;br&gt;&lt;a id="opt2"&gt;2&lt;/a&gt;&lt;br&gt;&lt;a id="opt3"&gt;3&lt;/a&gt;&lt;br&gt; &lt;div id="mydiv"&gt;option1&lt;/div&gt; </code></pre> <p>JS</p> <pre><code>var opt=1; $('#opt1').click(function() { opt=1; }); $('#opt2').click(function() { opt=2; }); $('#opt3').click(function() { opt=3; }); if(opt == 1){ $('#mydiv').text("option1"); }else if(opt == 2){ $('#mydiv').text("option2"); }else{ $('#mydiv').text("option3"); } </code></pre> <p>JS is wrapped inside document ready function. The sample is meant to change text according to option variable. Sorry that the tasks cannot be nested inside <code>.click(function()</code> and are purely depend on option value. How can I achieve this?</p> <p>here is the fiddle <a href="http://jsfiddle.net/Naw3y/" rel="nofollow">http://jsfiddle.net/Naw3y/</a></p>
javascript jquery
[3, 5]
1,406,295
1,406,296
Android Content Provider database leak issue
<p>I am writing a content provider for this application and in my content provider I am opening a database connection, running a query and returning the cursor of results to the calling program. If I close this database connection in the provider, the cursor has no results. If I leave it open, I get "leak found" errors in my DDMS log. What am I missing here? What's the clean, proper way to return a cursor of database results?</p>
java android
[1, 4]
2,054,434
2,054,435
How to store order of items in case we have a bitmask that contains a list of items?
<p>I have a bitmask in my db for storing a list of items. Before now I just rendered these items one by one on the screen. But now user should have an ability to set the order of items. I have a solution that I dislike: to store ids list in the field using some separator (something like this 1|8|4|16). </p> <p>Can anyone help me to find another solution?</p>
c# asp.net
[0, 9]
559,356
559,357
onChange="document.myform.submit() and PHP while loop
<p>I have the following code and on it's own works fine, but I need to have it in a PHP while loop as there may be hundreds of records. This does not work, meaning it does not submit the form.</p> <p>Any help with this code, or other ideas that will work are appreciated. It also needs to write to a mysql DB the new value. Please note that I am less than a newbie with javascript.</p> <p>Thanks</p> <pre><code>&lt;form action="home.php" method="post" name="status"&gt; &lt;input type="hidden" name="record_number" value="&lt;? echo $r['record_number']; ?&gt;"&gt; &lt;input type="hidden" name="submit" value="cstatus"&gt; &lt;select name="statuscode" type="dropdown" style="font-size: 8pt; width: 60px" onChange="status.submit();"&gt; &lt;? if($r['statuscode']) { echo "&lt;option value='".$r['statuscode']."'&gt;".$r['statuscode']."&lt;/option&gt;"; } ?&gt; &lt;option value='Open'&gt;Open&lt;/option&gt; &lt;option value='Closed'&gt;Closed&lt;/option&gt; &lt;option value='Pending'&gt;Pending&lt;/option&gt; &lt;option value='Cancelled'&gt;Cancelled&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre>
php javascript
[2, 3]
318,640
318,641
Why does jCaroussel Lite cut off text in some slides?
<p>I'm using a jQuery plugin called <a href="http://www.gmarwaha.com/jquery/jcarousellite/" rel="nofollow">jCarousel Lite</a> to create a vertical scrolling Twitter ticker. Everything works fine, except for the fact that some tweets aren't shown completely. They're cut off before the last line of text. I can't seem to figure out what is causing the problem and it seems to occur more or less randomly too.</p> <p>The page at <a href="http://www.reekx.nl/" rel="nofollow">http://www.reekx.nl/</a> shows the Twitter ticker in action (bottom right, titled 'Reekx op Twitter').</p> <p>Is anybody able to tell me what's going wrong here and how I can fix it?</p>
javascript jquery
[3, 5]
3,766,350
3,766,351
Save int into nullable int column
<p>I am trying to save an integer into a nullable int column only if there is a value</p> <pre><code>if (user.AssociationID != 0) { int? AssociationID = user.AssociationID; currentUser.AssociationID == AssociationID; } </code></pre> <p>I have tried casing currentUser into an int <code>(int?)currentUser.AssociationID</code></p> <p>I know this has to be terribly simple. I've googled for the title of the question and am not finding the results I need. Be nice, I'm a noob.</p> <p><strong>Error I'm getting:</strong> Only assignment, call, increment, decrement, and new object expressions can be used as a statement </p>
c# asp.net
[0, 9]
4,119,298
4,119,299
Override jquery onclick event?
<p>I have a button in ASP.NET, that renders to HTML as such:</p> <pre><code>&lt;input id="btn" type="submit" value="clickme"&gt; </code></pre> <p>If I then add the jquery:</p> <pre><code>$('#btn').click(function(){return false;}); </code></pre> <p>Every time the button is clicked, nothing will happen (i.e. no postback). This is fine.</p> <p>Is there any way in Javascript I can programatically invoke the click (which will cause a postback) whilst also disregarding the jquery-attached, <code>return false</code> function?</p>
javascript jquery asp.net
[3, 5, 9]
5,048,030
5,048,031
How to Append a Row in a Datatable?
<p>I have a datatable say dt1( which keeps changing its inside a loop). I have another datatable say dt2( initially its null). Now I have to append the Rows of dt1 in dt2. I tried using Merge(), but the previous rows of dt2 are vanishing. Any idea How to do this ??</p>
c# asp.net
[0, 9]
3,623,501
3,623,502
SubString/subsequence in javascript
<p>Can anybody help me in formatting the below string to display the final result as "<strong>Mark, Anthony</strong>" i have been using substring in javascript to format and do we have anything like subsequence to make these format in a single line code?</p> <pre><code>var res="undefinedMark, Anthony," var final = res.substring(9, res.length); // removes undefined var finalOP = final.substring(0, final.length - 9); // removes the final , </code></pre> <p>thanks</p>
javascript jquery
[3, 5]
4,080,270
4,080,271
i want call MotionEvent.ACTION_DOWN in one activity and MotionEvent.ACTION_UP in another activity
<pre><code> ImageView ii = (ImageView)v.findViewById(R.id.picture); ii.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent e) { ImageView i2 = (ImageView)findViewById(R.id.btn_imagetest); if(e.getAction() == MotionEvent.ACTION_DOWN){ //call activity one } if (e.getAction() == MotionEvent.ACTION_UP) { //call activity 2 } return true; } }); </code></pre> <p>when i touch on image 'ii' i should go to imgview(i2)(can be activity too) and when i leave the imgview should go away(back to same activitiy) ..(Note:imgview is covers full screen in phone) i have no idea..how to proceed. </p>
java android
[1, 4]
5,478,247
5,478,248
State Of Variables
<p>In "edmx" page I have button control with event "NextButton_Click" for click. When I click this button the variables "index" doesn't want to change to "40" and the "text" variable doesn't want to change to "active". These variables are always in the same state "text" is always equal to "start" and "index" is always equal to "10". Why they don't want to change with (index = 40; text = "active";) as I wrote in the click button event method ?</p> <pre><code>public partial class CountriesTowns : System.Web.UI.Page { int index = 10; string text = "start"; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { index = 20; text = "stop"; } } //click next button protected void NextButton_Click(object sender, EventArgs e) { Response.Write(index); Response.Write(text); index = 40; text = "active"; } </code></pre>
c# asp.net
[0, 9]
1,780,092
1,780,093
How to not activate mother when clicking child?
<p><a href="http://jsfiddle.net/aQb9H/" rel="nofollow">http://jsfiddle.net/aQb9H/</a> What is the best way to do this, do not activate the parent while on click its child. Now while clicking the child both are activated .</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;script&gt; $(document).ready(function(){ $('#child').click(function(){ $('#output').append('Child is activated ||') }) $('#mother').on('mousedown',function(){ $('#output').append('Mother is activated ||') }) }) &lt;/script&gt; &lt;/head&gt; &lt;style&gt; #mother,#child,#output{ display:block; color:white; font-weight:bold; cursor:pointer; } #mother{ width:100px;height:100px; padding:30px; margin:20px; background-color:purple; } #child{ width:100px;height:100px; background-color:orange; } #output{ width:300px;height:100px; border:2px solid red; color:black; } &lt;/style&gt; &lt;body&gt; &lt;h1&gt;Click Child, I don't want to activate mother when clicking child&lt;/h1&gt; &lt;div id='mother'&gt; Mother &lt;div id='child'&gt;Child&lt;/div&gt; &lt;/div&gt; &lt;div id='output'&gt; Output: &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
4,488,165
4,488,166
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]
5,469,148
5,469,149
override Master Page CSS div width in Child Page
<p>I've set a specific width to the body div in my Master Page and I want to change that in a Child Page that belongs to the Master Page. Is this possible? I've been searching and I think what I need is javascript.</p> <p>I haven't used javascript before though, but here's what I've tried:</p> <pre><code>&lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;script type="text/javascript"&gt; { document.getElementById("pagediv").style.width = "200px"; } &lt;/script&gt; &lt;/asp:Content&gt; </code></pre>
c# asp.net
[0, 9]
2,423,908
2,423,909
How to Overwrite first some bytes of a file with different bytes in android
<p>I have a problem that I want to overwrite first 2^21 bytes of a video file with another 2^21 bytes, but I don't know how to do that? Please suggest me the right solution for the same.</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,347,780
2,347,781
How to get content from a drop down menu to text field?
<p>I am a new person in this PHP and Javascript. I have a drop down menu as follows. Want to get the content or value to a text field and retain the value after the page refreshs? How will do this?</p> <pre><code>&lt;select name="animal" style="width: 350px;"&gt; &lt;option value=""&gt;Please Select&lt;/option&gt; &lt;option value="Dog"&gt;Dog&lt;/option&gt; &lt;option value="Cat"&gt;Cat&lt;/option&gt; &lt;option value="Cow"&gt;Cow&lt;/option&gt; &lt;option value="Rat"&gt;Rat&lt;/option&gt; &lt;/select&gt; </code></pre>
php javascript
[2, 3]
142,839
142,840
MediaPlayer errors
<p>I need to write a very simple android application but I have a serious problem.</p> <p>Here is my class:</p> <pre><code>package com.music.playa; import java.util.Random; import android.app.Activity; import android.content.Context; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class PlayMusic extends Activity { MediaPlayer mediaPlayer; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void playSound() { try { mediaPlayer.stop(); mediaPlayer.reset(); mediaPlayer.release(); mediaPlayer = null; } catch (Exception ex) { } String[] sounds = { "sound1", "sound2", "sound3" }; mediaPlayer = null; int path = getResources().getIdentifier( sounds[new Random().nextInt(sounds.length)], "raw", getPackageName()); mediaPlayer = MediaPlayer.create(this, path); mediaPlayer .setOnCompletionListener(new MediaPlayer.OnCompletionListener() { public void onCompletion(MediaPlayer mp) { // do something... } }); mediaPlayer.setVolume(1, 1); mediaPlayer.start(); } } </code></pre> <p>The problem is that when I press the button all the time calling PlaySound function, then after a while (about 40-50 presses of the button), the console throws a lot of errors:</p> <pre><code>05-28 12:56:00.202: E/MediaPlayer(755): error (-38, 0) 05-28 12:56:01.153: E/MediaPlayer(755): error (-19, 0) 05-28 12:56:01.153: E/MediaPlayer(755): Error (-19,0) </code></pre> <p>and the sound stops playing.</p> <p>What should I do?</p> <p>Android SDK 2.3.3</p>
java android
[1, 4]
5,706,842
5,706,843
Prevent user from holding f5 for more than x seconds?
<p>Is there a way to bind a jQuery event to pop off after a visitor holds a button for more than, say, 3 seconds? In this case I'd like to do something after a user holds f5 for 3 seconds.</p> <p>I've found a solution that prevents the refresh when user presses f5 here:</p> <p><a href="http://stackoverflow.com/questions/2482059/disable-f5-and-browser-refresh-using-javascript">disable f5 and browser refresh using javascript</a></p> <p>However, this isn't quite what I'm looking for as I'd like to allow my users to refresh pages but prevent them from placing a rock on the f5 button so to speak (it's an online game where you can do tasks by refreshing the page).</p> <p>Is what I'm trying to do even possible?</p> <p>EDIT: I am looking for a short-term, quick, client-side fix. The server side of things will be solved later on.</p>
javascript jquery
[3, 5]
3,180,805
3,180,806
Converting Url list to an ip?
<p>Is there any program for converting list of Urls to an ip list ? example:</p> <pre><code>site1.com ip1 site2.com ip2 site3.com ip3 </code></pre>
php javascript
[2, 3]
1,569,916
1,569,917
jQuery remove element on ajax success
<p>I have <code>&lt;button&gt;</code> with ajax on it, and want to remove it after successful request.</p> <pre class="lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt; $(".approve").click(function(){ var el, image_id = $(this).data('image-id'); $.ajax({ type: "PATCH", dataType: "json", data: { "approved": "True"}, url: "/ml/api/image/" + image_id + "/?format=json", success: function(data){ $(this).remove(); } }); }); &lt;/script&gt; </code></pre> <p>But this doesn't work…</p>
javascript jquery
[3, 5]
3,836,285
3,836,286
How can I get these jQuery results with vanilla JavaScript?
<p>Does anybody know how I can get the equivalent of jQuery's <code>.offset()</code> and <code>.closest()</code> without a JavaScript library?</p> <p>For <code>.closest()</code>, if I know how far to climb up the DOM tree, I can just use that many <code>.parentNode</code>s, but if I don't know how far to go, I'm stuck.</p>
javascript jquery
[3, 5]
1,266,032
1,266,033
Jquery Class selector
<p>I a developing an app in which I am using</p> <pre><code> $("#plblAgreeProblem",".plblAgreeComment").live("click", function(){ alert("bil"); } </code></pre> <p>but class selector is not working. my divs which have class="plblAgreeComment" are creating dynamically so I am using .live()</p> <p>Please help me.</p>
javascript jquery
[3, 5]
5,859,195
5,859,196
Execute Server Side from Client Side
<p>I want to execute the Add button click event(server side) from client side.</p> <p>This is my javascript function</p> <pre><code> function validateinput() { var arrTextBox = document.getElementsByTagName("input"); var retVal = 1; for (i = 0; i &lt; arrTextBox.length; i++) { if (arrTextBox[i].type == "text" &amp;&amp; arrTextBox[i].value == "") { retVal = 0; } } if (retVal == 0) { alert("Validation Failed"); return false; } else { alert("Validation Success"); return true; __doPostBack(btnAddItem); } } </code></pre> <p>I am calling the server side code only when alert("Validation Sucess") and returns true.</p> <p>This is my server side code </p> <pre><code> protected void Page_Load(object sender, EventArgs e) { txtbox1.Attributes.Add("onkeydown", "if(event.keyCode) {if (event.keyCode &gt; 57 &amp;&amp; event.keyCode &lt;= 90) return false; } else {return true};"); if (!IsPostBack) { //The code is too big to be posted } } protected void btnAddItem_Click(object sender, EventArgs e) { if (IsValidPost()) { if (btnAddItem.Text == "Add Item +") { if (textbox1.text== "") { Addtogrid(); } } } } </code></pre> <p>Am I doing it the right way? as I am not getting the expected results. Also I get an error at Page.GetPostBackEventReference(btnAddItem); saying ClientScript is a recommended way . When I try to use ClientScript.GetPostBackEventReference(btnAddItem); it throws an error stating ClientScript is not recognised.</p> <p>Please help</p>
javascript asp.net
[3, 9]
4,453,774
4,453,775
extension method parameter in gridview databind
<p>I'm binding an object to a gridview. The object (LeClient) consists of several variables, two of which are related to its phone number. One variable contains a string of digits (LePhone) and the other contains an int that represents the country code (LeCountryCode). I have an extension method for strings that works to format the string LePhone and that I'd like to pass it LeCountryCode as the parameter.</p> <p>So far, on RowDataBound I have an event handler with the following line:</p> <pre><code>e.Row.Cells[5].Text = (string)(e.Row.Cells[5].Text).ToPhoneFormat(1); </code></pre> <p>I'd like to replace the 1 with the corresponding country code that's stored in the object LeClient associated with the row. How does this work? I tried </p> <pre><code>.ToPhoneFormat(e.Row.DataItem("LeCountryCode")); </code></pre> <p>but it's not giving me the expected result.</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,114,972
5,114,973
Iframe contact form dosen't send parent windows link
<p>here is my site <a href="http://www.atc-center.com" rel="nofollow">http://www.atc-center.com</a>. i have an inquiry form embed in you can see at product page click at any product and find " Inquiry " in red. i want to get the current url of page ( for product details). i tried many things but i can't get the url or product title. i tried some java script commands. here is code :</p> <pre><code> &lt;input type='hidden' name='purl' id='purl' value='&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;' /&gt;&lt;br/&gt; </code></pre> <p>and a java script code at the end of form:</p> <pre><code>parent.document.getElementById('purl'). $_SERVER['REQUEST_URI']; </code></pre> <p>Please help me.</p>
php javascript
[2, 3]
3,504,578
3,504,579
Android 2.1 How to create sniper style game
<p>I am trying to make a sniper style game where the user looks through a scope to see a large image that he can navigate. The user can only see part of the image at a time. The image is supposed to be much larger than the screen size that way he has to actually navigate and look for the enemy. How do I use an image that is larger than the screen that the user can navigate?</p> <p>It is kind of like when you are zoomed in to an image and you can pan the image and move it around to see different parts.</p>
java android
[1, 4]
3,610,002
3,610,003
Writing a stream to the response in ASP.Net
<p>Ok just want to clarify something with my solution.</p> <p>I have a requirement to grab a file from a respository somewhere, this repository requires a session token to be passed in the form of a cookie along with the request for the file. </p> <p>I am authenticating the user against this repository and storing the session token in the users cookie collection for my application when the user first logs onto my application. </p> <p>Problem is the cookie will not get sent to the repository when a user tried to access a file because the repository is on a different URL and domain. Therefore I am creating a new http request, appending the cookie and getting the response stream back.</p> <p>I now need to send this response stream back to the user, headers and all (as this response stream will contain the headers for the file the user is trying to access)</p> <p>Can I use this:</p> <pre><code> string session = cookie.Value; StreamReader reader = new StreamReader(Utility.GetLinkStream(url, session)); Context.Response.ClearHeaders(); Context.Response.Clear(); Context.Response.Write(reader.ReadToEnd()); </code></pre> <p>Essentially the call to Utility.GetLinkStream goes off and creates a http request then returns the stream of the response. Will the call to Write write out the whole response headers and all, or is there a better way to acheive this?</p>
c# asp.net
[0, 9]
2,764,310
2,764,311
Why is it risky to store data as an attribute of an element?
<p>I keep reading the same thing:</p> <blockquote> <p>"Storing property values directly on DOM elements is risky because of possible memory leaks."</p> </blockquote> <p>But can someone explain these risks in more detail?</p>
javascript jquery
[3, 5]
2,093,007
2,093,008
Jcarousel change a divs text depending on first item shown
<p>I'm having a problem with Jcarousel where i need to have a divs text changing when the next button is pressed on the carousel. I have the carousel set up and working how i want, scrolling one item at a time:</p> <pre><code>jQuery(document).ready(function() { jQuery('.mycarousel').jcarousel({ scroll : 1 });}); </code></pre> <p></p> <pre><code> &lt;li&gt; &lt;img src="img/slider/slide1.gif" alt="slide1" /&gt;&lt;/li&gt; &lt;li&gt; &lt;img src="img/slider/slide2.gif" alt="slide1" /&gt; /li&gt; &lt;li&gt; &lt;img src="img/slider/slide3.gif" alt="slide1" /&gt; /li&gt; </code></pre> <p>Now i want to append the the text inside a div when the next button is pressed i know Jcarousel has the itemFirstInCallback: function but I'm totally lost on how to use this to append a divs text:</p> <pre><code> &lt;div class="copy"&gt; &lt;p&gt; example text &lt;/p&gt; &lt;/div&gt; </code></pre> <p>Any ideas?</p> <p>Thanks,</p> <p>Liam</p>
javascript jquery
[3, 5]
4,056,229
4,056,230
FindControl always returns null on dynamically generated table
<p>I have a generated table using the following code (snippet):</p> <pre><code>String sTable = "&lt;table id=\"ediTable\" runat=\"server\"&gt;\n" + "...\n" + "&lt;/table&gt;\n"; table_display.InnerHtml = sTable; table_win.Style.Add("display", "block");//show table </code></pre> <p>I then, later in my code, try to find this table using the <code>FindControl()</code> method to find this table as follows: </p> <pre><code>protected void SubmitTable(object sender, EventArgs e) { Control ctrl = table_display.FindControl("ediTable"); } </code></pre> <p>Here is my relevant html:</p> <pre><code>... &lt;div id="table_display" runat="server"&gt; &lt;/div&gt; &lt;asp:Button ID="submitReport" CssClass="submit_btn" runat="server" Text="Submit" OnClick="SubmitTable" /&gt; ... </code></pre> <p><code>ctrl</code> is always null when I step through my code, despite the fact that table_display still contains the html table. I know I could use a <code>DataList</code>, <code>DataView</code> or <code>Repeater</code> to generate the table instead, but I don't know how to use them and would rather get this working instead. If it's not possible to use <code>FindControl</code> this way, then I will just go and figure them out. </p>
c# asp.net
[0, 9]
1,675,318
1,675,319
How can i have Response.Redirect() work from MasterPage?
<p>I have a problem: when i call a Response.Redirect() from the MasterPage it doesn't work. Well, debugging i can see that until the Pre_Render() method the target page is loaded, but then is rendered the previous page.</p> <p>Here's some code to better explain:</p> <p>(from MasterPageMain.master.cs)</p> <pre><code>protected void Page_Init(object sender, EventArgs e) { string m_QueryStringValue = Request.QueryString.Get("action"); if ((!string.IsNullOrEmpty(m_QueryStringValue)) &amp;&amp; (m_QueryStringValue.ToLower() == "send")) { if (Session["to"] != null &amp;&amp; Session["to"] is List&lt;string&gt;) this.SendPageByMail(); else { Session.Add("AddressToSend", Request.RawUrl); Response.Redirect("~/chooseRecipients.aspx"); } } } </code></pre> <p>I have a javascript that adds the querystring adding "action=send" when i click on the Send button.</p> <p>If i am on page "~/somethingInterestingToSend()" -for example- i want to get on the recipient selection page, but when i click the Send button i see always the same page.</p> <p>What coul be the mistake?</p>
c# javascript asp.net
[0, 3, 9]
2,769,196
2,769,197
how to bundle javascript files into Java application?
<p>Javascript is executed by Java application. However, something like Jquery library is really too long to fit into a String variable. I am able to read jquery.js from a file but not sure how to package it inside the .jar file.</p>
java javascript jquery
[1, 3, 5]
678,133
678,134
Why parent element is undefined in Firefox only when onerror event of IMG tag is called?
<p>I am trying to unhide a DIV element if my extension in Firefox is not installed. </p> <p>For this purpose i am using the following technique.</p> <p>This doesn't work in Firefox. it says</p> <p><strong>ExtensionNeeded is undefined.</strong> </p> <p>I get the alert though. Please have a look at my code.</p> <pre><code>&lt;div style="display: none;" class="alert alert-error" id="ExtensionNeeded"&gt; &lt;img style="visibility: hidden; font-family: arial;" onerror="this.src='';alert('hello'); ExtensionNeeded.setAttribute('style','display:none;');" id="ffExt" src=""&gt; &lt;a onclick="ExtensionNeeded.setAttribute('style','display:none;');" data-dismiss="alert" class="close" id="CloseButton"&gt;×&lt;/a&gt; &lt;h4 class="alert-heading"&gt; Browser Extension Needed&lt;/h4&gt; &lt;p&gt; SmartSignin needs browser extensions to work. Download the extensions by clicking on the button below &lt;/p&gt; &lt;p&gt; &lt;a onclick="window.location=('../Installer_files/release.xpi');ExtensionNeeded.setAttribute('style','display:none;');" class="btn btn-danger" id="ExtensionDownload" href="#"&gt;Download Extension!&lt;/a&gt; &lt;a onclick="ExtensionNeeded.setAttribute('style','display:none;');" class="btn" id="DownloadLater" href="#"&gt;Download Later&lt;/a&gt; &lt;/p&gt; &lt;/div&gt; </code></pre> <p>Please help. I am picking my hair out on this.</p>
javascript asp.net
[3, 9]
3,496,239
3,496,240
From Variable separate the javascript using php
<pre><code>$current = file_get_contents('template.html'); </code></pre> <p>From above varible how to seprate the <strong>Javascript</strong> using <strong>php</strong></p> <p>Plz Help me</p> <p>Thank You</p>
php javascript
[2, 3]
2,020,204
2,020,205
Get all div values of similiar id in a particular div
<p>I have a div structure like below </p> <pre><code> &lt;div id=main"&gt; &lt;input type="hidden" id="people_0_1_0" value="12"/&gt; &lt;input type="hidden" id="people_0_1_1" value="12"/&gt; &lt;/div&gt; </code></pre> <p>Now how to add all hidden input values in a variable. Thanks</p>
javascript jquery
[3, 5]
1,427,290
1,427,291
Php use header location to load new page in entire window within jquery tabs
<p>I use Jquery tabs with in each tab a form. If the form is submitted it’s reloaded (after the actions in the database) in the tab so that not the whole page has to be reloaded. One of the forms has to link to a payment page if there has to be payed, so after some checks after a submit the payment page has to be loaded and the current page has to close. But if I use header-location the entire page Is loaded in the tab and i don’t want that….</p> <p>Ho to use header-location from within the tab and load the payment page in the entire window (from PHP and not from Javascript because I can’t do the checks and vallidations)….</p>
php jquery
[2, 5]
3,987,956
3,987,957
How do I read a GET variable from JavaScript/jQuery?
<p>How do I get a particular GET variable in JavaScript or jQuery?</p> <p>I want to pass it on in ajax script in this sort of way:</p> <pre><code>$.ajax({ url: 'foo/bar.php', data: { search: $(this).val(), page: something //$_GET['page'] only in js }, ... </code></pre>
javascript jquery
[3, 5]
258,943
258,944
jQuery - If none of 3 id's have content hide this
<p>I have 3 div's drawing content from fields in a database:</p> <pre><code>&lt;div id="one"&gt;{data_one}&lt;/div&gt; &lt;div id="two"&gt;{data_two}&lt;/div&gt; &lt;div id="three"&gt;{data_three}&lt;/div&gt; </code></pre> <p>If none of these three div's have data, can I add some jQuery to hide another div?</p> <p>Thanks, Jack</p>
javascript jquery
[3, 5]
5,442,144
5,442,145
How can I parse the string to Double
<p>I want to parse 78 into double variable where 78 is stored as a String</p> <p>I used below code to parse. </p> <pre><code>Double.parseDouble("78"); </code></pre> <p>It display's Exception Error java.lang.NumberFormatException</p> <p>Plz tell me How can I parse String 78 into double </p>
java android
[1, 4]
3,499,935
3,499,936
How do I find if an element contains a specific class?
<p>I need to check if an element contains a certain child class using JQUERY.</p> <p>I tried:</p> <pre><code>if ($('#myElement').has('.myClass')) { do work son } </code></pre> <p>Didn't work.</p> <p>My html code is laid out like this:</p> <pre><code>&lt;div id="myElement"&gt; &lt;img&gt; &lt;span&gt;something&lt;/span&gt; &lt;span class="myClass"&gt;Hello&lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,626,521
3,626,522
Setting the width of a pagination depending on how many child elements
<p>I am trying to set the width of a pagination depending on how many child elements are available.</p> <p>The reasoning for this, is because I want to centralise it within a parent div element.</p> <p>At the moment, I've resorted to trying to find the outerWidth of the UL element and setting the css to mirror this, but that still wont work.</p> <p>Any ideas?</p> <p><a href="http://jsbin.com/ezaqax/edit#javascript,html" rel="nofollow">http://jsbin.com/ezaqax/edit#javascript,html</a></p>
javascript jquery
[3, 5]
3,879,892
3,879,893
How to run java script code before page load?
<p>I have working in asp.net web application. Here I need to run javascript before page load.</p> <p>I have gone through </p> <pre><code>&lt;body oninit="funinit();" onprerender="funRender();" onload="funload();"&gt; &lt;/body&gt; &lt;script type="text/javascript" language="javascript"&gt; function funinit() { alert("funinit"); } function funload() { alert("funload"); } function funRender() { alert("funRender"); } &lt;/script&gt; </code></pre> <p>here only funload() is working. plz give me any solution to run script before page load.</p>
javascript jquery asp.net
[3, 5, 9]
3,718,812
3,718,813
Error Reference when assigning value to asp:textbox
<p>Hi everyone I have been having a lot of problems with Jquery right now and ended coming here to search for the problem I have, I found nothing that could help me so I decided to ask at once.</p> <p>So I was able to bring the value of the input by using this line of code:</p> <pre><code> $('#ClienteDialog').find('input[id$=txtAddCliente]').val() </code></pre> <p>But now it won't assign that value to the textbox used to store the value and use it on the code behind, it gives the following error:</p> <pre><code> ReferenceError: invalid assignment left-hand side $('input[id$=txtAddType]').val() = $('#ClienteDialog').find('input[id$=txtAddCliente]').val(); </code></pre> <p>And I really can't find anything bad about this.</p> <p>Edit: Hi again I tried your solution Harshit Tailor gave, but at the end it didn't work, it only seems to do it but when I check if it works by using the next code:</p> <pre><code>$('input[id$=txtAddType]').text($('#ClienteDialog').find('input[id$=txtAddCliente]').val()); $('input[id$=lblTypeAdd]').val("1"); var a1 = $('#ClienteDialog').find('input[id$=txtAddCliente]').val(); var a2 = $('input[id$=txtAddType]').text(); var a3 = $('input[id$=txtAddType]').val(); var a4 = $('input[id$=lblTypeAdd]').text(); var a5 = $('input[id$=lblTypeAdd]').val(); </code></pre> <p>It brings in each var:</p> <pre><code>a1 = "Toyota" //&lt;- This is the value I input a2 = Undefined a3 = "" a4 = Undefined a5 = "" </code></pre> <p>Is there anyway to put the input value into the text value of the labels and textbox mentioned above?</p>
c# jquery
[0, 5]
4,521,440
4,521,441
double click needed to activate binded mousedown/up
<p>this is part of my code:</p> <pre><code> $('.toggle_box').each(function (){ var timeout, longtouch; $(this).bind('mousedown', function() { timeout = setTimeout(function() {longtouch = true;}, 1000); $(this).bind('mouseup', function(){ if (!longtouch) { clearTimeout(timeout) var state = $(this).find('.switch').attr('data-state'); if(state == "off"){$(this).find('.switch').attr('data-state','on');} else{$(this).find('.switch').attr('data-state','off');} var choice = $(this).parent(); ckbmovestate(choice) } else{alert("3")}; });})}); </code></pre> <p>when I click an element (mousedown and up) it works fine, but the 2e time I have to double click the element for it to fire. It looks like the second click resets the bind so that the 3e can use it again. just weird.</p> <p>Here is a demo: Not valid anymore... It is the orange checkbox :) (please check in safari/chrome)</p> <p>thank you for your help :)</p>
javascript jquery
[3, 5]
3,385,853
3,385,854
simple jQuery - I can't figure out why this isn't working
<p>I am trying to do 2 things: 1: append a div to the body 2: make all clicks to links class 'editlink' make a popup and not go to their href</p> <p>Doing just #2 is fine:</p> <pre><code>$(document).ready(function(){ // $(body).append("&lt;div&gt;Hello world&lt;/div&gt;"); $("a.editlink").click(function(event){ alert("Javascript-endabled users should see this"); event.preventDefault(); }); }); </code></pre> <p>but if i uncomment the part 1 thing such:</p> <pre><code>$(document).ready(function(){ $(body).append("&lt;div&gt;Hello world&lt;/div&gt;"); $("a.editlink").click(function(event){ alert("Javascript-endabled users should see this"); event.preventDefault(); }); }); </code></pre> <p>The div appears as expected but clicking editlink links no longer gives me a popup and navigates to the link's href.</p> <p>what's going on?</p>
javascript jquery
[3, 5]
5,324,458
5,324,459
access javascript variables outside the scope of a jquery function
<p>I have a <code>jquery</code> function to display a menu on right click event. I wish to access an object from the parent function inside the <code>callback</code> function.</p> <p>Am using <a href="http://medialize.github.com/jQuery-contextMenu/" rel="nofollow">following</a> JQuery plugin to get the context menu.</p> <p>Here is the code:</p> <pre><code>function OnContextMenu() { //alert(key + ' ' +this.Node.Content); var localNode = this.Node; alert(localNode.Content); //CORRECT NODE VALUE GETS ALERTED $.contextMenu({ selector: '.Container', callback: function(key, options) { var m = "clicked: " + key; alert(localNode.Content); //ALWAYS PRINTS THE VALUE OF THE VERY FIRST NODE THAT WAS CLICKED. // window.console &amp;&amp; console.log(m) || alert(m); }, items: { "edit": {name: "Edit", icon: "edit"}, "cut": {name: "Cut", icon: "cut"}, "copy": {name: "Copy", icon: "copy"}, "paste": {name: "Paste", icon: "paste"}, "delete": {name: "Delete", icon: "delete"}, "sep1": "---------", "quit": {name: "Quit", icon: "quit"} } }); } </code></pre> <p>As you can see I am storing the value in a variable:</p> <pre><code>var localNode = this.Node; </code></pre> <p>and using this variable inside the <code>callback</code> function. Peculiar thing about this is, the <code>alert(localNode.Content);</code> inside the callback gives correct value when the menu is clicked the very first time. After that even though the <code>alert</code> of the outer function gives different values correctly, the inner callback function keeps displaying the same old value as that of the first time.</p>
javascript jquery
[3, 5]
1,120,428
1,120,429
What is the purpose of global.asax in asp.net
<p>how can we use global.asax in asp.net? and what is that?</p>
c# asp.net
[0, 9]
5,849,339
5,849,340
Programmatically Setting Number Input Value Not Working
<p>I have a piece of javascript that sets the number input value. However, it won't work. The input's value field is still empty after the call (although console.log() outputing the element's val() does show the correct value). I have tried setting the value three ways jQuery's .val(total), .attr('value', total), and with plain old .value =, and still nothing. I even replaced the entire element with html and the value concatenated into the value attribute, and it won't work.</p> <p>Any ideas why this won't take?</p> <p>Here's the markup:</p> <pre><code>&lt;div id="proposal_price_box"&gt; &lt;div class="proposal_price_header sys_bkgcolor"&gt; &lt;span class="title"&gt;&lt;h3&gt;Price to Appear on Proposal&lt;/h3&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="inner"&gt; &lt;span class="label"&gt;$&lt;/span&gt; &lt;input type="number" class="amount-input" id="proposal_price" value=""/&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And the pertinent javascript:</p> <pre><code>$('#proposal_price').val('1234'); </code></pre> <p>Jsfiddle demonstrating the problem below.</p> <p><a href="http://jsfiddle.net/n8z9K/12/" rel="nofollow">http://jsfiddle.net/n8z9K/12/</a></p> <p>Somehow, if the element's container is displayed, it will set the value. But as soon as its hidden again, it breaks.</p> <p><strong>EDIT</strong> Sorry, I didn't properly demonstrate the problem in JSfiddle. I am trying to clone the contents of the container and place it elsewhere. I've updated the jsfiddle to better show the issue.</p>
javascript jquery
[3, 5]
599,337
599,338
Cannot set the var i when returning up the chain
<pre><code>var i = -1; $('.rightBtn a').click(function(){ --i; // this part works.. if(i == -z){ $(".homeSlider").css("margin-left", 0); $('.homeSlider').animate({ marginLeft: '-='+$(window).width() }, function(){ var i = -1; // this is where its not working alert(i); // alerts it correct at -1 return i; // this doesn't return it? }); return i; } else { $('.homeSlider').animate({ marginLeft: '-='+$(window).width() }); return i; } return i; //} }); </code></pre> <p>Am I just forgetting something? Also, say for the sake of the argument var z = 5</p>
javascript jquery
[3, 5]
3,123,143
3,123,144
Jquery/Javascript link $(this) to an element in a different div?
<p>I've got a multiple select that I want to use to pick which elements show up in an HTML template window. So I have several options that I want to iterate over, and based on whether it's been selected, make the preview elements visible or hidden. I'm going for something like this:</p> <pre><code>$('#area_select option').each(function(i){ if($(this).is(':selected')){var $css = {'visibility' : 'visible'}} else{var $css = {'visibility' : 'hidden'}} $(??????).css($css); }); </code></pre> <p>As you can see, I'm just iterating over each option (I'm pretty sure that syntax works) in my area_select menu, but I don't know how to make the css get applied to the corresponding piece.... how can I reference my preview elements via my options?</p>
javascript jquery
[3, 5]
5,761,690
5,761,691
JQuery Autosubmit Dropdown
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12655229/jquery-javascript-how-to-parse-html-using-a-get">JQuery/Javascript how to Parse HTML using a Get</a> </p> </blockquote> <p>I have the following code that is working:</p> <pre><code>$.getJSON('json/shares.json', function(data) { var items = []; $.each(data.Shares, function(key, val) { items.push('&lt;option id="' + val.shareName+ '"&gt;' + val.shareName+ '&lt;/option&gt;'); }); $('&lt;select/&gt;', { 'id': 'shares_select', html: items.join('') }).appendTo('#shares'); }); $.get('lon_shares.html', function(data){ $(data).appendTo('#shares'); }); </code></pre> <p>This will create a dropdown list using a JSON file. I need it to autosubmit when a selection is made and then get the relevant html file, so if they choose "lon" from the dropdown the file is "lon_shares.html" and if they choose "par" it's "par_shares.html" and so on.</p> <p>I am new to JQuery and Javascript so please give examples of how it needs to look including my code thanks.</p>
javascript jquery
[3, 5]
2,626,347
2,626,348
Converting Microsoft Word Smart Quotes to Straight Quotes
<p>We have a program where the user needs to do a Copy-Paste of some content from Microsoft Word into a HTML editor (Visual Studio 2008).</p> <p>That content in the HTML is then used in our confirmation emails.</p> <p>Some of the characters like curly quotes turn into ? on the browser &amp; in our confirmation email.</p> <p>For the browser... I was able to find how to resolve this issue by using jQuery.</p> <p>But for the confirmation email I cannot use JavaScript.</p> <p>I tried this ASP.net / C# code but it hasn't worked for me.</p> <pre><code>if (s.IndexOf('\u201b') &gt; -1) s = s.Replace('\u201b', '\''); if (s.IndexOf('\u201c') &gt; -1) s = s.Replace('\u201c', '\"'); if (s.IndexOf('\u201d') &gt; -1) s = s.Replace('\u201d', '\"'); if (s.IndexOf('\u201e') &gt; -1) s = s.Replace('\u201e', '\"'); </code></pre> <p>I would appreciate any help in resolution.</p> <p>Thanks.</p> <hr> <p>Thank you all for your responses.</p> <p>I am using the StreamReader to read the HTML file containing the Word characters.</p> <pre><code>string sFileText = ""; StreamReader objReader = new StreamReader(sFilePath); sFileText = objReader.ReadToEnd(); objReader.Close(); return sFileText; </code></pre>
c# asp.net
[0, 9]
5,254,337
5,254,338
How to fadeOut with jQuery?
<p>I have this function in javascript:</p> <pre><code>function hid(id) { var x = document.getElementById("desc_div" + id).style.display = "none"; } </code></pre> <p>and I hope to use fadeOut effect instead of <code>display = "none"</code> by using jQuery</p> <p>How can I do that?</p>
javascript jquery
[3, 5]
1,975,211
1,975,212
ASP.NET Textbox omits the string after the double quote
<p>I have added an ASP.NET Textbox in my page and i do have next and previous button. I entered string, say <strong>Hello "World"</strong> in the textbox. I clicked on next button which will show the review page(non-editable), all the datas are stored in the sessioin. After this i am clicking on the previous button which should show me the entry fields(edit page). During this, i am getting the datas from the session and showing it back to the ASP.NET textbox. </p> <p>When i see the page, what ever entered after double quotes is getting removed from the ASP.NET textbox. that is, i can only see <strong>Hello</strong>.</p> <p>My requirement is like, i should allow the users to enter double quotes.</p> <p>Is there any way to fix this???</p>
c# asp.net
[0, 9]
1,811,702
1,811,703
Is there Android Intent concept in iPhone SDK
<p>Just switching from Android to iPhone. In Android I can make several apps and use a tabView to call each app as intent.</p> <p>In iPhone, I can make several apps. I need a tab to call each apps or app views. Is there similar concept as intent in iPhone? Just switched to iPhone, copying all the other projects into the tabbar does not work out. If you have other methods to solve, I really appreciate. Thanks,</p>
iphone android
[8, 4]
3,362,962
3,362,963
Extending a DOM element with jQuery
<p>I'd like to extend a DOM element without extending all of them. That is, I'd like a custom class with its own methods and properties, but also be able to treat it as a div. E.g.</p> <pre><code> MyClass = function(){ this.foo = "waaa"; } MyClass.prototype.changeText = function(newtext){ // if this extended $(document.createElement("div")) something // like this might be possible this.html(newtext); } MyClass.prototype.alertFoo = function(){ alert(this.foo); } var m = new MyClass(); $("body").append(m); m.changetext(); </code></pre> <p>Is this possible?</p>
javascript jquery
[3, 5]
1,499,672
1,499,673
How do I chain multiple selectors with filters in jQuery?
<p>I'm trying to select multiple elements which do not have the attribute 'disabled' but I'm not sure if there's an easier way to type this:</p> <pre><code>$('input:not(:disabled), select:not(:disabled), textarea:not(:disabled)') </code></pre> <p>It seems a little wasteful to be typing multiple 'not(:disabled)'.</p>
javascript jquery
[3, 5]
25,103
25,104
Javascript undefined attribute
<p>I'm new to Javascript and I got this:</p> <p>I have a <code>GridView</code> with the following event:</p> <pre><code>protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { foreach (TableCell c in e.Row.Cells) { c.Attributes.Add("full","false"); } } </code></pre> <p>And in my javascript I have an <code>onClick</code> event for every cell:</p> <pre><code>if(source.full="false") { ... source.full="true"; } else { ... source.full="false"; } </code></pre> <p>Why is it that <code>source.full</code> is always <code>undefined</code> on the first click?</p>
c# javascript asp.net
[0, 3, 9]
1,098,443
1,098,444
Post a form into an iframe on another page
<p>I have a page from a 3rdparty I want to post to another page into an iframe so that tha layout is maintained. So i have host.com/pageA. This contains the form</p> <p>host.com/pageB This contains the iframe</p> <p>vendor.com/reallyComplicatedUrlthatSoundsFancyButMeansNothing</p> <p>I want to post the results from pageA to pageB where the pageB contains the iframe into which the results are posted. </p> <p>Target=iframe doesn't work since the iframe is on another page.</p> <p>Please help</p>
php javascript jquery
[2, 3, 5]
2,720,915
2,720,916
How can I access content of a website client side?
<p>I've set up my own whatsmyip type site that returns a simple string of the callers external IP.</p> <p>But I can't figure out how to get the queried text into an asp control for use.</p> <p>I can load it up in an iframe and see it on the page, but accessing it and using it is blocked for built in security reasons.</p> <p>I can get it working server side with ~WebClient.DownloadString("Whatsmyip.com"). But I need the client's IP, not the web servers.</p> <p>Thanks!</p>
c# javascript asp.net
[0, 3, 9]
4,877,643
4,877,644
Load Image and Fade In, but in sequential way
<p>I'm trying to load my images and fade in. Its working. But lets suppose that I have 4 images. Right now, my script its working by loading the last image, not the first. How can I make my js load the first image, and just start loading the second after the first has been loaded?</p> <p>Here's my code:</p> <pre><code>$(function(){ $("a").click(function(){ $("#load").load('load.html', function() { $('#load img').hide(); alert($("#load img").length); $('#load img').each( function(){ $(this).on('load', function () { $(this).fadeIn(); }); }); }); return false; }); }); </code></pre>
javascript jquery
[3, 5]
3,831,348
3,831,349
javascript (trying to copy windows.location without success)
<p>This seems like I've fallen down the rabbit hole and I imagine there's a simpler overall strategy, but here I am. </p> <p>I want to allow users to sort a given set of results AFTER they've already filtered those results. I want to keep the original filters in place while adding a new one (sort). I wanted to avoid having to create hidden inputs with the original filters and then submit the form via a click event handler on the sort links. </p> <p>What I tried to do instead was read the window.location and concatanate the GET parameters with my new sort parameter. It worked, except that it kept concatanating with each sort click. I only want one sort variable added per click. I tried a regex solution and it's not working. It keeps changing the windows.location variable and redirecting the page. </p> <p>I'm new to js and I don't know how to deepcopy strings...or the equivalent. How can I solve this issue? I'm also new to js regex, so pardon my naivety</p> <pre><code> $('div#sort ul a').each(function(){ var currentPath=window.location; currentPath=currentPath.replace(/sort=\w+$/,'sort='+$(this).attr('data-sort')); $(this).attr('href',currentPath) </code></pre>
javascript jquery
[3, 5]
1,967,344
1,967,345
Js javascript code problem
<p>Hi i have a problem with my js code. So, i include in 'head' in my site, script</p> <pre><code>var Engine; jQuery ( function($) { Engine = { utils : { site : function(id) { $('#content').html('&lt;strong&gt;Please wait..&lt;/strong&gt;').load('engine.php',{'site':id},function() { os = {adres:'drugi'}; history.pushState(os,'s',ts); } ); }, topnav : function() { $('div li').bind('click',function() { Engine.utils.site($(this).attr('rel')); unbind('click',false); } ); } } }; Engine.utils.topnav(); } ); </code></pre> <p>Now i want call included script in index.php</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; Engine.utils.site(1); &lt;/script&gt; </code></pre> <p>And here is a problem above code doesn't works.</p> <p>But if i click on any 'li' element Engine.utils.site work's correctly.</p> <p>Please help me i try fix it a few days. Sory for my bad english</p>
javascript jquery
[3, 5]
5,117,005
5,117,006
Javascript looping issue
<p>I know this is something easy that is just eluding me.</p> <p>Anyway, I have a simple function that loops through a series of six images and text and hides and shows them based on which one is visible.</p> <p>Issue I'm having is that when it gets to the last image, it should just start over with the first but instead it goes back to the middle image.</p> <pre><code>&lt;script type="text/javascript"&gt; setInterval('testAnimation()', 5 * 1000); show = 0; function testAnimation() { $("#headerImage" + show).fadeOut(); $("#headerText" + show).fadeOut(); if (show == 5) { show = 0; } else { show++; } $("#headerImage" + show).fadeIn(); $("#headerText" + show).fadeIn(); } &lt;/script&gt; </code></pre> <p>So it should go like this:</p> <pre><code>Hide: 0 Show: 1 Hide: 1 Show: 2 Hide: 2 Show: 3 Hide: 3 Show: 4 Hide: 4 Show: 5 Hide: 5 Show: 0 </code></pre> <p>But what happens after 4, 5 is 3, 4. Then it goes to 5, 0.</p> <p>Any ideas as to why?</p> <p>You can see the behavior here: <a href="http://www.findyourgeek.com/index-copy.php" rel="nofollow">http://www.findyourgeek.com/index-copy.php</a></p>
javascript jquery
[3, 5]
867,860
867,861
android convert Date to TimeStamp
<p>Following code is working fine in my java application. But when I am making the same application for Android using java it's showing error "<em>The constructor Timestamp(long) is undefined</em>" in the following bold line "<strong>Timestamp rtnTS = new Timestamp(theDate.getTime());</strong>"</p> <pre><code>public static Timestamp createTimeStamp(String strTime, String strFormat) throws Exception { strTime = strTime.trim(); SimpleDateFormat formatter = new SimpleDateFormat(strFormat); java.util.Date theDate = new java.util.Date(); theDate = (java.util.Date) formatter.parse(strTime); **Timestamp rtnTS = new Timestamp(theDate.getTime());** return rtnTS; } </code></pre> <p>Anyone please help to sortout this issue.</p>
java android
[1, 4]
1,946,676
1,946,677
Show/Hide DIV on ASP.NET dropdown value change
<p>I have the following dropdown on my ASP.NET page:</p> <pre><code>&lt;asp:DropDownList ID="selectAttending" runat="server"&gt; &lt;asp:ListItem Value="Select One..."&gt;Select One...&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Yes"&gt;Yes&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="No"&gt;No&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>I also have the following script: </p> <pre><code>$(function (){ $("#selectAttending").change(function () { ToggleDropdown(); }); ToggleDropdown(); }); function ToggleDropdown(){ if ($("#selectAttending").val() == "No") { $("#ifAttending").hide(); } else{ $("#ifAttending").show(); } }; </code></pre> <p>The DIV tag I would like to show if they are attending is: #ifAttending</p> <p>Do I need to add an attribute to the dropdown to show/hide on change or is the code just wrong?</p>
c# jquery asp.net
[0, 5, 9]
412,267
412,268
What additional I need to convert a Java Application to Android Application?
<p>The title itself is my question.. </p> <p>What additional I need to convert a Java Application to Andriod Application?</p> <p>I have an application developed in Java J2SE with XML as back-end. I want to convert it to Andriod. Thanks in advance.</p>
java android
[1, 4]
4,265,832
4,265,833
Cannot select Combo box value
<p>I have two Combobox's where second one is dependent upon first one.</p> <p>This means when the selectedindexchanged event of first Combobox fires, then the second Combobox will be enabled. After Event Apply the second Combobox is loaded but I could not select the ComboBox Value </p> <p><strong>How will i select the value??</strong> i used Dave express in c# Thanks</p>
c# asp.net
[0, 9]
1,333,279
1,333,280
How do I make an image that is currently hidden, become visible upon validation passing in asp.net
<p>I have a simple web form in asp.net that has some validation on the form fields. I also have an image whose visibility is set to false. In my validation if statement I want code that will make that image visible if the validation has passed. Below is what I have but the image is not displaying. Thanks!</p> <pre><code>if (!Page.IsValid) return; //Order is valid. Process it. lblOrderDetails.Text = "&lt;h1&gt;Success!&lt;/h1&gt;" + "&lt;b&gt;Email: &lt;/b&gt; " + tbEmail.Text + "&lt;br /&gt;" + "&lt;b&gt;Model: &lt;/b&gt; " + dlModel.SelectedItem.Text + "&lt;br /&gt;" + "&lt;b&gt;Discounts: &lt;/b&gt; "; imgSnowboard.Visible = true; &lt;asp:Image Visible="false" runat="server" ImageUrl="~/SnowBoard.jpg" ID="imgSnowboard"/&gt; </code></pre>
c# asp.net
[0, 9]