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
754,556
754,557
Gridview on direct edit mode
<p>I want gridview directly on edit mode without any edit/update linkbutton on it and I want to update each row on every next different row selection. I have tried by putting textbox on itemTemplate and passed row index on row command (hidden button is created)updated on rowUpdating.</p> <p>Any ideas?</p>
c# asp.net
[0, 9]
3,858,491
3,858,492
While loading page in mozilla, First DIV code is not loaded
<p>While loading page in mozilla, First DIV code is not loaded tried to load html using inside</p> <pre><code>&lt;div id="mainContent"&gt;&lt;/div&gt; </code></pre> <p>with below call</p> <pre><code>if (destinationURL != null) { $.get(destinationURL, function(data) { $("#mainContent").attr("innerHTML",data); }); } </code></pre> <p>destinationURL refers below sample html</p> <pre><code>&lt;div id="A1"&gt; &lt;div id="B1"&gt; &lt;div id="c1"&gt; &lt;span&gt;hi&lt;/span&gt; &lt;/div&gt; &lt;div id="c2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="B2"&gt; &lt;div id="D1"&gt; &lt;span&gt;hi2&lt;/span&gt; &lt;/div&gt; &lt;div id="D2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="B3"&gt; &lt;div id="E1"&gt;&lt;/div&gt; &lt;div id="E2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="B4"&gt; &lt;div id="F1"&gt;&lt;/div&gt; &lt;div id="F2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>but, when html loads</p> <pre><code>$("#c1") refers null object </code></pre> <p>if i see </p> <pre><code>$("#D1") contains html. </code></pre> <p>if i give alert message on onLoad, i can able to get Html. Its happening only in mozilla</p>
javascript jquery
[3, 5]
3,050,735
3,050,736
PHP class method called by jQuery
<p>I'm fairly new to jQuery and OOP in PHP, but what I have is a PHP Object that has an array</p> <pre><code>$array[0] = "a" $array[1] = "b" $array[2] = "c" $array[3] = "d" </code></pre> <p>and a select box in my HTML</p> <pre><code>&lt;select class="box"&gt; &lt;option value="1"&gt;First Letter&lt;/option&gt; &lt;option value="2"&gt;Second Letter&lt;/option&gt; &lt;option value="3"&gt;Third Letter&lt;/option&gt; &lt;option value="4"&gt;Fourth Letter&lt;/option&gt; &lt;/select&gt; &lt;div&gt;&lt;/div&gt; </code></pre> <p>How do I dynamically change whatever is in the div tags as someone changes the value of the select box using jQuery?</p> <p>Is there a way to do something like </p> <pre><code>$('.box').change(){ var value = $object-&gt;array[index-1]}? </code></pre> <p>Assuming I had already have the value for index.</p> <p>EDIT I know I'll have to use Ajax, but I'm not sure how to call a method in an instance of an object already made.</p>
php jquery
[2, 5]
5,977,384
5,977,385
Jquery model popup maximize mode issue
<p>I want to open JQuery Dialog in maximized mode.<br> When I set Width &amp; Height properties of the model window It slightly goes out of inner window &amp; shows up horizontal scollbar. What's wrong in my code</p> <pre><code> $("#popupwin").dialog({ width: $(document).width(), height: $(document).height(), resizable: false }); </code></pre>
javascript jquery
[3, 5]
1,110,719
1,110,720
Exporting a ListView to Excel
<p>I have a ListView that I need to export to an Excel spread sheet. There a bunch of documentation to export GridViews and to a lesser extent ListViews to Excel but not so much in terms of doing some customization before export.</p> <p>Before exporting I need to prep the data, as a) only a subset of the columns need to be exported b) some of these columns are editable textbox controls.</p> <p>Doing a simple export without preping the table means that the control gets exported as well which obviously looks really ugly. </p> <p>At the moment I can iterate the controls and remove the formatting from both the Grid and ListViews thus solving b.</p> <p>In the GridView and I can just set some the columns I want to hide using Visible = false; and then set back to true when I have finished.</p> <p>The thing I can't figure is how to do this with the listview. </p> <p>I am wondering what is the best way to do this as I am kind of stuck.</p> <p>Thanks, Michael</p>
c# asp.net
[0, 9]
2,324,564
2,324,565
Should I wrap jQuery document ready in a self executing function?
<p>I had a thought to do something like this:</p> <pre><code>(function(window, undefined){ $ = window.jQuery; $(function(){ // Do some stuff }); })(this); </code></pre> <p>Would you consider this good practice or bad? Does it have any implications for when jQuery(document).ready() would fire?</p>
javascript jquery
[3, 5]
771,526
771,527
Is there only Ajax part of jQuery?
<p>Is there only Ajax part of jQuery? The matter is I do not need the whole library but only its Ajax part (I need to include this part on several iframes). </p>
javascript jquery
[3, 5]
2,926,160
2,926,161
connect to ms sql database in a server
<p>i am working on a app which should take data from a database on a server. it is a ms sql database. i need some help like little code hints or some useful information.</p> <p>thank you!</p>
java android
[1, 4]
3,718,036
3,718,037
Using spinner OnItemSelectedListener() to start new intent
<p>I have a spinner and when the user selects I want to call another java class using new Intent. The code below worked when I was using a Button but now I have it attached to the Spinner select I think it has something to do with view.getContext();</p> <p>areaspinner.setOnItemSelectedListener(new OnItemSelectedListener() {</p> <pre><code> public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { int item = areaspinner.getSelectedItemPosition(); Intent myIntent = new Intent(view.getContext(), ShowXMLPAR.class); startActivityForResult(myIntent, 0); } public void onNothingSelected(AdapterView&lt;?&gt; arg0) { } }); </code></pre> <p>Can anyone help me update this part of the code.</p>
java android
[1, 4]
5,720,350
5,720,351
AutoCompleteExtender - Get Primary Key into HiddenField
<p>I want to use autoComplete extender in a way similar to a dropDownList. Currently I have a dropdown List that holds a collection of companies. Selecting a company name enables me to get the value associated with the listItem.</p> <p>I want to replace the dropDownList with autocomplete extender and place a text box. While typing user will be able to view the company. After selecting the company, I want to capture the value (such as company ID). I don't want this ID to be visible to user.</p> <p>Please advice how to achieve this functionality with autoComplete extender.</p>
c# asp.net
[0, 9]
3,010,116
3,010,117
Post back issue
<p>OK. Let me ask the question this way: Generically, isn't the page cycle:</p> <p>page_load</p> <p>onclick and/or submit handlers</p> <p>page_load.</p> <p>If so, what should the values of the controls on the page be during the onclick/submit handlers? The values selected by the users, or the values from page_load?</p>
c# asp.net
[0, 9]
1,247,743
1,247,744
Does Android have any way to detect cyanogenmod and its version?
<p>I'm working on an android media player which needs equalizer. However, equalizer is only available on Gingerbread and above, but cyanogenmod 6 has modified audioflinger to act as equalizer, so I want to detect OS version.</p>
java android
[1, 4]
430,637
430,638
How can i remove columns which contains 0 using Jquery
<p>I have a table which contains suppose 4 columns i want to remove columns which contains 0 from first row to last row. In this case i want to remove 2nd &amp; 4th column how can i achieve this using jquery </p> <pre><code>1 0 10 0 2 0 20 0 3 0 30 0 </code></pre> <p>o/p should be</p> <pre><code>1 10 2 20 3 30 </code></pre>
jquery asp.net
[5, 9]
4,828,162
4,828,163
How does Apple change site based on whether Javascript is enabled?
<p>I am working on a site that will involve a lot of Javascript to show/hide elements in accordions, as well as other things. I want to make sure that even people that do not have Javascript enabled will be able to access all of the site's content (even if it is a little less pretty/interactive). I am not sure the best way to go about doing this. I know you can use the tag, but I know that cannot be the best way. It doesn't make sense to have to essentially have two versions of the site, one for Javascript and one for not.</p> <p>As I am still building the site, I thought using Apple's site would be a good example. On any of their product pages (say <a href="http://www.apple.com/ipod/" rel="nofollow">http://www.apple.com/ipod/</a>) they have their products at the top and then other options (Applications, iTunes &amp; More, etc.) that when you click it shows these next elements. It looks awesome. But if you have Javascript enabled, you no longer get the cool interactive interface, but you do have all the products in a list. How would you go about doing this?</p> <p>The solution doesn't necessarily have to be the way that Apple does it. I just thought it was a good example to illustrate what I am trying to do.</p>
javascript jquery
[3, 5]
414,207
414,208
result out of jQuery.post()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call-from-a-function">How to return the response from an AJAX call from a function?</a> </p> </blockquote> <p>Im trying to get result out of a function in which a jQuery Post function, but I dont know how to handle the date which I get as the result of the post function.</p> <pre><code> function getBuddyFromMessageId(id){ var u = "testName"; var result = ""; $.post("http://localhost/fisrtproject/api.php?action=getBuddyFromMessageId", { username:u, message:id }, function (data){ result = data; //the result is a normal string }); return result; } </code></pre>
javascript jquery
[3, 5]
5,579,378
5,579,379
How do you set the "Visible" property of a ASP.NET control from a Javascript function?
<p>Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function. I figured I would just access the control in Javascript using:</p> <pre><code>var theControl = document.getElementById("txtEditBox"); </code></pre> <p>Then just set the control's Visible property to true/false. It doesn't seem to be working, I can't seem to figure out how to set "Visible" to true/false. How can I do that? Also, is that the best way to hide/show a ASP.NET control from a Javascript function?</p> <p>Thanks, Jeff </p>
asp.net javascript
[9, 3]
5,809,570
5,809,571
Capitalize and color the first letter after a period in jquery
<p>I'm trying figure out how to color the first word after the period.</p> <p>I worked out capitalizing the first letter, but now I need it be colored. I preferred to be the first letter "red".</p> <pre><code>$(function () { function capitalizeSentences(capText, capLock) { if (capLock == 1 || capLock == true) { capText = capText.toLowerCase(); } capText = capText.replace(/\.\n/g, ".[-&lt;br&gt;-]. "); capText = capText.replace(/\.\s\n/g, ". [-&lt;br&gt;-]. "); var wordSplit = '. '; var wordArray = capText.split(wordSplit); var numWords = wordArray.length; for (x = 0; x &lt; numWords; x++) { wordArray[x] = wordArray[x].replace(wordArray[x].charAt(0), wordArray[x].charAt(0).toUpperCase()); if (x == 0) { capText = wordArray[x] + ". "; } else if (x != numWords - 1) { capText = capText + wordArray[x] + ". "; } else if (x == numWords - 1) { capText = capText + wordArray[x]; } } capText = capText.replace(/\[-&lt;br&gt;-\]\.\s/g, "\n"); capText = capText.replace(/\si\s/g, " I "); return capText; } //Capitalize After Period $("#capitalizeAfterPeriod").click(function () { var txt = $('textarea#generator').val(); txt = capitalizeSentences(txt, true); $('textarea#generator').val(txt).addClass('period'); }); }); </code></pre>
javascript jquery
[3, 5]
4,576,775
4,576,776
jQuery get values of 4th and greater number of checkboxes clicked using an each loop
<p>I am running an each loop to a form, to sum values based on user selections and get the final price of a product. The hard part is that in specific checkbox groups I have further restrictions like: the group A will start adding to the price, after 4 and more checkboxes are clicked and only add the values of those clicked after the 3rd item.</p> <p>Below is the function that I ve created and I am searching of a solution to my problem:</p> <pre><code>var quantity = 1; var removedProductPrice = false; //User can pick a variation of the same product, so the price changes to that selected variation (flag) var product_price = parseFloat($("#product").val()); //Base product price var totalProduct = product_price; $(":input", "#productForm").each(function(){ if(this.type == 'checkbox' || this.type == 'radio'){ if(this.checked == true){ priceProtocol = $(this).attr('rel').split('_'); //priceProtocol[0]: 'variation/component/steady, priceProtocol[1]: number of choices switch(priceProtocol[0]){ case 'variation': removedProductPrice = true; totalProduct = Number(totalProduct)+Number(this.value); break; case 'component': totalProduct = Number(totalProduct)+Number(this.value); break; case 'steady': //If the number of clicked checkboxes is greater than the limit, start adding to the price if($("input[name='"+this.name+"']:checked").length &gt; priceProtocol[1]){ totalProduct = Number(totalProduct)+Number(caller.val()); } break; } } }else if(this.id == 'product_quantity'){ quantity = this.value; } }); //If a variation selected, change the price to that of the variation if(removedProductPrice){ totalProduct = totalProduct-product_price; } //Multiple by the selected quantity totalProduct = Number(quantity)*totalProduct; //Preview the final price $("#current_product_price").html(totalProduct.toFixed(2)); } </code></pre> <p>How can I achieve that described above?</p>
javascript jquery
[3, 5]
2,586,692
2,586,693
How to create a delimited string dynamically with Jquery?
<p>Ok I'm kind of new to JavaScript and jquery so bare with me...</p> <p>I'm creating a dynamic form builder where table rows can be dragged, dropped, reordered and so on. Most of this is working but when it comes to deleting rows how would I created an array or set of values that I could post back to the php script that I am using to update the database.</p> <p>The way I am going to handle it is create a delimited string and post this back. </p> <p>How would I go about creating the the string dynamically by appending a value like the following: 23| every time the user clicks a button? For example the if user click the button 3 times the sting would be 23|25|26| and then when they clicked save that value could be posted back to be processed. </p> <p>This is the code I have for the delete function so far but its only removing the table rows and not actually generating the string.</p> <pre><code>$(".reMove").live('click', function(e) { $(this).parent().parent().remove(); var al = $(this).attr('rel'); $("#form1").find(".del").val(al); e.preventDefault(); sortt(); }); </code></pre>
javascript jquery
[3, 5]
5,222,677
5,222,678
highlight specific divs (tds) onhover of a link
<p>So i'm just starting to discover how awesome jquery is and how a basic function can drive me nuts to understand. I'm trying to highlight a div with a specific "id" generated via backend</p> <pre><code> &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt; &lt;div id="id_1"&gt; &lt;h2&gt;id_1 - &lt;a class="marker_id_1" href="#top" name="id_1" id="id_1"&gt;Top&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_1"&gt; &lt;h2&gt;id_1 - &lt;a class="marker_id_1" href="#top" name="id_1" id="id_1"&gt;Bottom&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_2"&gt; &lt;h2&gt;id_2 - &lt;a class="marker_id_2" href="#top" name="id_2" id="id_2"&gt;Top&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt; &lt;div id="id_2"&gt; &lt;h2&gt;id_2 - &lt;a class="marker_id_2" href="#top" name="id_2" id="id_2"&gt;Bottom&lt;/a&gt; &lt;/h2&gt; &lt;/div&gt;​ </code></pre> <p>So if I hover over the "id_1" Top , I want to highlight both the "id_1" Top and Bottom. Below is a link to that so it'll be easier to understand.</p> <p><a href="http://jsfiddle.net/4PgC6/66/">http://jsfiddle.net/4PgC6/66/</a></p> <p>Thanks!!</p>
javascript jquery
[3, 5]
761,146
761,147
How can I program a decimal addition with JavaScript
<p>How can i program this, the decimal shift needs to be programed that most of it I think , the rest would be just a normal add, any thoughts on how to program this? This is for an incrementer I'm building, the user can press plus or minus and increment a text input.</p>
javascript jquery
[3, 5]
3,239,786
3,239,787
how to get the element selected
<p>The dropdowns on the top right, I need to get the first three characters of the string of the type selected for example if the user selects Pizza Delivery i need the string "piz"</p> <p>here is the <a href="http://posnation.com/pre_config/pre_config_step_3.php?type=Restaurant&amp;count=1" rel="nofollow">url</a></p> <pre><code> &lt;div class="select-big select-small right"&gt; &lt;div class="select-holder"&gt; &lt;div class="button"&gt; &lt;div class="icon left"&gt;&lt;/div&gt; &lt;p class="text left"&gt;Fast Food Pos System&lt;/p&gt; &lt;a href="#" class="trigger right"&gt;&lt;/a&gt; &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; &lt;div class="dropdown"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s1"&gt;Grocery&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s2"&gt;Pizza Delivery&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s3"&gt;Quick Service&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s4"&gt;Retail&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s5"&gt;Salon&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" class="icon-s icon-s6"&gt;Bar&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>here is the Jquery that I am working with </p> <pre><code> $('.select-big ul li a').click(function () { $(this).parents('.select-holder').find('.text').text($(this).text()); // I need the string here </code></pre>
javascript jquery
[3, 5]
3,151,187
3,151,188
jquery get id of table closest to key press
<p>I am creating tables on button click and that works great. I then have have a hotkey to add extra rows to those tables. I need to get the parent id of the table where the cursor is but it keeps giving me undefined. I can get the parent div id ok but when I put table in it gives me undefined. Any help would be appreciated</p> <pre><code>$(document).ready(function() { $("#divNarrative1").keypress(function(e){ alert(e.target.id); var msgId = $( this ).closest( 'table' ).attr( 'id' ); alert(msgId); }); }); </code></pre>
javascript jquery
[3, 5]
580,906
580,907
Remove a perticular div of specific text
<p>I have the following code in a php page</p> <pre><code>&lt;div class="vmenu"&gt; &lt;div class="first_li"&gt;&lt;span &gt;Add Shift&lt;/span&gt;&lt;/div&gt; &lt;div class="first_li"&gt;&lt;span&gt;Add Comment&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Now I want to remove the div contains text "Add Shift" on document ready</p>
javascript jquery
[3, 5]
2,087,965
2,087,966
problem to convert string to date format on android
<p>I just want to convert string to date format on android. my date is: Wed, 24 Aug 2011 08:28:44 +0200</p> <p>I wrote this code:</p> <pre><code>pubDate = "Wed, 24 Aug 2011 08:28:44 +0200"; //create SimpleDateFormat object with source string date format // "EEE, d MMM yyyy HH:mm:ss Z" DateFormat sdf = new SimpleDateFormat ("EEE, d MMM yyyy HH:mm:ss Z",Locale.US); //parse the string into Date object try { return (Date) sdf.parse(pubDate); </code></pre> <p>and when I get to return in the debug I get page of -->Source not found with button edit source lookup path.</p> <p>thanks for help!</p>
java android
[1, 4]
514,688
514,689
word counter Javascript function call
<p>Wanted to have a word counter next to a input textbox on the website</p> <p>Got it working to show the count when the user click or modify the text but I wanted to load up straight away when the page finish loading.</p> <pre><code>$(document).ready(function() { $("#product_name").change(displayText).keyup(displayText); function displayText(){ $("em#counter").text($(this).val().length +' chars'); } }); </code></pre> <p>So I tried this the code below but couldn't get it working and don't know why.</p> <pre><code>$(document).ready(function() { if($("#product_name").length){ displayText(); } $("#product_name").change(displayText).keyup(displayText); function displayText(){ $("em#counter").text($(this).val().length +' chars'); } }); </code></pre> <p>Thanks so much.</p>
javascript jquery
[3, 5]
5,140,649
5,140,650
Using jQuery with php with IF logic
<p>I have some php conditional logic...basically I want to use jQuery to show or hide certain div's when I submit a form:</p> <pre><code>&lt;?php if (isset($_POST['submit']) { /* If the user submits the form and use jQuery to hide an existing div tag &lt;script type="text/javascript"&gt; $('#mydiv').hide(); &lt;/script&gt; */ } ?&gt; </code></pre> <p>Is there a sort-of non-messy way to go about mixing php and jQuery like this? I just want my jQuery to be in one block and my php to be in a separate block (i.e. not interspersed)</p>
php jquery
[2, 5]
4,340,406
4,340,407
Access Master Page/Child Page Controls from My Class
<p>I have a div on my master page and I want to use it for showing page errors. I have an error display class and it works fine. My problem is that in some instances, the error gets displayed even before the tag resulting in (non)-display of the message. This is mostly with code that has response.redirect.</p> <p>I want to counter this by having the error shown on a div within my master page (hoep it helps).</p> <p>How can I access <code>&lt;div id="errorSegment" runat="server"&gt;</code>?</p>
c# asp.net
[0, 9]
5,369,450
5,369,451
jQuery AJAX callback
<p>I'm having a difficult time trying to get this javascript function to return false inside of a .post() function.</p> <p>Is this even possible? or is there another way to do a simple ajax check to validate the voucher code is in the database.</p> <pre><code>function check_options(){ var voucher_code = $('#voucher_code').val(); $.post(baseURL+"ajax.php", { tool: "vouchers", action: "check_voucher", voucher_code: voucher_code }, function(data) { if(data == 'invalid'){ // NEED TO RETURN FALSE FOR THE MAIN FUNCTION } }); } </code></pre>
javascript jquery
[3, 5]
3,451,899
3,451,900
What can I do to optimize my web page for a mobile phone, specifically the iPhone?
<p>So I purchased myself an iPhone ... everybody has one ... so I figured I'd <strong>see</strong> what the big deal was. To my surprise ... and overall skepticism ... I must say that I am <strong>very</strong> impressed with the iPhone. There's not any <strong>real</strong> magic going on here ... it just seems to be a <strong>very clean and very easy</strong> to use device.</p> <p>So now I'd like to take our internal project management application and create another user interface specifically targeted to iPhone.</p> <p>I googled some sites and most of them seem very kool-aidish, not real meat or substance. I did see where you can use some additional Html attributes to get certain things to appear iPhonish as well as a User Interface library to help out with the rendering.</p> <p>Do you know of any good sites or having any recommendations for getting started creating an iPhone web user interface using ASP.NET? Is there any references out there that explain all the the Html tricks or syntax you can use that the iPhone/Safari will recognize?</p>
c# asp.net iphone
[0, 9, 8]
2,917,794
2,917,795
Get current URL, and strip it down
<p>I have a URL like:</p> <pre><code>http://url.test.com/account/name/pages/Stuff.html </code></pre> <p>I want to take 'Stuff' and apply that as a class to body.</p> <pre><code>&lt;body class="Stuff"&gt; ... &lt;/body&gt; </code></pre> <ol> <li><p>How can I get the current URL?</p></li> <li><p>How can I extract the text 'Stuff' after the final '/'</p></li> <li><p>Then add the class 'Stuff' to body?</p></li> </ol>
javascript jquery
[3, 5]
4,095,703
4,095,704
javascript, wrap first 200 characters in a div
<p>im making an accordion for a client. there website is built on .net, something of which i have no idea how it works.</p> <p>my current accordion is something similar too...</p> <pre><code>&lt;h1&gt;Header&lt;/h1&gt; &lt;span class="content"&gt;Content here&lt;/span&gt; </code></pre> <p>I need something more like </p> <pre><code>&lt;h1&gt;Header&lt;/h1&gt; &lt;span class="entry-content"&gt;summary here&lt;/span&gt; &lt;span class="content"&gt;Content here&lt;/span&gt; </code></pre> <p>I want the 'entry-content' to show initially and when the h1 is clicked the 'content' div slides down.</p> <p>As its in .net all the content is pulled from the following line...</p> <pre><code>&lt;%#Eval("Information")%&gt; </code></pre> <p>is there a way with JS i can wrap the first 200 characters in a div, and the rest can be wrapped in another div? </p> <p>I hope this makes sense!</p>
javascript jquery asp.net
[3, 5, 9]
4,718,634
4,718,635
Disabled asp button
<p>i have asp button like this:</p> <pre><code>&lt;asp:Button ID="ImportToDB" runat="server" OnClick="ImportToDB_Click" /&gt; </code></pre> <p>And i need to call a javascript function when mouseover on this button. So i have in page_load():</p> <pre><code>ImportToDB.Attributes.Add("onmouseover","javascript:OnButtonMove(" + ImportToDB.ClientID + ")"); </code></pre> <p>javascript function:</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; function OnButtonMove(id) { //something } &lt;/script&gt; </code></pre> <p>Everithing work fine <strong>only if button is enabled</strong>. but when i disable button, this javascript function will never fire.</p> <p>what i am trying to do: I have button and when is something wrong i just disable it. And when user mouseover this(disable) button, I show him DIV with a message.</p> <p>Can someone tell me why i cannot call this JS function while button is disabled? </p>
c# asp.net javascript
[0, 9, 3]
1,936,524
1,936,525
jQuery - Very simple issue i cant sort out (class's and an alert)
<p>I think this may be my most embarrassing question to date.</p> <p>Why does this not work? Ive been staring at this for around half an hour now and im starting to get desperate</p> <p><a href="http://jsfiddle.net/FU6Jb/" rel="nofollow">http://jsfiddle.net/FU6Jb/</a></p> <p>My HTML</p> <pre><code>&lt;a class="closedialog" href="#"&gt;Close&lt;/a&gt; </code></pre> <p>My JavaScript</p> <pre><code>$(document).ready(function() { $("a.closedialog").click(function() { alert("Test") }); }); </code></pre>
javascript jquery
[3, 5]
380,127
380,128
Service Causing Unexpected Close
<p>I am creating a game app and I have a few activities for the different screens. I have a service I am using to play music through out the activities. A really simple service, I have the title screen with image buttons to turn it on and off. Now I am getting a unexpected close and this error message from eclipse: </p> <pre><code>[2011-05-19 19:50:04 - ddms]null java.lang.NullPointerException at com.android.ddmlib.Client.sendAndConsume(Client.java:571) at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142) at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65) at com.android.ddmlib.Client.getJdwpPacket(Client.java:670) at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317) at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263) </code></pre> <p>EDIT: Code For Service</p> <p>public class BGMusic extends Service {<br> MediaPlayer player;</p> <pre><code>@Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { super.onCreate(); player = MediaPlayer.create(this, R.raw.still_wana); } public void onStart(Intent intent, int startId) { super.onCreate(); player.start(); } @Override public void onDestroy() { super.onDestroy(); player.stop(); } </code></pre> <p>}</p> <p>EDIT: Console Android Msg</p> <p>Starting activity com.android.hitmanassault.HitmanTitle on device emulator-5554 ActivityManager: DDM dispatch reg wait timeout ActivityManager: Can't dispatch DDM chunk 52454151: no handler defined ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.android.hitmanassault/.HitmanTitle }</p>
java android
[1, 4]
89,549
89,550
Error when get ID in jquery
<p>I have a code php:</p> <pre><code>&lt;?php for ($i=0, $n=count( $this-&gt;item ); $i &lt; $n; $i++) { $row = &amp;$this-&gt;item[$i]; ?&gt; &lt;tr id="&lt;?php echo $row-&gt;id; ?&gt;" class="row"&gt; &lt;span id="name_&lt;?php echo $row-&gt;id; ?&gt;" class="text"&gt;&amp;nbsp;&lt;?php echo $row-&gt;name; ?&gt;&lt;/span&gt; &lt;input type="text" value="&lt;?php echo $row-&gt;name; ?&gt;" class="editbox" id="name_input_&lt;?php echo $row-&gt;id; ?&gt;" /&gt; &lt;/tr&gt; &lt;?php $i++; } ?&gt; </code></pre> <p>and Jquery get id from this script php</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('.row').click(function(){ var ID = $(this).attr('id'); $('#name_'+ID).hide(); $('#name_input_'+ID).show(); alert(ID); }); }); &lt;/script&gt; </code></pre> <p>Error when i output alert(ID) result is NULL, How to get ID ? </p>
php jquery
[2, 5]
6,032,202
6,032,203
How should I pass data between classes and application layers?
<p>For example, if I am creating a 3 layer application (data / business / UI) and the data layer is grabbing single or multiple records. Do I convert everything from data layer into generic list/collections before sending to the business layer? Is it ok to send data tables? What about sending info back to the data layer? </p> <p>If I use objects/lists, are these members of the Data or Business layers? Can I use the same objects to pass to and from the layers?</p> <p>Here is some pseudo code:</p> <p>object user with email / password</p> <p>in UI layer, user inputs email / password. UI layer does validation and then I assume creates a new object user to pass to business layer which does further validation and passes same object to Data layer to insert record. Is this correct?</p> <p>I am new to .NET (come from 8+ years of ASP VBScript background) and trying to get up to speed on the 'right' way to do things.</p>
c# asp.net
[0, 9]
4,278,727
4,278,728
How to capture the user's browser info and submit in a form field?
<p>my app has a submit feedback form. Is there a way to can capture the user's browser &amp; version with jQuery and post that along with the form?</p> <p>Thanks</p>
javascript jquery
[3, 5]
751,690
751,691
Best way to insert a 'pause' in a .each enumeration
<p>What is the best/recommended manner in which to insert a 'pause' with each enumeration over a set of elements using the jQuery '.each()'?</p> <pre><code>$( '.someClass' ).each( function() { $( this ).trigger( 'click' ); //fire some request that appends a new div on the body //wait for div to be appended to the DOM. perhaps use the pause here //execute code once the div has been appended }); </code></pre>
javascript jquery
[3, 5]
528,817
528,818
JQuery : Play notification sound : IE8 Error
<p>This code works perfect for crome and firefox.. but error in IE8</p> <pre><code>if($('#soundcheck').is(':checked')){ //alert('checked'); var audio = document.createElement('audio'); document.body.appendChild(audio); audio.src = system_base_url+'/sound/horn.wav'; audio.play(); } </code></pre> <p>IE8 says: Object doesn't support this property or method, and it points to :</p> <pre><code>audio.play(); </code></pre> <p>Anyone having similar experience with IE8?</p> <p>Regards</p>
php javascript jquery
[2, 3, 5]
2,951,871
2,951,872
C# Error: The name 'RegisterHyperLink' does not exist in the current context
<p>I've been working on a group project with this code that another group member wrote and I'm getting the following error:</p> <p>The name 'RegisterHyperLink' does not exist in the current context</p> <p>Here's the chunk of code:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]); } </code></pre> <p>Anyone have any ideas as to why I'm encountering this error? Thanks in advance</p>
c# asp.net
[0, 9]
2,528,683
2,528,684
Code for Identifying a Single letter?
<p>Hi there I am a bit of a noob at programming but I want to create an IF statement , whether or not a textview , (which i have already referenced) contains a letter in side of it and only that letter for example I want to change any textview which has a "1" in it whats the code? this is what I have got can some one please help me complete it?</p> <pre><code>if ("!".contains(stuff.getText()) { stuff.setText("Incorrect Symbol"); }else { } </code></pre> <p>I know that I can use the keyboard to control what can be entered but I would prefer that someone would tell me how to do it this way. By the way I keep on get a little red line over stuff.gettext so can some one please tell me the problem?</p>
java android
[1, 4]
4,905,429
4,905,430
Is there a way to ignore a mouse event?
<p>When I hover over a div (assume it has id=div-CON), I have another div, positioned absolute, that pops up and follows the mouse while I am within div-CON. When the mouse leaves div-CON, the floating div disappears.</p> <p>Now, there are instances where if the browser is slow or lagging, the floating div does not update its position quick enough such that the mouse enters the floating div for an instant then leaves it. In this instant, the mouse leaves div-CON and enters again so the floating div essentially blinks.</p> <p>With regards to this, I was wondering if there was a way to ignore or cancel events so that in this case, when the mouse enters the floating div, the mouseleave event is not triggered on div-CON.</p> <p>Heres a jsFiddle: <a href="http://jsfiddle.net/vuxcR/" rel="nofollow">http://jsfiddle.net/vuxcR/</a></p>
javascript jquery
[3, 5]
2,070,024
2,070,025
Simplify my menu animation code
<p>I've got a bunch of 'project' divs that I want to expand when they're clicked on. If there's already a project open, I want to hide it before I slide out the new one. I also want to stop clicks on an already open project from closing and then opening it again.</p> <p>Here's an example of what I mean (warning - wrote the code in the browser):</p> <pre><code> $('.projects').click(function() { var clicked_project = $(this); if (clicked_project.is(':visible')) { clicked_project.height(10).slideUp(); return; } var visible_projects = $('.projects:visible'); if (visible_projects.size() &gt; 0) { visible_projects.height(10).slideUp(function() { clicked_project.slideDown(); }); } else { clicked_project.slideDown(); } }); </code></pre> <p>Really, my big issue is with the second part - it sucks that I have to use that if/else - I should just be able to make the callback run instantly if there aren't any visible_projects. </p> <p>I would think this would be a pretty common task, and I'm sure there's a simplification I'm missing. Any suggestions appreciated!</p>
javascript jquery
[3, 5]
1,311,255
1,311,256
jquery click (remember OLD VALUE)
<p>When I click on '<strong>SELECT</strong>' - element, I need to remember <strong>OLD VALUE</strong>.<br/>This code work in FF,CHROME,OPERA but still not working correctly in IE.</p> <p>In IE it`s work like -> when I click on '<strong>SELECT</strong>' element- <br/><br/> 1)remember OLD value. (ok) <br/>2)Than I choose '<strong>OPTION</strong>' - > and its replace my OLD VALUE - with selected OPTION!</p> <pre><code>$('#viewTableOrders tr td &gt; select').click(function() { oldCurrentPath = $(this).val(); oldId = $(this).attr('title'); oldCurrentDate = $('#viewTableOrders tr#vagon' + oldId + '&gt; td &gt;input.input_ver1').val(); dataAjax = {}; }); /* event on change path */ $('#viewTableOrders tr td &gt; select').change(function() { //do something... + old value }); </code></pre>
javascript jquery
[3, 5]
933,405
933,406
Jquery fadeout - wait to complete - then delete <TR>
<p>Good evening all. I'm trying to do a fadeout with Jquery to a with unique id which works but after that, i delete the with simple function removeElement which works too. My problem is that the removeElement function kicks in so fast that you cannot see the slow transition of the fadeout. I tried using the Javascript native setTimeout function, but still no help. </p> <pre><code>var elem_comment_release_container = 'release_' + release_id + '_comment_' + comment_release_id; //fade to &lt;TR&gt;...nice effect $("#" + elem_comment_release_container).fadeTo('slow','0.00'); //removeElement(elem_comment_release_container) setTimeout(removeElement(elem_comment_release_container),31000); </code></pre>
javascript jquery
[3, 5]
4,367,566
4,367,567
Cast object to WebControl based on Switch enum?
<p>I'm not sure if this is possible in C#:</p> <p>I have a <code>userControl</code> in which I have a property <code>inputType</code> - enum'd to have 3 possible options, textBox, dropDownList or checkBox.</p> <p>I'd then like to create a new object of that type and add it to a placeholder in the userControl:</p> <p>I can do this:</p> <pre><code>object txt; switch (_inputType) { case code.enums.inputType.textBox: txt = new TextBox(); break; case code.enums.inputType.dropDownList: txt = new DropDownList(); break; case code.enums.inputType.checkBox: txt = new CheckBox(); break; } </code></pre> <p>However, then I can't access the properties of the textbox, dropdownlist or checkbox as Visual Studio doesn't know the type - Nor can I cast the object - <code>(TextBox)txt</code> -as I don't know which one it'll be...</p> <p>Is there a way to do this? Or should I look to do all control specific operations in the <code>switch</code>?</p> <p>As requested, ideally I'd like the <code>object txt</code> to be available for the rest of the page. So after the switch statement to be able to access <code>txt</code>.</p> <p>I'll definately want to do:</p> <pre><code>plcHolder.Controls.add(txt); </code></pre> <p>That part is fine - it's just trying to access the control specific properties before that... Which I think it can't be done... But always best check with the SO experts :)</p> <p>Many thanks, Mark</p>
c# asp.net
[0, 9]
3,536,991
3,536,992
javascript\jquery: Event that fires when textbox changes
<p>I'm looking for a jquery/simple javascript (not some other library) solution that set an event to a textbox that will fire when the textbox being changed? (not after blur)<br> I need it to fire no matter how it was changed (keyboard char key/tab/enter or mouse paste) And I need it to be fired one time only.</p>
javascript jquery
[3, 5]
547,677
547,678
jquery ready handler never executed
<p>I have a website about festivals, with a separate page for each festival. Normally, a festival's page should look something <a href="http://www.festivals.ie/festival/show/1" rel="nofollow">like this</a>, but <a href="http://www.festivals.ie/festival/show/30" rel="nofollow">one of the festival pages</a> has a few problems. These include:</p> <ul> <li>twitter and facebook buttons in header don't load</li> <li>google map in top-right corner doesn't load</li> <li>festival lineup is not laid out properly and blue background thereof doesn't appear</li> </ul> <p>After some debugging, I discovered that this is because the jQuery ready handler is not being executed. The handler I'm referring to is in an linine script that begins on line 3252 of the page.</p> <p>I guess the reason this doesn't get executed is because a JavaScript error occurs earlier on in the page-loading process, but I can't see any evidence of errors in Firebug.</p>
javascript jquery
[3, 5]
2,471,468
2,471,469
Javascript error: Missing : after property id?
<p>Here's the code:</p> <pre><code>window.onload({ var Country = '&lt;?= $core-&gt;HotelData($hid, "country"); ?&gt;'; var options = document.getElementsByTagName('option'); for (var i = 0; i &lt; inputs.length; i ++) { if (options[i].type == 'option' &amp;&amp; options[i].value == Country) { options[i].attr('selected','selected'); } } }); </code></pre> <p>I've been struggling with this for hours now, and figured it'd be better if I sought advice from experts.</p> <p>UPDATE: Source</p> <pre><code>window.onload({ var Country = 'United Kingdom'; var options = document.getElementsByTagName('option'); for (var i = 0; i &lt; inputs.length; i ++) { if (options[i].type == 'option' &amp;&amp; options[i].value == Country) { options[i].attr('selected','selected'); } } }); </code></pre> <p>UPDATE#2: Fix The cause of the problem was mostly my stupidity.. ktnxbai</p> <pre><code>function OnLoad() { var Country = "&lt;?= $core-&gt;HotelData($hid, "country"); ?&gt;"; var options = document.getElementsByTagName('option'); for (var i = 0; i &lt; options.length; i ++) { if (options[i].value == Country) { options[i].selected = true; } } } window.onload = OnLoad(); </code></pre>
javascript jquery
[3, 5]
4,324,845
4,324,846
Can't make JQuery work
<p><strong>Tools:</strong> Visual Studio 2010</p> <p>I'm trying to learn jQuery, but I cant make this example work even after trying for 2 hours. I know it's quite simple but I don't know what I'm missing.</p> <p>JQuery is defined here, inside the <code>&lt;head&gt;</code> tag:</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="Scripts/jquery-1.7.1-vsdoc.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $("button").click(function () { $("#divTest1").hide(); $("p").hide(); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;div id="divTest1"&gt; Itz too much I cant make it work...! &lt;/div&gt; &lt;h2&gt; This is a heading&lt;/h2&gt; &lt;p&gt; This is a paragraph.&lt;/p&gt; &lt;p&gt; This is another paragraph.&lt;/p&gt; &lt;button&gt; Click me&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p><strong>Updates:</strong><br/></p> <ul> <li><p>I have tried this $(document).ready(function () { alert("Hello"); }); And added breakpoint in firebug/Script,after page load firebug got into the jquery library and the went out of it,but it didn't showed any popup</p></li> <li><p>I just changed from "jquery-1.7.1-vsdoc.js" to this "jquery-1.7.1.js" and used simple script to check if itz working <code>$(document).ready( function(){ alert("Hello"); } );</code> ,jquery is working now.</p></li> </ul>
javascript jquery asp.net
[3, 5, 9]
5,716,828
5,716,829
How to change href attribute of a link using Jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery">How to change the href for a hyperlink using jQuery</a> </p> </blockquote> <p>I have this link:</p> <pre><code>&lt;a id="myLink_33" href="javascript:toggleMe(1);"&gt;Toggle&lt;/a&gt; </code></pre> <p>How can I change the <code>href</code> attribute of this link using Javascript/jquery so the link becomes this:</p> <pre><code>&lt;a id="myLink_33" href="javascript:toggleMe(0);"&gt;Toggle&lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
440,440
440,441
i tried serialize() but doesnt seem to work ? what am i doing wrong?
<p>i did this but not working </p> <pre><code>if(error.join()!="") { $("#sub_error").fadeTo(200,0.1,function() { $("#sub_error").html(error.join("&lt;br/&gt;&lt;br/&gt;")).append('&lt;br/&gt; &lt;input type="button" name="err_ok" id="err_ok" value="ok"&gt;') .addClass('subboxerror').fadeTo(900,1); bindEvents(); }); function bindEvents() { $("#err_ok").click(function() { $("#sub_error").fadeTo(1000,0); }); } } else { $("#frm_sub") .removeClass().addClass('messagebox') .text('Submitting...').fadeIn("slow"); $.post("register_user.php", { $('#frm1').serialize() } , function(data) { alert(data); }); }); } </code></pre>
javascript jquery
[3, 5]
470,850
470,851
What tools are available to develop an "inmail" solution?
<p>I want to build an application that offers an "inmail" like feature that is available in financial and other applications. </p> <p>Is there a toolset these are all based to use? Or is this all customized?</p> <p>I reviewed a bit of XMPP, but that deals with Chat it seems, and not email.</p> <p>I wanted to be able to send emails as well, but mostly the inmail would be used from user to user within the application domain.</p>
java javascript jquery
[1, 3, 5]
1,429,190
1,429,191
Jquery append css
<p>I'm trying to make a simple image zoom script.</p> <p><a href="http://jsfiddle.net/GbDw9/1051/" rel="nofollow">http://jsfiddle.net/GbDw9/1051/</a></p> <p>The problem is that margin style applies only after second a[data-onclick="zoom"] click.</p> <p>Why so?</p>
javascript jquery
[3, 5]
710,694
710,695
Load image from external domain (AWS S3) and store it in browser memory
<p>I'm new to ASP.net and wondered how easy it is to load a photo from an external domain (Amazon S3), using their expiring link, and store the photo in browser memory for another script to pick up that uses an OpenBinary method? This allows me to resize and watermark it before printing to screen.</p> <p>This is what I want to happen:</p> <p></p> <p>On loadImage.aspx, I get the photoID from my DB, create an expiring signed URL for Amazon S3, call the photo somehow and save it to memory. When in memory, my ASP.Jpeg script will call the OpenBinary method, resize and watermark the photo and the use the SendBinary method to show the photo.</p> <p>I think memory stream or response binary write maybe the thing I'm looking for but not sure how to use it on an external photo source. This is what I have managed so far but got confused and thought I'd get help as I'm not sure this is going to work, if I can load an external domains photo in memory, if I'm missing something important....</p> <p><strong>My image element:</strong></p> <pre><code>&lt;img src="loadImage.aspx?p=234dfsdfw5234234"&gt; </code></pre> <p><strong>On loadImage.aspx:</strong></p> <pre><code>string AWS_filePath = "http://amazon............" using (FileStream fileStream = File.OpenRead(AWS_filePath)) { MemoryStream memStream = new MemoryStream(); memStream.SetLength(fileStream.Length); fileStream.Read(memStream.GetBuffer(), 0, (int)fileStream.Length); } // Persits ASP.Jpeg Component objJpeg.OpenBinary( ... ); // resize bits // watermark bits objJpeg.SendBinary( ... ); </code></pre> <p>Any help would be amazing.</p>
c# asp.net
[0, 9]
2,373,129
2,373,130
jquery before() is out of order?
<p>I have a page where you can click a link that says "add a keyword" and an input will appear and you can enter the keyword, and then convert it into a span tag on blur or the "return" key. However, I've been adding onto it to allow for an "autocomplete" feature, so I'm trying to insert a </p> <pre><code>&lt;ul&gt;&lt;/ul&gt; </code></pre> <p>after my input in order to do a .load inside the list.</p> <p>The relevant code I have is:</p> <pre><code>var addKeywordId = 0; $('a.add_keyword').live('click', function(){ $(this).before('&lt;input type="text" class="add_keyword" id="addKeyword'+addKeywordId+'" /&gt;&lt;ul&gt;&lt;li&gt;hi&lt;/li&gt;&lt;/ul&gt;'); $('.add_keyword').focus(); addKeywordId++; }); </code></pre> <p>The problem is, that my HTML structure ends up looking like this:</p> <pre><code>&lt;ul&gt;&lt;li&gt;hi&lt;/li&gt;&lt;/ul&gt; &lt;a class="add_keyword"&gt;+ add keyword&lt;/a&gt; &lt;input id="addKeyword0" class="add_keyword" type="text /&gt; </code></pre> <p>INSTEAD OF</p> <pre><code>&lt;input id="addKeyword0" class="add_keyword" type="text /&gt; &lt;ul&gt;&lt;li&gt;hi&lt;/li&gt;&lt;/ul&gt; &lt;a class="add_keyword"&gt;+ add keyword&lt;/a&gt; </code></pre> <p>Anybody know why my HTML is added out of the order I specified??</p> <p>Thanks</p> <p>EDIT: This seems to be working fine in Google Chrome, but not in Mozilla Firefox.. :(</p>
javascript jquery
[3, 5]
4,593,734
4,593,735
Why am I having problems with setInterval?
<p>I'm a novice javascript programmer and I always have trouble with the <code>setInterval</code>. W3Schools makes it look so easy but I can never get it to work when i need to. Here I have a span I want to make 'flash'.</p> <pre><code>var id = window.setInterval(function(){ if($("#span1").css("color") == "red"){ $("#span1").css("color","blue"); } else{ $("#span1").css("color","red");} }, 100); </code></pre> <p>I keep getting a <code>SYNTAX ERROR: Unexpected token ILLEGAL</code>. What am I doing wrong here?</p> <p>NOTE: I know there's some jQuery method that could handle this easily. I'm trying to gain a better understanding of this JS function.</p> <p><strong>UPDATE</strong> I fixed the syntax error. (Missing quotation). Now I get an error <code>undefined</code>.</p>
javascript jquery
[3, 5]
961,700
961,701
Selecting the last child elements of a div without looping
<p>Here's a quick one. I'm trying to get better at writing selectors for jquery because I seem to be relying on loops far too much in order to get things done.</p> <p>In this particular example, I want to add the "Absolute" class too all of the divs that have the ganttview-block-container class except the last one in the parent ganntview-blocks div.</p> <p>HTML:</p> <pre><code>&lt;div class='ganttview-blocks'&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class='ganttview-blocks'&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;div class='ganttview-block-container'&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Javascript:</p> <pre><code>$("div.ganttview-block-container").addClass("Absolute").addClass("Opacity"); $($("div.ganttview-blocks")).each(function () { var thisDiv = $(this); thisDiv.children("div.ganttview-block-container:last").removeClass("Absolute"); }); </code></pre> <p>My javascript/jquery accomplishes this goal correctly but it seems so inefficient. I'm confident there's a more elegant way of getting this done... perhaps even in 1 line.</p> <p>Can anyone help? Thanks!</p>
javascript jquery
[3, 5]
3,529,709
3,529,710
having trouble making a menu slide down on click and then reverse this animation using jquery
<p>I am trying to create a sliding menu effect when a link is clicked, basically on click I want to prepend a background that fades in with 0.6 opacity and then slide my menu into place and then on a further click I want to reverse this animation. I have create a click event with a callback function but I think this callback is cancelling out my first click so nothing seems to be happening, can anyone advise me on how I can create this effect?</p> <p>I have created a fiddle here: <a href="http://jsfiddle.net/AHj4Y/3/" rel="nofollow">http://jsfiddle.net/AHj4Y/3/</a></p> <p>Thanks Kyle</p>
javascript jquery
[3, 5]
4,168,974
4,168,975
correct way to display image from php onto page
<p>I am not getting my image correctly. I am unsure what is happening. First things first, the image is coming out of a mysql query. Little confused about how to make that image ready for a ajax call?</p> <p>here is how I get the image out mysql</p> <pre><code> if(mysql_query("insert into Personal_Photos (Email, Pics) values('$email', '$data')")) { $query="select Pics, MAX(ID) from Personal_Photos where Email='$email'"; $result=mysql_query($query) or die("Error: ".mysql_error()); $row=mysql_fetch_array($result); //$mime = 'image/yourtype'; //$base64 = base64_encode($contents); //$uri = "data:$mime;base64,$base64"; //header("Content-type: image/jpg"); echo '&lt;img src="data:image/jpeg;base64'.base64_encode($row['Pics']).'"/&gt;'; } </code></pre> <p>the jquery that I use is like so</p> <pre><code>$('#profilepicbutton').live('change', function(){ $("#preview").html(''); $("#preview").html('&lt;img src="loader.gif" alt="Uploading...."/&gt;'); $("#registerpt3").ajaxForm({ target: '#preview', success: function(data) { $("#preview").html(''); $("#preview").append(data); } }).submit(); }) </code></pre>
php jquery
[2, 5]
4,361,908
4,361,909
How can I intercept/get notified about asynchronous requests in ASP.NET?
<p>I need to get notified about asynchronous requests in ASP.NET. I used the jQuery <code>.ajaxSend</code> global event but it does not trigger when using <code>UpdatePanels</code>.</p> <p>Is there a multi-browser way to detect when a request is being made on a page?</p>
asp.net jquery
[9, 5]
4,748,087
4,748,088
Anchor tag onclick to call a code behind method
<p>I use <code>&lt;a href="javascript:void(0);" onclick="orgvalid();return false;" class="regular"&gt;Register&lt;/a&gt;</code> in my aspx page. Once true is returned from the function <code>orgvalid()</code> I want to call a code behind function, <code>insertorganization()</code>. Is it possible to do so? If so, how?</p>
javascript asp.net
[3, 9]
1,030,593
1,030,594
HTTP authentication using PHP authentication
<p>I'm making a members area for my site and I have it already running. I authenticate members using mysql and php and this works really well.</p> <p>But now problems occurs, I would like to offer members a possibility to upload files to the systems, and those files should be available ONLY to logged in members.</p> <p>I know I could store those files to a database or even in a filesystem and serve them throught php, BUT this will get very heavy for the server when members upload bigger files. Those files might be even 20MB or even bigger.</p> <p>I would like to let apache serve the files, but just need to find a way to automatically do the http authentication, so users wouldn't need to log in twice. I suppose it is ok to make this http authentication behind one username and password, something like when a user logs in to the php and mysql authentication, transparently at the same time javascript etc. would do that http authentication also, every member would do the http authentication with the same credentials. Of course I wouldn't want to store those http auth credentials in a javascript file, but something ajax like solution maybe would do the trick. I'm just not sure how to do this. </p>
php javascript
[2, 3]
2,596,720
2,596,721
jQuery and ajax
<p>I have HTML table with 10 rows and which has a "Current Value" column and a "Price" column.</p> <p>Q: The first row has 1000 dollars and 5 th row as 10000 dollars.</p> <p>If a user has changed the price column to GBP, how can I make an ajax call through jQuery and update the current value.</p> <p>What's the best approach here?</p>
java jquery
[1, 5]
1,355,590
1,355,591
Modal Confirmation Custom Dialog Box
<p>I wonder whether someone may be able to help me please.</p> <p>I've put together a script which allows a user to view their uploaded images in a gallery format as shown <a href="http://www.mapmyfinds.co.uk/development/gallerytest.php#/0" rel="nofollow">here</a>.</p> <p>Using the jQuery demo <a href="http://jqueryui.com/demos/dialog/modal-confirmation.html" rel="nofollow">here</a>, I'm now trying to implement a custom dialog box to appear when the user selects a image to be deleted. I already have the error message written as shown in the extract below:</p> <pre><code>Galleria.ready(function() { this.$('thumblink').click(); $(".galleria-image").append("&lt;span class='btn-delete'&gt;&lt;/span&gt;"); $(".btn-delete").live("click", function() { var img = $(this).closest(".galleria-image").find("img"); alert('Deleting image... ' + $(img).attr("src")); return false; }); }); </code></pre> <p>The problem I'm having is that I can't find a way to create the <code>div</code> around it which is necessary for the dialog box. I'm relatively new to Javascript, so perhaps this is a really basic error, but I just wondered whether someone could have a look at this please and let me know where I've gone wrong?</p> <p>Many thanks and regards</p>
javascript jquery
[3, 5]
3,929,431
3,929,432
Use The Code Only One Time In my asp.net
<p>I have a class there is a code and this class is execute every time when website start.</p> <p>I want to use the class run only single time when my website is start.</p> <p>What can I do...?</p>
c# asp.net
[0, 9]
869,748
869,749
OnAuthenticate Login Control
<p>Could someone help me authenticate a user on OnAuthenticate Im have problems logging in. For some reason FormsAuthentication.Authenticate isn't working but membership.ValidateUser is . Also if someone can expand on this please do I don't know if i've got everthing sorted I've never done this part before. Leave a comment and suggestions.</p> <pre><code>protected void LoginUser_OnAuthenticate(object sender, AuthenticateEventArgs e) { TextBox UserName = LoginUser.FindControl("UserName") as TextBox; TextBox Password = LoginUser.FindControl("Password") as TextBox; if (Membership.ValidateUser(UserName.Text, Password.Text)) { FormsAuthentication.SetAuthCookie(UserName.Text, true); ProfileCommon profile = Profile.GetProfile(UserName.Text); profile.Visits += 1; profile.Save(); e.Authenticated = true; if (Request.QueryString["ReturnUrl"] != null) { Response.Redirect(Request.QueryString["ReturnUrl"]); } else { FormsAuthentication.RedirectFromLoginPage(UserName.Text, true); } } } </code></pre>
c# asp.net
[0, 9]
2,830,867
2,830,868
Dynamic CheckBoxes from JSON Array
<p>I am new to JavaScript / JQuery and I am not sure how I could do this. Maybe a small example of each part could help.</p> <p>Say I have <code>&lt;div id="checkboxes"&gt;&lt;/div&gt;</code></p> <p>When the page loads, I will make an ajax call that will return JSON array. This I know how to do.</p> <p>The objects will be like so:</p> <pre><code>[ { name: "Item 1", id: "27", checked: "true" } ... ] </code></pre> <p>I need to somehow take that JSON response and inject in some checkboxes into that div that will also store the ID. The checkbox text would be 'name'.</p> <p>Then, I need to know how to attach a function for when any of these checkboxes are checked, I will need to get the 'id' at that point because I will do an ajax call when any checked changes.</p> <p>Any examples of doing this sort of thing with JQuery would be very helpful.</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,919,794
2,919,795
Organizing classes with many properties that need to be iterated through
<p>Sometimes when I'm working with a class (usually one that represents a database model), I'll have about 15 different properties on it, usually of different types. These are properties that need to be accessed by the users, as well, so each property will typically need some function like</p> <pre><code>T getPropertyName(); setPropertyName(T value); </code></pre> <p>But, it's also extremely valuable for me to be able to iterate through each property <strong>in a particular order</strong> (although, I suppose that "value" may stem from laziness of not having to type each one individually). Is there some logical way to set up this class, so that I could iterate through it in this order? Or am I helpless for organization, and I should just go back to the basics of having 15 private variables, and 15 "getters" and "setters"?</p> <p>As an aside, currently I'm working with Android and Java, so answers pertaining specifically to that would be the most helpful, but seeing how I encounter this somewhat frequently in other languages, too, any solution would be ideal.</p> <p><strong>Edit:</strong> I've been thinking about using something similar to a <a href="http://developer.android.com/reference/android/os/Bundle.html" rel="nofollow">Bundle</a> with a list of keys, but I don't know how effective that would really be either.</p>
java android
[1, 4]
3,609,536
3,609,537
Calculate date difference in jQuery
<p>The question is; there are 2 fields in my application, one is date (Field1) and second is a label (Field2). So, I want that when user selects a date in field 1, then field 2 should be automatically populated (current date - date from field 1). Can anyone help on how to implement it.</p> <p>I'm using jQuery to display date:</p> <pre><code>// This displays the date dialog when user clicks on Field1 $('#Field1').click(function () { $('#Field1').simpleDatepicker(); }); // Tried following code but it didn't worked $('#Field1').click(function () { $('#Field1').simpleDatepicker({ onSelect: function () { $('#Field2').value(calculateDays($('#Field1').toString)) } }); }); function calculateDays(dateString) { var today = new Date(); var inputDate = new Date(dateString); var days = today - inputDate; return days; }; </code></pre> <p>This may look like pathetic code to some folks but I'm just a beginner, so any suggestions/comments are welcome.</p> <p>Also please tell me if this can be done using html only and no need to go to jQuery. It is my understanding that the calculating days (difference between dates) code will go in jQuery since this needs to be fired after selecting date ('onSelect' event). Please correct if wrong.</p>
javascript jquery
[3, 5]
2,037,351
2,037,352
Java's "public static final Object" in C++
<p>What would be the equivalent of this in C++ of the following snippet. I am in the process converting parts of an java application to C++.</p> <p>Here is that java class snippet:</p> <pre><code> class container { Public static final Object CONTAINER_FULL = new Object { public boolean equals(Object other) { // ... } String toString() { // ... } // ... } // ... } </code></pre> <p>The above class is wrapped in an java interface class "container". The call is ...</p> <pre><code> public Object fetch_the_object(int at_pos) { if (at_pos == MAX) { return container.CONTAINER_FULL; } // ... } </code></pre> <p>What would be the closest equivalent in C++ of that static class and its call?</p>
java c++
[1, 6]
1,121,716
1,121,717
Camel casing acronyms?
<p>This question may seem pedantic or just silly, but what is your practice for camel casing when it comes to acronyms? Do you insist that everything, even acronyms must be camel cased, or do you make an exception for acronyms. Explanations would be great too. I'm not sure how this practice effects IDE features (autocomplete) or what the industry standard are.</p>
c# java
[0, 1]
203,185
203,186
No focus in settings menu on D-PAD use
<p>I am working on an Android handset that has a D-PAD.</p> <p>Here is the scenario: 1) Open settings menu 2) Scroll to the bottom of the list using touch 3) Use D-PAD to scroll the list.</p> <p>Problem: No focus/marker is shown when D-PAD is used to scroll the list items</p> <p>I have tried to figure this out, but not able to find out the root cause. All suggestions/opinions/comments are welcome.</p>
java android
[1, 4]
2,347,034
2,347,035
Passing parameters to popup window?
<p>I am trying to pass parameters to a popup window via query string(a hidden field id &amp; a textbox id). However, since I am using master pages the id's are very long (ct100_someid). Is there a way to elegantly pass my ids ?Can I shorten my id's or not show them to the user at all ? Please tell me any alternates. </p>
javascript asp.net
[3, 9]
4,126,211
4,126,212
PHP Undefined variable and Javascript
<p>I have tried to figure this out myself I am new to PHP and I know its easy but I am missing something. I am trying to create something that if someone click a Button have it pass a value called id from the button hyper link for example:</p> <pre><code> &lt;a href="abc123.html?id=d"&gt;Click Here...&lt;/a&gt; </code></pre> <p>Then have the page abc123.html load and at the top of the page run this script below which is to see if id = f then if it does run the javascript code if not don't run it.</p> <pre><code> &lt;?php $vid = $_GET["id"]; if ($vid != "f") { echo "&lt;script type=""text/javascript""&gt;" echo "if (screen.width&lt;800)" echo "{" echo "window.location=""../mobile/default.html""" echo "}" echo "&lt;/script&gt;" } ?&gt; </code></pre> <p>However I am getting an PHP Undefined variable error from the Get ID. I have tried to use isset and that doesn't seem to work. But I know the error is caused if the value of id is blank because the id value might not always be available only if the user clicks on the abc123.html link. Can someone please tell me what I am doing wrong?</p> <p>I have researched answers here: </p> <p><a href="http://stackoverflow.com/questions/8157072/undefined-variable-php">Undefined variable php</a></p> <p><a href="http://stackoverflow.com/questions/910457/undefined-variable-error-in-php">Undefined variable error in PHP</a></p> <p>and here...</p> <p><a href="http://matthom.com/archive/2005/02/19/php-passing-variables-across-pages" rel="nofollow">http://matthom.com/archive/2005/02/19/php-passing-variables-across-pages</a></p> <p>and here...</p> <p><a href="http://www.w3schools.com/php/php_if_else.asp" rel="nofollow">http://www.w3schools.com/php/php_if_else.asp</a></p>
php javascript
[2, 3]
4,369,692
4,369,693
convert bitmap to image for ASP.NET
<p>this is how my code look now:</p> <pre><code>System.Drawing.Image objImage = System.Drawing.Image.FromFile(Server.MapPath("aaa.jpg")); int height = objImage.Height; int width = objImage.Width; System.Drawing.Bitmap bitmapimage = new System.Drawing.Bitmap(objImage, width, height); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmapimage); System.Drawing.Image bitmap2 = (System.Drawing.Image)Bitmap.FromFile(Server.MapPath("sem.png")); g.DrawImage(bitmap2, (objImage.Width - bitmap2.Width) / 2, (objImage.Height - bitmap2.Height) / 2); MemoryStream stream = new MemoryStream(); bitmapimage.Save(stream, ImageFormat.Jpeg); String saveImagePath = Server.MapPath("ImagesMerge/") + "aaa.jpg"; bitmapimage.Save(saveImagePath); imgBig.ImageUrl = saveImagePath; </code></pre> <p>The problem I have now is that the image is not displayed in browser, I don't understand why .</p>
c# asp.net
[0, 9]
4,923,610
4,923,611
How to define document height is changed in javascript/jquery?
<p>I have a problem for showing a full size div over all of my HTML document. I've set the size of my div to my page width and height. and write this codes for resizing of document:</p> <pre> $(window).resize(function(){ sysSetOverlaySize(cDivOverlay);//cDivOverlay is my full size div }); </pre> <p>when my browser window resize this function is called and set the new size of my div from the size of my page. but when tinymce increase my page height this function only called in FF. I want some action to define when document height is changed. Thanks a lot </p>
javascript jquery
[3, 5]
3,626,292
3,626,293
Is it possible to attach an onclick event to specific coordinates in a document?
<p>I am wondering if it is possible to attach an onclick event to specific coordinates in a document. Maybe something similiar to "area coords" in an image map that would allow me to create a rectangular or circular area that when clicked on would execute some code. Been trying to find a solution all morning hope someone with better coding knowledge could clarify this for me.</p>
javascript jquery
[3, 5]
5,054,482
5,054,483
In jQuery how can I parse out and execute JavaScript using getJSON
<p>In the following code:</p> <pre><code> function main() { jQuery(document).ready(function($) { /******* Load HTML *******/ var jsonp_url = "http://184.72.244.64/test.fwx?callback=?"; $.getJSON(jsonp_url, function(data) { $('#DivTagToInsertTheHTML').html(data.html); }); }); } </code></pre> <p>I would like to deliver a considerable amount of JavaScript through to the client browser, using this function. The reason I need to use this is I need to retrieve it from an outside server which breaks the "same origin policy". So when I get the JavaScript inside JSON, how do I parse it out and execute it?</p> <p>Is there a better way of doing this?</p> <p>Tanks in advance Jeff</p>
javascript jquery
[3, 5]
1,734,986
1,734,987
How to call javascript function from code-behind
<p>I wrote a javascript with a asp.net page.</p> <p>In Asp.net Page</p> <pre><code>&lt;HTML&gt; &lt;HEAD&gt; &lt;script type="text/javascript"&gt; function Myfunction(){ document.getElementId('MyText').value="hi"; } &lt;/script&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;input type="text" id="MyText" runat="server" /&gt; &lt;/BODY&gt; </code></pre> <p>In Code-behind</p> <pre><code> Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Session("My")= "Hi" Then I want to call "Myfunction" javascript function End If End Sub </code></pre> <p>How can I do?</p>
javascript asp.net
[3, 9]
733,495
733,496
JQuery offset #NaN issue
<p>I have a fixed menu bar at top of the page and all menu links are anchor links on the same page. In short, it's a one page website divided in sections with anchor links as menu items.</p> <p>I am using the javascript below for smooth slide to section when menu items are clicked.</p> <pre><code>$(document).ready(function() { $("a.anchorLink").anchorAnimate() }); jQuery.fn.anchorAnimate = function(settings) { settings = jQuery.extend({ speed : 1100 }, settings); return this.each(function(){ var caller = this $(caller).click(function (event) { event.preventDefault() var locationHref = window.location.href var elementClick = $(caller).attr("href") var destination = $(elementClick).offset().top-60; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() { window.location.hash = elementClick-60 }); return false; }) }) } </code></pre> <p>Since the top menu height is 60 pixels, I need to subtract it from offset().top to ensure slide works properly. I also have to subtract in location hash else there is a jerky slide (in FF and IE, works fine in Chrome) once the slide on click in complete. </p> <p>It works great but the problem is the URL is shown as <a href="http://www.site.com/#NaN" rel="nofollow">http://www.site.com/#NaN</a> instead of <a href="http://www.site.com/#linkname" rel="nofollow">http://www.site.com/#linkname</a> </p> <p>Here is the full code - <a href="http://jsfiddle.net/85saK/1/" rel="nofollow">http://jsfiddle.net/85saK/1/</a>. Unfortunately, it won't show you the URL after click which ends with #NaN instead of the actual link ID, e.g #store, #home or #contact.</p>
javascript jquery
[3, 5]
5,935,434
5,935,435
hide a message after 30 seconds.?
<p>How can after click on button show a message and next <strong>hide it after 30 seconds</strong>?</p> <p><strong>Like:</strong></p> <pre><code>$('#message').live('click', function() { $('#sm').hide(); $('#sm').hide().show('slow').html('You have successfully registered'); // how is hide "$('#sm')" after 30 seconds?? }); </code></pre> <p>Please give me example in <a href="http://jsfiddle.net/" rel="nofollow">http://jsfiddle.net/</a></p>
javascript jquery
[3, 5]
5,298,684
5,298,685
How to call Java code from C#?
<p>We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ... </p> <p>What would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?</p>
c# java
[0, 1]
3,029,270
3,029,271
How can I access the row in a RowCommand event
<p>I am trying to find a DropDown element in the GridView_RowCommand but it says that GridViewCommandEventArgs does not contain a definituon for 'Row'. I need to do this in this event because i am evaluating a GridView Command. See failing code below</p> <pre><code>protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { DropDownList Myddl = null; ClientClass client = new ClientClass(); Myddl = e.Row.FindControl("ddlClients") as DropDownList; if (Myddl != null) { updated = client.InsertUpdateClient(ClientID, int.Parse(e.CommandArgument.ToString()), departmentID); } else { Labels.Text = "There was an error updating this client"; } } } </code></pre>
c# asp.net
[0, 9]
69,857
69,858
Need an efficient way for a simple problem in c#
<p>I am developing a web application using c#. I am reading some data from database to a data table named dt . Sample data is shown below.</p> <pre><code>agentName WeekNumber Score John 3 45 John 5 78 John 6 33 </code></pre> <p>I want to make some change in the above data based on some conditions. Cause i want to draw a graph based on this data.The agent name is always same.and the week field is unique. I want to make a new data table using conditions listed below.</p> <p>1-The new data table week field must start from 1.If there is no entry in the data table for week 1, you can add the data into new data table as shown below </p> <pre><code>John 1 0 </code></pre> <p>it means just give 0 as score.</p> <p>2-If there is any missing weeks from second row onwards in the data table obtained from database , add the row for that week with score as -1. in the above example after first row there is a missing week 4. so add it to new data table with score -1</p> <p>the new data tab;e for sample data is shon below</p> <pre><code>agentName WeekNumber Score John 1 0 John 2 0 John 3 45 John 4 -1 John 5 78 John 6 33 </code></pre> <p>How can i do it in an efficient method using c#? The number of rows will vary . I want to do it using c# . not by using queries because of some reason</p>
c# asp.net
[0, 9]
1,879,131
1,879,132
Javascript update problem. ASP.net UpdatePanel
<p>I have some Javascript that I'm writing out to a literal control inside an UpdatePanel. I've set it to alert the current time every 15 seconds but I always get the original time. When I use Firebug I can see that the Script is getting updated. Is this because its a partial page refresh? How can I stop this happening. I've added the OutputCache directive to try and stop caching to see if that was the problem but that hasn't made any difference.</p> <p>Here's code sample. Front End:</p> <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;asp:UpdatePanel ID="updTest" runat="server" UpdateMode="Always"&gt; &lt;ContentTemplate&gt; &lt;script type="text/javascript"&gt; function initScript(){ &lt;asp:literal id="litUpdateScript" runat="server" /&gt; } &lt;/script&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger EventName="Tick" ControlID="panelRefresh" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:Timer ID="panelRefresh" Interval="15000" runat="server"&gt;&lt;/asp:Timer&gt; </code></pre> <p>Code Behind:</p> <pre><code>Protected Sub panelRefresh_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles panelRefresh.Tick Me.litUpdateScript.Text = "alert('" &amp; Now.ToString() &amp; "');" End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.litUpdateScript.Text = "alert('" &amp; Now.ToString() &amp; "');" Dim script As String = "initScript();" ScriptManager.RegisterStartupScript(updTest, updTest.GetType(), "Myscript", script, True) End Sub </code></pre> <p>This Causes the Correct time on page load but doesn't change on timer refreshes. Although I can see the script changing in firebug.</p>
javascript asp.net
[3, 9]
3,641,909
3,641,910
Hide makes page jump to top
<p>little annoying issue here. My hide function makes the page jump to top:</p> <pre><code> $(".home .options .tabs ul li").click(function(event){ $("#wrapper .home .aba").hide(); var qual = $(this).attr("ref"); $(".content.home .options .tabs ul li").removeClass("active"); $(this).addClass("active"); $("#"+qual).show(); return false; }); </code></pre> <p>If i remove it, it works pretty well. Whats happening?</p> <p>After i click on each tabs, the issue stops. But when i refresh the page, come back.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
894,634
894,635
How to add months by quarter using java script
<p>Hereby i am the following inputs:</p> <p><strong>Months to be separated by</strong> : 4 months</p> <p><strong>Will have the date with month and year</strong>: 07-05-2011.</p> <p>Now i need to add months by 4 using java script or jquery. How can this be done?</p> <p><strong>For example:</strong></p> <p><strong>I am having the date as : 01-01-2011 and the duration is 4</strong></p> <p><strong>My output should be:</strong></p> <p>01-12-2010</p> <p>01-04-2011</p> <p>01-08-2011</p> <p>01-12-2011</p> <p><strong>For example if it is:</strong></p> <p><strong>I am having the date as : 01-06-2011 and the duration is 4</strong></p> <p><strong>My output should be:</strong></p> <p>01-06-2011</p> <p>01-10-2011</p> <p>01-02-2012</p> <p>01-06-2012</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
5,387,555
5,387,556
Save/output dynamically generated html source using jquery
<p>I have a search form that can be built dynamically by the user using code such as:</p> <p><code>$('tr.form_row:last').clone(true).insertAfter('tr.form_row:last');</code></p> <p>All of this is working fine, however, I would like to save the dynamically generated form html when the form is submitted. I have tried using <code>$(#my_form').html()</code> but this doesn't appear to have the dynamic content, instead, it's just the default html before customisation that is gathered.</p> <p>Is there a way of getting the generated source using javascript/jquery? It would need to include the value within the input fields that the user has typed etc.</p> <p><strong>EDIT</strong> - I've included my coding so far:</p> <p>This is the coding I have tried - it uses jquery form plugin and I populate a hidden form field called 'search_html':</p> <pre><code>var search_form = { beforeSubmit: function() { var search_html = '&lt;table&gt;'; $('.form_row').each(function() { search_html += $(this).html(); }); search_html += '&lt;/table&gt;'; $("#search_html").val(search_html); }, success: function(html) { $('#search_output').html(html); } }; $('#search_form').ajaxForm(search_form); </code></pre> <p>When I submit the form, HTML is passed within the hidden 'search_html' field, but it is only the first table row and doesn't have the values of the input fields populated.</p>
javascript jquery
[3, 5]
1,951,185
1,951,186
JavaScript / JQuery array/object problem
<pre><code>$.fn.fieldValues = function(successful) { var values = {}; this.each(function() { if(strstr(this.name, '[]', true)) { var tmp = this.name.replace(/\[\]/, ''); if(typeof values[tmp] == 'undefined') values[tmp] = {}; var x = 0; while(typeof values[tmp][x] != 'undefined') x++; values[tmp][x] = $(this).val(); } else values[this.name] = $(this).val(); }); return values; } </code></pre> <p>problem is I get this array on php side:</p> <pre><code>array(['tagCloud'] =&gt; '[object Object]', ['status'] =&gt; 'Active'.....) </code></pre> <p>Why is tagCloud an object, how can I post a whole associative array to php?</p>
javascript jquery
[3, 5]
2,237,975
2,237,976
Remove Second Row From Table
<p>I would like to remove the second row of my table with jquery.</p> <p>I have tried:</p> <pre><code>$("tr:second").remove(); </code></pre> <p>But this unfortunately doesnt work :( Any suggestions?</p>
javascript jquery
[3, 5]
3,175,915
3,175,916
How to close an established network connection?
<p>I have to download a file in parts. For this I am using "xxx.setRequestProperty()". But I get error saying that it cannot be used when a connection is made. So I want to close the connection which was already established using download URL.</p> <pre><code>try { URL url = new URL(aurl[0]); URLConnection connection = url.openConnection(); InputStream input = new BufferedInputStream(url.openStream()); Log.d(TAG,"connected"); int length = connection.getContentLength(); </code></pre> <p>Now I want to close "connection". Please suggest some ways to do this.</p>
java android
[1, 4]
4,817,673
4,817,674
How do I easily check if all bools are true in asp.net c#?
<p>I have a list of bools on every page. I'm writing some validation code and am checking to make sure each bool is true before the user moves on. What is the best way to check to see if all the bools are true or false?</p> <p>I know I can hard code each one in, but I'm wondering if there is a better way.</p> <p>Here are the list of bools:</p> <pre><code>public bool posTitleBool; public bool firstNameBool; public bool lastNameBool; public bool titleBool; public bool emailBool; public bool phoneBool; public bool passwordBool; public bool passwordValBool; public bool companyNameBool; public bool address1Bool; public bool address2Bool; public bool cityBool; public bool stateBool; public bool zipBool; public bool industryBool; </code></pre> <p>Any help is appreciated.</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,244,896
2,244,897
jquery text area length count?
<p><br/> I have a text area field where i need to provide information about the word count when the user enters some text in the field. Length of the field is supposed to be 500 Characters. Initialy it must show </p> <blockquote> <p>min characters:100 | 0 of 500 // 0 of 500 must be in red color</p> </blockquote> <p>and once the user enters come character need to update the count as well. Once the user reaches the count say the min character 100, i need to display </p> <blockquote> <p>min characters:100 | 100 of 500 // 100 of 500 must be in green color.</p> </blockquote> <p>How can i do this?? is there any plugin for the same??? let me know your thoughts on this.</p>
javascript jquery
[3, 5]
556,586
556,587
jQuery cookie plugin - save and call parsetInt() values
<p>I'm new to JS. I have a script wich should count clicks and store clicks number value in cookie. The problem is i cant currectly save and call clicks number(generated by parseInt) value from cookies.</p> <p>Here is the code <a href="http://jsfiddle.net/csTpG/99/" rel="nofollow">http://jsfiddle.net/csTpG/99/</a> (using jquery.cookie plugin)</p> <p>Yup parseInt() shows NaN.</p> <p>Need help!</p>
javascript jquery
[3, 5]
5,941,292
5,941,293
Do all .java files load when the app is opened?
<p>I'm just starting into Java/Android apps... I've got a few sample things up and running... but I want to organize my code in a proper manner. Are all .java files loaded when the app is opened, or do I need to tell it to load other .java files within my code...</p>
java android
[1, 4]
976,705
976,706
Android Row becomes Unclickable with Button
<p>I have a listView, where each row has a button in the row layout. However, this seems to make the row itself unclickable. How can I make both the button and row clickable? </p> <p>Thanks.</p>
java android
[1, 4]
5,064,894
5,064,895
When remove the Class. nochange on class'length?
<pre><code>&lt;% (1..3).each do %&gt; &lt;p id="input"&gt; &lt;input type="text" name="somename"/&gt; &lt;a class="remove" &gt;Remove&lt;/a&gt; &lt;/p&gt; &lt;% end %&gt; </code></pre> <p>jQuery:</p> <pre><code>var $remove=$(".remove") $remove.click( function(){ $(this).parent().remove(); alert($remove.length); }) </code></pre> <p>It always alerts <code>3</code>, why? Did I remove the class <code>remove</code> correctly?</p>
javascript jquery
[3, 5]
3,252,951
3,252,952
php syntax query
<p>i have 2 questions to ask: first of all, in <code>while ($row = mysql_fetch_object($result))</code></p> <p>i have an object: <code>$row-&gt;atitle</code></p> <p>now through javascript, i want to print on the page an ++increment of the current object of the array.</p> <p>i am doing this: </p> <pre><code>hidephp = document.write("&lt;?php echo .$row-&gt;atitle.["+inc+"];"+" ?&gt;"); </code></pre> <p>the above doesnt seem to work. help would be much appreciated.</p>
php javascript
[2, 3]