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
682,427
682,428
How do I find if an element contains a specific class?
<p>I need to check if an element contains a certain child class using JQUERY.</p> <p>I tried:</p> <pre><code>if ($('#myElement').has('.myClass')) { do work son } </code></pre> <p>Didn't work.</p> <p>My html code is laid out like this:</p> <pre><code>&lt;div id="myElement"&gt; &lt;img&gt; &lt;span&gt;something&lt;/span&gt; &lt;span class="myClass"&gt;Hello&lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,756,805
5,756,806
Use of Response.Redirect in C#
<p>I am working on a website that I inherited (ASP.NET and C#), and I noticed that in almost EVERY method in the code behind of the project pages (except some helper methods), the original author uses Response.Redirect() to redirect to a page (typically home.aspx, but not always).</p> <p>What is the purpose of doing this? It seems unneeded to me - at least it doesn't appear to change anything the website is doing if I keep it in or remove it.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
3,886,511
3,886,512
using javascript .preventDefault() inside an asp server control
<p>I am having an asp.net sever control as below</p> <pre><code>&lt;asp:HyperLink Visible='&lt;%# (GetAnswer(Eval("AnsQID"))) != 1 %&gt;' ID="HyperLink1" runat="server" NavigateUrl="#" ToolTip='Like this answer' onclick="javascript:(likeThis(this))"&gt;Like &lt;/asp:HyperLink&gt; </code></pre> <p>I am handling this onclick event on the client side by passing to the function on the client side as shown. Here is the "likeThis" function on the client side</p> <pre><code>function likeThis(e) { e.preventDefault(); // how do I get the event arguments as e ? var controlBar = ($(e).parents('div[class="group"]').children('p[id="controlBar"]')); } </code></pre> <p>I want the click event to be preventing the default behavior. So can you advise me on how to do that . Thanks</p>
javascript jquery asp.net
[3, 5, 9]
2,130,515
2,130,516
Previewing TIF documents on the Web (.Net C#)
<p>I am looking for a way to display TIF documents on a web page. It basically needs to render a Multi-page TIF in some form of container on a web page.</p> <p>Do I need a control or is there a simple way to build something like this? Is there any free stuff that we could simply implement?</p> <p>I have looked at the <a href="http://www.telerik.com/products/reporting.aspx" rel="nofollow">Telerik reporting</a> product which apparently contains a Tif viewer. I haven't looked into the licensing for this though. (If I only need the TIF Viewer, do I need to purchase the entire reporting solution?</p> <p>Our biggest issue at the moment (like always) is that we have a very tight deadline with very little available resource. This product will be installed at a client so ActiveX controls that request user permission to install are less than ideal.</p> <p>Any suggestions and/or comments would be welcome.</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,344,137
2,344,138
Prevent jQuery from traversing parts of document
<p>I am working on a website with heavy use of Ajax request that build up a tab based structure in the DOM. My concern is that the DOM will accumulate so many tabs and elements that JQuery selectors will eventually perform poorly.</p> <p>Is there a way to maintain a large DOM, but offer JQuery a "hint" to exclude certain sections. For example I would like to maintain the elements in the DOM, but only have my JQuery selectors apply to the active tab.</p> <p>I was hoping there would be some sort of "ignore" tag that I could dynamically apply to inactive sections</p> <p>Perhaps it's an alternative to store the inactive tab elements in the data dictionary, and bring them in and out of the DOM as they come into focus.</p>
jquery asp.net
[5, 9]
4,934,045
4,934,046
Is there a replaceWholeText Equivalent in jQuery? - How to replace TextNode
<p>Is there a way in jQuery to replace only the textNode of an element without destroying any child DOM elements?</p> <pre><code>&lt;a href="#"&gt;&lt;span&gt;Text we don't want replaced&lt;/span&gt; Text we want replaced&lt;/a&gt; </code></pre> <p>When using <code>jquery.text([content])</code> it will replace any child nodes as well as the text content. Thus resulting in...</p> <pre><code>&lt;a href="#"&gt;Replaced Text&lt;/a&gt; </code></pre> <p>To get around this issue, I use the javascript function: replaceWholeText, but is there a better more jQuery-esque way of doing this?</p> <pre><code>$('a.button')[0].lastChild.replaceWholeText('Replacement Text'); </code></pre> <p>Second question: Will this work in all browsers?</p> <p>jsfiddle example showing both the jQuery and Javascript methods: <a href="http://jsfiddle.net/highwayoflife/ABfMS/1/" rel="nofollow">http://jsfiddle.net/highwayoflife/ABfMS/1/</a></p>
javascript jquery
[3, 5]
153,419
153,420
How to Click and Drag Columns Using JQuery - Example Included
<p>I'm trying to create a similar effect to the one seen <a href="http://www.pubdesign.com.br/" rel="nofollow">here</a>.</p> <p>I've looked through their Javascript and I feel like it's very specialized to their website. Besides, I don't want to steal hard-earned code.</p> <p>How does one create the effect where the columns can be click and dragged in and out of frame, as well as scroll on mouseover using the mousewheel?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
940,913
940,914
Asp.net same page but different content depends on user
<p>I have a page that needs to have different content depending on if the user is an Owner of a profile, or if the user is a visitor of another user's profile.</p> <p>How do I show different content based on the current user?</p>
c# asp.net
[0, 9]
3,039,904
3,039,905
Jquery droppable live disabling/enabling
<p>I have a some draggables in a list of droppables (1 draggable per droppable li). </p> <p>When I move a draggable from one droppable to another free droppable, I want to diable the receiving droppable, and enable the droppable it is leaving from. </p> <p>In firebug the droppable class gets removed – but the functionality of the droppable remains. I have a feeling I need to use live() somehow, but could use a leg-up.</p> <pre><code>$(function() { $(".user").draggable({ revert : true, revertDuration : 200 }); $("li.droppable").droppable({ accept : ".user", hoverClass : "drophover", drop: function(event, ui) { var position = this.getAttribute("id").replace("position_", ""), user_id = ui.draggable.attr("id").replace("user_", ""); droppable = this parent = ui.draggable.parent() $.ajax({ url : "users/"+user_id+"", type : "POST", dataType: "JSON", data : ({ "position" : position, "_method" : "PUT" }), success : function() { $(ui.draggable).parent().addClass("droppable"); $(ui.draggable).appendTo(droppable); $(parent).removeClass("droppable"); } }); } }); }); </code></pre>
javascript jquery
[3, 5]
1,569,136
1,569,137
css() function call failing silently?
<p>I am having a strange problem with the css() function. Here's my code snippet.</p> <pre><code>console.log('' + $(this).css('left') + ':' + $(this).css('top')); console.log('Desired position - ' + return_to_left + ':' + return_to_top); $(this).css('top', return_to_top + 'px'); $(this).css('left', return_to_left + 'px'); console.log('Finally: ' + $(this).css('left') + ':' + $(this).css('top')); </code></pre> <p>The output I get on the console is this.</p> <pre><code>458px:2113px Desired position - 448px:2102px; Finally: 458px:2113px; </code></pre> <p>Could anyone suggest why this might be happening? I have tried experimenting with '!important'. Doesn't help.</p> <p>(Also, for context, this code is part of a callback function after an animation. It tries to position the element back to where it was before animation began.)</p> <p>Thank you for your help.</p>
javascript jquery
[3, 5]
5,253,773
5,253,774
ASP .NET - RequiredFieldValidator creates space after textbox
<p>I have a DetailsView with a number of textboxes setup with RequiredFieldValidators.</p> <p>The code for both is:</p> <pre><code>&lt;InsertItemTemplate&gt; &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("date_time") %&gt;'&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="TextBox1" ErrorMessage="Please update date_time." ValidationGroup="InsertDetailsView1"&gt;*&lt;/asp:RequiredFieldValidator&gt; &lt;/InsertItemTemplate&gt; </code></pre> <p>The problem is that the validation control is now creating a space (ie <br>) between the textbox and the one below it. How do I get rid of the space? Is it a CSS thing?</p> <p><img src="http://i40.tinypic.com/24zykuw.jpg" alt="alt text" /></p>
c# asp.net
[0, 9]
4,905,230
4,905,231
Coverting MS Word documents to HTML
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/253834/convert-doc-to-html-in-php">Convert .doc to html in php</a> </p> </blockquote> <p>I want to know how can I convert word to html so that I can embed it in a web page. I want to use php (I prefer it). How can this be achieved?</p>
php javascript
[2, 3]
4,878,376
4,878,377
Converting Some Code to jQuery
<p>Hey guys, I have some code that I found that I would rather use as jQuery instead of direct JavaScript. Hopefully you guys can help me convert it:</p> <pre><code>var sub = document.getElementById('submit'); sub.parentNode.removeChild(sub); document.getElementById('btn-area').appendChild(sub); document.getElementById('submit').tabIndex = 6; if ( typeof _some_var != 'undefined') { document.getElementById('some-textarea').value = _some_var; } document.getElementById('something').style.direction = 'ltr'; </code></pre> <p>The reason I want to do this is because FireFox is telling me that <code>sub</code> is null when it is used on the second line. This happens because that code runs before the the <code>submit</code> button appears. So naturally I would like to use jQuery for the purpose of running the code after everything is ready. Yes, I know it's possible to do that in direct JavaScript as well, but I would rather have jQuery either way.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,429,139
2,429,140
how can i stop my sound file from being auto download in php jquery
<p>i have following code in my php jquery call...</p> <pre><code>&lt;object type="application/x-shockwave-flash" data="mysounds/player.swf" id="audioplayer1" height="1" width="1"&gt; &lt;param name="movie" value="mysounds/player.swf" /&gt; &lt;param name="FlashVars" value="playerID=audioplayer1&amp;autostart=yes&amp;soundFile=mysounds/online.mp3" /&gt; &lt;param name="quality" value="high" /&gt; &lt;param name="menu" value="false" /&gt; &lt;param name="wmode" value="transparent" /&gt; &lt;/object&gt; </code></pre> <p>and i have internetdownloadmanager installed on my pc</p> <p>when ever i try to load the page it start downloading the sound with internetdownloadmanager how can i stop that....and prevent it from auto downloading from any downloader...</p>
php jquery
[2, 5]
4,773,882
4,773,883
how is it calculated?
<p>I want to know why the answer of this script is </p> <pre><code>var h1Array = $('h1').first().text().split(' '), h1Last = h1Array[h1Array.length-1], answerElem = $('#jschl_answer'); answerElem.val(22+14*10); answerElem.val(parseInt(answerElem.val())+(h1Last.substr(0,h1Last.length-1)).length); </code></pre> <p>what is the sum of this? i know that 10*14 = 140 + 22 = 162 but why in this case the sum is 179</p> <p>so from where we got the extra 17?</p> <p>Another example</p> <pre><code>var h1Array = $('h1').first().text().split(' '), h1Last = h1Array[h1Array.length-1], answerElem = $('#jschl_answer'); answerElem.val(46+36*8); answerElem.val(parseInt(answerElem.val())+(h1Last.substr(0,h1Last.length-1)).length); </code></pre> <p>sum = 347 while the sum of answerElem.val(46+36*8); is actually equals to 334 so from where we got the extra 13?</p> <p>Thank you in advance.</p>
javascript jquery
[3, 5]
1,799,638
1,799,639
How to update views in activity with data from another thread?
<p>I need to update views in activity every 1-2 seconds with data that i must get from the other thread. How can i do that ? I was reading about broadcast receiving, but i can`t imagine how to do that in my case. Can you ,please , give me some example with it, hope with comments ) Thanks, P.S. Sorry for clumsy english.</p>
java android
[1, 4]
3,182,607
3,182,608
Getting source code from page AFTER jQuery function in PHP
<p>I'm trying to get the source code from <a href="http://www.cinesion.ch/horaires" rel="nofollow">this page</a>, to get the code of the timetables, and then parse it. </p> <p>But when I fetch it with <code>file_get_contents</code>, the <code>div</code> I'm looking for is <strong>empty</strong>. I searched in the code, and it looks like it's filled with <code>jQuery</code> when to body is loaded.</p> <p>So my question is : how can I get the source code of the page after the jQuery is executed ?</p> <p>Thanks.</p>
php jquery
[2, 5]
5,753,557
5,753,558
Dynamically generate a <li>?
<pre><code>&lt;span id="n-email" class="email-btn"&gt;&lt;a href="#."&gt;&lt;/a&gt;&lt;/span&gt; </code></pre> <p>On clicking this, a list item with a text field shows</p> <pre><code>&lt;li id="new" class="select"&gt; &lt;a&gt; &lt;input type="text" id="emails" class="add-email" value="Untitled" onfocus="if(this.value=='Untitled'){this.value=''}" onblur="if(this.value=='') {this.value='Untitled'}"/&gt; &lt;/a&gt; &lt;/li&gt; </code></pre> <p>Suppose I filled something in this input field and press enter.<br> On pressing enter I want to fire a event which would</p> <ol> <li>Remove the <code>&lt;li&gt;</code> containing the input field.</li> <li><p>Insert new <code>&lt;li&gt;</code> in its place, like</p> <pre><code>&lt;li&gt; &lt;a href="#."&gt; //here comes the value what we entered in the input field of above li// &lt;/a&gt; &lt;/li&gt; </code></pre></li> </ol>
javascript jquery
[3, 5]
3,360,250
3,360,251
Show or Hide div from label Click
<p>I have three labels having folowing code on all with different ids and three divs with different ids</p> <pre><code>&lt;asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()"&gt;&lt;/asp:Label&gt;&amp;nbsp; </code></pre> <p>here is div code for all</p> <pre><code>&lt;div id="DIV_CA" runat=server align="center" visible="false" style="background-color:#f3f3f3; text-align: left; width: 500px; height: 470px; overflow:auto;"&gt;Some data&lt;/div&gt; </code></pre> <p>I want to make a show or hide mechanism from label click can anyone tell me how can i do this that when i click a label then the a specific div should show and others should hide and when i click next label the its coresspondent div should show.</p> <p><strong>UPdate</strong> This is My Script Code</p> <pre><code>&lt;script type="text/javascript"&gt; function hideshow(span) { var div = document.getElementById("DIV_" + span.id); if (div.style.display == "none") div.style.display = "block"; else div.style.display = "none"; } &lt;/script&gt; </code></pre> <p>and here is lablel code</p> <pre><code>&lt;asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()" onclick="hideshow(this)" &gt;&lt;/asp:Label&gt;&amp;nbsp; </code></pre>
javascript asp.net
[3, 9]
5,147,557
5,147,558
How to make Android emulator boot faster
<p>I'm currently stuck with using Atom CPU desktop for my Android app development. What are the ways to improve its boot time. When running the emulator I can see that the number of cores used by the emulator is just one, I'm running the emulator from within the Eclipse ADT plugin. </p> <ul> <li>How can I make the emulator use two cores instead of just one?</li> <li>What are the emulator setting that will make boot faster?</li> </ul> <p>My android project will be mainly a PhoneGap + jQuery android app.</p>
java android
[1, 4]
712,215
712,216
hidden field value using javascript/ jquery
<p>I have a page where I am loading a another page and a js file. The child page has a hidden field</p> <pre><code> &lt;input type="hidden" name="eventOk" id="eventOk" value="" /&gt; </code></pre> <p>This child page has a an event which is setting value of this variable:</p> <pre><code>function onEndClientCallBack(sender, eventArgs) { $('#eventOk').val('5') alert('1 value is' + $('#eventOk').val()); } </code></pre> <p>The alert is showing that value is set properly. Now I want to use this value inside the js file which is loaded in the frame but when I alert the value it shows blank value. how can I set the value in aspx page and use in js file ?</p> <p>Please suggest. Thanks.</p>
javascript jquery
[3, 5]
3,538,541
3,538,542
Checking if an ASP page is dirty before asking user if they want to leave
<p>I have a ASP.NET form and it has a bunch of user inputs, text boxes, checkboxes, etc. I need to be able to check if the user has made an edit on the form without saving and if so prompt then beforeunload. </p> <p>I have a dirty flag that set once the user edits one of the text boxes. If they save the data on the form then I reset the flag. Therefore the flag should only ever be set when the user edits but has not saved.</p> <p>I then use this flag to decide whether or not to prompt the user “Are you sure you want to leave this page?”</p> <p>Code snippet:</p> <pre><code>var _isDirty = false; $(function () { try { $("#MainContent_txtSometextBox").change(function () { _isDirty = true; }); } catch (e) { } }); </code></pre> <p>The problem is I don’t want to have to set this on every control. Is it possible to set it at a page level? I don’t think it will be that easy as we also have custom user controls on the page.</p>
javascript jquery asp.net
[3, 5, 9]
5,550,530
5,550,531
Pass array of strings via jquery post to ASP.net
<p>What I have is a table that holds 3 input elements, They represent order, name, value. The user can add a new row of 3 inputs to add as many of these sets of data as they want.</p> <p>To accomplish the dynamically adding in of inputs I use jquery's clone method.</p> <p>That works fine and I am able to iterate through each and grab the values, however the real pain I am having is that when the user has entered in all of the data I want to pass that data to an asp.net page through jQuery's post method. How do I go about passing an array of strings so that I send this format to the asp.net page, and when I've done that how do i parse the data on the asp.net side of it.</p> <p>Desired Data Format:</p> <p>["Name|Link|Order", "Name|Link|Order", "Name|Link|Order"]</p> <p>jquery Code so far:</p> <pre><code>$("#saveBtn").click(function (e) { e.preventDefault(); $("#addPanel").slideUp(300); //Perform Save Operation var saveString = ""; $("#addTable tbody&gt;tr").each(function () { var o = $(this).find(".hsaorder").val(); var n = $(this).find(".hsaname").val(); var l = $(this).find(".hsalink").val(); saveString += n + "|" + l + "|" + o ; }); ////// Create Array here or some other method? $.post("/modules/H/Modify.aspx", { OBVIOUSLY SOMETHING GOES HERE}); // Remove all but top table element to return to original state $("#addTable tbody&gt;tr").not("#addTable tbody&gt;tr:first").remove(); }); </code></pre>
c# asp.net jquery
[0, 9, 5]
3,444,234
3,444,235
A Better way? Finding ASP.NET controls, finding their id
<p>I have a method that finds all the controls, iterates through them, determines if they are a textbox,drop down list, etc.. retrieves their ID name, and depending on the ID name it will set a boolean statement (thus I would know if that section of the form is complete, and will email to a certain group of people) unfortunetly this is done with too many if statements and was wondering if I could get some help making this more manageable</p> <pre><code>protected void getEmailGroup() { Control[] allControls = FlattenHierachy(Page); foreach (Control control in allControls) { if (control.ID != null) { if (control is TextBox) { TextBox txt = control as TextBox; if (txt.Text != "") { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } if (control is DropDownList) { DropDownList lb = control as DropDownList; if (lb.SelectedIndex != -1) { if (control.ID.StartsWith("GenInfo_")) { GenInfo = true; } if (control.ID.StartsWith("EmpInfo_")) { EmpInfo = true; } } } } } } </code></pre>
c# asp.net
[0, 9]
385,089
385,090
Translate <body onload function to Javascript function?
<p>Hello guys can you help me to translate this function same functionality just in other way? Because of CloudFlare (CDN) my code isn't working and it will most likely will if to change the approach I'm using.</p> <p>Here is the code: </p> <pre><code> &lt;body onload=\"javascript:document.aa.submit();\"&gt; </code></pre> <p>Anything in javascript or jquery will be great.</p>
javascript jquery
[3, 5]
3,097,733
3,097,734
passing parameters to an event handler
<p>In jquery how can you pass additional parameters to an event handler function?</p> <p>So for example</p> <pre><code>mySaveFunction: function(i) { var msg = "my message " + i; $.ajax({ ... success: this.successFunction, // i want to pass msg to successFunction ... }); successFunction: function(response) { // do something with msg }, </code></pre>
javascript jquery
[3, 5]
2,527,981
2,527,982
Prevent toggle all items
<p>I have this line of code in an for loop:</p> <pre><code>echo '&lt;toggle_me style="display: none"&gt;&lt;img align="center" src="images/icon/pdf_mail.png" /&gt;&lt;/a&gt;&lt;/toggle_me&gt;'; </code></pre> <p>With this jQuery:</p> <pre><code>&lt;script&gt; $("img").click(function () { $("toggle_me").toggle(); }); &lt;/script&gt; </code></pre> <p>Ofcourse this toggles all images, how can I only toggle the one clicked?</p>
php jquery
[2, 5]
5,850,733
5,850,734
Fetch data which is in between html tags
<p>I have a word document. When I upload that document, I need to fetch the name from that. I always have the name in the first row, the data in the word document is like,</p> <pre><code>Shanish K [email protected] ..... ...... </code></pre> <p>For this, I just converted the word file to html, and from that am trying to read the name. Once I converted the word file am getting the <code>style defenitions</code> also along with the actual content. I dunno how to get only the data which is there in the <code>first row</code>. Can anyone help me out here. Thanks in advance...</p> <p>note:- I noticed something when I was debugging, that the actual contents are in between paragraph tags like <code>&lt;p .....&gt;Shanish&lt;/p&gt; .....,</code> is is possible to fetch the data in between the first <code>&lt;p&gt;&lt;/p&gt;</code> ?</p>
c# asp.net
[0, 9]
1,923,470
1,923,471
Storing data in session using jquery and accessing that value in PHP
<p>How can I store data in session or cookie using jquery or JS and access it in php?</p>
php javascript jquery
[2, 3, 5]
2,109,981
2,109,982
can I use both php and java for a same web application
<p>I want to use php in place of jsp/servlets for my web app whose service layer and database layer has been written in java. It is possible to do so? If yes, can a web hosting server run both of them simultaneously?</p>
java php
[1, 2]
2,294,901
2,294,902
Detect change in URL hash usining JavaScript
<p>I'm working on a simple application which is single page based (due to project restrictions) and has dynamic content. I understand the dynamic content alright but what I don't understand is how to setup a script that changes the html of a div when the hashtag in the URL changes.</p> <p>I need a JavaScript script to work as such:</p> <p>Url: <code>http://foo.com/foo.html</code> div contents: <code>&lt;h1&gt;Hello World&lt;/h1&gt;</code></p> <p>Url: <code>http://foo.com/foo.html#foo</code> div contents: <code>&lt;h1&gt;Foo&lt;/h1&gt;</code></p> <p>How would this work?</p> <p>Please help! Thanks.</p>
javascript jquery
[3, 5]
842,297
842,298
How to share objects between activites, serialization or SingleInstance?
<p>I have certain data in the data model class and want to share this data/object to the other activity. Single Instance could be a good choice but want to finish my previous activity and hence will got null pointer. Please Suggest the best possible way to do it?</p>
java android
[1, 4]
603,345
603,346
jquery paging records and cookie data
<p>Im paging records of data with filter paramters that is stored in a cookie if i select a data record and go to that record and i go back to the paged data the page loads the cookie and and loads the last place where i was in filtering and paging the records the thing is if i were to go any where else in the application and then go back to the records that i previously paged it will always load that data from the cookie does anyone get my senario it needs to be reset again at some point what should i do.</p>
jquery asp.net
[5, 9]
2,357,320
2,357,321
print copyright symbol in TextView
<p>I am parsing the xml which has copyright symbol in some tag which i'm getting as String and displaying it on TextView. But instead of symbol it is printing #174; . Can anyone tell that how can I print appropriate symbol.</p> <p>EDIT: It is like this in xml <strong>Raghav©</strong> and i want to display it like this, but it is displaying only <strong>#174;</strong></p>
java android
[1, 4]
4,948,742
4,948,743
Python csv.reader() to JS?
<p>I have a python code such as :</p> <pre><code>import csv reader = csv.reader(open('myText.txt', 'r'), delimiter=",") for row in reader: print row[0] + 'is' + row[1] + '&lt;/br&gt;' </code></pre> <p>I look for a similar action/code[1] <strong>in JS or JQuery</strong>. The name of this action is welcome too. I'am exploring JS and wondering if there is a way do get an online/offline csv, parse it, iterate, inject some HTML in my website accordingly.</p> <p>[1]: more precisely I look for a JS translation of <strong>reader = csv.reader(open('myText.txt', 'r'), delimiter=",")</strong> , I can manage the rest.</p> <p><strong>Note:</strong> myText.txt will be <a href="https://raw.github.com/cburgmer/cjklib/master/cjklib/data/pinyinipamapping.csv" rel="nofollow">this online file</a></p>
javascript jquery python
[3, 5, 7]
1,700,667
1,700,668
Validating script pasted in a field
<p>I want to add a textarea field to my website where users can paste a whole script into it and save it.</p> <p>What I'm worried about is users trying to inject other code into the field.</p> <p>This is how the script would look ... ID and hex would change but nothing else:</p> <pre><code>&lt;script type="text/javascript"&gt; var advertvars_vars = { pubid: '00000000000', // publisher id bgcolor: '804296', // background color (hex) text: 'FFFFFF', // font-color (hex) test: true }; &lt;/script&gt; &lt;script type="text/javascript" src="http://mysite.com/static/ad.js"&gt;&lt;/script&gt; </code></pre> <p>My question is...Is there anyway of validating that the user is pasting valid code as above?</p>
php javascript
[2, 3]
3,322,300
3,322,301
How parseInt get its value
<pre><code>parseInt('bcedfg',16) </code></pre> <p>Base on this code I am getting <em>773855</em> in a JavaScript,</p> <p>I go through the conversion table , and not sure how to get this "773855" value</p> <p>my question is how parseint come out with this "773855" value , because I wanted to translate this tiny code in to a c# code , and is that any similar way in c# allow me to get this "773855" value</p>
c# javascript
[0, 3]
4,801,282
4,801,283
Hiding element after firing click handler
<p>Say I have the following code to add a clickable image after a set of elements. The click handler fires every time the image is clicked which is not what I want. I guess hiding the image using .hide() in the click handler is one approach but I can't figure out how to refer to the img element in the click handler.</p> <p>Help? Thanks</p> <pre><code> $(...) .after($('&lt;img src="..."/&gt;') .css("cursor","pointer") .attr("title","Click here for ...") .click(function(){ ... } </code></pre>
javascript jquery
[3, 5]
4,269,256
4,269,257
get number of hours between start and end time(HH:MM) 24Hr
<p>Hai am new to javascript, I have two textboxes with start and end time How to calculate the number of hours between two times which are in 24 hr format (HH:MM)</p>
javascript jquery
[3, 5]
4,428,050
4,428,051
Javascript sort with function not working on iPhone
<p>When calling sort(function) in Javascript on an iPhone it doesn't seem to sort. For example:</p> <pre><code>devices.sort(function(a, b) { return a.name &gt; b.name; }); </code></pre> <p>Are there some known limitations or can someone help me how to do this on an iPhone. It seems to work fine in Chrome, IE, Firefox.</p>
javascript iphone
[3, 8]
4,462,735
4,462,736
jquery select all textboxes in a listview
<p>I have a listview which is databound to X items. On a submit button click I would like to use jquery to go through the listview rows and do basic form validation. This validation isn't systems critical so I am not worried about someone manipulating or sending back malicious scripts. It is things like, you must have a firstname,lastname. So on and so forth. </p> <p><strong>Any ideas on how to do this in jquery without using the clientID (lvBob$ct10$txtName) would be great. Thank you very much</strong></p> <p>Sorry question seems to be a little ambigious</p> <p>To eleberate I would like to iterate over X amount of rows with X amount of columns that are rendered in a listview. Validate each column based on my buisness logic and spawn an error message for each failure to validate.</p> <p>Psuedocode</p> <pre><code>for each row in Listview { row.txt1 != null {return "error message"} } </code></pre> <p>But I would like to do this in jquery.</p>
jquery asp.net
[5, 9]
4,643,809
4,643,810
Returning to previous page
<p>If a user is making an edit and clicks cancel, how can i return them to the page before the edit was made? Not jus refering them back to the previous page, but referring them back to how it was before they decided to edit.</p> <p>If i need to me more thorough please ask.</p> <p>I used this code but it just refers back to the previous page. I had a previous thread about a problem but couldnt find the solution.</p> <p>When a user clicks add new row button it opens up the new row in a edit and cancel form. If the user clicks cancel it automatically adds the row as blank, I dont want that I want the row to be deleted. I was thinking if I could set it to return to its orginal form before the new row was created oit would work the same way.</p> <pre><code> protected void gv_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Insert") //- this is needed to explain that the INSERT command will only work when INSERT is clicked { dbcon.Execute("INSERT INTO PROJ_ASP (TRANS_CD) VALUES('')", "ProjectASPConnectionString"); gv.DataBind(); gv.EditIndex = gv.Rows.Count - 1; gv.DataBind(); } } protected void gv_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { ///When cancel is clicked, redirect page to orginal page Response.Redirect("Default.aspx"); </code></pre> <p>I actually think I understand what my issue is, the way I setup it up is anytime the user clicks INSERT it automatically adds a blank row into the database REGARDLESS if its empty. What can i do to not allow it to insert it into the database until all rows are complete? Im assuming its a code i would be placing under gv_RowCommand</p>
c# asp.net
[0, 9]
4,881,537
4,881,538
How can we set the background color in datatable through code-behind?
<p>I am binding my data in a datatable and then bind that datatable into a datagrid. I want that some rows of the datatable should be highlighted with some color. How can we do that from code-behind? </p>
c# asp.net
[0, 9]
2,326,157
2,326,158
jQuery create function and call it on each separately
<p>Hey guys I'm trying to create a function and call it inside another each loop. I got it to work, but the each loop is not working. So I tried to add an extra <code>$(this)</code> and it didn't work either...any help is appreciated.</p> <pre><code>.moveClass { position:relative; } $(function() { $('.a_projectLoad').each(function(evt){ $(this).hover(function(){ $(this).slideRight(); }); }); }); function slideRight () { $('.img_rightArrow') .addClass('moveClass') .animate({"left": "+=50px"}, "fast"); } &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="#" class="a_projectLoad"&gt;Title Goes Here&lt;/a&gt;&lt;/td&gt; &lt;td &gt;&lt;img src="images/btn_loadProject.png" class="img_rightArrow"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="#" class="a_projectLoad"&gt;Title Goes Here&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;img src="images/btn_loadProject.png" class="img_rightArrow"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
771,152
771,153
How to get the top position of an element?
<p>Is possible with javascript/jquery to get the top position of an element? </p> <p>The element is a table, if that matter.</p>
javascript jquery
[3, 5]
3,392,146
3,392,147
Get a sibling div with specific class and is not disable
<p>I want to find a div with a class associated with it, but it must not be disabled. I am using following code for getting the next sibling, but it will return the next element with the "menuDiv" class.</p> <pre><code>var nextDiv=jQuery('div.subMenuBarhover').nextAll('.menuDiv:first'); </code></pre> <p>but now I need the element which is not disable and id of all element is unkown.</p> <p>How can I achieve this?</p>
javascript jquery
[3, 5]
1,055,099
1,055,100
Is it okay to include many .js files to make my code look modular?
<p>I have a page where almost all functions were using Ajax request. I have so many lines of js code. Is it a good practice to dissect my js codes and just include it in my page, for example:</p> <pre><code>&lt;script src="../js_code_func_1.js"&gt;&lt;/script&gt; &lt;script src="../js_code_func_2.js"&gt;&lt;/script&gt; &lt;script src="../js_code_func_3.js"&gt;&lt;/script&gt; &lt;script src="../js_code_func_4.js"&gt;&lt;/script&gt; &lt;script src="../js_code_func_5.js"&gt;&lt;/script&gt; </code></pre> <p>Will there be any bad performance effect if I do this?</p> <p>Thanks! From a JavaScript noob..</p>
javascript jquery
[3, 5]
5,957,915
5,957,916
Access a resource name programmatically
<p>I have many string arrays in my resource files, and I want to access them programmatically depending on user input. </p> <pre><code>int c = Getter.getCurrentNumber(); String[] info = getResources().getStringArray(R.array.n_&lt;c&gt;); </code></pre> <p>So if c==12, info should be the string-array with name "n_12". Is there a way to do this, and avoiding to do a switch statement with hundreds of cases?</p> <p>Thanks</p>
java android
[1, 4]
2,437,643
2,437,644
PHP work with JS Jquery
<p>How do i make PHP work with JS? I mean more like, i want to check if the user is logged in or not, and if he is then it will: $("#message").fadeIn("slow"); ..</p> <p>How should i do this? I have an idea maybe have a file that checks it in php, and then it echo out 1 or 0.</p> <p>And then a script that checks if its getting 1 then do the message fade in.. But im not as so experienced to script that in JS</p>
php javascript jquery
[2, 3, 5]
4,188,748
4,188,749
Kinda like dynamic function in java/android
<p>I am coming from PHP to Java and I have some questions about "dynamic" functions. </p> <p>Kinda like in php where you can do an <code>include(VARNAME.".php");</code> and if varname is <code>a</code> it'll include <code>a.php</code> if its <code>x</code> it'll include <code>x.php</code>. </p> <p>I wanna do that in Java but with functions.<br> Kinda like I have a varname and I want to include a function. So if varname is <code>Test</code> it'll include <code>test()</code> but I have a bunch of functions and its a nuisance to do </p> <pre><code>if(varname == "x"){ x(); }. </code></pre> <p>Is there any easy way to do it?</p>
java android
[1, 4]
2,913,080
2,913,081
Trying to fetch ID from inside of repeater
<p>Inside a repeater there's a list of addresses ..when address link button is clicked, the address is shown inside of text boxes above repeater with all text boxes greyed out and an Edit button is rendered on the page OUTSIDE the repeater and below the text boxes..Now how do I edit this address ?</p> <p>I need the AddressID of the address that has been clicked inside the repeater...</p> <p>when Address link is clicked,DisplayAddress command event is fired inside of repeater's ITemCommand so what I did was assigned "AddressID" generated(when Adress link was clicked inside repeater) to a globally decalred string variable and tried to use that inside my Edit Button's click event so as to fill the Datasource(Method used to fill data source requires AddressID) and do stuff...didnt work</p>
c# asp.net
[0, 9]
3,252,481
3,252,482
javascript foo.call(object) vs. object.foo()
<p>i was looking on the <a href="https://github.com/jquery/jquery/blob/master/src/core.js" rel="nofollow">jQuery source code</a> and then i saw that they use <code>foo.call(context)</code> instead of <code>context.foo()</code>.<br> for example- assuming <code>this</code> is array they use:</p> <pre><code>return slice.call( this ); </code></pre> <p>instead of:</p> <pre><code>return this.slice(); </code></pre> <p>what is the difference and is it the prefer way (in terms of performance) doing those calls?</p>
javascript jquery
[3, 5]
2,293,865
2,293,866
how do use $.post() in jquery?
<p>The program run successful and update the data in Database, but it's didn't display jquery message ("success") under the save button. Processing time "status bar display error logo". So i double click the logo, the error message is "Permission denied". So i thought the error may be in $.post(). Please check my code and give idea to solve the problem. jQery code:<br></p>
php jquery
[2, 5]
1,537,818
1,537,819
Bind click handler with variables in scope when created?
<p>I'd like to create a list of items dynamically in jQuery, and dynamically bind a click handler to each one, with the variables in scope at the moment the click handler is created. </p> <p>The code below creates a list of items from 1-6, but the click handler only seems to bind with the value of the final item - the alert always shows 6. </p> <p>Is this a JavaScript scope problem? How can I bind the alerts with variables from 1-6?</p> <p>HTML:</p> <pre><code>&lt;ul id="saved-list"&gt; &lt;/ul&gt; </code></pre> <p>JS:</p> <pre><code>var all_cookies = [1,2,3,4,5,6]; for (var i = 0; i &lt; all_cookies.length; i++) { var route_num = all_cookies[i]; var list_item = "&lt;li&gt;&lt;a href='#saved-route'&gt;"; list_item += "&lt;p&gt;" + route_num + "&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;"; var newLi = $(list_item); newLi.bind('click', function(){ alert(route_num); }); $('#saved-list').append(newLi); } </code></pre> <p>See jsFiddle here: <a href="http://jsfiddle.net/n6FU5/" rel="nofollow">http://jsfiddle.net/n6FU5/</a></p>
javascript jquery
[3, 5]
5,982,172
5,982,173
How to make this code more useful (preventing special characters in textarea)
<p>i am using this code and working fine but the problem with this code is, its not optimized and for an example if i want to add few more characters then i will end-up having ifs.... </p> <pre><code>if (keychar == "#" || keychar == "!" || keychar == "$" ..........) </code></pre> <p>is there a way to optimized this code? meaning less ifs (if i need to add more special characters to prevent)</p> <pre><code> &lt;script language="javascript" type="text/javascript"&gt; function check(e) { var keynum var keychar var numcheck // For Internet Explorer if (window.event) { keynum = e.keyCode } // For Netscape/Firefox/Opera else if (e.which) { keynum = e.which } keychar = String.fromCharCode(keynum) //List of special characters you want to restrict if (keychar == "'" || keychar == "a") { return false; } else { return true; } } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,642,600
1,642,601
calculations and probably approach getting the better with slider, advice really required
<p>I've created a slider consisting of a list of panels, basically when the code loads I want to work out some calculations and present .active dead center of #wrapper, then when you click a panel i want to basically position that .active panel dead center of the page. At the moment my calculations are way off and I'm not completely sure how to achieve this effect. Im basically working out the #wrapper width, the clicked items left offset, the arrows widths and trying to work with these to position .slides left property. If anyone could help it would be greatly appreciated.</p> <p>JS</p> <pre><code>slides_li.not('.dummy').on('click', function() { var off = $(this).offset(), off_left = off.left, calc = -(wrapper_w - off_left - arrow_w); console.log(off_left, arrow_w, calc); $(this).parent().css('left', calc); gep.toggle_slides(this); }); </code></pre> <p><strong>Fiddle is here</strong> : <a href="http://jsfiddle.net/E5GSM/21/" rel="nofollow">http://jsfiddle.net/E5GSM/21/</a></p>
javascript jquery
[3, 5]
2,195,969
2,195,970
How to escape "[" character in jQuery code
<p>I'm trying to set some values in some INPUT elements but my code doesn't work. See the code below:</p> <pre><code>&lt;?php foreach($languages as $language): ?&gt; $('input[name="product_description\\[&lt;?php echo $language["language_id"]; ?&gt;\\]\\[name\\]]"').val(data.items[0]['volumeInfo']['title']); $('input[name="product_description\\[&lt;?php echo $language["language_id"]; ?&gt;\\]\\[description\\]]"').val(data.items[0]['volumeInfo']['description']); &lt;?php endforeach ?&gt; </code></pre> <p>The HTML markup looks like this:</p> <pre><code>&lt;input type="text" value="" size="100" name="product_description[1][name]"&gt; </code></pre> <p>What's wrong there? jQuery doesn't return any error and data.items[0]['volumeInfo']['title'] has values so what I'm doing wrong?</p>
php javascript jquery
[2, 3, 5]
2,022,787
2,022,788
how to read array data without assigned to array variable
<p>I have a file <code>data.json</code>. It has following data</p> <pre><code>[ "101 200", "102 201", "102 202", "103 202" ] </code></pre> <p>How can I read this data using javascript? Notice it is not assigned to any variable and the name of the file ended up with <code>.json</code> but the data inside doesn't look like json data.</p>
javascript jquery
[3, 5]
4,388,784
4,388,785
Learning JAVA for android
<p>Hi I'm interested in creating applications for android but I have no knowledge of java programming. So what I wanna know is that should I first go through java tutorials or should I learn java specifically for android? Cause I've read that they have some major differences.</p>
java android
[1, 4]
5,272,570
5,272,571
how to mark row on gridview by any value?
<p>i have gridview that contain:</p> <pre><code>Fname|Born aa |03/05 bb |19/01 cc |03/08 dd |19/01 </code></pre> <p>if today is: <code>19/01/2011</code> how to mark in red color the 2 rows that Satisfies the condition ?</p> <p>in C# asp.net</p> <p>thanks for any help</p>
c# asp.net
[0, 9]
1,167,519
1,167,520
Need random virtual keyboard in asp.net
<p>Hi all i need a virtual keybopard to be displayed when user selects an option as use virtual keyboard. This keyboard should be generated randomly for each time i selects the option</p>
c# asp.net
[0, 9]
5,622,282
5,622,283
TextView setText from another class
<p>My problem is that i've a tabhost with two tabs. The first is a listview and the second only have two textviews.</p> <p>What i want is when i click on an item in the listview on tab one, the array position id (int) should be sent to tab/class two, where there is an array who fetches a text by the position id that was sent.</p> <p>The switching of tabs is done, but i fail everytime i try to send the position-id.</p> <p>This is how i send it:</p> <p>TAB ONE:</p> <pre><code>//This function is called when i click a listitem public void setDetails(String Text, long arr_id){ Detail detail = new Detail(); detail.setDetail(); // right now i don't send the parameters because it wont even work with or without it. } </code></pre> <p>TAB TWO:</p> <pre><code>TextView descr; TextView title; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail); descr = (TextView)findViewById(R.id.desc); title = (TextView)findViewById(R.id.title); } public void setDetailText(String Text){ descr.setText(Text); } public void setDetailTitle(String Text){ title.setText(Text); } public void setDetail(){ this.setDetailTitle("example text"); this.setDetailText("example text2"); } </code></pre> <p>I want to set the text on tab two BEFORE it switch to tab two. This works if i use SetDetail() and setDetailTitle() in the same tab/class, but not in another.</p> <p>I've googled my ass off, please help me </p>
java android
[1, 4]
5,698,864
5,698,865
Single Instance Login Implementation
<p>I am facing a serious problem in my project (a web application built in ASP.NET 2.0) explained below.</p> <p>Let say I have given userid “singh_nirajan” and A user say “User1” logged into the system using this userid. Now my requirement is whenever other user let say User “User2” try to log in to the system using same (singh_nirajan) userid, it will show a message that “singh_nirajan already logged in”.</p> <p>In order to implement the same, I just update a flag in database. Similarly, we update the flag in database whenever user logout properly. And we have also handled few scenarios when user will not properly log out as follows.</p> <ol> <li>Browser close by clicking (X) close</li> <li>Session Timeout</li> <li>On Error</li> </ol> <p>But somehow user gets logged out abruptly because of network failure, power failure or any such reason. I am not able to update the flag in database that is why user is not able to log in using same userid until and unless we update that flag manually.</p> <p><strong>Reason for above implementation:</strong></p> <p>Sometime a user open multiple browser and started heavy processing task in different browser, many of times they share their user id and password which sometime invite concurrency problem. In order to restrict this, we need to implement the single instance login.</p> <p>Can any one suggest me any other approach to implement the above.</p> <p>Thanks in advance. </p>
c# asp.net
[0, 9]
31,369
31,370
StreamReader C# - read only a specific line
<p>I am trying to log only 3rd line (or lines 1 to 3 if logging just one line is not possible) from a webResposne.</p> <p>here is a snippet of the code that I am using for now.</p> <pre><code>StreamReader read = new StreamReader(myHttpWebResponse.GetResponseStream(), System.Text.Encoding.UTF8); String result = read.ReadToEnd(); Log("Access", Server.HtmlEncode(result), "Success"); </code></pre> <p>I am getting the following output</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Access is Granted.&lt;/title&gt; &lt;style&gt; body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } ... </code></pre> <p>and so on.</p> <p>I would just like to log "(title>Access is Granted.(/title>" and not print anything else (or anything after that line).</p> <p>How would I go about doing that?</p> <p>Thank you</p>
c# asp.net
[0, 9]
4,276,062
4,276,063
Is it possible to check whether a request is from <script> tag in PHP?
<pre><code>&lt;script src="test.php"&gt;&lt;/script&gt; </code></pre> <p>I want my <code>test.php</code> executed only when it's from <code>&lt;script&gt;</code>, is it possible?</p>
php javascript
[2, 3]
5,353,018
5,353,019
Google Nexus 4.0.4 USB HOST UsbDeviceConnection.bulkTransfer() returns -1 every time
<p>I have a problem with my galaxy nexus 4.0.4. I try to connect to my Device over the USB. I have done all initializations without failure. The <code>UsbDeviceConnection.controlTransfer()</code> function works fine in both directions.</p> <p>However if I call <code>UsbDeviceConnection.bulkTransfer()</code> it always returns -1.</p> <p>Has anyone encountered the same issue? If code is mandated I'll post it!</p> <p>If I use <code>UsbRequest.queue()</code> following with <code>UsbDeviceConnection.requestWait()</code>, the same problem occurs and no data will be transfered.</p> <p>If I try to communicate with the named function that doesn't work because my device doesn't generate an interrupt. It looks like no data leaves the Android device with these functions!</p> <p>I hope to get some answers or help!</p>
java android
[1, 4]
3,469,468
3,469,469
jQuery reversing the direction of an effect
<pre><code>$("#left_image1").delay('1000').animate({width:'toggle'}, 1000); </code></pre> <p>This causes the element to collapse in such a way that it appears to be moving off the LEFT side of the screen. How can I reverse the effect so that the element appears to be moving off the right side of the screen?</p>
javascript jquery
[3, 5]
4,091,685
4,091,686
create bitmap with alpha from multiple drawables
<p>I am drawing multiple resources onto a bitmap via a canvas. I would like the end result of the composite image to have a certain alpha. Right now I'm setting paint's alpha to the level i want and then drawing each bitmap with that alpha, but i know this would create a composite image of a lot of different alphas. Is there a way to apply an alpha to the entire composite image in performance friendly manner?</p>
java android
[1, 4]
4,851,134
4,851,135
select option error on server side, but runs on client side
<p>I have selection box and it has values and <strong><a href="http://jsfiddle.net/marafee1243/NLGPT/" rel="nofollow">client example</a></strong></p> <p>and i have server code as below</p> <pre><code> &lt;select name="customer_id" id="customer_id"&gt; &lt;?php get_customer_list_options(); ?&gt; &lt;/select&gt; | &lt;input id="customer_name_from_sel" type="text" /&gt; </code></pre> <p>and below jquery code</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#customer_id").bind('change', function() { var k = $("#customer_id option:selected").attr("title"); $("#customer_name_from_sel").val(k); }); });​ &lt;/script&gt; </code></pre> <p>and function code</p> <pre><code>function get_customer_list_options() { $fquery39 = mysql_query("select User_ID, First_Name, Email_ID from customers"); while($r39 = mysql_fetch_row($fquery39)) { echo "&lt;option value='$r39[0]' title='$r39[1]' &gt;$r39[2]&lt;/option&gt;"; } } </code></pre> <p>Now when i run the code from jsfiddle, runs perfectly, while on server page, its not working out. And i have already working jquery libraries are good.. in perfect state.</p> <p><strong>the value attr <code>title</code> is not displayed on text <code>customer_name_from_sel</code></strong></p> <p>Below is the image output of HTML code.</p> <p><img src="http://i.stack.imgur.com/bLW3z.png" alt="enter image description here"></p> <p>Error image</p> <p><img src="http://i.stack.imgur.com/Mz7Ll.png" alt="enter image description here"></p>
php jquery
[2, 5]
1,608,414
1,608,415
How to catch a given user ID to display different Activity in Login?
<p>with this Login form, an admin with (ID: 001) should get a 'AdminActivity' whereas every other userID should get a 'UserActivity', and this is the code. It's not returning the adminID for some reason. Thank you</p> <pre><code>btnLogin.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { UserFunctions userFunction = new UserFunctions(); String id = inputId.getText().toString(); String pswd = inputPassword.getText().toString(); JSONObject json = userFunction.loginUser(id, pswd); try { if (json.getString(KEY_SUCCESS) != null) { loginErrorMsg.setText(""); String res = json.getString(KEY_SUCCESS); if(Integer.parseInt(res) == 1){ DatabaseHandler db = new DatabaseHandler(getApplicationContext()); JSONObject json_user = json.getJSONObject("user"); if(id == "001"){ // Launch Admin Activity Intent tab1 = new Intent(getApplicationContext(), AdminActivity.class); // Close all views before launching requestActivity tab1.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(tab1); } // Clear all previous data in database userFunction.logoutUser(getApplicationContext()); db.addUser(json_user.getString(KEY_ID), json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json_user.getString(KEY_CREATED_AT)); // Launch User Activity Intent tab = new Intent(getApplicationContext(), UserActivity.class); // Close all views before launching requestActivity tab.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(tab); }else{ loginErrorMsg.setText("Incorrect username/password"); } } } catch (JSONException e) { e.printStackTrace(); } } }); </code></pre>
java android
[1, 4]
5,836,645
5,836,646
adding values to the dropdownlist via loop in asp.net
<p>I'm developing web-application, in this I want to add all months values on the client side browser in registration form.</p> <p>I'm doing it manually by adding all months' values one-by-one. I want to know is it possible to add all months with by putting one for loop in my code or not.</p> <p>Suggest me if it's possible.</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,773,247
2,773,248
Context Menu with TabHost issue
<p>I have a TabHost with 2 Fragments, both lists. The onCreateContextMenu works fine for both, but both onContextItemSelected are "pointing" to the first Fragment class. I'm using different names for the lists in the XML files, so the ID isn't the same.</p> <p>Here is the code for both onCreateContextMenu</p> <pre><code>@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; int itemID = info.position; Map m = (HashMap) this.listView.getAdapter().getItem(itemID); menu.setHeaderTitle(getString(R.string.options)); menu.add(0, v.getId(), 0, activity.getString(R.string.delete)); } </code></pre> <p>And here onContextItemSelected for the first Fragment, second one is pretty much the same code just changing var names. In fact this doesn't change anything to the question, since this method only runs on the first Fragment, even when I'm on the second list.</p> <pre><code>@Override public boolean onContextItemSelected(MenuItem item) { ContextMenuInfo menuInfo = (ContextMenuInfo) item.getMenuInfo(); AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; int itemID = info.position; Map m = (HashMap) this.listView.getAdapter().getItem(itemID); processId = Integer.parseInt(m.get("processId").toString()); activity.setSupportProgressBarIndeterminateVisibility(true); runBackground(activity.getString(R.string.accessingECM), false, false, ACTION_REMOVE); return true; } </code></pre> <p>This is how I register for context menu on the onActivityCreated method. Note that the onCreateContextMenu works for both Fragment.</p> <pre><code>listView = (ListView) this.view.findViewById(R.id.listProcess); registerForContextMenu(listView); </code></pre> <p>I tried to change the menu.add() 1st and 3rd parameters to (1,1) and (1,2). Also tried both to be Menu.NONE. Still doesn't work.</p> <p>Thanks</p>
java android
[1, 4]
5,603,364
5,603,365
iPhone PHP integration
<p>I want to make an iPhone application that send some data to php web site. </p> <p>Which is the best way to do it? Someone know how application like facebook do it? I can avoid to use SSL?</p> <p>Thanks!</p>
php iphone
[2, 8]
4,375,284
4,375,285
How can I get event of Wi-Fi appearing?
<p>I need to make Android application which should send some data into my server every night. If wi-fi connection is absent application should send data when connection become avaiable automatically. Why can I get event about wi-fi availability? Should I use broadcast receiver? Please, give me an example or idea. Thank you </p>
java android
[1, 4]
4,745,668
4,745,669
What's an easy way to truncate an array with Jquery?
<p>Linq has a convenient operator method called Take() to return a given number of elements in anything that implements IEnumerable. Is there anything similar in jQuery for working with arrays?</p>
javascript jquery
[3, 5]
4,199,138
4,199,139
Save dataset value as an integer
<p>I have a dataset that has just one column and one row. It gives me an integer. I have to save it in an other integer. I am a learner. please help me out! Thanks!</p> <pre><code>Dataset pds; if (pds.Tables[0].Rows.Count &gt; 0) { int Islocationcount = pds.Tables[0].Columns[0].ColumnName[1]; } </code></pre>
c# asp.net
[0, 9]
1,954,006
1,954,007
Detect if iPhone is rotating as it's rotating?
<p>I have the following code which will update the background image of my page when you rotate it a certain way:</p> <pre><code>window.onorientationchange = function() { var orientation = window.orientation; switch (orientation) { case 0: $(".bg-img").css("background-image", "url(" + portrait + ")"); break; case 90: $(".bg-img").css("background-image", "url(" + landscape + ")"); break; case -90: $(".bg-img").css("background-image", "url(" + landscape + ")"); break; }; };​ </code></pre> <p>This works, but when the page is rotated, it takes a few seconds to load the new image, and causes the page to look odd.</p> <p>Is there anyway to detect that the orientation is changing, instead of changed? Something like <code>willAnimateFirstHalfOfRotationToInterfaceOrientation</code>?</p>
javascript jquery
[3, 5]
2,280,125
2,280,126
browser back button issue in c#
<p>In my application browser back button is taking user to previous page though user is logged out. i want to prevent this. Browser back button should work properly for logged in user and i don,t want to disable cache.</p>
c# javascript
[0, 3]
1,049,042
1,049,043
How does Wordpress handle HTML Tables interaction with jQuery
<p>I have javascript that gets the width of a table and reduces the css fontsize of text within the table until the table width is less then the width of its parent div.</p> <p>The code bellow shows the principle ONLY.</p> <p>This approach works out side Wordpress. Within Wordpress the fontsize is reduced to 0px and the width of the table width shrinks, but remains wider than the width of its parent.</p> <p>Outside wordpress the browser adjust the table width to fit the text.</p> <p>So how does Wordpress handle HTML Tables different?</p> <pre><code>function ShrinkTable() { var FontSize = parseInt($("#tbl").css('font-size').replace('px', ''),10); var TabWidth = jQuery("#tbl").width(); var DivWidth = jQuery("#narrorColumn"); if (parseInt(DivWidth.css('width').replace('px', ''),10) &lt;= TabWidth) { jQuery("#tbl").css('font-size', FontSize - 1 + 'px'); /* you can change 4 with any number, the smaller is better but it may require more loop */ //Shrink the font while div width is less than table width ShrinkTable(); } } </code></pre>
jquery javascript
[5, 3]
10,640
10,641
$("*") with exception?
<p>A long time ago a friend made this for me:</p> <pre><code>$(".rnd1").click(function(){ $("*").click(function (event) { event.stopPropagation(); $(this).fadeOut(); }); $('#random-button').hide(); $('#recover-button').show(); }); </code></pre> <p>now i would like to protect some elements (like body and #recover-button) from fading out.</p>
javascript jquery
[3, 5]
2,416,505
2,416,506
How to select all values in drop down list by clicking a button using jQuery?
<p>If I use this </p> <pre><code>$("select option").attr("selected", "true"); </code></pre> <p><strong>Or</strong></p> <pre><code>$(function(){ $('select').children('option').attr('selected', 'selected'); }); </code></pre> <p>the list of dropdown will be selected automatically.</p> <p>But in my position I should not use Iterator. Here both function using iterator. Here each and every option we set true or selected through iterator. </p> <p>I need like if I set true to object of list, all the value of list should be selected without using loop or iterator.</p>
javascript jquery
[3, 5]
555,942
555,943
how to change value of progress bar
<pre><code> temp_volume=temp_volume-2; if(temp_volume&lt;0) { temp_volume=0; } else { $('#inchat li.'+name_of_inchatting_class).css('height','97px'); $('#volume strong').text(temp_volume); //$('#volume progress').attr("value")=temp_volume; } &lt;html&gt; &lt;div id="volume"&gt; &lt;strong&gt;60&lt;/strong&gt; &lt;progress max="100" value="60"&gt; &lt;/progress&gt; &lt;/div&gt; &lt;/html&gt; </code></pre> <p>I am trying to change the status of progress bar when the event happens What is a right code to put in else condition statement? Any thought? Thank you.</p>
javascript jquery
[3, 5]
1,591,743
1,591,744
State storage in GridView
<p>gridview has 20 pages. The user is see first gridview page . He decide to apply highlite style using jquery on few row . Now he move to second page . He apply style this page too. Now when he go back to first page, he cannot see row with style he apply before he move to page 2.</p> <p>How to store state of the rows style when user moving on pages? Perdon my English</p>
asp.net jquery
[9, 5]
3,612,265
3,612,266
Replacement of the complex character string
<p>The string is "hi\how \ r\ u\" and need to replace "\" with the space.</p> <p>String stringToModify = "hi\how \ r\ u\";</p> <p>stringToModify = stringToModify .replace("\\", "");</p> <p>System.out.println(stringToModify ); </p>
java android
[1, 4]
6,025,443
6,025,444
Error when trying to stream file for download using ASP.NET
<p>Below is my code to download at client when user click on a download link</p> <pre><code>Response.AppendHeader("Content-Disposition", "attachment; filename=.pdf"); Response.TransmitFile(FileName); Response.End(); </code></pre> <p>Content Types are of different: pdf,word,swf,.zip,ppt,xls</p> <p>But i'm getting the same issue as attached<img src="http://i.stack.imgur.com/O7yN1.png" alt="enter image description here">.</p>
c# asp.net
[0, 9]
5,495,747
5,495,748
jQuery hover functions IE error
<p>I've been having some difficulty with jQuery hover functions. Proberbly as a result of staring at the same code for far too long, but perhaps someone can help.</p> <p>I have the following function:</p> <pre><code> $("#div1").mouseover(function () { $("#div2:hidden").show(); }); $("#div1").mouseout(function () { $("#div2:visible").hide(); }); </code></pre> <p>Which I have also tried as:</p> <pre><code> $("#div1").hover(function () { $("#div2:hidden").show(); }, function() { $("#div2:visible").hide(); }); </code></pre> <p>Neither work AT ALL in IE. Everything I write using ANY mouseover, hover, mouseout or any other "mouse" function causes errors in IE. With other browsers it is perfect and what's more annoying is it occasionally works in IE, for instance on occasion the first and second time it will work - then it will error.</p> <p>Any help would be fantastic!</p>
javascript jquery
[3, 5]
117,559
117,560
jQuery JS scroll to top on click works only once?
<p>I'm trying to make a page scroll to top when a link is clicked. Heres what I got so far.</p> <pre><code>&lt;script&gt; jQuery(document).ready(function () { jQuery("ul.pager a").click(function() { scroll(0,0); return false; }); }); &lt;script&gt; </code></pre> <p>Problem with that code is that it works only on first click.</p> <p>How to make it work every time I click on a link?</p>
javascript jquery
[3, 5]
5,604,193
5,604,194
How to use javascipt to create auto refresh data only for Repeaters in asp.net?
<p>I want to do a mail system in inbox with function auto refresh in repeaters only for data.How to do it?</p> <pre><code> &lt;asp:Repeater ID="Repeater1" runat="server" DataSourceID="dsInbox"&gt; &lt;ItemTemplate&gt; &lt;tr id="trInbox" class="normal" style='cursor:pointer; font-weight:&lt;%# StyleBold(Convert.ToBoolean(Eval("inbRead")) ) %&gt;' onclick='selectedRow(this,&lt;%# Eval("INBID") %&gt;)' onMouseOver="if(this.className!='selected') this.style.backgroundColor='#E2E1F4';" onMouseOut="if(this.className!='selected') this.style.backgroundColor='#FFFFFF'"&gt; &lt;td width="370px" height="25px"&gt;&lt;div align="left" class="style95"&gt;&amp;nbsp;&lt;%# DisplaySubject(Eval("inbSubject").ToString(), Eval("inbMsg").ToString())%&gt;&lt;/div&gt;&lt;/td&gt; &lt;td width="80px" height="25px"&gt;&lt;div align="left" class="style95"&gt;&amp;nbsp;&lt;%# Eval("inbCreatedAt","{0:MM-dd-yyyy}") %&gt;&lt;/div&gt;&lt;/td&gt; &lt;td width="94px" height="25px"&gt;&lt;div align="left" class="style95"&gt;&amp;nbsp;&lt;%# Eval("inbCreatedAt","{0:hh:mm:ss tt}") %&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre>
javascript asp.net
[3, 9]
3,399,394
3,399,395
insert an element at a certain time of the day
<p>what is the best way to do something , like inserting an element at a certain time of the day ? should I use setTimeout() os is there a better way to do it ?</p>
javascript jquery
[3, 5]
1,361,036
1,361,037
Doing this with a for cycle
<p>And now a very easy java question....</p> <pre><code> Object[] objectList={ new Object(name[0], description[0], R.drawable.creep_0), new Object(name[1], description[1], R.drawable.creep_1), new Object(name[2], description[2], R.drawable.creep_2), new Object(name[3], description[3], R.drawable.creep_3), }; </code></pre> <p>How can i do this dynamically with a <code>for</code> cycle? Thanks!</p>
java android
[1, 4]
2,599,863
2,599,864
Javascript setting Date to previous year from the current year
<p>i want to show jquery calendar dates from 1st september 2010 to current date. </p> <p>for example</p> <p>consider if i am spooling a report on 12th january 2011 ,i should allow jquery calendar selection from 1st september 2010 to 12th janyary 2011 .My question is how to set the date to 1st sep 2010 from current date (if current date is january 11th 2011) i.e next year. I want to get the date from the server and set in the javascript.</p> <p>Currently i get the minimum date from serverside java like this</p> <pre><code>minDate = new Date(); // timestamp now Calendar cal = Calendar.getInstance(); // get calendar instance cal.setTime(minDate); // set cal to date cal.set(2010,cal.SEPTEMBER,1); minDate = cal.getTime(); </code></pre> <p>the output would be 20100901</p> <p>but i dont want to hardcode 2010 in the code , i want a generic code that takes 1st sep 2010 as minimum even when i execute on january 2011.</p>
java javascript jquery
[1, 3, 5]
5,947,988
5,947,989
Display in a toast array list
<p>How do i display my array list in a toast.. This is the code i have, but it's not displaying the full items in the array..what is my problem?</p> <pre><code>public static EditText txt1; String ag; public static ArrayList&lt;String&gt; playerList = new ArrayList&lt;String&gt;(); String playerlist[]; /** Called when the activity is first created. * @param Public */ public void onCreate(Bundle savedInstanceState, Object Public) { super.onCreate(savedInstanceState); setContentView(R.layout.screen2); // edittext1 or textview1 txt1 = (EditText) findViewById(R.id.editText1); ag = txt1.getText().toString(); //add more items button Button more = (Button) findViewById(R.id.button1); more.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (txt1.getText().length() != 0) { String ag = "Current Added Players:," + txt1.getText().toString() + txt1.getText().toString(); playerList.add(ag); Toast.makeText(getBaseContext(), ag, Toast.LENGTH_SHORT).show(); Intent myIntent = new Intent(view.getContext(), Screen2.class); myIntent.putExtra("Stringarray", playerList); //startActivityForResult(myIntent, 0); } } }); } </code></pre>
java android
[1, 4]
2,551,952
2,551,953
jQuery reduce the width from left to right
<p>Hello I have a DIV that has a width of 500px.</p> <p>I am trying to reduce the width with an animation from 500px to 0px and from 0px to 500px again.</p> <p>There is only a problem, that the DIV is reduced starting from the right to the left.</p> <p>I want the opposite thing.</p> <p>From the start the width will be reduced and animated from left to right, and then will be increased from 0px to 500px starting from right to left.</p> <p>How can I do it with jQuery?</p> <p>Thanks for any help</p> <p><strong>EDITED</strong></p> <pre><code>function animateText(px) {  $('#slidetext').animate({   'width' : px  }); } </code></pre>
javascript jquery
[3, 5]
5,547,072
5,547,073
how to remove text between <script> and </script> using python?
<p>how to remove text between <code>&lt;script&gt;</code> and <code>&lt;/script&gt;</code> using python?</p>
javascript python
[3, 7]
3,379,789
3,379,790
Iterate through repeater
<p>There's this repeater...</p> <pre><code> &lt;asp:Repeater ID="myRepeater" OnItemCommand="rpt1_ItemCommand" runat="server" OnItemDataBound="rpt1_OnItemDataBound"&gt; &lt;HeaderTemplate&gt; &lt;table width="99%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tr class="lgrey"&gt; &lt;td&gt;Default&lt;/td&gt; &lt;/tr&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:LinkButton ID="lnk1" Text="Make Default" CommandName="SetDefault" runat="server" Visible="True" CommandArgument='&lt;%#Eval("UserID") %&gt;' CausesValidation="false"&gt;&lt;/asp:LinkButton&gt; &lt;asp:Label ID="label1" Text="Yes" runat="server" Visible="False"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/table&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>What I want is that when user clicks on any of the "lnk1" link button in the lsit that repeater renders, the link should be replaced with the label "label1"..ie when the user clicks on "Make Default" link, it should be replaced with "Yes" label</p> <p>Now when I click 2 link buttons, both get their label "Yes" displayed where as I want only one link button to display Yes ie the one which has been clciked and rest of the items should display "Make Default" link button only.</p> <p>ie Only ONE item should be displaying "Yes" label...now how do I iterate through the repeater items to set only ONE item as default and not multiple ??</p>
c# asp.net
[0, 9]
3,598,576
3,598,577
"return false;" for form submission is not working
<p>"return false;" for form submission is working for the rest of my code, just not this section. Any ideas why?</p> <pre><code>function checkForm() { $("select[name*=lic_company]").each(function() { if($(this).val() != '') { var i1 = $(this).parent("td").next("td").children("select"); var i2 = i1.parent("td").next("td").children("input"); var i3 = i2.parent("td").next("td").children("input"); if(i1.val() == '') { i1.parent("td").addClass("formErrorTD"); i1.addClass("formError"); alert("You must enter a state for this license"); return false; } if(i2.val() == '') { i2.parent("td").addClass("formErrorTD"); i2.addClass("formError"); alert("You must enter an expiration date for this license"); return false; } if(i3.val() == '') { i3.parent("td").addClass("formErrorTD"); i3.addClass("formError"); alert("You must enter a license number for this license"); return false; } } }); } </code></pre> <p>and it's being called by</p> <pre><code>$("#addAgentForm").submit(checkForm); </code></pre>
javascript jquery
[3, 5]
2,724,921
2,724,922
Crop image using a crop tools to crop
<p>I have a piece of code as below: I want to crop image with 4 attributes:</p> <blockquote> <p><code>top, left, width, height</code></p> </blockquote> <p>I can alert to see <code>top,left,width,height</code> correctly as where I want to crop, but when I click the button <code>#crop</code>, it doesn't crop to the location where I have alerted. Any solution will be appreciated. Thank you.</p> <pre><code>$(document).ready(function (e) { $("#crop").click(function () { var canvas = document.getElementById("Mystore1"); var context = canvas.getContext("2d"); var top = $('#face').offset().top; var left = $('#face').offset().left; var width = $('#face').width(); var height = $('#face').height(); var destX = top; var destY = left; var destwidth = width; var destheight = height; alert(top); alert(left); alert(width); alert(height); var imageSrc = '../../../Public/Pictures/Sample Pictures/Desert.jpg'; var imageObj = new Image(); imageObj.onload = function () { context.drawImage(imageObj, top, left, width, height, destX, destY, destwidth, destheight); }; imageObj.src = imageSrc; }); }); </code></pre>
javascript jquery
[3, 5]
4,544,675
4,544,676
Send and Receive TCP socket android client
<p>I wrote c# client-server application, server is sending data using socket.send(byte[]) and receive using socket.receive(byte[]) now i want to send and receive from android and totally new to android.</p> <p>i appreciate any kind of help.</p>
c# java android
[0, 1, 4]
45,962
45,963
Replace strings in native .exe using c#
<p>how can I catch all strings from a native windows .exe file and replace them later with others using c# ?</p> <p>Background: I want to create a c# tool to extract and replace strings from a simple .exe file.</p> <p>Is this possible somehow?</p>
c# c++
[0, 6]
1,630,184
1,630,185
Need to position div element outside document area not working
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4531489/position-element-through-css">Position element through css</a> </p> </blockquote> <p>Im have a problem with css positioning</p> <pre><code>jQuery(this).css({"left": (jQuery(document).css("left") - jQuery(form).width())}); </code></pre> <p>Im getting an error with this jQuery(document).css("left") i could just put zero but i want to know the correct way of doing it</p>
javascript jquery
[3, 5]