Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,463,415
1,463,416
Javascript SyntaxError: Unexpected EOF -webkit browsers only
<p>I have a function (show below) that totals up all the hours on the page onBlur of the ".total" input fields. This function works perfectly in FF but in Chrome and Safari I am getting this error: SyntaxError: Unexpected EOF ---I did some research but I am lost as to what might be causing this. </p> <p>thanks for any help!</p> <pre><code>function totalUpHours() { //add all values to an array var hrsTotalsarr = new Array(); $('.total').each(function() { var thisTotal = $(this).val(); //clean the value if (thisTotal == "HRS") { thisTotal = 0; } hrsTotalsarr.push(thisTotal); }); //sum up the array var hrsTotal = eval(hrsTotalsarr.join('+')); $('#taskHRStotals').val(hrsTotal); } </code></pre>
javascript jquery
[3, 5]
4,546,488
4,546,489
UI handler in android
<p>Is there a dedicated UI handler for android application? how can i intercept the messages before they get handled ? im using java to write my android application. My goal is to capture UI generated events and log them.</p>
java android
[1, 4]
2,450,546
2,450,547
jQuery not pulling hidden field value on content page
<p>I am running this script within a content page on my ASP.net site.</p> <pre><code>&lt;script&gt; $(document).ready(function () { var satShifts = $('#hidSat').val(); alert("Sat: " + satShifts); }); &lt;/script&gt; </code></pre> <p>On the page_Load event on the server I have this code:</p> <pre><code> hidSat.Value = "2"; </code></pre> <p>The variable comes back as undefined in the alert window. I have this same process on the master page with another script and it works flawlessly. Is this an issue because it is a content page?</p>
javascript jquery asp.net
[3, 5, 9]
2,886,700
2,886,701
jQuery fadeOut / fadeIn scroll issue in Chrome
<p>I am using jQuery fadeOut &amp; fadeIn to dynamically change the content on a page, inside a div. All browsers work great, except Chrome for Mac. In Chrome for Mac, on the first page, if you scroll down, fadeOut and then fadeIn the newly faded in content is "off the screen" - in other words, missing. If you don't scroll down on the first page, and go to the second page, the content is displayed just fine.</p> <p>I have created a simple demo on my site. Again, this works in every browser but Chrome for Mac. Please help! Chrome for Windows works fine.</p> <p>Demo: <a href="http://dev.corecoding.com/problem.php" rel="nofollow">http://dev.corecoding.com/problem.php</a></p> <p>On the Mac, I am seeing a user agent with AppleWebKit/534.57.2, and in Windows it uses AppleWebKit/536.5. The interesting bit is that it works fine in Safari for Mac, which uses the same (older) WebKit.</p> <p>Is there a way to make this work with another jQuery / javascript commands? Or should I just forget about it and wait for Chrome's WebKit to be updated?</p>
javascript jquery
[3, 5]
5,453,856
5,453,857
Get value of HTML element without ID?
<p>This is a sample of how it looks like:</p> <pre><code>"&lt;span class="value"&gt;7,611&lt;/span&gt;" </code></pre> <p>I need to get it's value (7,661, no need to convert it to number) in C#.</p>
c# asp.net
[0, 9]
4,476,575
4,476,576
What is Background Processing in Asp.net?
<p>How I can implement Background Processing in asp.net. Can anyone give a small and easy sample or provide me a useful link.</p> <p>thanks.</p>
c# asp.net
[0, 9]
2,498,666
2,498,667
jQuery: How to scope event listeners on form elements to their own forms?
<p>So I have multiple forms on a page. Each form is identical except for the data they may contain. I am listening for changes to a specific elements that should modify other elements within its same form, but I am having trouble figuring out how to scope those actions within its own form. Here's what I've got so far:</p> <pre><code>var ContactSponsor = new function(){ this.init = function(){ $('#SponsorStatus_ID').change(SponsorStatusChanged); }; var SponsorStatusChanged = function(){ var $form = $(this).closest('form'); var selectedValue = $(this).find('option:selected').text(); if (selectedValue == 'Executed Contract') { markFieldRequired('#NumVAPs', $form); markFieldRequired('#SponsorWebsiteLevel_ID', $form); autoFillFieldWithCurrentDate('#ContractDate', $form); } else { markFieldNotRequired('#NumVAPs', $form); markFieldNotRequired('#SponsorWebsiteLevel_ID', $form); } }; var markFieldRequired = function(fieldID, $form){ $(fieldID, $form).siblings('label').addClass('required'); }; var markFieldNotRequired = function(fieldID, $form){ $(fieldID, $form).siblings('label').removeClass('required'); }; var autoFillFieldWithCurrentDate = function(fieldID, $form){ if ($(fieldID, $form).val() == '' || $(fieldID, $form).val() == '0000-00-00') { $(fieldID, $form).val(getCurrentDate()); } }; }; </code></pre> <p>Also, I'm passing the form to each of the methods. Not sure if there is a way I can do this without passing it in every time.</p>
javascript jquery
[3, 5]
4,029,310
4,029,311
How to display images from a folder in a gridview?
<p>How to display images from a folder in a gridview whose path is stored in ms sql database?</p>
c# asp.net
[0, 9]
30,429
30,430
Enter is not working in Internet explorer and Firefox
<p>This function is not working in Internet Explorer and Firefox. In Firefox, it returns the following error:</p> <blockquote> <p>TypeError: e is undefined<br> [Break On This Error]<br> ...e.which == "number") ? e.which : e.keyCode; keyCodeEntered = (e.which) ? e.which... </p> </blockquote> <p>The function:</p> <pre><code>function onSearchPhraseKeyDown(e) { var buttonId = '&lt;%=SearchButton.ClientID %&gt;'; if (!e) var e = (typeof e.which == "number") ? e.which : e.keyCode; keyCodeEntered = (e.which) ? e.which : window.event.keyCode; if ((keyCodeEntered == 13) || (keyCodeEntered == 13)) { document.getElementById(buttonId).click(); return false; } else { return true; } } </code></pre> <p>Can anyone see what's wrong?</p>
javascript jquery
[3, 5]
5,428,859
5,428,860
open a fancybox on pageload
<p>The situation is to open a fancy box on the page load,</p> <p></p> <p>Please find the below html, and the code behind I am using but with no success.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (SessionController.CurrentMember != null) { if (Request.IsAuthenticated) { int memberId = SessionController.CurrentMember.MemberID; bool checkaccepted = CheckAcceptedTermsandConditions(memberId); if (!checkaccepted) { string script = @"&lt;script&gt;$(document).ready(function() { $(""#onlineCasinoTandC"").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'speedIn' : 600, 'speedOut' : 200, 'overlayShow' : false, 'overlayOpacity': 0.5, 'width' : 800, 'showCloseButton': true, }); $(""#onlineCasinoTandC"").click(); });&lt;/script&gt;"; ClientScript.RegisterStartupScript(this.GetType(), "fancybox", script); onlineCasinoTandC.HRef = "/Common/EN/TermsandConditions.aspx"; } } } } </code></pre> <p>Regards Srividhya</p>
c# jquery asp.net
[0, 5, 9]
1,407,420
1,407,421
Is there any api which give suggestion words?
<p>I want to ask is there any api which return list of suggestions of words on giving input in any text control in any platform.</p> <p>For example when we type in EditText in android through soft keyboard , keyboard returns some suggestions so my question is that is there any api which gives the suggestions of corresponding input words(Platform does not matter).</p> <p>I am clearing it by a example suppose i type ab in EditText then the keyboard gives suggestions like Ab abc anita ashima etc. Please guide me. Thanks in advance</p>
iphone android
[8, 4]
1,722,206
1,722,207
Zooming the image of particular portion through jQuery
<p>I have the image of gray scale of 150 dpi. The problem is that I am scanning the document online and saving it to data base the in the <code>tiff</code> format and then after I am showing the image the document like form and identity proof in which the font of the row is very small so that after scanning the image not showing very clear. So please guide me what is the possible solution for that.</p>
c# jquery asp.net
[0, 5, 9]
3,500,461
3,500,462
applying same function to many elements (in order)
<p>any better way to do that (assuming I have 10 <code>a</code> elements, for instance)?</p> <pre><code>$('#id &gt; a:nth-child(1)').click(function() { changeP(1); return false; }); $('#id &gt; a:nth-child(2)').click(function() { changeP(2); return false; }); $('#id &gt; a:nth-child(3)').click(function() { changeP(3); return false; }); </code></pre> <p>I know 2 possibilities, but I don't particularly like them:</p> <ol> <li>using <code>.bind()</code> with parameter instead of <code>.click()</code></li> <li>using <code>.map(return $(this))</code> and then iterating over the array with an index var</li> </ol>
javascript jquery
[3, 5]
1,076,001
1,076,002
Redirecting new tab OR browser on button click.(Response.Redirect) in asp.net C#
<p>Can anybody suggest how we can open the page in new window or New Browser using Response.Redirect in c#. I have used : Response.Redirect("page1a.aspx");</p> <p>but it's open in existing tab.</p>
c# asp.net
[0, 9]
2,894,074
2,894,075
Using JavaScript to get different behavior depending on page size
<p>I'm trying to activate different settings for different screen/browser resolutions based on a bit of JavaScript that offers zoom functionality. I've included the below script within my HTML document but I don't think its working correctly. </p> <p>What I'm saying is if the screen width is more than 1025px AND the width of the browser is greater than 1025px then change <code>zoomWidth</code> and <code>zoomHeight</code> values.</p> <p>Where am I going wrong with my IF statement?</p> <pre><code>&lt;script&gt; if (screen.width &gt;= 1025 &amp;&amp; (document.documentElement.clientWidth &gt;= 1025)) { $(document).ready(function() { $('.jqzoom').jqzoom({ zoomWidth: 609, zoomHeight:756 }); }); } // Start second IF statement if (screen.width &lt; 1024 &amp;&amp; document.documentElement.clientWidth &lt; 1024) { $(document).ready(function() { $('.jqzoom').jqzoom({ zoomWidth: 200, zoomHeight:200 }); }); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,049,681
2,049,682
How to pass String from 2 activities to one?
<p>I have two activitys with lists.</p> <p>One for tablet's and one for regular density phones. When an item in the list is clicked it launches the same activity for either activity with list's.</p> <p>The problem is when an item is clicked i have getter and setter class that gets the URL for a particular item and passes it to the launching activity like this...</p> <pre><code> private String URL = null; try{ URL = com.fttech.AbstractFeedsActivity.feed_url; } catch(IllegalArgumentException e){ e.printStackTrace(); URL = com.fttech.ItemsActivity.url; } </code></pre> <p>As you see what i tried to do is try and catch. So if the first one isnt found then the second one will be retrieved.</p> <p>But it doesnt seem to work.</p> <p>It returns null each time.</p> <p>For what i have describe what is the best way to implement this? Is my way logic? Or is there a better way.</p> <p>Thanks</p>
java android
[1, 4]
5,410,039
5,410,040
Combining and Caching multiple JavaScript files in ASP.net
<p>Either I had a bad dream recently or I am just too stupid to google, but I remember that someone somewhere wrote that ASP.net has a Function which allows "merging" multiple JavaScript files automatically and only delivering one file to the client, thus reducing the number of HTTP Requests.</p> <p>Server Side, you still kept all the individual .js files, but the Runtime itself then creates one big JavaScript file which is then included in the script-tag instead and can be properly cached etc.</p> <p>In case that this function really exists and is not just a product of my imagination, can someone point me in the right direction please?</p>
asp.net javascript
[9, 3]
3,932,683
3,932,684
Get text value of input from FindControl
<p>I know now normally you can get the value of a text input using the following:</p> <pre><code>txtName.Text </code></pre> <p>But because my input is inside of a LoginView I am using FindControl like this:</p> <pre><code>LoginView1.FindControl("txtComment") </code></pre> <p>This successfully find the text input but returns its type rather than the value. Adding the Text function at the end does not work.</p>
c# asp.net
[0, 9]
3,510,504
3,510,505
dynamic collection of text from text field
<p>this is html code</p> <pre><code>&lt;div id="domTxtEntry"&gt; &lt;strong&gt;Your Name:&lt;/strong&gt; &lt;input type="text" name="txtdisplay" id="txtdisplay" value="" class="input" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;div id="domPrv"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>this jquery code</p> <pre><code>$(document).ready(function () { var nameNode = $('#domPrv'), name = $('#txtdisplay'); //comment...easy $('#domTxtEntry input').bind('blur keyup', function () { //name if ($('#txtdisplay').val()) { nameNode.text(name.val() + ' modifies this'); } }); }); </code></pre> <p>this is here in this fiddle. <a href="http://jsfiddle.net/qSq37/1/" rel="nofollow">http://jsfiddle.net/qSq37/1/</a></p> <p>two problems</p> <ol> <li>on deletion of values from textfield the output windows does not update it or leaves at the last word.</li> <li>i tried many things to add the output to float on the right of the text field but it is displayed at the bottom of the text field.</li> </ol> <p>Help needed.</p>
javascript jquery
[3, 5]
1,463,246
1,463,247
RegisterStartupScript not behaving as expected with jQuery script
<p>I have a Page with an update panel, in this update panel I have a button that I want to show/hide by outputting JavaScript given some params, I am using for example:</p> <pre><code>RegisterStartupScript(Me.Page, Me.GetType(), "deleteHideScript", "$('.deleteButton').hide();", True) </code></pre> <p>I am able to run the <code>$('.deleteButton').hide();</code> bit in the console and get the desired effect. I am also able to output a script in the same way to <code>console.log('imHere');</code> and get the expected behavior.</p> <p>What am I missing?</p>
javascript asp.net
[3, 9]
222,992
222,993
what is the equivalent component in android like uiindicator in iphone
<p>can anybody tell what is the equivalent component in android like uiindicator in iphone give example</p> <p>Thanks</p>
iphone android
[8, 4]
2,818,056
2,818,057
Handling dynamically generated controls in asp.net
<p>What's the best way to handle data entered through dynamically generated controls in ASP.NET?</p> <p>Currently, I have a group of controls that are generated in the Page_Load stage, and I need to access the data from them. It seems like it might be possible to just use a hidden field that's read and parsed on postback, but I'd like to know if there's a better way to do it that makes better use of the framework.</p>
c# asp.net
[0, 9]
4,287,769
4,287,770
delete rows and change pagination counters?
<p>I want change <code>1 تا 6 از 36</code>=translator to EN=> <code>1 to 6 of 36</code> after delete row(s)(with click on link <strong>DELETE</strong>) in table.<br> <strong>EXAMPLE:</strong> total rows is <code>36</code> if we delete <code>3</code> rows, this total row online change to <code>33</code> (like when that select value of select box and change this part of table).<p> You see this link that be clear: <a href="http://binboy.gigfa.com/admin/accommodation/show" rel="nofollow">http://binboy.gigfa.com/admin/accommodation/show</a> <br> Here is my full js code: <a href="http://binboy.gigfa.com/files/js/admin.js" rel="nofollow">http://binboy.gigfa.com/files/js/admin.js</a><p></p> <p>With respect</p>
javascript jquery
[3, 5]
4,808,039
4,808,040
On click with an element that has been added to the page?
<p>I add a delete button dynamically to the page once the user uploads an image.</p> <pre><code>$('.galleryImage .delete').bind('click', function() { //do delete } </code></pre> <p>The above does not work.</p> <p>As I understand it, it's because the delete button is added to the page after creation.</p> <p>I've tried</p> <pre><code>$('body').on('click', '.galleryImage .delete', function() { </code></pre> <p>But this only works with jquery 1.7+ and I need to use 1.6.</p> <p>Any ideas how I can get this to work?</p>
javascript jquery
[3, 5]
5,104,722
5,104,723
Get handle of back click in java class
<p>In my android application my Home activity calls Async task which is placed in another java class.If the user press on back of device i would like to perform some action in async task called.How can i get access of user back click in my java class which doesnot extend Activity. </p> <p>Please let me know if any suggestions.</p>
java android
[1, 4]
1,915,517
1,915,518
how to put focus back on textbox which fails validation ,inside gridview
<p>I have below <code>textbox</code> inside <code>itemtemplate of gridview.</code>.problem is when i click on <code>edit button of gridview</code>,and if i enter invalid value in <code>textbox</code> according to validation logic, <code>focus of textbox is lost</code> when i click on <code>update button</code>..if i am at 30est row focus went to top most row..how to prevent focus..</p> <pre><code>&lt;asp:TextBox ID="tbattendence" Width="40px" runat="Server" Text='&lt;%# Eval("attendence") %&gt;' onkeydown = "return (event.keyCode!=13);"&gt; &lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbattendence" ErrorMessage="Attended Attendence is required!" Display="Dynamic" ValidationGroup="bottom" ForeColor="#6600FF"&gt;*&lt;/asp:RequiredFieldValidator&gt; &lt;asp:CompareValidator ID="CompareValidator" runat="server" ErrorMessage="Attended Attendence must be Lesser!" ControlToValidate="tbattendence" ControlToCompare="tbcutoff" Display="Dynamic" Operator="LessThanEqual" Type="Integer" ValidationGroup="bottom"&gt;*&lt;/asp:CompareValidator&gt; </code></pre>
c# asp.net
[0, 9]
2,728,508
2,728,509
Can't convert values
<p>Im trying to convert the Id field to send it to the DB but in the DB the type is bigInt:</p> <pre><code>var ID_Inscricao = (Label)row.FindControl("Label1"); </code></pre> <p>How do I convert this to a type that is compatible with bigInt? I have tried cast and convert but neither worked.</p>
c# asp.net
[0, 9]
3,604,526
3,604,527
find the value of psudo class variable in javascript
<p>hey every one I want to alert value of n from this string </p> <pre><code>$('.orbit-bullets:has( &gt; li.active:nth-child)'); </code></pre>
javascript jquery
[3, 5]
4,945,653
4,945,654
JQuery,Passing Form POST/FILES data to PHP
<p>I have simple Image ulpoad HTML Form, The Idea is, I'm passing my Data to PHP script Via JQuery, Anyway, My script is not passing $_FILES Data Code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#addpic').live('submit', function(e) { e.preventDefault(); $.post('add.php', $(this).serialize(), function (data, textStatus) { if (data == "true") { //Upload successful $('#submitf').hide(); $('#backf').hide(); var thank="&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;center&gt;&lt;h3&gt;Teşekkürler,&lt;br&gt;fotoğraf kontrol edildikten sonra aktif hale gelecektir.&lt;/h3&gt;&lt;/center&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;"; $('#signupdiv').html(thank); } else if (data == "err") { } else { alert(data); } }); return false; }); }); &lt;/script&gt; </code></pre> <p>and For Sure my Form is </p> <pre><code>&lt;form method="POST" action="" name="addpic" id="addpic" onsubmit="return checkform(this);" enctype="multipart/form-data"&gt; </code></pre> <p>and PHP is simple no problem in there.</p>
javascript jquery
[3, 5]
6,010,618
6,010,619
How to append an Object to a DOM Element with JQuery append(), add() or appendTo()?
<p>I can't seem to get this working, even though I have the idea it is perfectly correct. Consider the following code:</p> <pre><code>&lt;script type="text/javascript&gt; ul = $(".qtrans_language_chooser"); parent = ul.parent(); activeLangLi = ul.children("li.active"); parent.prepend('&lt;ul class="qtrans_active_language"&gt;&lt;/ul&gt;'); activeLangUl = $(".qtrans_active_language"); o = activeLangLi.appendTo(activeLangUl); activeLangLi.remove(); &lt;/script&gt; </code></pre> <p>All I'm trying to do is add activeLangLi to the empty activeLangUl. But no matter if I use append(), appendTo() or add() it never shows up.</p>
javascript jquery
[3, 5]
5,542,744
5,542,745
change asp.net panel rendered tag from div to span
<p>I have an <code>&lt;asp:Panel&gt;</code> inside an <code>li</code>, so the problem is the html will not validate.</p> <p>Any help in changing the rendered <code>div</code> to a <code>span</code>?</p> <p>I'm doing this in a ASP.NET 4.0 website using c# code.</p>
c# asp.net
[0, 9]
923,503
923,504
Tally xml creation from asp.net
<p>Is it possible to create a tally xml from asp.net. There should be multiple tallymessage tag in the xml. It means that I want to import a day book in tally with multiple debitnotes.</p>
c# asp.net
[0, 9]
3,882,248
3,882,249
How are linked lists implemented without the use of pointer?
<p>It is easy to implement linked list in c++ where you have pointers. But how are they implemented in other languages (like java,python,etc). I don't want to use built-in class(which are supported in JAVA) for linked-list but what i want is how to replace pointers to create linked-list?</p>
java c++
[1, 6]
2,753,011
2,753,012
check if user is visiting pure root url
<p>I'd like to run a js script if a user is visiting my site's root url. I am using this code:</p> <pre><code>&lt;script type="text/javascript"&gt; if(location.pathname == "/") { window.open ('#107','_self',false); } &lt;/script&gt; </code></pre> <p>However <a href="http://example.com/?foo=bar#hash" rel="nofollow">http://example.com/?foo=bar#hash</a> will also run the script, since the pathname excludes the query string and location hash.</p> <p>It currently behaves like this:</p> <pre><code>http://example/ Root /?querystring Root /#hash Root /page Not root </code></pre> <p>I want it to behave like this:</p> <pre><code>http://example/ Root /?querystring Not root /#hash Not root /page Not root </code></pre> <p>Any suggestions? Thanks.</p>
javascript jquery
[3, 5]
531,949
531,950
javascript - set var equal to data returned from a function
<pre><code>var ipAddress="unknown"; $.getJSON('http://jsonip.appspot.com/?callback=?', function(data){ ipAddress=data.ip;}); document.getElementById('callbackForm').elements["callback_form.ipAddress"].value = ipAddress; </code></pre> <p>This javascript code sets the var ipAddress equal to 'unknown', then executes a jquery function that sets the value of ipAddress to the user's ip. Then I attempt to set a form element equal to the value of ipAddress.</p> <p>This is not working. The form element is being set to 'unknown'. I'm not sure if this is a scoping problem? Any advice appreciated.</p>
javascript jquery
[3, 5]
2,942,594
2,942,595
Jquery submits form but does not fade my div
<p>The title almost says it all. I have a jquery code i've written, im not good at it but this is what i achieved:</p> <pre><code>$("#myForm").submit(function(){ //alert($(this).serialize()); $.post("submit.php", $(this).serialize(), function(data){ if(data == success) { $("#add_vote").fadeOut("fast"); $("#verification_sent").fadeIn("fast"); $("#wrong").fadeOut("fast"); } else { $("#wrong").fadeIn("fast"); } }); return false; }); </code></pre> <p>The form gets submitted well but the fadeIn and fadeOut's I have does not work. Do anyone know why?</p>
php jquery
[2, 5]
2,721,853
2,721,854
Javascript formatting for if condition
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4728144/check-variable-equality-against-a-list-of-values">Check variable equality against a list of values</a><br> <a href="http://stackoverflow.com/questions/13959064/javascript-comparing-single-value-against-multiple-values-with-or-operands">Javascript: Comparing SINGLE Value Against MULTIPLE Values with OR Operands</a> </p> </blockquote> <p>First of all I am new to javascript side. Please let me know is there any simple way of formating the below code.</p> <pre><code>if( fileName== 'doc' || fileName=='docx' || fileName=='xls' || fileName=='xlsx' || fileName=='ppt' || fileName=='pdf' ){ Do something } else{ Do something } </code></pre>
javascript jquery
[3, 5]
2,678,839
2,678,840
class of a DOM and jQUery
<p>I sometimes see that there is something like this:</p> <pre><code>&lt;input name="star2" type="radio" class="star 1"/&gt; &lt;input name="star2" type="radio" class="star 2"/&gt; </code></pre> <p>is it possible in jQuery to let one class to handle these two class? Because basically they have the same parent class, which is star? If it is possible, how can I do that? Using regular expression?</p>
javascript jquery
[3, 5]
4,507,616
4,507,617
<link rel="Stylesheet" type="text/css" href="<% ResolveUrl("~/Css/test.css") %>"/>
<pre><code>Error 5 ; expected &lt;link rel="Stylesheet" type="text/css" href="&lt;% ***ResolveUrl("~/Css/test.css");*** %&gt;"/&gt; </code></pre> <p>Do i need to give <code>;</code> over here as my solution is not still working it starts giving some other error</p>
c# asp.net
[0, 9]
736,650
736,651
Listview with image from the gallery
<p>I have a 'contacts' application within my app and I would like to be able to set an image against a persons name within the listview. </p> <p>How can I select a picture from the gallery and set this as the image? I've seen loads of examples where the image is loaded into an array but I don't believe this is what I'm looking for.</p>
java android
[1, 4]
3,341,574
3,341,575
Raw resources file with variable name in android
<p>My Current Code is </p> <pre><code>dbfileRawCopy(myOutput,R.raw.dbaa); dbfileRawCopy(myOutput,R.raw.dbab); dbfileRawCopy(myOutput,R.raw.dbac); dbfileRawCopy(myOutput,R.raw.dbad); dbfileRawCopy(myOutput,R.raw.dbae); dbfileRawCopy(myOutput,R.raw.dbaf); dbfileRawCopy(myOutput,R.raw.dbag); dbfileRawCopy(myOutput,R.raw.dbah); dbfileRawCopy(myOutput,R.raw.dbai); dbfileRawCopy(myOutput,R.raw.dbaj); dbfileRawCopy(myOutput,R.raw.dbak); dbfileRawCopy(myOutput,R.raw.dbal); dbfileRawCopy(myOutput,R.raw.dbam); dbfileRawCopy(myOutput,R.raw.dban); dbfileRawCopy(myOutput,R.raw.dbao); dbfileRawCopy(myOutput,R.raw.dbap); dbfileRawCopy(myOutput,R.raw.dbaq); dbfileRawCopy(myOutput,R.raw.dbar); dbfileRawCopy(myOutput,R.raw.dbas); dbfileRawCopy(myOutput,R.raw.dbat); dbfileRawCopy(myOutput,R.raw.dbau); </code></pre> <p>It's possible to loop the raw file with variable name ?</p> <p>Following code is example and it's not correct </p> <pre><code>for(char ch='a';ch&lt;='u';ch++){ dbfileRawCopy(myOutput,R.raw.dba+ch); } </code></pre>
java android
[1, 4]
753,147
753,148
Call PHP on server via Javascript?
<p>I am attempting to make a dead simple webpage that does things when I click a button.</p> <p>I am trying to use Javascript so I don't have to reload the main page or anything.</p> <p>So I want a button that says "Shutdown", and I simply want to run shutDown.php that will shut down the server when I click on this.</p> <p>I've been searching for an hour now and can't find a simple example. Could someone please post a very simple, example, or a link to one? </p> <p>Many thanks :)</p> <p>EDIT: Okay so here's my pitiful attempt.. it doesn't work.. any tips?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Control Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"&gt; /************************************* JQUERY EXAMPLE *************************************/ $('#mysubmit').click(){ var jqueryXHR = $.ajax({ 'type': 'POST', 'url': 'http://localhost/killIE.php', 'dataType': 'json' }); } } &lt;/script&gt; &lt;input type="submit" name="mysubmit" value="Click!" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
php javascript
[2, 3]
2,118,494
2,118,495
assign a value from a foreach loop to an asp:button CommandArgument
<p>The code behind file creates a list of employees and the asp.net page loops through list. Now, How do I assign the employeedID to the commandArgument of an asp:button?</p> <pre><code> &lt;%foreach(var employee in employeesList){%&gt; &lt;tr&gt; &lt;td&gt;&lt;%=employee.firstName%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=employee.lastName%&gt;&lt;/td&gt; /*How to access employee.Id in the commandArgument? */ &lt;td&gt;&lt;asp:Button ID="btnDeleteEmployee" runat="server" CommandArgument='' Text="Delete" OnCommand="btnDeleteEmployee_Click" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;%}%&gt; </code></pre>
c# asp.net
[0, 9]
3,269,573
3,269,574
RadioButtonList.SelectedIndex vs RadioButtonList.SelectedValue
<p>Out of curiosity, anyone knows the particulars of the internal implementation of </p> <pre><code>ListControl.SelectedIndex = (int) &lt;new valueIndex&gt; </code></pre> <p>VS </p> <pre><code>ListControl.SelectedValue = &lt;new value&gt;.ToString() </code></pre> <p>I'm having difficulties with a custom validation object we've built here to process all validation in one sweep. I suspect using <code>&lt;SelectedValue = &gt;</code> will raise a <code>SelectedIndexChanged</code> event, even though both the value and index remain the same, both before and after the operation.</p> <p>(The ListControl's values are populated declaratively....)</p> <p>As ever, thank you for your time!</p>
c# asp.net
[0, 9]
2,927,446
2,927,447
how to get value from the previous hidden input from a span tag using jQuery
<p>how to get value from a hidden input previous to a span tag using jQuery</p> <pre><code> &lt;div&gt; &lt;input type="hidden" value="&lt;?php echo $activeTimeID; ?&gt;" class="activeTimeId" name="activeTimeID&lt;?php echo $j;?&gt;[]" /&gt; &lt;span class="closeTime"&gt;close&lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
284,321
284,322
URL accesses based on login
<p>Hello everyone I have a question that I will describe as good as I can. I have project that resides in the folder on my server the path for url is like</p> <p>www.domain.com\project now what I am trying to achieve is to have a \project directory be only accessible if user is login. scenario would be the user opens the url www.domain.com and he see the login screen if he logins path \project will be accessible if he does not and try's to go to any file in the direcoty or directory it should give him an error and redirect him back to login screen. I am using MVC3 in my project but I can write the login screen in asp.net web forms. I am also want to authorization be based in db a table with user logins so when the user logins it validates based on the information in the table. I am not looking for roles or privileges just a straight access to url based on login. If someone can show an example or a code sample on how to achieve this I will be greatly appreciated it.</p>
c# asp.net
[0, 9]
123,845
123,846
Setting Date Value selected on Date Picker
<p>I'm trying to get a date picker on my asp.net webpage. I've been able to run the same code using a master page and it works, but now I'm trying to get it to work without a master pager and I'm getting error message: Error: Unable to get value of the property 'aspnetForm.ctl00_txtDOB': object is null or undefined</p> <p>On my Default.aspx page....</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function calendarPicker(strField) { window.open('date_picker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=190,resizable=yes'); } &lt;label&gt;DOB:&lt;/label&gt;&lt;asp:TextBox ID="txtDOB" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;img src="images/calendar.gif" alt="Pick To Date" onclick="calendarPicker('aspnetForm.ctl00_txtDOB');"/&gt; I already tried onclick="calendarPicker('txtDOB');"/&gt; My date_picker.aspx.cs private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e) { // Clear the link from this day e.Cell.Controls.Clear(); // Add the custom link System.Web.UI.HtmlControls.HtmlGenericControl Link = new System.Web.UI.HtmlControls.HtmlGenericControl(); Link.TagName = "a"; Link.InnerText = e.Day.DayNumberText; Link.Attributes.Add("href", String.Format("JavaScript:window.opener.document.{0}.value = \'{1:d}\'; window.close();", Request.QueryString["field"], e.Day.Date)); // By default, this will highlight today's date. if (e.Day.IsSelected) { Link.Attributes.Add("style", this.Calendar1.SelectedDayStyle.ToString()); } // Now add our custom link to the page e.Cell.Controls.Add(Link); } </code></pre>
c# javascript asp.net
[0, 3, 9]
5,489,238
5,489,239
Set Objects Key Value
<p>I am using jQuery to iterate through a Javascript object and I would like to set the key value of one or more of the objects keys from within the loop.</p> <pre><code>var children = $(clone).children(); $.each(obj, function(k, v) { if(v == undefined) { //Loop through data array and match. for(var i=0; i&lt;children.length; i++) { var dataId = children[i].id.split('.'); if(k == dataId[1]) { obj.k = children[i].value; //This is the value I want to set on the key. } } } }); </code></pre> <p>The children variable is an array of children (input and select objects) within a div. The loop is passed an object and runs through all the keys in the object. In this case the object is a phone numbers and its keys are similar to number, type, primary etc. but that doesn't matter much. If a key on the object is undefined I want to populate that key with a value from its matching child object.</p> <p>Everything is working perfectly except I cannot figure out how to set the key with a new value.</p>
javascript jquery
[3, 5]
4,533,137
4,533,138
Getting the value of option choosen by the user
<p>In my index file where the form and function are located, named:</p> <p><strong>index.php</strong></p> <pre><code>$(function() { $.ajax({ type: "POST", url: "invtype.php", data: "getrevenuetype=true", success: function(b){ $("#revenueType").html(b) } }) }) </code></pre> <p><code>&lt;span name="revenueType" id="revenueType"&gt;&lt;/span&gt;&lt;br/&gt;</code></p> <p><strong>invtype.php</strong></p> <pre><code>&lt;?php mysql_connect("","","") or die('Error: '.mysql_error()); mysql_select_db("dbname"); if(isset($_POST['getrevenuetype'])) { $sql3 = mysql_query("SELECT * FROM chartofaccount WHERE accountnumber &gt;= 4000 and accountnumber &lt;= 4999"); $acct = ''; $acctrow = mysql_num_rows($sql3); if($acctrow &gt; 0) { echo 'Revenue Type:&lt;select name="rename"&gt;'; while($chartrow = mysql_fetch_array($sql3)) { $revenueaccountname = $chartrow['accountname']; $acct .= '&lt;option value="$revenueaccountname"&gt; '. $revenueaccountname .' &lt;/option&gt;'; } } } echo $acct; echo '&lt;/select&gt;'; </code></pre> <p>My question is how will I get or what code should I put on to get the value of the option selected by the user? My purpose in getting the value is that I want to put it in another php where it will be used as var in inserting data into MySQL. already tried this code: <code>$name = $_POST['rename'];</code> then included 'invtype.php'; on the other php file (this is where I will use the value of option selected) but it doesn't seem to work. I know my code is all messed up and I'm really sorry about it, but guys if you can help I would really appreciate it. </p>
php javascript jquery
[2, 3, 5]
3,932,556
3,932,557
Adding auto increment value to li element
<p>im a css/designer guy so please excuse my lameness in not knowing any .js</p> <p>basically i want to know how to add an auto incremental id to a list item with javascript / jquery for something that i am trying to add some css to.</p> <p>before</p> <pre><code>&lt;li id=""&gt;&lt;a href=""&gt;Item number 1&lt;/a&gt;&lt;/li&gt; &lt;li id=""&gt;&lt;a href=""&gt;Item number 2&lt;/a&gt;&lt;/li&gt; &lt;li id=""&gt;&lt;a href=""&gt;Item number 3&lt;/a&gt;&lt;/li&gt; </code></pre> <p>after</p> <pre><code>&lt;li id="1"&gt;&lt;a href=""&gt;Item number 1&lt;/a&gt;&lt;/li&gt; &lt;li id="2"&gt;&lt;a href=""&gt;Item number 2&lt;/a&gt;&lt;/li&gt; &lt;li id="3"&gt;&lt;a href=""&gt;Item number 3&lt;/a&gt;&lt;/li&gt; </code></pre> <p>thanks in advance and especially just for reading this</p> <p>tried all the responses, nothing has worked on a plain html page with nothing but the ul/li items.</p> <p>thanks to all that tried, i have failed in a big way.....im not a coder</p>
javascript jquery
[3, 5]
4,377,899
4,377,900
Can't execute file via Server.Execute()
<p>I'd like to execute a file in a subsite. Both the parent and sub site are web apps. I don't want to redirect to the sub site file. I'm trying to execute the sub file using Server.Execute() but it isn't working.</p> <p>The main URL is: <a href="http://mysite.com/subsite" rel="nofollow">http://mysite.com/subsite</a></p> <p>Virtual path to file in subsite: ~/subsite/subfile.aspx</p> <p>When I access <a href="http://mainsite.com/subsite/subfile.aspx" rel="nofollow">http://mainsite.com/subsite/subfile.aspx</a>, it works fine. When I do</p> <pre><code>Server.Execute("~/subsite/subfile.aspx") </code></pre> <p>from the parent site, I get:</p> <pre><code>Could not load type 'Subsite.SubFile'. </code></pre> <p>Any ideas what I'm doing wrong?</p>
c# asp.net
[0, 9]
2,864,955
2,864,956
jQuery reset refreshing browser as well as resetting form
<p>I am trying to issue a form reset to clear the contents back to there initial state. What is happening however, is that the form clears but also the browser refreshes. I have also tried putting the code inside a document ready but still the same. Can someone explain to me why this is happening. Thanks</p> <pre><code>&lt;button id="AUSR_reset" class="resetbutton icon-right ui-state-default2 ui-corner-all"&gt;&lt;span class="ui-icon ui-icon-circle-plus"&gt;&lt;/span&gt;Reset&lt;/button&gt; &lt;script language="javascript" type="text/javascript"&gt; $("#AUSR_reset").click(function() { $("#AUSR_adduser").get(0).reset(); }); </code></pre> <p></p>
javascript jquery
[3, 5]
2,548,789
2,548,790
exporting gridview to Ms Excel 2007
<p>I am trying to export grid view data into excel 2007 i.e. xlsx format. but its giving error.</p> <p>i am using following code</p> <p>protected void Button1_Click(object sender, EventArgs e)</p> <pre><code> { Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=text.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); GridView1.DataSource = Presenter.CurrentModel.BillStatementGlModelRecords; GridView1.DataBind(); GridView1.AllowPaging = false; GridView1.DataBind(); GridView1.HeaderRow.Style.Add("background-color", "#FFFFFF"); for (int i = 0; i &lt; GridView1.Rows.Count; i++) { GridViewRow row = GridView1.Rows[i]; //Change Color back to white row.BackColor = System.Drawing.Color.White; //Apply text style to each Row row.Attributes.Add("class", "textmode"); } GridView1.RenderControl(hw); //style to format numbers to string string style = @"&lt;style&gt; .textmode { mso-number-format:\@; } &lt;/style&gt;"; Response.Write(style); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); } </code></pre> <p>but not working properly and on opening the file it gives following error "Excel cannot open the file 'ChangeRequestList[2].xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"</p> <p>Can anyone help me?</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,839,382
5,839,383
how to avoid $ conflict in the callback function of jquery with prototype
<pre><code>jQuery.noConflict(); or $.noConflict(); (function($) { $(document).ready( function() { // Show menu when #input1 is clicked $("#input1").contextMenu({ menu: 'myMenu' }, function(action, el, pos) { alert("clicked"); }); })(jQuery); </code></pre> <p>In above code, i have avoided conflict with the prototype by using function($){}(jQuery); But in the callback function(action, e1, pos) it is again calling function from prototype.</p> <p>Both $.noConflict(); &amp; jquery.noConflict(); i have tried but no use. Please provide suggestion show can I avoid this conflict.</p> <p>The conflict is resolved now. Thanks to all for their expert advices. But now the other problem is context menu is not opening on right clicking input1. Please provide your valuable suggestions.</p> <p>Thanking You. </p>
javascript jquery
[3, 5]
2,854,564
2,854,565
What does jQuery.fn mean?
<p>What does the 'fn' here mean?</p> <pre><code>window.jQuery.fn.jquery </code></pre>
javascript jquery
[3, 5]
5,772,263
5,772,264
(Deep) copying an array using jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-a-javascript-object">What is the most efficient way to clone a JavaScript object?</a> </p> </blockquote> <p>I need to copy an (ordered, not associative) array of objects. I'm using jQuery. I initially tried </p> <pre><code>jquery.extend({}, myArray) </code></pre> <p>but, naturally, this gives me back an object, where I need an array (really love jquery.extend, by the way).</p> <p>So, what's the best way to copy an array? </p>
javascript jquery
[3, 5]
2,779,511
2,779,512
A quick question about keypress and jQuery
<p><code>$(document).keydown(function(e) {</code></p> <p>Well, that's my code - I was wondering if it is possible to have something like:</p> <p><code>$(document).not('#pinkElephant').keydown(function(e) {</code></p> <p>(Except, that doesn't work...)</p> <p>Any Ideas?</p> <p>Thanks very much!</p> <p>p.s. All that function has inside it, is a <code>switch</code> statement.</p> <p><strong>[edit]</strong> Hey guys n gals - I cannot <code>return false;</code> because the element I need to type in is an <code>&lt;input&gt;</code> text, so the keyboard still needs to return here. </p> <p>It's really confusing me :(</p>
javascript jquery
[3, 5]
4,262,408
4,262,409
how to wait until Array is filled (asynchronous)
<p>I have an array which is filled asynchronous and contains 28 items. I want to wait until the array is filled with all items.</p> <pre><code>function checkIfFinished(){ return(Results.length &gt;= 28); } var isfinished = false; while(isfinished){ if(checkIfFinished()){ returnResults(); isfinished = true; } else //Wait 100ms } </code></pre> <p>Well, but in Javascript there is no wait function! I tried it with setTimeout, but I don't know how to insert it... I just get errors with too much recursion and stuff :D</p> <p>Thank you!</p>
javascript jquery
[3, 5]
2,926,198
2,926,199
Ajax PopupControlExtender in Gridview
<p>I just want to get your opinion on what is the best approach in my gridview. Sample Gridview Data.</p> <pre><code>-------------------------------------------------------------------- | | UserID | First Name | Last Name | Last Loggedin| -------------------------------------------------------------------- |imgBtn | PHUserId1 | Jim | Carey | 1/16/2011 6:00AM | -------------------------------------------------------------------- -------------------------------------------------------------------- |imgBtn | PHUserId2 | Andres | Boni | 1/27/2011 5:56 PM | -------------------------------------------------------------------- -------------------------------------------------------------------- |imgBtn | PHUserId3 | George | Jungle | 1/2/2011 4:01 AM | -------------------------------------------------------------------- </code></pre> <p>What I want to do is, in the 1st column of the GridView(grdUserList) control once I click the ImageButton control inside ItemTemplate of the gridview a popup (Ajax PopupExtender) will appear. The popup contains GridView (grdHistory) control inside of it which are the logged history of the user you select. </p> <p>Actually, the design and the output is already done. I get a popup everytime I click the ImageButton on the 1st column of the GridView(grdUserList) control.</p> <p>But the problem now is, how do I refresh the GridView (grdHistory) control in my popup everytime I select different user in my GridView(grdUserlist). I place Click event on the ImageButton but it fires only once. The next click on the ImageButton will no longer fires the Click event. I dont what to used the Ajax ModalPopupExtender for the reason of, I dont what the user to close a popup evertime they click the ImageButton in the 1st row.</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
167,568
167,569
IF IE neglect/hide div
<p>I have page like this</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;div id="container"&gt; Hello, this is NON-IE content. &lt;/div&gt; &lt;/head&gt; &lt;/html&gt; </code></pre> <p>What I want is to <strong>Stop</strong> Internet Explorer <strong>[ IE ]</strong> from <strong>loading OR Neglecting</strong> <code>&lt;div id="container"&gt;</code> &amp; <strong>allow</strong> all <strong>other browsers</strong> to <strong>load</strong> It.</p> <p>Don't want to use <code>&lt;!--[if IE 7]&gt;</code>.</p> <p>Looking for <strong>Javascript</strong> to work with.</p> <p>How Can I achieve this ?</p> <p>Thanks</p> <ul> <li>Mandar</li> </ul>
javascript jquery
[3, 5]
5,121,336
5,121,337
Can I get the standard currency format to use a negative sign instead of parentheses?
<p>There are many places in my project where I try to display currency with the built-in <code>{0:C}</code> currency format. If the number is negative, it surrounds the value in parentheses. I want it to use a negative sign instead.</p> <p>My web.config has culture set to <code>auto</code>, and it resolves to <code>en-US</code>.</p> <p>The ideal solution would be some global web.config or other setting that would make the <code>{0:C}</code> display the negative sign for the <code>en-US</code> culture, but I'm open to other, less awesome solutions as well.</p>
c# asp.net
[0, 9]
5,807,602
5,807,603
PHP coding in Android
<p>I want to ask if I can run virtual server, MySQL, and a PHP editor on Android (4.1 for example)? I know my question is simple, but I didn't find anything helpful in my searches. </p>
php android
[2, 4]
1,560,737
1,560,738
Is it possible to change javascript variable via iframe ?
<p>I am trying to change javascript variable when iframing that page. Not the same, but did some similar on pinterest</p> <pre><code>if (top != self) { $('body').html('&lt;h1&gt;Unauthorized&lt;/h1&gt;') } </code></pre> <p>Above is their code. I used this to cancel it</p> <pre><code>&lt;iframe src="http://www.pinterest.com/?v= if(top!%3Dself)%7B%24('body').html('%3Ch1%3EUna uthorized%3C%2Fh1%3E')%7D"&gt; </code></pre> <p>This works on chrome. So my question is, ccan we change javascript variables via iframe ?</p>
javascript jquery
[3, 5]
3,284,181
3,284,182
How can I have hover effect on DIV's using the DIV ID in javascript?
<p>I want to have a different hover effects on each div using the div id. Is it possible? I have been searching on google for a while now and all I see is hover effect using classname and tags. I want to do this using javascript or jquery. Any help is appreciated, Thanks!</p>
javascript jquery
[3, 5]
3,748,639
3,748,640
Div is jumpy with fadeIn jQuery
<p>When I roll over .comptext_rollover div it should hide the initial div on the page and show the minipage div. but it does but is sometimes really jumpy and also the minipage div sometimes shows below the initialpage div. any ideas? sorry i am new to coding! Thanks in advance.</p> <pre><code>$(document).ready(function() { $('#mini_page').hide(); $('.comptext_rollover').hover(function() { $('#initial_page').hide(); $('.register_button').hide(); $('#mini_page').fadeIn(100); $('#container').css({ 'margin-top': '-217px' }); }, function() { $('#mini_page').hide(); $('#initial_page').show(); $('.register_button').show(); $('#container').css({ 'margin-top': '-150px' }); }); }); </code></pre>
javascript jquery
[3, 5]
1,946,023
1,946,024
"too much recursion" error with live handlers in jQuery 1.3.2
<p>This question is similar to <a href="http://stackoverflow.com/questions/639862/too-much-recursion-error-in-jquery-1-3-2">my last question about "too much recursion" errors in jQuery</a>, but involving live handlers. I have one element within another. Both of them have custom event handlers with the same name. The outer element has a traditional handler and the inner element has a live handler. When I try to trigger the event on the outer element, my browser pauses for a while, then I get an error saying "too much recursion".</p> <p>I read on the <a href="http://docs.jquery.com/Events/live" rel="nofollow">live handler documentation page</a> that I can prevent bubbling of a live handler by returning false within the handler function. However, I tried this and it doesn't seem to make a difference. Either way, the outer function seems to somehow be called many times when I am trying to call it only once.</p> <p>How can I fix this? Is it possible to have handlers with the same name like this, or do I have to come up with different names? You can test the problem using this code:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt;&lt;head&gt; &lt;title&gt;live event handler test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="outer"&gt; &lt;div id="inner"&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $("#outer").bind("test", function() { $("#inner").trigger("test"); }); $("#inner").live("test", function() { return false; }); $(function() { $("#outer").trigger("test"); }); &lt;/script&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
797,784
797,785
Cant stop playing sound in other Activity with MediaPlayer in Android
<p>I'm trying to play a background sound in my Android application. I'm using a seperate class as a Soundmanager. And in my first activity, i start the sound and i want it to play through 2 other activitys. And in my third class i want it to stop and another sound should play. But im having a problem stopping that sound and don't know why. I guess it has something to do with that im using the class Context in my Soundmanager class.</p> <p>Does anyone know how to make the sound stop? I'll link my Soundmanager class becuase that is the only one that is relevant i guess. Im pretty new to programming, so please be gentle.</p> <p>Soundmanager class <a href="http://codepad.org/KJi6DZN6" rel="nofollow">http://codepad.org/KJi6DZN6</a></p>
java android
[1, 4]
3,073,133
3,073,134
Check if asp Checkbox is checked in a row of a GridView with Javascript
<p>I have a grid view and I want to see if the checkbox in the first column is checked. If the check box is checked it opens a new window. I cannot figure out how to see if the checkbox is checked. Please help the function below is not working and I can't figure out why.</p> <pre><code>function mapSelectedClick() { var CustomerIDs = ""; var grid = document.getElementById('&lt;%=grdCustomers.ClientID %&gt;'); for (var i = 1; i &lt; grid.rows.length; i++) { var Row = grid.rows[i]; var CustomerID = grid.rows[i].cells[1].innerText; if (grid.rows[i].cell[0].type == "checkbox") { if (grid.rows[i].cell[0].childNodes[0].checked) { customerIDs += CustomerID.toString() + ','; } } } customerIDs = customerIDs.substring(0, customerIDs.length-1); window.open("MapCustomers.aspx?CustomerIDs=" + customerIDs); } </code></pre>
javascript asp.net
[3, 9]
2,502,223
2,502,224
asp.net login control with another panel
<p>How to use login and signup button, in which whenever user clicks on that link login and signup form will open in same window like in flipkart.com. How to do that task in my website? I am making an ecommerce website...</p>
c# jquery asp.net
[0, 5, 9]
2,520,403
2,520,404
Connecting App with PHP and mysql
<p>I am trying to access a database through a simple PHP code. But the constraints are that it is a remote database, accessed by a remote server from a real device.</p> <p>here is a snippet of the code:-</p> <pre><code>ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;(); postParameters.add(new BasicNameValuePair("username", un.getText().toString())); postParameters.add(new BasicNameValuePair("password", pw.getText().toString())); String response = null; try { response = CustomHttpClient.executeHttpPost("http://WebsiteName.com/check.php", postParameters); String res=response.toString(); res= res.replaceAll("\\s+",""); if(res.equals("1")) error.setText("Correct Username or Password"); else error.setText("Sorry!! Incorrect Username or Password"); } catch (Exception e) { un.setText(e.toString()); } </code></pre> <p>The PHP is <a href="http://pastebin.com/EiXSQVRG" rel="nofollow">here</a>. Most probably there is no problem with the PHP code because it works locally.</p> <p>One of the most important things I want to clarify is where to keep the PHP code in the server. I have it directly under the root directory. When i execute it from the browser (say by typing website.com/check.php), i get the required response. Unfortunately many people who have given a tutorial on this, has mentioned about local server and local database more than remote ones. Is there something more I should do for getting it done with a real device?</p> <p>PS: The app works fine when connected to an emulator and local database with local webserver.</p> <p>===UPDATE===</p> <p>I am pretty sure that the phone is not contacting the web server. I verified by making the webserver give a positive response always, which also failed. Any hints on where I should look at? I can't think of anything other than the online server...which is working (when checked from browser). Any way of cross checking it? Thanks.</p>
php android
[2, 4]
5,547,253
5,547,254
jQuery.find() IE7 bug?
<p>I have a few lines of code where I use this function, but it seems to only find the 1st element in IE7. Works in IE8/FF/Chrome.</p> <pre><code>$(document).find("#JobID").attr('checked', $('#CheckAll').is(':checked')); </code></pre> <p>I also have a similar line which only finds the first element.</p> <pre><code>$(document).find("#JobID").each(function() { ... } </code></pre> <p>Does anyone know if this is a known bug or a workaround? Maybe I'm not using the proper method?</p>
javascript jquery
[3, 5]
3,768,737
3,768,738
jQuery stop append removing div
<p>I am copying a div into another div using append. However it removes the original. I tried to use clone but it seems to only work with appendTo. But appendTo breaks my layout so I have to use append with works fine.</p> <p>I am wrong that clone will not work with .append and is there another way to stop the div removing?</p> <p>Thanks</p> <pre><code> $('.compareWrapper').append(htmlStr) </code></pre>
javascript jquery
[3, 5]
3,959,171
3,959,172
how to count total number of divs with in a div using javascript
<p>how to count total number of divs with in a div using javascript</p>
php javascript
[2, 3]
2,470,060
2,470,061
PHP variable to JS - over and over
<p>Sorry my Gods, but....</p> <p>I have php, file, and in this php i set the language, and include the necessary lang file:</p> <pre><code> ... if ($lan=='ge') {$_SESSION['lang']='german';...} if ($lan=='en') {$_SESSION['lang']='english'; ....} } if ($_SESSION['lang']=='english'){ include ..english }else{ include ...german } </code></pre> <p>I use Yshout in my site, and want to make it multilang. In the JS file the developer use some text which i have to make it multilanguage. </p> <p>So in JS file the first line:</p> <pre><code>`&lt;?php header('Content-type: text/javascript');?&gt; </code></pre> <p>And in the php: </p> <pre><code> &lt;script src="/js/yshout.php" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>Now i can use PHP in JS file. So i try to use instead of the fix text. But no results, 'coz JS don know $text variable. If i include the language file in the JS then OK, but i have to include the necessery language file, this is not work, 'coz JS dont know the $_SESSION['lang'] varible when he run.</p> <p><strong>Which is the simplest way to tell JS which language file have to be included and how can i do that?</strong></p> <p>Thank you </p>
php javascript
[2, 3]
2,540,904
2,540,905
get dropdownlist selectedvalue on button click in ListView
<p>I have DropDownList and a button in ListView for each row. Now i want to get the selected value of the dropdownlist on Button click event. How can i get this.</p> <p>Please guide me.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
835,436
835,437
jQuery event binding with accessibility in mind - click and keypress
<p>Just a quick question, I seem to do this a lot:</p> <pre><code>$saveBtn.bind("click keypress", function(e) { if (e.type != "keypress" || e.keyCode == 13) { // Do something... return false; } }); </code></pre> <p>Is there a quicker way to bind an 'action' listener to a button? I want to always ensure my buttons with event listeners fire on both clicks and the enter key...this seems like it'd be a fairly common thing to want to do but found nothing on google. Any thoughts?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,562,731
4,562,732
C# oncheckedchanged event handler of aspcheckbox does not fire when checkbox is unc
<p>Hey could you look at this code: I get this error:</p> <blockquote> <p>Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. </p> </blockquote> <p>Source Error: </p> <pre><code>{ CheckBox chkBox1 = (CheckBox)e.Row.Cells[8].FindControl("chkStatus"); chkBox1.CheckedChanged += new EventHandler(chkStatus_OnCheckedChanged); chkBox1.Checked = true; chkBox1.AutoPostBack = true; } </code></pre>
c# asp.net
[0, 9]
2,681,924
2,681,925
Removing default text from text box
<p>I got this Text box with default value as "First Name" ..Now when I click inside this text box to enter name , this value "First Name" keeps on displaying. What I want is to the text box to clear as soon as I click inside it. What property do I need to set in mt textbox tag ?</p> <p><strong>[Edit] ok anything from Telerik that I can use to do that ?</strong></p>
c# asp.net
[0, 9]
1,910,126
1,910,127
jQuery override css hide on mouse out
<p>I have a hidden div that I show when the mouse hovers.</p> <p>Then when I click the text changes and I want the div to be permanently shown. The problem is that it disappears again when the mouse moves off.</p> <p>Is there a way in jQuery to override the mouse out hide in the css?</p> <p>Thanks</p> <p>CSS</p> <pre><code>.saveCompare { display:none; margin-left: 10px; background-color:#BDD455; color:#ffffff; padding: 2px 8px; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } .listingContainer:hover .saveCompare { display: inline; } </code></pre> <p>jQuery</p> <pre><code> $("div.saveCompare").click(function() { $(this).text('Compare Added'); $(this).show(); return false; }); </code></pre>
javascript jquery
[3, 5]
4,619,481
4,619,482
Object reference not set to an instance of object, help needed
<p>I have the code below </p> <p>It throws an error <strong>"Object reference not set to an instance of object"</strong></p> <pre><code>TextBox rateCenterName = (TextBox)row.FindControl("txtRateCenterName"); cmd.Parameters.Add("@RateCenterName", OleDbType.VarChar).Value = rateCenterName.Text; </code></pre>
c# asp.net
[0, 9]
5,765,251
5,765,252
Porting c++ to python code
<p>I want to convert this C++ code to Python v2:</p> <pre><code>static unsigned char asConvCode[3] = {0xFC, 0xCF, 0xAB}; void asConv(char* str, int size) { int i = 0; for (i = 0; n&lt; size; n++) { str[i] ^= asConvCode[n % 3]; } } </code></pre> <p>tried to make like that:</p> <pre><code>def asConv(self, data): asConvCode= [0xFC, 0xCF, 0xAB] for i in range(len(data)): data[i] ^= asConvCode[i % 3] # Error: Unsupported operand type(s) for ^=: ... return data </code></pre> <p>I will be happy for any hint</p>
c++ python
[6, 7]
2,864,498
2,864,499
Using jquery, how do you reorder rows in a table based on a TR attribute?
<p>I have a table with rows similar to the following. These rows get updated from time to time via jquery calls. Using jquery, how would I construct a function that reorders these table rows based on the myAttribute value putting the highest myAttribute value rows at the top and the lowest myAttribute value rows at the bottom? There could be up to 100 rows in the table. </p> <pre><code>&lt;tr id='1' class='playerRow' myAttribute=5&gt; &lt;td&gt; One&lt;/td&gt; &lt;td&gt; Two&lt;/td&gt; &lt;/tr&gt; &lt;tr id='2' class='playerRow' myAttribute=6&gt; &lt;td&gt; One&lt;/td&gt; &lt;td&gt; Two&lt;/td&gt; &lt;/tr&gt; </code></pre>
javascript jquery
[3, 5]
3,122,583
3,122,584
get query string into js/jquery
<p>i hae a link like ( domain.com/jsapi?key=123456 )</p> <p>hov can i get this "key" into my JS code? i use jQuery and i don't know about its are easy way to get this "key" into JS variable.</p> <p>tanks for all.</p>
javascript jquery
[3, 5]
1,394,959
1,394,960
How to access a framework/opt class from framework/opt when compiling android 4.2?
<p>On Android 4.1 some java telephony related files where located inside android/framework/base, since google released Android 4.2.2 these classes moved to android/framework/opt.</p> <p>"My problem is that I've a java class inside android/frameworks/base/core/java/android (and it MUST be there) tree that must import elements from the source now located at android/framework/opt".</p> <p>Till android 4.1 I used to call these classes as follow (in my java file): </p> <p>import com.android.internal.telephony.SmsMessageBase</p> <p>but now (Android 4.2.2) it does not work anymore and generate a compiling error.</p> <p>How can I handle this issue?</p>
java android
[1, 4]
4,591,104
4,591,105
How to open file upload prompt when text link is clicked?
<p>This works in FF6 and IE 7, 8 and 9, but not Chrome/Safari or Opera:</p> <pre><code> &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $('#uploadFile').click(function(e) { $('#fileUploadField').click(); e.preventDefault(); }); }); &lt;/script&gt; &lt;input type="file" name="something" style="display: none" id="fileUploadField" /&gt; &lt;a href="" id="uploadFile"&gt;Upload File&lt;/a&gt; </code></pre> <p>I'm guessing this is due to browser security restrictions. Does anyone know of any cross browser solution to achieve this?</p>
javascript jquery
[3, 5]
1,809,505
1,809,506
why "$(opener.document).ready()" is not working?
<p>I tried something like, below in popup-window, but not working...</p> <p>any correction at line 3, please suggest.</p> <pre><code>function closePopup() { window.opener.history.go(0); $(opener.document).ready(function(){ window.opener.some_function(some_variable); self.close(); }); } </code></pre>
javascript jquery
[3, 5]
871,716
871,717
How to make hitTest, Collision Detection Functionality in Android
<p>I have three small ImageView on Screen/View. OnTouch and onTouchMove I have to detect that the Touch/Mouse has collide the ImageView.</p>
java android
[1, 4]
3,860,295
3,860,296
How do I add click events to dynamically added elements in JQuery?
<p>I want to add <code>click</code> events do dynamically created elements. How do I do that using JQuery?</p> <pre><code>$(function() { $('.class').after('&lt;a href="#" onclick="displayHideBox('1'); return false;"&gt;Text&lt;/a&gt;'); }); </code></pre>
javascript jquery
[3, 5]
130,020
130,021
asp.net POST HTTP
<p>I would like to do an HTTP POST using C# but I have not been able to find a good tutorial. Any ideas would be helpful.</p>
c# asp.net
[0, 9]
1,265,695
1,265,696
FileUpload method for asp.net website
<p>net and am just wondering if there is a method for the file upload tag in a library anywhere ?</p> <p>Thanks guys heres my code</p> <pre><code>&lt;asp:FileUpload ID="FileUpload1" runat="server" ForeColor="white" /&gt; </code></pre>
c# asp.net
[0, 9]
5,721,567
5,721,568
jQuery click on scrollbar not registering as in the element in IE?
<p>This is referring specifically to the jQuery dropkick plugin:</p> <p><a href="http://jamielottering.github.com/DropKick/" rel="nofollow">http://jamielottering.github.com/DropKick/</a></p> <p>Scroll to the second demo where the lists overflow and there is a scrollbar. In ever browser but IE, you can interact with the scrollbar. In IE, the panel is hidden on mouse up, as if it is seeing that click as being outside of the element perhaps?</p> <p>I'd love any help trying to track down the issue.</p>
javascript jquery
[3, 5]
4,573,454
4,573,455
How to edit drawables in other APK's (SystemUI.apk)
<p>so my app has one function (for now), to change the background color of Notifications in android. I can easily determine which drawable needs to be changed, and my app works to send and can retrieve the color from Settings.System.ACCELEROMETER_ROTATION (I don't know how to make it send to a custom setting). All I need to do is find out how to use my color to edit the drawable in SystemUI.apk. It really isn't neccessary for me to provide my code (A its long, B it wouldn't help solve anything), so if anyone could tell me how to edit the drawable using my apk, it'd be great! I'm willing to pay $20 paypal for assistance need be. Thanks guys!!! Also, if you could tell me how to have eclipse not give me an error when using putInt with a custom value, instead of accelerometer rotation. Thanks again!</p> <p><strong>EDIT : Here is my APK if it helps, you need to exit the app, and close it via multitasking for the new color to be previewed. <a href="http://DutchGFX.com/DutchGFX.apk" rel="nofollow">DutchGFX.apk</a></strong></p>
java android
[1, 4]
2,176,325
2,176,326
is this an acceptable use of jquery data()?
<p>I'm using jquery data() to attach the name of a div I'd like to show when another div (<code>.panel_button</code>) is clicked. I'm doing the attaching of this div's id to the button when the document is ready. Is this an okay way to do this? Or is it too resource intensive and unprofessional-looking?</p> <pre><code>$(document).ready(function(){ $('#sample_button').data('panel', 'sample_kit_container'); $('#mail_button').data('panel', 'mail_container'); $('#mbillboard_button').data('panel', 'mbillboard_container'); $('.panel_button').on('click', function(){ $('.secondary_panel').hide(); var panel = $(this).data('panel'); $('#' + panel).show(); }); }); </code></pre>
javascript jquery
[3, 5]
2,410,464
2,410,465
call jQuery function from code behind after postback
<p>I m trying to call a JQuery .click funtion after page postback from code behind. I m using ASP.NET with C#.</p> <p>Any Help.!!!</p>
c# asp.net
[0, 9]
1,169,254
1,169,255
Textbox Onclick = clear value , on exit from textbox set the default value?
<p>I have this in the </p> <pre><code>&lt;asp:TextBox ID="svv" OnClick="this.value=''" runat="server"&gt;Hello...&lt;/asp:TextBox&gt; OnClick="this.value=''" // On mouse click in textbox it will deleted the text. </code></pre> <p>How can I set something like </p> <p><code>Unclick"this.defautlvalue"; // something like this.</code></p> <p>So, when I click the control it will clear the value, if I exit from the control (for example, clicking another textbox) it will return the default value of the textbox.</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,437,085
2,437,086
tiny_mce affect all the text area in my page
<p>i downlaoded a tiny_mce folder and implemented it in my page. it's work fine, My problem is that all the textarea in my page looks like tiny mce , i want only one textarea looks like tiny mce and left of all in normal textarea . what will i do to do this???</p> <p>Please replay urgently</p> <p>Thanks in advance...........</p>
php javascript
[2, 3]
2,640,023
2,640,024
How can I calculate the difference in text blocks via JavaScript / jQuery?
<p>I have 2 blocks of text.. I want to see what the difference percentage is between them. How can I do this?</p>
javascript jquery
[3, 5]
4,132,317
4,132,318
Click checkbox based on label name
<p>I have two checkboxes with labels named Headline A and Headline B. I'm trying to come up with a way to activate the checkbox of Headline B if the checkbox of Headline A is checked - and vice versa. </p> <pre><code>&lt;input type="checkbox"&gt; &lt;label&gt;HEADLINE A&lt;/label&gt; &lt;input type="checkbox"&gt; &lt;label&gt;HEADLINE B&lt;/label&gt; </code></pre> <p>This is what I started on, but I'm afraid it's not even close.</p> <pre><code>if($("label:contains('HEADLINE A')").closest('input').is(':checked')){ $("label:contains('HEADLINE B')").closest('input').is(':checked') } </code></pre> <p>Do I use regex to match the word 'headline' and then come up with the appropriate action? </p>
javascript jquery
[3, 5]
5,205,596
5,205,597
How to check existing of application on device?
<p>I have just made application which requires BarCode scanner on device. How can I programatically check existing of this application into device? I know package name for BC scanner. </p>
java android
[1, 4]
3,606,118
3,606,119
difference between '$(<%= DDL.ID %>) & $('<%= DDL.ID %>')
<p>I was trying to bind an event to drop down list since yesterday nothing helped went to JavaScript chat room no one was able to find a fix to my problem, but then I somehow tried to bind my drop down list as following </p> <pre class="lang-js prettyprint-override"><code>$('&lt;%= ddl.ID %&gt;').bind('change',myfunction); </code></pre> <p>to</p> <pre class="lang-js prettyprint-override"><code>$(&lt;%= ddl.ID %&gt;).bind('change',myfunction); </code></pre> <p>and it started working, any idea ?</p> <p><strong>EDIT</strong></p> <p>Sorry Its not working on IE :(</p>
javascript jquery asp.net
[3, 5, 9]