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,488,902
5,488,903
add event to Jquery Plugin
<p>I have a JQuery plugin and I want to add some event to it. Any help, tips, or tutorial?</p>
javascript jquery
[3, 5]
2,362,476
2,362,477
Tick check box and enables submit button not working in IE6/7
<p>I have the following code which is working fine in firefox but ie just doesn't want to know:</p> <pre><code>$("#termsandconditionscontinue").attr("disabled", "disabled"); $("#agreeTandC").click(function() { var checked_status = this.checked; if (checked_status == true) { $("#termsandconditionscontinue").removeAttr("disabled"); } else { $("#termsandconditionscontinue").attr("disabled", "disabled"); } }); </code></pre> <p>Here is the example: <a href="http://jsfiddle.net/zidski/LXGMu/" rel="nofollow">http://jsfiddle.net/zidski/LXGMu/</a></p>
javascript jquery
[3, 5]
240,817
240,818
Set focus to end of text in textbox after postback?
<p>I've got a simple ASP.Net form with txtBox and btn.<br> User click btn, which adds text to an ASP:TextBox in a postback (its adding a known "starter text".<br> After the postback I'd like the focus to be set to the end of the text in the textbox.</p> <p>If I call Page.SetFocus(...) or txtBox.Focus() then the txtBox gets focus, but at the beginning of the text - which means if the user starts typing, they'll be in the wrong place.</p> <p>e.g.<br> <code>cursor</code>100-01 </p> <p>would like it to be </p> <p>100-01<code>cursor</code></p> <p>I've tried the following in the textbox: </p> <pre><code>onfocus="alert('focus');this.value = this.value;" </code></pre> <p>but the "alert" only appears the first two times? Then nothing?</p>
javascript asp.net
[3, 9]
1,621,028
1,621,029
Speed difference between very similar jQuery expressions in IE
<p>In IE, compare the speed of execution of an expression along the lines of</p> <pre><code>$('div.gallery div.product a"); </code></pre> <p>to the very similar</p> <pre><code>$('div.gallery').find("div.product").find("a"); </code></pre> <p>Sometimes the second variant runs faster, sometimes slower. Often the speed difference is a factor of 2 or more. What is going on?</p>
javascript jquery
[3, 5]
1,599,549
1,599,550
enable disable textbox inside a table when checkbox checked
<p>I am using jQuery. How to enable or disable textbox inside a table when checkbox checked. This is my edit.cshtml.</p> <pre><code> &lt;table id="scDetails" class="dataTable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;RItem&lt;/th&gt; &lt;th&gt;IChecked&lt;/th&gt; &lt;th&gt;Notes&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; @foreach (var fback in Model.Fbacks) { &lt;tr&gt; &lt;td @Html.DisplayFor(m =&gt; fback.RItem)&lt;/td&gt; &lt;td&gt;@Html.CheckBoxFor(m =&gt; fback.IChecked)&lt;/td&gt; &lt;td&gt;@Html.TextBoxFor(m =&gt; fback.Notes)&lt;/td&gt; &lt;/tr&gt; } &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>What i have tried is:</p> <pre><code> $('td :checkbox').change(function () { var parentTx = $(this).closest('tr').find(input[type = "text"]); if (this.checked) { parentTx.attr("disabled",false); } else { parentTx.attr("disabled", true); } }); </code></pre> <p>Where am doing wrong? I dont want to use any classes on the controls to achieve this.</p>
javascript jquery
[3, 5]
5,855,629
5,855,630
Javascript condition assign value to data variable
<p>I am reading some data from the database which are numbers.</p> <p>What I need to do is to assign a name to each number ... </p> <p>something like:</p> <pre><code>get the variable: ... thevar = '1'; If thevar = 1 then myname = 'name1'; else If thevar = 2 then myname = 'name2'; </code></pre> <p>How can I do this with javascript?</p> <p>Sorry, I don't think I've explained it properly...what I need if the syntax on how I would do this the above with javascript.</p> <p>Hope it now makes more sense.</p>
javascript jquery
[3, 5]
5,099,438
5,099,439
How to place a Required field validator programmatically in a certain place
<p>I have a field validator that is created programmatically, how can i place it in a specific place in my aspx page?, right now it justs puts it next to the field but i want it somewhere else, how can i do this?</p>
c# asp.net
[0, 9]
450,291
450,292
Transform a working Java aplication to mobile
<p>I developed a small java application (jar file), nothing fancy except to take some text in some text boxes and some dropdown menus, that translate some other string sequences that is needed for my job. Works great on the pc. I never did something similar on a mobile and I wonder if there is a simple way to transforme threw the Netbeans IDE to run on an adroid application.</p> <p>Thank you in advance.</p>
java android
[1, 4]
919,734
919,735
Cached Jquery selector behavior that I do not understand
<p>Given the following code why am I getting different values for <code>a</code> and <code>b</code>? I would have thought they would return the same thing:</p> <pre><code>(function() { var a = $('#foo'); var Test = function(){ console.log(a); //outputs 'jQuery()' var b = $('#foo'); console.log(b); //outputs 'jQuery(select#foo)' which is what I want }; })(); </code></pre> <p>This question stems from me trying to stick frequently used selectors into vars. Originally I was doing it in each method (like I did with <code>var b</code> in the above example) but then I found I needed to use the selectors in multiple methods so I moved the assignment out to be available (or so I thought) to all of the methods in that anonymous function. As you can see, it does not work. Why is this?</p> <p>EDIT: this code is loaded by a method that is triggered by a click. The id foo is present at page load and is not dynamically set or changed.</p>
javascript jquery
[3, 5]
3,915,871
3,915,872
Check and process the div block after its loading
<p>In my HTML, one div block(whose id looks like kdsm_32532535) is dynamically created after about 15-20 seconds of dom loading. I want to style this block with javascript with below code. </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ if($("div[id^='kdsm_']").length &gt; 0){ $(this).css({'margin':'20px','border':'1px dotted red;'}); } /* OR below code. None of them working :( */ $("div[id^='kdsm_']").css({'margin':'20px','border':'1px dotted red;'}); }); &lt;/script&gt; </code></pre> <p>If I would do this in document.ready, it will not work because this div block doesn't exist on DOM ready.</p> <p>How do i check continuously within interval of fraction, whether this div block is loaded or not ?</p>
javascript jquery
[3, 5]
903,278
903,279
C# equivalent to Java resource
<p>Is there an online resource or database that allows looking up the C# equivalent to a Java class and vice versa?</p> <p>I have been porting code and have been Googling individual classes one at a time; it gets a little tedious. 8^j</p> <p>Cheers</p>
c# java
[0, 1]
5,230,124
5,230,125
How can I get the corresponding table column (td) from a table header (th)?
<p>I want to get the entire column of a table header.</p> <p>For example, I want to select the table header "Address" to hide the address column, and select the "Phone" header to show the correspondient column.</p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th id="name"&gt;Name&lt;/th&gt; &lt;th id="address"&gt;Address&lt;/th&gt; &lt;th id="address" class='hidden'&gt;Address&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Freddy&lt;/td&gt; &lt;td&gt;Nightmare Street&lt;/td&gt; &lt;td class='hidden'&gt;123&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Luis&lt;/td&gt; &lt;td&gt;Lost Street&lt;/td&gt; &lt;td class='hidden'&gt;3456&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; </code></pre> <p></p> <p>I want to do something like <a href="http://www.google.com/finance?q=apl" rel="nofollow">http://www.google.com/finance?q=apl</a> (see the related comanies table) <em>(click the "add or remove columns" link)</em></p> <p>:) thanks in advance.</p>
javascript jquery
[3, 5]
5,737,308
5,737,309
How to stop users from manually editing file path in HTML file input control?
<p>I have a asp.net form with 5 HTML file input controls with runat=server and a submit button. after user selects the files and clicks the submit button, the files are upload in the server.</p> <p>Problem is the HTML file input controls are editable, and user can edit the path after he has already selected the file from the browse button.</p> <p>If he enters a invalid file path, the file is not uploaded because it does not exist.</p> <p>How can I stop users from manually changing the file path? I have tried to make the controls read only, but it disables the browse button also.</p>
c# javascript asp.net
[0, 3, 9]
2,308,785
2,308,786
jQuery Toggle Duplication Stops Working
<p>Just setup jQuery Toggle. Here's the function below. it works fine. Basically when you click 'Show More' it shows more content, and the word 'Show More' changes to 'Show Less'.</p> <pre><code>$('#toggle').toggle( function() { $('#content').slideDown(); $(this).html('Show less &amp;rarr;'); }, function() { $('#content').slideUp(); $(this).html('Show more &amp;rarr;'); } ); </code></pre> <p>This is fine, my issue is having more than one on a page. For some reason when I copy and paste the same HTML multiple times to create more than one toggle content, the others don't work and only the first one does. Here's the HTML:</p> <pre><code>&lt;div id="team-page"&gt; Intro paragraph &lt;a id="toggle" href="#"&gt;Show more &amp;rarr;&lt;/a&gt; &lt;div id="content"&gt; Content shown when toggled &lt;/div&gt; &lt;/div&gt; </code></pre> <p>So when I duplicate this multiple times, the rest don't work. There is the obvious get around by adding #toggle1 #toggle2 and duplicating and amending the jQuery - but what's the better way? Many thanks.</p>
javascript jquery
[3, 5]
5,981,584
5,981,585
Wrapped context doesn't work properly
<pre><code>var parent = $('&lt;div&gt;parent&lt;/div&gt;'); $('div').wrap(parent); parent.append('&lt;div&gt;appended&lt;/div&gt;'); </code></pre> <p>I am testing it with below html code and append method doesn't work on parent object. Where i am doing mistake ?</p> <pre><code>&lt;div&gt;child&lt;/div&gt; </code></pre> <p>Edit: Expected html result is</p> <pre><code>&lt;div&gt;parent &lt;div&gt;child&lt;/div&gt; &lt;div&gt;appended&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,856,433
4,856,434
jquery animate the page background-color on page load
<p>I'm attempting to just change the background colour of a webpage upon page load. I see no reason why this shouldn't work, "body" is the correct element I wish to manipulate. I am using <a href="http://docs.jquery.com/UI/Effects/animate" rel="nofollow">http://docs.jquery.com/UI/Effects/animate</a> as a reference.</p> <pre><code>$(document).ready(function(){ $("body").animate({ backgroundColor: "#000000" }, 1000); }); </code></pre>
javascript jquery
[3, 5]
1,859,073
1,859,074
Word searching engine
<p>I work on game in which player gathers word from letters.All i need to do is to check if word exists in language or search in dictionary.Best of what I found is Hunspell but it wont work because I want to search words only in nominative case.Is there some others tool that can help me?</p>
java android
[1, 4]
2,046,068
2,046,069
jquery ajax request failing in IE6
<p>I have got a ajax request working in safari,FF and Chrome but not in IE6.I get the error message and the xhr.statusText is <strong>unknown</strong>.I know I should be ditching IE6 but its in the requirements list so I'm helpless.If anyone has a solution to please lemme know.</p> <p>Thanks</p> <pre><code>$.ajax({ type: "GET", url: "vMenu.xml", dataType: "xml", error:function(xhr, status, errorThrown) { alert(errorThrown+'\n'+status+'\n'+xhr.statusText); }, success: function(data) { alert('success') ; } }); </code></pre> <p>the XML file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="vMenu.xsl"?&gt; &lt;vMenuList&gt; &lt;menu loc="menu1.htm"&gt;menu1&lt;/menu&gt; &lt;menu loc="menu2.htm"&gt;menu2&lt;/menu&gt; &lt;menu loc="menu3.htm"&gt;menu3&lt;/menu&gt; &lt;menu loc="menu4.htm"&gt;menu4&lt;/menu&gt; &lt;menu loc="menu5.htm"&gt;menu5&lt;/menu&gt; &lt;menu loc="menu6.htm"&gt;menu6&lt;/menu&gt; &lt;menu loc="menu7.htm"&gt;menu7&lt;/menu&gt; &lt;menu loc="menu8.htm"&gt;menu8&lt;/menu&gt; &lt;/vMenuList&gt; </code></pre> <p>All the files are in the same folder </p>
javascript jquery
[3, 5]
3,541,396
3,541,397
store id and transfer to another php page
<p>I have a little question. On my site i use for few jquery functions , they get some data and transfer by GET method to php helper. This is not work when i want to use the data in another php page. For example i have jquery that store id of the anchor:</p> <pre><code>$("#rightContent .users_list li a").live('click', function() { var id = $(this).attr('id'); $.get("getHelper",{'userId':id},function(data){ $('#user_rightContent').html(data); }); }); </code></pre> <p>And in php file returned by "getHelper" i do:</p> <pre><code>if(isset($_GET['userId'])){ $id = $_GET['userId']; //do something ); </code></pre> <p>The anchor of the live click lead to another page displayed by another php file where i want to use this id by using helper... This is work only if i stay on same page... Can anybody help me in this problem? thanks for advice</p>
php javascript jquery
[2, 3, 5]
5,246,980
5,246,981
Pass data using jQuery Trigger event to a Change event handler?
<p>Is there a way to pass data to a "change" event via jQuery's trigger method?</p> <p>The issue here is that a "click" event triggers the upload menu. Once the image is selected, the "change" event is fired, however. The data I passed into the trigger event's second parameter is passed to the click event, not to the change event. In the example below, "data" is undefined.</p> <p><strong>Trigger Image Change</strong></p> <pre><code>$('.change_main_image').live('click', function() { $('input[name=photo].change_uploader').trigger('click', ["some string"]); }); </code></pre> <p><strong>Event Handler</strong></p> <pre><code>$('input[name=photo].change_uploader').live('change', function (e, data) { alert(data); // undefined //canvas resize and upload script }); </code></pre>
javascript jquery
[3, 5]
1,443,592
1,443,593
From PHP to Python accommodation
<p>I've been coding php for years, and now i have to finally make my own project, and i want it very optimized and shiny. So, i've been searching around the net about which programming language should i use for my needs (fast, secure, easy-understandable, customizable) and all points to -> Python. So I decided to go on, but i just can't feel "home" when writing python (inc Django app...). I got used to PHP's syntax, and my IDE (PHP Expert Editor 4.3) makes php look awesome, so now i just can't go with python.</p> <p>Maybe there is something which has php's syntax (let's say per example: Perl)...but the advantages of a high-level programming language (aka Python)?</p>
php python
[2, 7]
3,827,417
3,827,418
Error free JQuery/Javascript is not working in Firefox 4 or Chrome
<p>Code: <a href="http://dpaste.org/Oerz/" rel="nofollow">http://dpaste.org/Oerz/</a></p> <p>The page looks as it should, with the title, 5 paragraphs and buttons all appearing. Each button is supposed to make a small alteration to a specific elements styling. </p> <p>Currently no action occurs when any of the buttons are clicked.</p> <p>I'm only claiming the above code is error free based on finding no errors in chrome's javascript console or firebug. Then again, I'm new to all this so I don't know if I'm using them correctly.</p> <p>Any help would be appreciated.</p>
javascript jquery
[3, 5]
2,778,964
2,778,965
if jquery doesn't load then load jquery from here
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4523263/load-jquery-from-external-source-if-not-loaded">load jQuery from external source if not loaded</a> </p> </blockquote> <p>How can I set up a backup if jquery doesn't load?</p> <p>I've found and tried this:</p> <pre><code>if (typeof jQuery == 'undefined') { alert('jquery didn't load !'); loadScript("/here/jquery.min.js"); .... // this is where i'd want to say load from '/here/jquery.js' } </code></pre> <p>but I don't know how to call the src of a script within a script.</p>
javascript jquery
[3, 5]
397,178
397,179
Add Html to Text without children element
<p>I am very confused on how to get this work, did a lot of research online to help find a solution to this, but got nothing. Found this link here: <a href="http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/" rel="nofollow">http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/</a> but still didnt help much</p> <p>This is what I am trying to accomplish, the system is outputting text like this, I have no control over the html.</p> <pre><code>&lt;div class="myclass"&gt; Text 1 Text 2 Text 3 &lt;/div&gt;` </code></pre> <p>but would like to use jquery to insert html around those text For example:</p> <pre><code>&lt;div class="myclass"&gt; &lt;span&gt;Text 1 &lt;/span&gt; &lt;span&gt; Text 2 &lt;/span&gt; &lt;span&gt; Text 3&lt;/span&gt; &lt;/div&gt; </code></pre> <p>any help is appreciated</p> <p>thank you very much</p>
javascript jquery
[3, 5]
4,320,445
4,320,446
Android ACTION_WEB_SEARCH
<p>I am not able to get the ACTION_WEB_SEARCH to work correctly, does this require any permissions on the AndriodManifest.xml?</p> <p>This is my code:</p> <pre><code> String q = edittext.getText().toString(); Intent myIntent = new Intent(Intent.ACTION_WEB_SEARCH, Uri.parse(q)); startActivity(myIntent); </code></pre> <p>Any help would be much appreciated.</p> <p>Platform 2.0.</p>
java android
[1, 4]
1,633,657
1,633,658
&amp; php post receive problem
<p>my ajax request is</p> <pre><code>ajaxRequest.send("var1=" + var1.value + "&amp;var2=" + var2.value + "&amp;var3=" + var3.value); </code></pre> <p>but the browser sends the request as</p> <pre><code>var1= hello&amp;amp;var2= world&amp;amp;var3=1 </code></pre> <p>php side receives the data as a post</p> <pre><code>$variable1 = $_POST['var1']; $variable2 = $_POST['var2']; $variable3 = $_POST['var3']; </code></pre> <p>only the first variable receives the data. The las two variables do not receive any data.</p> <p>the correct format of sending the request as i know is</p> <pre><code>var1= hello&amp;var2= world&amp;var3=1 </code></pre> <p>But why did the browser appended some useless characters that made the php side unable to recognise what has been sent ?</p>
php javascript
[2, 3]
841,276
841,277
Route url to php file with javascript/jQuery
<p>I have researched this but found luck and my question really is a hope and I'm doubting this is possible. </p> <p>Can you route URLs to a specific PHP file using JavaScript? Like you would with rewrites in .htaccess. It would be a lot easier for several reasons for me to just link a fake URL to a PHP file with JavaScript. </p> <p>The scenario is that I am creating a user profiles with PHP, a database and jQuery. Since I am using a history API script I can easily provide a profile for users without editing the .htaccess file IF a user navigates to a profile with a link. To do this I would preventDefault on the link click so you don't get a 404, get the href value, use AJAX to get JSON data from a PHP file and then AJAX in the template with info loaded in. </p> <p>The problem is when a user directly enters the URL for example www.example.com/joebloggs, this would just cause a 404 since that file does not exist. I would like to intercept the page load with jQuery and instead load up the PHP template and ajax in info with JSON.</p> <p>If not possible I will use .htaccess it would just be easier to do it with JavaScript </p>
javascript jquery
[3, 5]
5,649,590
5,649,591
Issue resetting form with JQuery
<p>I'm having an issue with a form that is built with Ajax. Basically it is one of those forms which populates as you drill down from a parent select. The problem is once you advance forward a page, and go back the first drop down has its option selected, but the others are not processed and therefore just say "Select a [thing] first". So I'm trying to reset the form when I move back a page.</p> <p>I have in my document ready the following:</p> <pre><code>$('form[name="Search"]')[0].reset(); </code></pre> <p>This works fine in Firefox and Chrome, however IE9 I get the following message: </p> <blockquote> <p>Microsoft JScript runtime error: Unable to get value of the property 'reset': object is null or undefined</p> </blockquote> <p>Does anyone know of a workaround, or suggest a better way to approach this?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
1,607,772
1,607,773
How to blit an ever-varying int array at animation speed to the screen in Android
<p>I have a Java app that depends on <strong>MemoryImageSource</strong> with <strong>Image</strong> to copy the contents of an int array of changing RGBA data to a window at animation speed (~20fps). I'm trying to port this app to Android. What would be the closest equivalent to this in Android's API? If it helps explain, i used *<em>DIBSection</em>*s in WIndows to do the same thing.</p>
java android
[1, 4]
4,540,829
4,540,830
How to clear a input array all elements using jQuery
<p>I have defined my form elements using the html array method like this:</p> <pre><code>&lt;input type="text" maxlength="45" name="Apikey[key]"&gt; &lt;select name="Apikey[developer]"&gt; </code></pre> <p>How can I clear all Apikey array using jQuery?</p> <p>The question is how to clear them? All possible forms fields must be cleared.</p>
javascript jquery
[3, 5]
2,317,104
2,317,105
jquery using $.on for added dom elements?
<p>I am a bit confused, I have a bunch of elements that get added via jquery using a ajax call and I want to attach a click handler to them (there could be a lot).</p> <p>But I have no idea how to even begin this, I looked at .on and it is really confusing. I want to attach a click event handler for a certain class so that when I click on it, I get the <code>this.id</code> and then do stuff with it.</p>
javascript jquery
[3, 5]
5,209,623
5,209,624
how to pass a php var through jquery?
<p>i have this script on <a href="http://jsfiddle.net/patrioticcow/HysJ6/" rel="nofollow">JsFiddle</a> .</p> <p>when i click on the links i get another view.</p> <p>What i am trying to do is replace</p> <pre><code>&lt;a id="mine_click" href="#"&gt;test&lt;/a&gt; </code></pre> <p>with:</p> <pre><code>$test = 'here we go' &lt;a id="mine_click" href="?var=$test"&gt;test&lt;/a&gt; </code></pre> <p>and pass the <code>$test</code> var to the <code>tab3</code>view when i click on the <code>test</code> link,</p> <p>so that the result will be <code>2222 here we go</code></p> <p>any ideas on how to pass a php var through a link going through jquery?</p> <p>thanks</p>
php javascript jquery
[2, 3, 5]
1,850,852
1,850,853
I want to supply some pdf documents with my application
<p>After certain research and lookup over the internet I found that I cannot place these files in the assets folders as those files will be private to my application, I want the native pdf application to be invoked on a button press which redirects the user to the particular document. What I am confused about is how do I bundle the files with my application so that when the user downloads or installs my application these files get stored in her SD-Card. </p>
java android
[1, 4]
3,139,581
3,139,582
How can I calculate the width of individual li with varying widths within a ul
<p>Say I have this list below. Each image has a varying width and the a tag has a margin right of 15px which extends the list item a little more to give it some space from the next image.</p> <pre><code>&lt;div id="otherproducts"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alight-slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/eclider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/aluer.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alucr.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>How can I get jquery to give me the correct width of the items in my calculation below so I can give the UL the correct total width because currently the total is coming out much greater than it should...</p> <pre><code>var obj = $(this); var s = $("li", obj).length; var w = $("li", obj).width(); var h = $("li", obj).height(); obj.width(w); obj.height(h); $("ul", obj).css('width',s*w); </code></pre>
javascript jquery
[3, 5]
145,346
145,347
GridView DataFormatString problems. convert Doudle to TimeStamp
<p>Need some help with DataFormatString in GridView. I have a Double value that needs to be shown as TimeSpan. I have tried DataFormatString="{0:HH:mm:ss}". This did not work. </p> <p>Tested it a bit in C# and there I would do:</p> <pre><code>TimeSpan.FromHours(16.7358217592592).ToString() </code></pre> <p>This gives me.</p> <pre><code>"16:44:08.9580000" </code></pre> <p>Which is what i am after. But how to get it in ASP.Net is the big question. Any Suggestions?</p> <p>I have a simple GridView that looks like this.</p> <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="sOprTime" HeaderText="Sum OprTime" ReadOnly="True" SortExpression="sOprTime" /&gt; &lt;asp:BoundField DataField="sWorkTime" HeaderText="Sum WorkTime" ReadOnly="True" SortExpression="sWorkTime" /&gt; &lt;asp:BoundField DataField="sFaultTime" HeaderText="Sum FaultTime" ReadOnly="True" SortExpression="sFaultTime" /&gt; &lt;/Columns&gt; &lt;EmptyDataTemplate&gt; No data is present. &lt;/EmptyDataTemplate&gt; </code></pre> <p></p> <p>The SQL query looks like this:</p> <pre><code>sqlString1 = string.Format(@"SELECT SUM(CONVERT (Float, OprTime)) AS sOprTime, SUM(CONVERT (Float, WorkTime)) AS sWorkTime, SUM(CONVERT (Float, OprTime)) - SUM(CONVERT (Float, WorkTime)) AS sFaultTime FROM tblNovikLogg WHERE (Date_Time &gt; '{0:yyyy/MM/dd H:mm:ss}' And Date_Time &lt; '{1:yyyy/MM/dd H:mm:ss}')", selectedDate, selectedDate.AddDays(1)); </code></pre>
c# asp.net
[0, 9]
2,960,763
2,960,764
Code Crush Android
<p>I want to crush the code of my android app so that it's very hard to refactor it.</p> <p>Which tool do i use to crush the Javacode?</p> <p>Thanks and best regards, Till</p>
java android
[1, 4]
4,091,870
4,091,871
How to pass values from MapOverlay
<p>I want to pass the values from <em>MapOverlay</em> class to another class. I tried to use an Intent </p> <pre><code>Intent i = new Intent(getApplicationContext(), AnotherClass.class); i.putExtra("value1", x1); i.putExtra("value2", y1); startActivity(i); </code></pre> <p>but Eclipse alerts me "The method getApplicationContext() is undefined for the type MapOverlay" so I can't use this method to pass the values. Please advise me on how I should do this.</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,260,556
2,260,557
php post upload multipart/form-data query?
<p>Hi all hope someone can help.Must the file pass through this no matter what? Still stuck on uploading an image from a android phone that does not come out as a application/octet type and as image/jpeg type. Thx</p>
php android
[2, 4]
3,939,284
3,939,285
jquery $(this) works once inside same function
<pre><code>$('#test img:first').ready(function() { var w = $(this).width(); console.log(w); $('#test img:first').attr('width', 200); //$(this).attr('width', 200); }); </code></pre> <p>width of the element is correct so as setting width via selector but </p> <pre><code>$(this).attr('width', 200); </code></pre> <p>doesn't work, what am I missing?</p>
javascript jquery
[3, 5]
2,037,411
2,037,412
Jquery - IE not implemented error (in IE 8)
<p>I am having an IE not implemented JavaScript error and it seems not to have anything to do with what ive been reading on so far on this website. </p> <p>Im using jquery.simplemodal plugin which works fine in all browsers except IE unless I change the doctype to </p> <blockquote> <p>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"></p> </blockquote> <p>IE is pointing the error to the first line of the following code (I mean the line in bold): </p> <blockquote> <p><strong>s.removeExpression('height');</strong></p> <p>s.removeExpression('width');</p> <p>s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');</p> <p>s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');</p> </blockquote> <p>How can I make it work in IE while using a doctype different from </p> <blockquote> <p>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> </p> </blockquote> <p>(I would like to use this doctype </p> <blockquote> <p>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">)</p> </blockquote> <p>The plugin is available at <a href="http://lescracks.com/jquery.simplemodal.js" rel="nofollow">http://lescracks.com/jquery.simplemodal.js</a> . IE detects the error at line 142. </p> <p>Thanks</p> <p>One more thing, it also works fine in IE with the Compatibility view enabled. </p>
javascript jquery
[3, 5]
4,642,865
4,642,866
DataSet table adapter manager help
<p>i have a plain and simple console app where i'm trying to update customers and orders tables and i'm getting an error message:</p> <pre><code>The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Orders_Customers". The conflict occurred in database "CustomerOrder", table "dbo.Customers", column 'Id'. The statement has been terminated. </code></pre> <p>Am I missing something obvious?</p> <pre><code> RsNorthwinds ds = new RsNorthwinds(); RsNorthwinds.CustomersRow cRow = ds.Customers.NewCustomersRow(); cRow.Name = "John Smith"; ds.Customers.AddCustomersRow(cRow); RsNorthwinds.OrdersRow oRow = ds.Orders.NewOrdersRow(); oRow.CustomerId = cRow.Id; oRow.OrderDate = "9/26/11"; ds.Orders.AddOrdersRow(oRow); RsNorthwindsTableAdapters.TableAdapterManager tm = new DataTableAdapterTester.RsNorthwindsTableAdapters.TableAdapterManager(); tm.OrdersTableAdapter = new DataTableAdapterTester.RsNorthwindsTableAdapters.OrdersTableAdapter(); tm.CustomersTableAdapter = new DataTableAdapterTester.RsNorthwindsTableAdapters.CustomersTableAdapter(); tm.UpdateAll(ds); </code></pre>
c# asp.net
[0, 9]
640,425
640,426
Adding values of multiple text box values
<p>I have multiple text boxes with a class name <code>.paymentamount</code>.i want to add all values of text boxes of the same class but i am getting error nan.Code is this</p> <pre><code>function paymentData() { $('.paymentamount').keyup(function(){ var amountSum=0; $('.paymentamount').each(function(){ amountSum+=parseInt(this.value); //console.log(this.value); }); console.log(amountSum); }); } </code></pre>
javascript jquery
[3, 5]
1,711,935
1,711,936
Adding custom setting to PreferenceFragment
<p>I have a <code>PreferenceFragment</code> and I need to put custom preferences in it. Now the problems are not the custom preferences themselves, I already extended some <code>DialogPreference</code>s creating my own preferences and I already dealt with saving/restoring data; the problem is how do I add these custom preferences to my <code>PreferenceFragment</code>? I can't declare them in XML (can I?), and I can't find any method to dynamically add them to my <code>PreferenceFragment</code>.</p>
java android
[1, 4]
1,550,052
1,550,053
What is the difference between $('#div') and _$('div')?
<p>What is the difference between <code>$</code> and <code>_$</code> in jQuery, and where we should use <code>$</code> and <code>_$</code></p> <pre><code>_$('Set_txtDateinputBox_From') $("#Set_drpdnAvailability") </code></pre>
javascript jquery
[3, 5]
2,897,934
2,897,935
Copy to clipboard using jquery for all browsers
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1390953/how-to-select-all-text-in-a-textbox-and-copy-it-to-clipboard-using-javascript-jq">How to select all text in a textbox and copy it to clipboard using JavaScript/jQuery?</a><br> <a href="http://stackoverflow.com/questions/1539641/copy-text-to-the-clients-clipboard-using-jquery">Copy text to the client’s clipboard using jQuery</a> </p> </blockquote> <p>I need a javascript, jquery function for copy to clipboard functionality. I know following code but it works in IE only:</p> <pre><code>holdtext.innerText = copytext.innerText; Copied = holdtext.createTextRange(); Copied.execCommand("Copy"); </code></pre> <p>I see some tutorials which are suggestion some swf files. I have used some of them like <a href="http://www.steamdev.com/zclip/" rel="nofollow">http://www.steamdev.com/zclip/</a> but it is not working.</p> <p>Please suggest solution to it.</p>
javascript jquery
[3, 5]
3,268,981
3,268,982
Problem updating android contact picture with ContentResolver.Update()
<p>I am new to android. My requirement is to update contact picture with the selected one. Below is the code I am writing to implement this</p> <pre><code>byte[] imageBytes = imgContactPhoto.getDrawable().toString().getBytes(); ContentValues values = new ContentValues(); values.put(ContactsContract.Data.RAW_CONTACT_ID, contactId); values.put(ContactsContract.Data.IS_SUPER_PRIMARY, 1); values.put(ContactsContract.CommonDataKinds.Photo.PHOTO, imageBytes); values.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE); Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(contactId)); cr.update(uri, values, ContactsContract.Contacts._ID + " = " + contactId, null); </code></pre> <p>imgContactPhoto is the ImageView, in the first line, I am extracting Bytes array of the image set upon it and updating the contact (with cotact id = contacted). When I debug the code, it passes all the above statements smoothly without any exception, but the contact picture is not updated.When I check the values of uri and values during debug in new watch, "uri"   uri cannot be resolved to a variable<br> "values"   values cannot be resolved to a variable </p> <p>Any help is appreciated.</p>
java android
[1, 4]
5,576,086
5,576,087
change EditText to TextView
<p>I want to change the <code>TextView</code> to <code>EditText</code> and the <code>TextView</code> to <code>EditText</code>, therefore I decided to use the <code>ViewSwitcher</code> element on android, I read about it on the <a href="http://developer.android.com/reference/android/widget/ViewSwitcher.html" rel="nofollow">android developer website</a>.</p> <p>However I still have some point that I don't understand:</p> <ol> <li>How can I determine the current switch? (for example, to show only the <code>EditText</code>, and to invisible the <code>TextView</code>)</li> </ol> <p>Here is my code:</p> <pre class="lang-xml prettyprint-override"><code> &lt;ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_switcher" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;TextView android:id="@+id/clickable_text_view" android:clickable="true" android:onClick="TextViewClicked" android:text="@string/some_value" /&gt; &lt;EditText android:id="@+id/hidden_edit_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/some_value" &gt; &lt;/EditText&gt; &lt;/ViewSwitcher&gt; </code></pre>
java android
[1, 4]
3,308,523
3,308,524
Javascript loop when setinterval is done
<p>Please help me to loop this script when done the interval, when the <code>class="cur"</code> goes to last <code>p span</code> i would like to loop it again. I'm practicing a javascript code and this is what i made.</p> <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt;&lt;/script&gt; &lt;p style="font-size: 50px"&gt;This is a test&lt;/p&gt; &lt;script&gt; function blink() { $('.cur').next().css('color', '#333').addClass('cur'); $('.cur:first').css('color', '#ccc').removeClass('cur'); } var str = $('p').text(); var count = str.length - 1; var splt = str.split(""); var newstr = ""; for(i=0;i&lt;=count;i++) { newstr += splt[i].replace(splt[i],"&lt;span style='color: #CCC;'&gt;"+splt[i]+"&lt;/span&gt;"); } $('p').empty().append(newstr); $('p span:first').addClass('cur').css('color','#333'); setInterval('blink()', 100); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,653,764
3,653,765
C# Dictionary Performance
<p>I am using a Dictionary to store data, and will be caching it. I would like to avoid server memory issues, and have good performance by limiting the size of the Dictionary&lt;>, either in size or number of entries.<br> What is the best method of doing this? Is there another class I should be considering other than a Dictionary?</p>
c# asp.net
[0, 9]
2,253,470
2,253,471
Specified cast is not valid. enum
<p>whats wrong with this code, i try also <code>Enum.Parse</code> but didnt work.</p> <pre><code>public enum RoleNames { Administrator, [Description("Personnel Security")] PrsonalSecurity, } foreach (RoleNames roleName in arRoles) //&lt;&lt;&lt;error { if (IsCurrentUserInRole(roleName)) { return true; } } </code></pre> <p>arRoles is ArrayList of RoleNames, which is passing as a parameters.</p>
c# asp.net
[0, 9]
4,524,097
4,524,098
jQuery post array
<p>Am wondering how to post an array using $.ajax. My array is something like this:</p> <pre><code>var a = new Array(); a['test'] = 1; a['test2'] = 2; and so on... </code></pre> <p>I tried:</p> <pre><code>$.ajax({ url: baseUrl+"chat.php", data: { vars: a}, type: 'post', success: function(data) { alert(data); }}); </code></pre> <p>Any suggestions? Thank you for your time.</p>
javascript jquery
[3, 5]
384,430
384,431
PHP & JQuery Question?
<p>Is there a way to hide a form from my users until they click a link and then the form drops down for the user to fill out, by using PHP or JQuery if so how? Is there a tutorial that will teach me how to do this?</p>
php jquery
[2, 5]
894,127
894,128
Reload page with new parameters
<p>I have a popup window and when I click a button it will close that window and reload the parent window with new parameters. For example the url is <code>page.apsx?id=oldparameter</code>, the parent reloaded with new parameter like <code>page.aspx?id=newparameter</code></p> <p>I have something like: </p> <pre><code>object newparameter = r[“id”]; string url = “~/page.aspx?id=” +newparameter ; </code></pre> <p>Then I tried this:</p> <pre><code>Response.Write("&lt;script language='javascript'&gt; {window.opener.document.forms[0].elements['id'].value = '" + url + "'; top.close();}&lt;/script&gt;"); </code></pre> <p>But it doesn’t work. Can somebody show me how to do this? Thank you very much.</p>
c# javascript asp.net
[0, 3, 9]
4,338,483
4,338,484
How to modify XML with JQuery
<p>I am trying to modify a status flag in an XML structure using Javascript. Using examples found on the internet I believe this should work: </p> <pre><code>test = "&lt;?xml version='1.0' encoding='utf-8' standalone='no' ?&gt;" + "&lt;resultaat&gt;" + "&lt;type&gt;6&lt;/type&gt;" + "&lt;status&gt;I&lt;/status&gt;" + "&lt;start_datum&gt;2012-06-16 00:00:00&lt;/start_datum&gt;" + "&lt;eind_datum&gt;&lt;/eind_datum&gt;" + "&lt;/resultaat&gt;" </code></pre> <p>To change the content of the status field: </p> <pre><code>$(test).find("status").text("D") </code></pre> <p>The result is however that test is not modified and still contains the old status <code>I</code></p> <p><strong>Thanks for the answers</strong></p> <p>The correct insight is that you need to convert to an XMLObject first and modify this.</p> <p>Below is how I ended up doing it: </p> <pre><code>/* Convert Text to XML Object */ doc = $.parseXML(test) /* Change the fields required */ $(doc).find('status').text('D') /* Back to Text */ str = (new XMLSerializer()).serializeToString(doc); </code></pre>
javascript jquery
[3, 5]
1,884,981
1,884,982
Implementing deeplinking with multiple levels
<p>I need to implement deeplinking for my site as it's built heavily in AJAX. I understand the basic idea and have got deeplinking implemented for my top level nav. Problem is my site has multiple levels. A user can click on the top nav, which adds to the hash and then click on a secondary nav and a tertiary nav. I also need to add this secondary and tertiary nav click in to the hash...and then also be able to remove that item when the user clicks back on a primary nav item. I can't think of a way to do this...any ideas?</p> <p>Oh and the code (jQuery) I'm using to achieve the hashing on the primary nav is:</p> <pre><code>updateHash : function(hash) { var hashHistory = []; location.hash = hash; } </code></pre>
javascript jquery
[3, 5]
4,989,664
4,989,665
Parsing HTML page in ASP.NET
<p>I'm trying to parse HTML on an external page and read its contents (eg. get "title" element from google.com). XmlDataSource does not appear to be working because it's not clean XML, does anybody know how to do this?</p> <p>Thank you.</p>
c# asp.net
[0, 9]
4,787,991
4,787,992
Loading welcome animation only once jquery/php
<p>In my site i have a welcome animation (created with jquery) which runs when any one opens my website (<strong>www.mysite.com</strong>). Then the same user going to anther page in my site for example <strong>www.mysite.com/about</strong> then click back to home (<strong>www.mysite.com</strong>) the animation again shows up. How can i restrict this ?</p> <p>Share some logic like putting a session or settimeout or something like that.</p>
php jquery
[2, 5]
5,626,850
5,626,851
$_POST array is empty when POSTing with C# WebRequest
<p>I've been trying to get some client-server interaction happening with JSON, however, the data that I post to the server is not arriving; the <code>$_POST</code> array in my PHP script is empty.</p> <p>I've just ended up grabbing the WebRequest example straight from <a href="http://msdn.microsoft.com/en-us/library/debx8sh9.aspx" rel="nofollow">MSDN</a> and testing that. That still doesn't work. I've also tried just posting some data with HTML form, and that works fine. I'm completely stumped.</p> <p>When I call <code>getallheaders()</code> in my PHP I get</p> <pre><code>OK array(5) { ["Content-Type"]=&gt; string(33) "application/x-www-form-urlencoded" ["Host"]=&gt; string(9) "localhost" ["Content-Length"]=&gt; string(2) "54" ["Expect"]=&gt; string(12) "100-continue" ["Connection"]=&gt; string(10) "Keep-Alive" </code></pre> <p>though doing a var_dump($_POST) returns array(0)</p> <p>Can anyone suggest anything?</p>
c# php
[0, 2]
1,011,672
1,011,673
select all html elements based on rel value
<p>I have some html elements in my code like this</p> <pre><code>&lt;div rel="test1"&gt;item1&lt;/div&gt; &lt;div rel="test1"&gt;item2&lt;/div&gt; &lt;div rel="test1"&gt;item3&lt;/div&gt; &lt;div rel="test2"&gt;item4&lt;/div&gt; &lt;div rel="test2"&gt;item5&lt;/div&gt; </code></pre> <p>and I need a way to select all the divs that use <code>rel="test1"</code> and add a class to them how can I do this with <code>jQuery</code>?</p>
javascript jquery
[3, 5]
258,714
258,715
Youtube video webview is overlapping on the other layout in android
<p>I have a webview in my application and its working fine, but when there is a youtube video embeded in that url then the webview is overlapping on the other layout and that layout get covered. As far as I did here is the code:</p> <pre><code>web = (WebView) findViewById(R.id.webview01); progressBar = (ProgressBar) findViewById(R.id.progressBar1); web.getSettings().setLoadWithOverviewMode(true); web.getSettings().setUseWideViewPort(true); web.setWebViewClient(new myWebClient()); web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); web.getSettings().setPluginState(PluginState.ON); web.getSettings().setJavaScriptEnabled(true); web.loadUrl("http://savebigshopper.com/amazon"); </code></pre> <p>here is the image where I can show how the layout gets displaced:</p> <p><img src="http://i.stack.imgur.com/wyB7H.png" alt="enter image description here"></p>
java android
[1, 4]
5,251,792
5,251,793
Shell Android App Faster
<p>We have a web based App (html 5) and have created an Android Shell App from it. The Android App seems pretty slow - start-up, navigation, querries, etc. What can be done to improve the latency/performance of this App? Any comments/feedback will be appreciated. Thx</p>
javascript android
[3, 4]
576,669
576,670
Nested ListView ItemDataBound
<p>tryin' to render articles with pictures for each article. Im trying to use 2 nested ListView's and 2 querys in SQL Server 08 which i get in 2 methods from my 2 objectdatasources...</p> <p>My ListViews look like this: <a href="http://pastebin.com/Lf1Evd1d" rel="nofollow">http://pastebin.com/Lf1Evd1d</a> and my code-behinde like this: <a href="http://pastebin.com/0YebPk15" rel="nofollow">http://pastebin.com/0YebPk15</a></p> <p>Problem is I'm not really sure how to write the ItemDataBound. Im trying to get it to render with NyhetID connected with the each picture from the database. I think its wrong at the databound point. Just get an error which says that my method is non-generic and got something wrong with an ID...</p> <p>If anyone got other suggestions on how to reneder out articles with picture for each article please share :)</p> <p>Regards /Haris</p>
c# asp.net
[0, 9]
5,846,837
5,846,838
jQuery delay/pause an animation
<p>I have the following code to scroll a table's scrollbar</p> <pre><code>$('.myTable').animate({ scrollTop: myPositon }, 45000, function() { }); </code></pre> <p>Now I have the following event listening for the scroll bar position</p> <pre><code>$('.myTable').bind('scroll', function() { //if the scroll bar reaches certain position //pause the scrolling for 5 seconds }); </code></pre> <p>I have the code to check if the scroll bar reaches certain position, the questions is how to pause the scrolling/or animation for 5 second within the bind function and afterwards automatically resume the animation?</p> <p>I know there's delay and clearQueue. but calling:</p> <p><code>$('.myTable').delay(5000) or $('.myTable').clearQueue</code> does seem to have any effect</p>
javascript jquery
[3, 5]
3,154,205
3,154,206
Highlight similar text using jquery
<p>I have large text containers and i want to compare and highlight them using jquery. The question answered here <a href="http://stackoverflow.com/questions/119441/highlight-a-word-with-jquery">highlight a word with jquery</a> is perfect except it contains repetition of text. Here is an example</p> <pre><code>&lt;div id="source"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/div&gt; &lt;div id="similar1"&gt;Lorem ipsum dolor&lt;/div&gt; &lt;div id="similar2"&gt;consectetuer adipiscing elit&lt;/div&gt; </code></pre> <p>Now I want to match similar1 and similar2 with source div. The solution in above link suggests following code:</p> <pre><code> $("#similar1").highlight("Lorem ipsum dolor sit amet, consectetuer adipiscing elit."); $("#similar2").highlight("Lorem ipsum dolor sit amet, consectetuer adipiscing elit."); </code></pre> <p>As you can see I have to repeat source text everytime. Is it possible to get contents directly from source div? i.e.</p> <pre><code> $("#similar1").highlight($('#source').val()); </code></pre>
javascript jquery
[3, 5]
2,116,811
2,116,812
How do I set a variable in a function using Javascript or jQuery
<p>I need to move the data out of HTML code and load it on demand.</p> <p>I need to do something like this:</p> <pre><code>function processData( data ) { if ( data.length===0 ) { data = get data from server using Ajax or even... data = [['2011-06-01',1],['2011-06-02',3]] ; // just for educational purposes } else go do stuff with data ; } storeData = [] ; processData( storeData ) ; // first time storeData doesn't contain any data processData( storeData ) ; // now storeData contains data </code></pre> <p>I can't figure out how to stuff the data from within the function. Is there a way of accomplishing this?</p>
javascript jquery
[3, 5]
503,435
503,436
Access Master page variables in child page in asp.net
<p>Here is my master page file. I need to pAss strName,id,url,startime etc. variables to Child page. I know we can write this logic in our child page also. But, I would like to access this Master Page variable in child page only. Please suggest. I cannot write this logic in each set/get method. While accessing these variable in child page, i am getting null values. basically here the master pageload calls when after child pageload calls over </p> <p>1) MASTER PAGE NAME: MyMasterPage</p> <pre><code> public partial class MyMasterPage: MasterPage { public string strName = string.Empty; public string id= string.Empty; public string url = string.Empty; public string startTime = string.Empty; public string endTime = string.Empty; public string remoteUrl = string.empty; public void Page_Load(object sender, EventArgs e) { DataTable dtEventTable = DataAccessManager.GetEventInfo(Connection); if (dtEventTable.Rows.Count &gt; 0) { strName = dtEventTable.Rows[0]["NAME"].ToString(); id = dtEventTable.Rows[0]["ID"].ToString(); url= dtEventTable.Rows[0]["URL"].ToString(); starttime = dtEventTable.Rows[0]["starttime"].ToString(); endtime = dtEventTable.Rows[0]["endtime"].ToString(); remotelive = dtEventTable.Rows[0]["remotelive"].ToString(); // assume that strName = "TCG",id=5, startime=20111001 etc. } } } </code></pre>
c# asp.net
[0, 9]
4,581,021
4,581,022
How to create a list of video files in php?
<p>Am implementing one application that is Fetching video files from server, the list of video files should show in application, when I click that video, the video should play, and how I have to create a php file for that.</p>
php android
[2, 4]
3,903,296
3,903,297
Explicit or implicit looping?
<p>Why or when is "explicit" preferred when implicit solutions often are more readable and less code? It says "explicit is better than implicit" when for example an implicit loop is better than an explicit loop isn't it? </p> <pre><code>for every in all: every.updated = True </code></pre> <p>The above looks implicit to me and better than an explicit counter since a counter is another thing that can go wrong and why not leave to the compiler or other environment instead of requirement an explicit counter variable:</p> <pre><code> for(int i=0, i&lt;a.length, i++) ... </code></pre> <p>And there are languages where all looping is "implicit" - what does it mean and when is it preferred? And not explicitly setting a value to <code>null</code>or <code>None</code> or likewise seems better to me and I want to rewrite code when I "solve" a requirement by explicitly setting <code>return null</code> or <code>String name = null</code> since I think being explicit about what should be null and None should have a more clear solution such as only use a variable if it's needed and if I write return null somewhere I'm probably doing it wrong. When I was writing Java I found myself writing <code>return null</code> and declaring values as null at some places and I didn't like it and could rewrite it even though the case where I put <code>return null</code> was reached only in case of error. </p> <p>I asked the guru at work whether we ever should declare a variable to null, isn't defaults much better?</p> <p>I'd be glad to know your thoughts about this. An example where it <em>is</em> better to be explicit I can think of is declaring a list and explicitly declaring what type is in the list is better than just a list of objects e.g. it's preferred to declare <code>ArrayList&lt;ArrayList&gt;</code> instead of just an ArrayList if we know that it's a list of lists. </p>
java python
[1, 7]
3,437,263
3,437,264
onClick and window.location.href using Javascript
<p>I have a form submit based on the URL parameters. Now, before submitting the form, I also wanted to get a choice from the user and using a popup window for that.</p> <pre><code>&lt;input type="image" name="btnAddToCart" src="&lt;?php echo $pd_thumbnail;?&gt;" onClick="popupwindow('include/option.php?pid=&lt;?=$pd_id?&gt;','Choice', '200','200');" window.location.href='&lt;?php echo $cart_url; ?&gt;';" class="addToCartButton"&gt; </code></pre> <p>With this code, I am not able to use the window.location.href and my url is not refreshing.</p> <pre><code>&lt;input id="details_&lt;?=$pd_id?&gt;" name="details_&lt;?=$pd_id?&gt;"&gt; </code></pre> <p>In the URL, I also wanted to pass the value of above input which is coming from the popup window option.php.</p> <pre><code>&lt;head&gt; &lt;? $pid=$_GET['pid'] ?&gt; &lt;/head&gt; &lt;body&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; &lt;!-- Begin function sendValue(val){ window.opener.document.getElementById('details_&lt;?=$pid?&gt;').value = val; window.close(); } // End --&gt; &lt;/script&gt; &lt;form name="selectform"&gt; &lt;?=$pid?&gt; &lt;input id="1" name="details_&lt;?=$pid?&gt;" value="option1" type="radio" onClick="sendValue(this.value);"&gt;option1&lt;br&gt; &lt;input id="1" name="details_&lt;?=$pid?&gt;" value="option2" type="radio"onClick="sendValue(this.value);"&gt;option2&lt;br&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
php javascript
[2, 3]
5,806,236
5,806,237
Dynamically change option values in drop down list
<p>Hi I want to add multiple drop down lists to my html page. Which they are contained same option values. (name,email,state,city,country,phone) condition is when user select "name" in first drop down list it should be disabled in all other drop down list. Assume when user select "email" in second drop down list, both email and name should be disabled in other drop down lists. I only select one option value for one drop down list. Previously selected option values should be disable in other drop down lists. </p> <p>please can anyone help me??? </p>
php jquery
[2, 5]
3,342,376
3,342,377
increment/decrement .data() in jQuery
<p>Dom elements seems a perfect place to attach data that relates to that element, but accessing it is cumbersome code-wise, and probably inefficient too.</p> <p>Currently I am doing something like this to increment:</p> <pre><code>$('#the-thing').data({ counter: $('#the-thing').data('counter') + 1 }) </code></pre> <p>Is there a faster way to increment a number stored in the .data() of a jQuery object?</p>
javascript jquery
[3, 5]
1,608,066
1,608,067
jQuery .is(":visible") works in Firefox but not Chrome
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8337186/jquery-isvisible-not-working-in-chrome">jquery .is(&ldquo;:visible&rdquo;) not working in Chrome</a> </p> </blockquote> <p>I am trying to get all of the visible items in an array. It's working fine in Firefox but not Chrome.</p> <p>Here's my code:</p> <pre><code>$.each (t.config.promoInput, function (i, v) { var size = 0; $.each ($(v).find('option'), function (i, v) { $(v).show() // Show all options in &lt;tt&gt;$(v)&lt;/tt&gt;. .not(':first-child') // Don't hide &lt;tt&gt;(All)&lt;/tt&gt;. .not(':Contains("' + t.config.searchSpanInput.val() + '")') // Don't hide options that match the searchCriteria. .hide(); // Hide everthing that doesn't match or isn't (All). if ($(v).is(":visible")) { size++; } }); }); </code></pre> <p>In Firefox size increments, whereas Chrome size stays equal to 0.</p> <p>EDIT: :Contains is my own addition to the jQuery library. It is a case-insensitive version of :contains.</p>
javascript jquery
[3, 5]
3,374,241
3,374,242
Android Improve SQLite Performance Optimise
<p>I have an onCreate that currently opens an sqlite database and reads off 4 values. I then have a conditional and depending on what activity has sent it there it either displays those values or updates two values and then displays the other.</p> <p>Now if I run this activity without updating the database it is lightning fast. Whereas if I run two queries to write to the database it can be sluggish. Is there anything I am able to do to optimise this.</p> <p>The problem is the display stays on the previous activity until the sqlite updating has completed. This seems to be the problem.</p> <p>Sorry for what is most likely a rubbish explanation. Please feel free to ask me to better describe anything.</p> <p>Any help appreciated.</p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reason); //Opens DB connection type = b.getString("TYPE"); get(); if(type.equals("next")){ update();} db.close(); } public void get(){ Cursor b = db.rawQuery("SELECT * FROM " + DB_TABLE2 +" WHERE _id='1'" , null); b.moveToFirst(); id = b.getInt(b.getColumnIndex("nextq")); nextvalue = b.getInt(b.getColumnIndex(type)); if(nextvalue==0){nextvalue=1;} b.close(); nextvalue ++; } public void update(){ db.execSQL("UPDATE " + DB_TABLE2 + " SET nextq='" + nextvalue + "'" + " WHERE _id='1'"); db.execSQL("UPDATE " + DB_TABLE + " SET answered_correctly='" + anscorrect +"' , open ='1' WHERE _id='" + id + "'"); } </code></pre>
java android
[1, 4]
3,375,516
3,375,517
How to hide footer if someone checks your site from a link on a specific website
<p>I recently started to develop an interest in freelancing. I just created an account on vWorker, but it seems they do not alow linking to sites that have your personal information.</p> <p>That means that I can not link to my website portfolio, unless I find a way to hide the footer when someone clicks on the link from them.</p> <p>Is there a way that I can hide my footer when someone clicks on the link on this page?</p> <ul> <li><a href="http://www.vworker.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=8262781&amp;Tab=2" rel="nofollow">my vworker portfiolio</a></li> </ul> <p>The footer should be hidden only for this scenarion.</p>
php javascript
[2, 3]
3,588,899
3,588,900
on click disable function, else function works?
<p>I have a jQuery code here: </p> <pre><code>jQuery(document).ready(function () { $("td").click(function (e) { var chk = $(this).closest("tr").find("input:checkbox").get(0); if (e.target != chk) { chk.checked = !chk.checked; } if ($(this).closest("tr").find("input:checkbox").is(":checked")) { $(this).closest("tr").css("font-weight", "bold"); } else { $(this).closest("tr").css("font-weight", ""); } }); }); </code></pre> <p>As you can see I have a lot of checkboxes and on click on any <code>td</code> it's checked and adding css.</p> <p>It works fine. What I want, is in the same form I also have a lot of <code>select</code> boxes.<br> When I try to choose something the function works.<br> I want to disable the function on click on the select box because I want to choose not to enable the checkbox.</p>
javascript jquery
[3, 5]
666,395
666,396
Adding values to serialised Array Jquery
<p>Im trying to add data to a preserialised array. Its not working. Anyone spot why?</p> <pre><code>$("#show-friends").live("click", function() { var friendSelector = $("#jfmfs-container").data('jfmfs'); var sendArr = $(friendSelector).serializeArray(); sendArr.push({ name: "userid", value: "&lt;?php echo $userId;?&gt;" }); sendArr.push({ name: "fid", value: "&lt;?php echo $fid;?&gt;" }); $.post({ url:'test.php', data: sendArr, }); }); </code></pre> <p>Edit: I changed my code to:</p> <pre><code> $("#show-friends").live("click", function() { var friendSelector = $("#jfmfs-container").data('jfmfs'); var sendArr = friendSelector.serializeArray(); $.post({ url:'test.php', data: "name=&lt;?php echo $userId;?&gt;&amp;fid=&lt;?php echo $fid;?&gt;&amp;jsondata="+sendArr, }); }); </code></pre> <p>However I get a error friendSelector.serializeArray is not a function</p>
javascript jquery
[3, 5]
5,864,934
5,864,935
Random string from string array list
<p>I have list of countries in my array, I would like to pick random country from the list (using random probably?), but I haven't found out the answer myself...</p> <p>This is what I have so far:</p> <pre><code>String[] list = {"Finland", "Russia", "Latvia", "Lithuania", "Poland"}; Random r = new Random(); </code></pre>
java android
[1, 4]
2,993,360
2,993,361
Why does asp.net still have to use js?
<p>I'm a beginner of <code>asp.net</code>, and I learned yesterday that we can use <code>.cs</code> file to handle control event, so do we still need to use <code>js</code>? Can we just use c# to deal with the web controls?</p>
c# javascript asp.net
[0, 3, 9]
4,459,023
4,459,024
jquery mouseover
<p>I have a button on my asp.net page and I am using ajax jquery to create a mouseover effect.I want to show alert on mouse over. How can i do this ?</p>
jquery asp.net
[5, 9]
3,884,586
3,884,587
IE8 window.opener problems
<p>Having problems with IE8...</p> <p>I have a button that onclick fires the <code>showImageBrowser()</code> function.</p> <pre><code>function showImageBrowser(params) { var open = window.open('http://localhost/admin/browse?'+params,'newwin','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=950,height=500'); if (!open) { alert('Could not open the image browser, please disable your popup blocker.'); } } </code></pre> <p>Now in the image browser when you click on an image it calls this function:</p> <pre><code>function selectFile(url, el) { window.opener.replaceImage('Test_Image', url); window.close(); } </code></pre> <p>Which is calling the <code>replaceImage()</code> function in the parent window, as expeted.</p> <p>This is the code:</p> <pre><code>function replaceImage(el, url) { $('#'+el).html('&lt;a href="'+url+'" target="_blank" class="image"&gt;'+basename(url)+'&lt;/a&gt;'); $("input[name='"+el+"']").val(url); } </code></pre> <p>Now if you click on the original <code>showImageBrowser()</code> button for the second time, IE will bring up the window but this time it freezes for a few seconds and then you get the alert "Could not open the image browser, please disable your popup blocker."</p> <p>This works fine in Firefox (obviously) but not in IE. I haven't even tried it in IE7/6 because if it doesn't work in 8 then I know I'm going to have problems.</p> <p>Any advice?</p>
javascript jquery
[3, 5]
1,021,557
1,021,558
How can I set a Global Variable from within a function
<p>How can I set a Global Variable from within a function?</p> <pre><code>$(document).ready(function() { var option = ''; $("[name=select_option_selected]").change(function() { var option = $(this).val(); alert(option); // Example: Foo }); alert(option); // Need it to alert Foo from the above change function }); </code></pre>
javascript jquery
[3, 5]
942,126
942,127
Help using a few text boxes to display and save data to database
<p>Let's say I have a db table like so:</p> <pre><code>Notes: -ID -Name </code></pre> <p>Then I have a product edit form that has 3 textboxes in which the user can save up to 3 different notes for a specific product. What is the best way to handle populating and then saving the data? If I use the code below to display it, how do I save it, as the textbox doesn't know the id of the note.</p> <pre><code> var f = db.ItemsFeatures.Where(x=&gt; x.ItemID == q.ItemID).Select(x =&gt; x); if (f.Any()) { try { txtItem1.Text = f.First().Name.ToString(); txt1 = f.First().FeatureID; txtItem2.Text = f.Skip(1).First().Name.ToString(); txt2 = f.Skip(1).First().FeatureID; txtItem3.Text = f.Skip(2).First().Name.ToString(); txt3 = f.Skip(2).First().FeatureID; } catch { } } </code></pre> <p>Would I use hidden fields? I have a feeling there is a better way to go about this.</p>
c# asp.net
[0, 9]
3,548,834
3,548,835
Java code translation of Python array-splitting code
<p>Can someone please give the Java equivalent of the below python (which slices a given array into given parts) which was originally written by ChristopheD here:</p> <pre><code>def split_list(alist, wanted_parts=1): length = len(alist) return [ alist[i*length // wanted_parts: (i+1)*length // wanted_parts] for i in range(wanted_parts) ] </code></pre> <p>I don't know any python but can really use the above code in my Java app. Thanks</p>
java python
[1, 7]
497,728
497,729
how to kill the session when user closed the brower without logout
<p>I am developing one aspnet application in that i am using Sessions. if user login into the application and click on logout here i am closing session. </p> <p>suppose if the user doesn't click on the logout and he close the browser. how to kill the session when user closed the brower without logout</p> <p>Regards kumar</p>
c# asp.net
[0, 9]
2,304,408
2,304,409
Jquery open url as a variable and change text
<p>I have this:</p> <pre><code>&lt;fieldset id="social_associations" class=""&gt; &lt;a href="/social/login/twitter"&gt;Associate your account to twitter&lt;/a&gt; &lt;br&gt; &lt;a href="/social/login/facebook"&gt;Associate your account to facebook&lt;/a&gt; &lt;br&gt; &lt;/fieldset&gt; </code></pre> <p>And I would like a function to follow the URLs within these links but these URLs are generated by a script and may change according to the user's profile (if a user has already associated an account then the URL that will appear will have 'disconnect' instead of 'login') so the function must take whatever appears in the link, it can't be hardcoded. I don't want to leave the current page while clicking on it. And when a link is clicked I would like to change the text from associate... to disconnect. Must be easy but I have no clue!</p> <p>EDIT:</p> <p>I understand that the question is not clear so I rephrased it here: <a href="http://stackoverflow.com/questions/10494835/javascript-on-click-change-href-and-open-in-new-window">javascript on click change href and open in new window</a></p>
javascript jquery
[3, 5]
4,239,021
4,239,022
How to find control insdie table which is inside gridivew
<p>I have a tricky question to ask.. I want to get the ID of the <strong>ASP control inside a table and the table is inside a gridview</strong>... Here's the code to give you a better idea...</p> <pre><code> &lt;asp:GridView ID="gvTest" runat="server"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td&gt;&lt;asp:Label ID="lblTestLabel" runat="server"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>I have no problem getting the <strong>control inside a gridview</strong> and here's the code </p> <pre><code>function TestFunction(sender, e) { var gridview = document.getElementById('gvTest.ClientID'); var i = gridview.rows.length - 1; var node1 = gridview.rows[i].cells[1].children[0]; } </code></pre> <p>But i need to put table inside gridview for formatting issues and when i did it, the controls are not accessible .... So my question is how can i get the ID of the ASP label (in this case, lblTestLabel") in javascript?? Answers and suggestions are very much appreciated..</p>
javascript asp.net
[3, 9]
2,185,895
2,185,896
less than conditional not working for floats
<p>heres my jquery/javascript code:</p> <pre><code>amount_sale = parseFloat($('#p_sale span').html()).toFixed(2); amount_cash = parseFloat($('#p_cash span').html()).toFixed(2); if (amount_cash &lt; amount_sale) { alert('Cash amount must be greater than or equal to sale amount'); return; } </code></pre> <p>lets say that the html is as follows:</p> <pre><code>&lt;p id="p_sale"&gt;Sale: &lt;span&gt;10.00&lt;/span&gt;&lt;/p&gt; &lt;p id="p_cash"&gt;Cash: &lt;span&gt;20.00&lt;/span&gt;&lt;/p&gt; </code></pre> <p>for whatever reason, even if the contents within the p_cash span is greater than the contents within the p_sale span, i still get the alert.</p> <p>i don't get it.</p>
javascript jquery
[3, 5]
1,057,943
1,057,944
Putting jQuery/javascript source pages before end of body tag
<p>I've seen in several plugin instructions , paste the javascript/jQuery source just before the end of body tag. I made search why they are saying like that, didn't make me any sense. </p> <p>If I put the src file where ever in the script, I never faced a problem at all. Could anyone give me a good answer about this?</p>
javascript jquery
[3, 5]
4,831,590
4,831,591
Generating event when user clicks in textarea with disabled=true, to tell them they can't modify it
<p>I want to tell the user they can't modify a textarea that's been disabled for update, when they try to click in it. How can I tell them why it is disabled in this case, e.g. with an alert? </p> <p>The problem is/was, when I give the textarea a disabled attribute, the events for it don't fire off either (at least in Chrome).</p>
javascript jquery
[3, 5]
3,155,340
3,155,341
Usage of setInterval method and asking for jQuery alternate
<p><code>window.setInterval("moveUp(fire,2)","100"); </code></p> <p>in the code above fire is a object represting a div. I want to pass this object to moveUp method and call this method continuosly.</p> <p>My problem is window.setInterval does not accepts fire object like this and gives error as fire is not defined. Although i am using fire object at other places as well. Besides this i also want to know if i can do the same using jQuery.</p>
javascript jquery
[3, 5]
5,137,015
5,137,016
When does javascript called from jquery.ready() run relative to scripts in <head>?
<p>Javascript passed to <a href="http://api.jquery.com/ready/" rel="nofollow">jQuery.ready()</a> will run after the DOM is fully loaded but doesn't wait for all assets such as images to be received (unlike <a href="http://api.jquery.com/load-event/" rel="nofollow">jQuery.load()</a>). Cool. But will javascript placed in <code>&lt;script&gt;</code> tags in the <code>&lt;head&gt;</code> of a document always run before code passed to jQuery.ready()?</p> <p>I'm assuming the answer is yes, but couldn't find anything specifically clarifying this.</p>
javascript jquery
[3, 5]
849,353
849,354
Dynamically created LinkButton posts back but does not call onClick Method
<p>My issue is the page posts back but does not call the method.</p> <p>Here is where I create the link Buttons inside the RenderProducts method</p> <pre><code>for (var counter = 1; counter &lt;= numberOfPages; counter++) { var pagingLink = new LinkButton { Text = " " + counter.ToString(CultureInfo.InvariantCulture) + " ", ID = "page" + counter }; pagingLink.Attributes["runAt"] = "server"; pagingLink.Attributes["class"] = "paging-link"; pagingLink.Attributes.Add("AutoPostBack", "true"); pagingLink.Attributes.Add("AutoEventWireup", "true"); pagingLink.Click +=ChangePage; paging.Controls.Add(pagingLink); } </code></pre> <p>The method it is calling</p> <pre><code> public void ChangePage(object sender, EventArgs args) { // handle this particular case RenderProducts(2); } </code></pre> <p>For completeness below you will see on PostBack I prevent it's default action</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { GetSideBar(); BuildRefineSearch(); PopulateList(); PerformSearch(); if(!IsPostBack ) { RenderProducts(1); } } </code></pre>
c# asp.net
[0, 9]
209,198
209,199
Session Variable problems when storing an object in my Session
<p>I have a log in page where I valid my users and based on this validation I store their user info in a session variable so I can access it at any time. To do this I am trying to store an instance of one of my dbml generated classes "UserInfo". So I populate the class and then store it in a session variable I call "user"</p> <pre><code> UserInfo u = new UserInfo(); u = dal.RetrieveUser(userID, userPass) Session["user"] = u; </code></pre> <p>The issue I am having with this is it seems to mix up these session variables between users. Or more specifically it always seems to take the information from the first user variable stored for each subsequent user that logs in. So user 1's info is being pulled in for User 2, User 3, etc...</p> <p>Is my problem that my class "UserInfo" is somehow static? Or what is causing this to happen? My UserInfo class looks like this:</p> <pre><code>public partial class UserInfo { ... </code></pre> <p>EDIT: After further review it seems that my Session variables are in fact working properly but my custom menus are actually the problem.</p>
c# asp.net
[0, 9]
2,737,394
2,737,395
How do I protect phone number from bots
<p>I want a phone number which display on public page will be protected. Example converts phone number characters to HTML entities and bots can't grab the number in plain text. Let me know the trick.</p>
php jquery
[2, 5]
2,040,188
2,040,189
can this code be re-written to use jquery chaining for setTimeout()
<p>Is it possible to use chaining when using setTimeout(). This example gives a div a red background, then I use setTimeout() to wait a second and make the background back to normal. can it be re-written or improved in any way</p> <pre><code>$(target).css('background', 'red'); setTimeout(function(){ $(target).css('background', ''); }, 1000 ); </code></pre>
javascript jquery
[3, 5]
1,830,441
1,830,442
How to call this javascript function from code behind
<p>I'm putting javascript created controls (http://www.dariancabot.com/projects/jgauge_wip/) on my page.</p> <pre><code>&lt;div class="jgauge" &gt;&lt;/div&gt; $(document).ready(function () { var ctl; ctl = new jGauge(); ctl.init(); )} </code></pre> <p>Let's say I need to pass few parameters to <code>init</code>. like... <code>ctl.init(a, b);</code> from code behind, how can I achieve that? I tried something like this...</p> <pre><code>string script2 = String.Format("init('{0}','{1}')", param1, param2); this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true); </code></pre> <p>But it's not working. I got:</p> <pre><code>ReferenceError: init is not defined </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,164,352
4,164,353
Why isnt my jquery working when I use external pages
<p>Im using jquery to load in 2 external pages, one called search.php and the other is called info.php. I am displaying them each on a single page called user.php but only when there link has been clicked in the navigation bar. Unfortunately I am currently experiencing a problem, when I use this section of script:</p> <pre><code>$(document).ready(function() { $('#content_area').load($('.menu_top:first').attr('href')); }); $('.menu_top').click(function() { var href = $(this).attr('href'); $('#content_area').hide().load(href).fadeIn('normal'); return false; }); </code></pre> <p>My page seems to flicker and stall for 2 seconds before changing the content. I have noticed However if I remove the .hide and fadeIn it seems to work fine. How can I still use the fade-in but eliminate the stall and flickering?</p>
javascript jquery
[3, 5]
766,774
766,775
Android - playing RTSP audio streams using MediaPlayer
<p>I'm trying to creating radio application and one of the radio stations is using rtsp:\ protocol (rtsp:\\addres\file.sdp with mp4a codec). I was trying to play it using <a href="http://developer.android.com/reference/android/media/MediaPlayer.html" rel="nofollow">MediaPlayer</a> but it doesn't want to work. Is it possible to play such audio stream using android with MediaPlayer or... other lib?</p> <p>Any one :(?</p>
java android
[1, 4]
41,692
41,693
creating an options menu with quit application function
<p>I'm writing an application for android and I would like to insert an options menu, that would have only one function and that is to quit an application.</p> <p>My options_menu.xml looks like this (I created a new folder under res called menu - just like the instructions said):</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:id="@+id/quit" android:icon="@drawable/ic_quit" android:title="@string/quit" /&gt; &lt;/menu&gt; </code></pre> <p>Than I added the following code to my java class file:</p> <pre><code>@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.quit: finish(); return true; default: return super.onOptionsItemSelected(item); } } </code></pre> <p>I also defined the @string/quit in values - strings.xml file, but it still says that there is an error:</p> <pre><code>C:\Users\Domen\workspace\Lovne Dobe1.1\res\menu\options_menu.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/quit') </code></pre> <p>So if anybody can help I would be very grateful.</p>
java android
[1, 4]
2,989,966
2,989,967
error handling full request to the server side of asp.net page
<p>I have asp.net page and js code to download files from the page using window.location and its working but the problem is i want to make error handling from window.location , how to handle the errors from full request to the asp.net page ??</p>
javascript jquery
[3, 5]