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,230,862
| 1,230,863
|
How to sort a JSON object in javascript or jquery with the following format
|
<pre><code>"attributes": [
"BytesServed",
"Duration",
"UniqueIPAddresses",
"StopEvents",
],
"rows": [
[
"12118931578714",
"160557966.305",
"372",
"193381",
],
[
"248313315029",
"4628315.959",
"350",
"27352",
],
]
</code></pre>
<p>I have 2 arrays, where the first array has keys and the second array is a multi-dimensional array with values. </p>
<p>Is there any pre-defined function in Javascript or jQuery which will give me the values in descending order by passing a key?</p>
<p>I have a solution, but I feel that it is a more costly approach. If anybody has better solution please let me know.</p>
<p>My current solution is -- get the index from the first array and loop through the second array and create a temporary array and then sort that temp array and use it. </p>
|
javascript jquery
|
[3, 5]
|
5,214,276
| 5,214,277
|
Is it better to use .delegate() performance wise?
|
<p>One of the developers I work with began to write all his code this way:</p>
<pre><code>$('.toggles').delegate('input', 'click', function() {
// do something
});
</code></pre>
<p>vs:</p>
<pre><code>$('.toggles').click(function() {
// do something
});
</code></pre>
<p>Are there any performance benefits to doing this?</p>
|
javascript jquery
|
[3, 5]
|
3,013,253
| 3,013,254
|
Why does this code use an .aspx file for JavaScript?
|
<p>I found some old code which I'm not sure I understand completely. The folowing is an .aspx page containing only JavaScript:</p>
<pre><code><%@ Page Language="C#" EnableSessionState="True" CodePage="65001" uiculture="auto" %>
<%
Response.ContentType = "text/plain";
%>
var csBackgroundColor;
function testfx() {
csBackgroundColor.setAttribute('disabled', 'disabled');
}
</code></pre>
<p>and it was referenced like this:</p>
<pre><code><script type="text/javascript" src="filename.js.aspx"></script>
</code></pre>
<p>I'm wondering why it wasn't just marked as completely a JavaScript file? Was it done this way so you could include code blocks? With the file this way, I don't even get IntelliSense.</p>
|
javascript asp.net
|
[3, 9]
|
2,890,277
| 2,890,278
|
Jquery - Too Much recursion
|
<p>Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to latest version of jquery & jquery form and still having same issue. </p>
<p>This is the error in firebug</p>
<p>too much recursion
[Break on this error] (function(){var l=this,g,y=l.jQuery,p=l....each(function(){o.dequeue(this,E)})}});\n</p>
<p>And in IE8 it's a popup error that says "Stack Overflow: Line 12"</p>
<p>Here's the url to the website. Any idea what part of our jquery code could be causing this? </p>
<p><a href="http://www.caromalcolours.com/" rel="nofollow">http://www.caromalcolours.com/</a></p>
<p>thanks</p>
|
php jquery
|
[2, 5]
|
5,159,693
| 5,159,694
|
login using open id authentication
|
<p>I would like to know as in StackOverflow website user can login with open id authentication how it has been done.Can I get any sample example of doing this.</p>
|
c# asp.net
|
[0, 9]
|
2,132,525
| 2,132,526
|
how to get last typed or pasted substring in a text box using javascript
|
<p>i have a scenario i which i want to get the substing that was typed or pasted at the last position in the TextBox </p>
<p>eg: when i type " hello how are you "</p>
<p>-- it alerts for each words ie. </p>
<p>alert 1: hello </p>
<p>alert 2: how </p>
<p>alert 3: are </p>
<p>alert 4: you</p>
<p>but if i paste "HelloHowareYou" it will alert HelloHowareYou</p>
<p>i get the last cursor position by caret function but i am not able to proceed further for getting the last substing from the string . for performance optimisation i dont want to use split function</p>
|
javascript jquery
|
[3, 5]
|
1,486,835
| 1,486,836
|
How to get the numeric value progmatically from the sliderExtender?
|
<p><strong>what I tried:</strong></p>
<p><strong>MarkUP:</strong></p>
<pre><code> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" AssociatedControlID="TextBox2" Text="Label"></asp:Label>
<asp:SliderExtender ID="SliderExtender1" TargetControlID="TextBox2" BoundControlID="Label1" Maximum="200" Minimum="100" runat="server">
</asp:SliderExtender>
</code></pre>
<p><strong>Output:</strong></p>
<p><img src="http://i.stack.imgur.com/CW881.jpg" alt="enter image description here"></p>
<p>now how can I get the value shown "100" progmatically in my C# code ?</p>
|
c# asp.net
|
[0, 9]
|
5,885,312
| 5,885,313
|
Jquery -> vanilla javascript?
|
<p>I am programmer who learning jQuery javascript but never really grasped vanilla javascript (i know I am a naughty programmer). My question is how would I go about replicating this functionality in vanilla JS?</p>
<pre><code>$('select').change(function() {
if($(this).val() == "Other (please specify)") {
$(this).parent().parent().find("input.hidden").show();
}
});
</code></pre>
<p>Any help would be greatly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,888,370
| 4,888,371
|
Invoke anoymous event handler using reflection?
|
<p>I have implemented my own event registration for a client-server UI framework, much like in ASP.NET. I store an event's name (e.g. "<code>Click</code>") in a dictionary and as the value I remember </p>
<p><code>oEventHandler.Method.DeclaringType.AssemblyQualifiedName.ToString() + "." + oEventHandler.Method.Name.</code></p>
<p>Then to reinvoke the event handlers later on, I recreate the delegate:</p>
<pre><code>var oEventHandler = Delegate.CreateDelegate( typeof( BLUIEventHandler ), oPage, sEventMethod, false )
</code></pre>
<p>and invoke it on the page:</p>
<pre><code>oEventHandler.Invoke( oPage, this, oEventArgs );
</code></pre>
<p>This works fine for event handlers that are part of the ASPX page, like</p>
<pre><code>var oTheButton = new UIButton();
oTheButton.Click += this.HandleClick;
private void HandleClick() {}
</code></pre>
<p>but fails for anonymous delegates:</p>
<pre><code>var oTheButton = new UIButton();
oTheButton.Click += delegate {/* Will never be called. */};
</code></pre>
<p>The resulting string for a non-anymous delegate is:</p>
<pre><code>"MyTest.Rene.UI.Foo, BDRS, Version=8.10.1.19703, Culture=neutral, PublicKeyToken=null.HandleClick"
</code></pre>
<p>For an anoymous delegate it is:</p>
<pre><code>"MyTest.Rene.UI.Foo+<>c__DisplayClass1, MyTest, Version=8.10.1.17866, Culture=neutral, PublicKeyToken=null.<OnInitializeLayout>oTheButton__0"
</code></pre>
<p>However when I try to recreate the anonymous delegate, I get a binding error.
Is there a way to get back to the anymous delegate and invoke it?</p>
|
c# asp.net
|
[0, 9]
|
3,030,846
| 3,030,847
|
Inflating a view throws Resources$NotFoundException on physical device
|
<p>The exact error:</p>
<pre><code>07-16 18:34:41.729: ERROR/AndroidRuntime(28347): android.content.res.Resources$NotFoundException: Resource ID #0x7f030001
07-16 18:34:41.729: ERROR/AndroidRuntime(28347): at android.content.res.Resources.getValue(Resources.java:892)
07-16 18:34:41.729: ERROR/AndroidRuntime(28347): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)
07-16 18:34:41.729: ERROR/AndroidRuntime(28347): at android.content.res.Resources.getLayout(Resources.java:731)
07-16 18:34:41.729: ERROR/AndroidRuntime(28347): at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
...
</code></pre>
<p>The call: </p>
<pre><code>LayoutInflater a = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
LinearLayout mainLayout = (LinearLayout)findViewById(R.id.linearLayout1);
mainLayout.removeAllViews();
mainLayout.addView(a.inflate(R.layout.input, null));
</code></pre>
<p>Bottom line throws the error.</p>
<p>The resource ID in the error is <code>R.layout.input</code>, which I'm trying to insert into another LayoutView <code>mainLayout</code>.</p>
<p>What's strange is that it only happens when I debug on my phone, when I run it in an emulator it works perfectly and adds the LayoutView as I want, yet if I try to debug on my phone it comes up with this error.</p>
|
java android
|
[1, 4]
|
645,324
| 645,325
|
C# Disable/Enable Button based on Emtpy/Populated Text Boxes
|
<p>I have a form with 5 text boxes and a button, and when the button is clicked it send the data to a SQL database. I would like the button to be disabled if any of the text boxes are null, how do I do this in C#? (I am in visual studio 2010 ASP.NET web app)</p>
|
c# asp.net
|
[0, 9]
|
3,084,025
| 3,084,026
|
How to access Database which was in APP_DATA
|
<p>I developed a sample for membership and roles using the tutorial available. Now what i need is if i run my example in the other machine i would like to login and access the pages with the user name and password that were created using Asp.Net Configuration in my machine can any one give me an idea to achieve this</p>
|
c# asp.net
|
[0, 9]
|
4,562,751
| 4,562,752
|
Add href to links dynamically
|
<p>I have a series of horizontal div boxes that I need to add the relevant href to link to the next one with anchorlinks. As they are produced dynamically I need to add the href with JavaScript.</p>
<p>The desired effect will be:</p>
<pre><code><div id="post1">
<a class="next-video" href="#post2">NextVideo</a>
</div>
<div id="post2">
<a class="next-video" href="#post3">NextVideo</a>
</div>
</code></pre>
<p>Added the script </p>
<pre><code>$('.next-video').each(function(index) {
$(this).attr('href', '#post' + (index + 2));
});
</code></pre>
<p>but doesn't seem to target the <code>.next-video</code> class, this is the live version:
<a href="http://www.warface.co.uk/clients/detail-shoppe/test-scroll" rel="nofollow">http://www.warface.co.uk/clients/detail-shoppe/test-scroll</a></p>
<p>Many thanks</p>
|
javascript jquery
|
[3, 5]
|
738,805
| 738,806
|
Put a tags round user highlighted text?
|
<p>I need to get the user selected area of a textarea and then insert <code><a></code> tags round it.</p>
<p>I use this to get the user selected area:</p>
<pre><code>var textComponent = document.getElementById('article');
var selectedText;
if (document.selection != undefined)
{
textComponent.focus();
var sel = document.selection.createRange();
selectedText = sel.text;
}
// Mozilla version
else if (textComponent.selectionStart != undefined)
{
var startPos = textComponent.selectionStart;
var endPos = textComponent.selectionEnd;
selectedText = textComponent.value.substring(startPos, endPos)
}
</code></pre>
<p>Now, I know I can do a string search for the user selected text and insert a tags round it, but what happens if that user selected text appears twice in the text, for example.</p>
<blockquote>
<p>Hello to you, goodbye to you.</p>
</blockquote>
<p>If the user highlights the second 'you' for the link they want, surely a string replace would put a tags around every instance of 'you'.</p>
<p>Whats the best way to do this?</p>
|
javascript jquery
|
[3, 5]
|
5,295,334
| 5,295,335
|
Java "events" - nothing more than Interfaces. Why pretend it is Events when it is just a normal Interface and classes that implements that interface?
|
<p>I am mainly developing in .NET C# and I love the Events in C#.</p>
<p>Im now doing som Android stuff and thus must deal with Java. When porting some code from C# to Java I ran into the problem of Events; Java does not have anything that corresponds to C# Events.</p>
<p>So, when reading up on how Java handles "events", the only thing I can conclude is that it doesnt. There is no such thing as "events" in Java. Instead they use normal Interfaces and classes that implement those interfaces.</p>
<p>In Java:
First, you have to first create the Interface
Then, all classes that want to listen to the "event" has to implement that interface.
Then, the class that fires the "event" has to keep a list of all listeners (Array of some sort)
Then, the class that fires the "event" has to have a method so that listeners can add themselves to the Array</p>
<p>And when the firing class decides to "fire the event", it has to iterate through the Array of the listeners, calling the methods.</p>
<p>That is just plain Interface-usage, not Events in my world.</p>
<p>Am I wrong?</p>
|
c# java android
|
[0, 1, 4]
|
1,585,234
| 1,585,235
|
populate drop down list with month/year
|
<p>I have a date and I need to populate a drop-down with the months/years between that date and today. For instance, if that date is 10/14/2010 then the drop-down should contain October 2010, November 2010, December 2010, January 2011.</p>
<p>The way I'm thinking of doing this is to pass that date to a function, loop from today backwards step 1 month while adding each month to a collection until we reach that date and finally return a collection of strings. Then, populate the drop-down control on page load. Finally, use some ajax with a page method to parse back the string and trigger a partial page reload.</p>
<p>I'm just wondering if there's an easy way to do it.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
3,302,101
| 3,302,102
|
Trigger Click event using jQuery
|
<p>I want to trigger an ASP.NET button using jQuery <br>Target button placed in an Updatepanel
<br>jQuery Code :</p>
<pre><code> $(document).ready(function () {
$('.ViewDetail').click(function (e) {
var ID = $(this).parent().parent().attr('ExpID');
$("#hflIdentityID").val(ID);
$("#btnLoadBills").trigger('click');
$("#ExpenseBills").dialog("open");
return false;
});
});
</code></pre>
<p>Mark Up code :</p>
<pre><code><asp:UpdatePanel ID="DetailBillUpdatepanel" runat="server">
<ContentTemplate>
<div id="btnLoadGrid" style="display: none;">
<asp:Button ID="btnLoadBills" ClientIDMode="Static" CausesValidation="false" runat="server"
Text="Button" />
</div>
GridView is Here...
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>Behind Code : </p>
<pre><code>Protected Sub btnLoadBills_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLoadBills.Click
grvExpenseBills.DataSource = tadok.Data.DataRepository.EdlBlpProvider.GetByEdlId(hflIdentityID.Value)
grvExpenseBills.DataBind()
End Sub
</code></pre>
<p>Why event does not fire ?</p>
|
jquery asp.net
|
[5, 9]
|
3,004,219
| 3,004,220
|
Redirecting to multiple pages and showing up a particular page in between
|
<p>I startup with a HTML page then on submit click I redirect a page to a different xyz.aspx page. On the load event of xyz.aspx I write a code:</p>
<pre><code>StreamReader sr = File.OpenText(Server.MapPath("~/ResultXml/Result.xml"));
Response.ClearHeaders();
Response.AddHeader("content-type", "text/xml");
Response.Write(sr.ReadToEnd());
Response.Redirect("abc.aspx");
</code></pre>
<p>now on the page load event of abc.aspx the code is:</p>
<pre><code>Response.ContentType = "text/xml";
Response.AppendHeader("Content-Disposition", "attachment; filename=Result.xml");
Response.TransmitFile(Server.MapPath("~/ResultXml/Result.xml"));
Response.End();
</code></pre>
<p>The problem with the whole process is that I just get the download box dialog and I am unable to show the result file in xyz.aspx with <code>Response.Write()</code>.
the page which remains on the background is the starting HTML page.</p>
|
c# asp.net
|
[0, 9]
|
5,135,122
| 5,135,123
|
Extract HTML from a WebView
|
<p>I want to extract only the Table (TagName: tbody) from the following Webpage: <a href="http://info.tam.ch/custom/stpl_klw.php" rel="nofollow">http://info.tam.ch/custom/stpl_klw.php</a></p>
<p>But it doesn't work. Can somebody help me?</p>
<p>(I used this Tutorial: <a href="http://lexandera.com/2009/01/extracting-html-from-a-webview/" rel="nofollow">http://lexandera.com/2009/01/extracting-html-from-a-webview/</a>)</p>
<p>I tried this:</p>
<pre><code>public class Stundenplan extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Context myApp = this;
class MyJavaScriptInterface
{
@SuppressWarnings("unused")
public void showHTML(String html)
{
new AlertDialog.Builder(myApp)
.setTitle("HTML")
.setMessage(html)
.setPositiveButton(android.R.string.ok, null)
.setCancelable(false)
.create()
.show();
}
}
final WebView browser = (WebView)findViewById(R.id.webView);
browser.getSettings().setJavaScriptEnabled(true);
browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT");
browser.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url)
{
browser.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('tbody')[0].innerHTML+'</head>');");
}
});
browser.loadUrl("http://info.tam.ch/custom/stpl_klw.php");
}
</code></pre>
|
java javascript android
|
[1, 3, 4]
|
3,664,878
| 3,664,879
|
Fading slideshow Javascript
|
<p>There are tons of fading slideshows to copy and paste.. but I want to understand how it all works... So I have this working slideshow in JavaScript. How do I add a fade effect to it? Can it be done by adding the jquery fadeOut() method?
Thanks in advance!</p>
<pre><code>var counter = 0;
function slideShow() {
var pics = [6];
pics[0] = "bilder/1.jpg";
pics[1] = "bilder/2.jpg";
pics[2] = "bilder/3.jpg";
pics[3] = "bilder/4.jpg";
pics[4] = "bilder/5.jpg";
pics[5] = "bilder/6.jpg";
document.getElementById('bildspelsrc').src = pics[counter];
counter++;
if (counter % 6 == 0) counter = 0;
}
setInterval(slideShow,1000);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,086,540
| 2,086,541
|
Date format in c#
|
<p>How can i get below mentions date format in c#.</p>
<pre><code>For 1-Nov-2010 it should be display as : 1st November
For 30-Nov-2010 it should be display as : 30th November
</code></pre>
<p>Can we do using any date format or make a custom function that returns for 1 -> 'st', 2-> 'nd' 3-> 'rd', any date no -> 'th'.</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
1,781,847
| 1,781,848
|
asp.net http handlers and http modules does it work without using IIS?
|
<p>Can i only use HTTP handlers or HTTP modules if i use my ASP.NET website with IIS or NOT?</p>
<p>And besides that, what is actually the main difference between an http handler and a http module??</p>
|
c# asp.net
|
[0, 9]
|
4,517,119
| 4,517,120
|
Access C# Variable From JavaScript
|
<p>I have a public property in my code behind named Tab which I'm trying to access in the pages aspx file with javascript but I'm not sure how to get the right value.</p>
<p>This gives me the value I want</p>
<pre><code>alert('<% Response.Write(this.Tab); %>');
</code></pre>
<p>This does not</p>
<pre><code> var x = <% =this.Tab %>;
alert(x);
</code></pre>
<p>Any ideas?</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
2,983,125
| 2,983,126
|
how to create signup form using jquery in asp.net?
|
<p>i need to create a signup form using jquery like current <strong>Gmail signup form</strong>,
can anyone guide me or give a like to creating like this?</p>
<p>where when we typing something the error comes at right place, </p>
<p>thanks</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
3,964,278
| 3,964,279
|
sending values from android to server
|
<p>I want to set the following code in a start and stop button to send my values to server after every second . so i am wondering how to adopt best strategy for it .should i put in a thread or refresh the activity . please guide me the easy direction to adopt . Thanks</p>
<pre><code>URL url = new URL("http://............./add.jsp?a="+value+"&b="+value+"");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
String line = null;
String response = "";
while ((line = rd.readLine()) != null) {
response += line;
}
wr.close();
rd.close();
</code></pre>
|
java android
|
[1, 4]
|
5,099,631
| 5,099,632
|
Rotate 5 testimonials at a time with jQuery
|
<p>I am looking to show 5 testimonials at a time, and have simple navigation arrows rotate to the next 5 when clicked. I'm still new to JS and jQuery and am having some trouble figuring this oneout. I assume I could create a custom post type for the testimonials, and call them on the front page. But I don't know how to only get a block of 5 show at a time, hide the remainder, and have them go through a "slider". Any suggestions on jQuery plugins or how to start coding this? I've searched through a number of plugins and haven't come up with a proper solution. </p>
|
jquery javascript
|
[5, 3]
|
5,535,459
| 5,535,460
|
Deleting file in asp.net using c#?
|
<p>When I save a document file in my solution explorer, I send that doc file through mail then I am wanting to delete the document file. It is giving an error like this: <code>process being
used by another process</code>. </p>
<p>Below please find my code:</p>
<pre><code>protected void btnsubmit_Click(object sender, EventArgs e)
{
if (Label1.Text == txtverifytxt.Text)
{
if (rdoSevice.SelectedItem.Value == "1")
{
PackageType = ddlindPackages.SelectedItem.Text;
}
else if (rdoSevice.SelectedItem.Value == "2")
{
PackageType = ddlCorpPack.SelectedItem.Text;
}
if (ResumeUpload.PostedFile != null)
{
HttpPostedFile ulFile = ResumeUpload.PostedFile;
string file = ulFile.FileName.ToString();
FileInfo fi = new FileInfo(file);
string ext = fi.Extension.ToUpper();
if (ext == ".DOC" || ext == ".DOCX")
{
int nFileLen = ulFile.ContentLength;
if (nFileLen > 0)
{
strFileName = Path.GetFileName(ResumeUpload.PostedFile.FileName);
strFileName = Page.MapPath("") + "\\Attachments\\" + strFileName;
ResumeUpload.PostedFile.SaveAs(strFileName);
}
sendingmail();
FileInfo fi1 = new FileInfo(strFileName);
ResumeUpload.FileContent.Dispose();
Label2.Visible = true;
Label2.Text = "Request sent sucessfully";
fi1.Delete();
//if (File.Exists(strFileName))
//{
// File.Delete(strFileName);
//}
ClearAll(tblOrdernow);
//Response.Redirect("CheckOut.aspx");
}
else
{
Label2.Visible = true;
Label2.Text = "Upload only word documents..";
}
}
else
{
Label2.Visible = true;
Label2.Text = "Do not upload empty document..";
}
}
else
{
Label2.Visible = true;
Label2.Text = "Verify Image not Matched";
Label1.Text = ran();
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,753,919
| 5,753,920
|
jQuery -- adding and removing a class using next() across paragraphs
|
<p>I have a document and it's got a variety of spans in it with the class .highlight on them. The first selected item also has .currentItem on it, indicating it's the one currently selected. I want to be able to browse to the next highlighted item when the user clicks a button. Here's the function that, best as I can tell, should work:</p>
<pre><code>function goNextHighlight() {
var $active = $('.currentItem');
var $next = $('.currentItem').next('.highlight');
$active.removeClass('currentItem');
$next.addClass('currentItem');
}
</code></pre>
<p>$active is being set properly, and it's removing the currentItem class from it. However, $next often doesn't work because the next highlighted item is in another div or paragraph. <a href="http://jsfiddle.net/qjsjt/" rel="nofollow">Here's a jsfiddle that shows the problem</a>. If you click on the next button twice, you'll see it works the first time, but not the second.</p>
<p>How do I make this work so that it'll go to the next matching .highlight, regardless of where in the document it is?</p>
|
javascript jquery
|
[3, 5]
|
3,528,858
| 3,528,859
|
Load file once into an ASP.NET application
|
<p>I'm working on a web based app which in the core is an expert system, and I need to load the rules file to the app only once .. so I need an equivalent to public <code>static void main() {}</code> in ASP.NET site to load the file in it .. what is this equivalent and is it exist .. any suggestions are highly welcome </p>
|
c# asp.net
|
[0, 9]
|
2,483,890
| 2,483,891
|
Javascript/Jquery : Call a Function after Previous Function is Complete
|
<p>Ok, it's 1 a.m., I suck at coding javascript, and I can't seem to find a clear solution anywhere.</p>
<p>This is essentially what I have:</p>
<pre><code>$('a.button').click(function(){
if (condition == 'true'){
function1(someVariable);
function2(someOtherVariable);
}
else {
doThis(someVariable);
}
});
</code></pre>
<p>How can I ensure that "function2" is called only after "function1" has completed?</p>
|
javascript jquery
|
[3, 5]
|
3,875,320
| 3,875,321
|
How do I change accordion header with plus and minus symbol?
|
<p>I don't like the default Accordion icons and I want to change them. This link here:</p>
<p><a href="http://jqueryui.com/demos/accordion/#option-header">http://jqueryui.com/demos/accordion/#option-header</a></p>
<p>shows the option to change the header but it requires to specify icons. I don't need icons. I just need a simple <code>(+)</code> and <code>(-)</code></p>
<p>How can I do that with accordions?</p>
|
javascript jquery
|
[3, 5]
|
708,461
| 708,462
|
JSCocoa and the iPhone
|
<p>Now I have a stack of free time on my hands, I wanna get into iphone dev fo real.</p>
<p>But Objective C scares me (a bit). It feels I'm going a bit back in time. I say this because I've spent the last 8 months coding in C++.</p>
<p><a href="http://inexdo.com/JSCocoa" rel="nofollow">JSCocoa</a> looks awesome, but does this actually work on the iphone?</p>
<p>What would need to be done to get this working on the iphone?</p>
|
javascript iphone
|
[3, 8]
|
791,674
| 791,675
|
how to stop javascript function after running once?
|
<p>can someone please show me how i can stop this javascript function after it has ran once?
At the moment it just repeats again and again and i only want it to run the once.</p>
<p>I'm still learning javascript, so sorry if its not great.</p>
<p>thanks</p>
<pre><code><script>
$(function() {
$(".search_prompt").hide();
$("#text").focusin(function() {
$(".search_prompt").show();
}).focusout(function () {
$(".search_prompt").hide();
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,523,557
| 2,523,558
|
How can I pass arguments to anonymous functions in JavaScript?
|
<p>I'm trying to figure out how to pass arguments to an anonymous function in JavaScript.</p>
<p>Check out this sample code and I think you will see what I mean:</p>
<pre><code><input type="button" value="Click me" id="myButton" />
<script type="text/javascript">
var myButton = document.getElementById("myButton");
var myMessage = "it's working";
myButton.onclick = function(myMessage) { alert(myMessage); };
</script>
</code></pre>
<p>When clicking the button the message "it's working" should appear... but the <code>myMessage</code>-variable inside the anonymous function is null.</p>
<p>This problem becomes much more evident when using jQuery since it uses a lot of anonymous functions.</p>
<p>How can I do this?</p>
|
javascript jquery
|
[3, 5]
|
299,848
| 299,849
|
uncontrolable disableSelection on jquery?
|
<p>I'm using <code>.disableSelection()</code> on my webpage with jquery.</p>
<p>When I want to focus on INPUT and TEXTAREA tags it's not possible to focus.</p>
<p>I want to enable selection when I focus on <code>INPUT and TEXTAREA</code>.</p>
<p>Please help me.</p>
|
javascript jquery
|
[3, 5]
|
1,725,627
| 1,725,628
|
jquery background-position-x issue
|
<p>How to do background-position-x in Jquery ?</p>
<pre><code>console.log($('.element').css('background-position-x'));
</code></pre>
<p>Outputs <code>(an empty string)</code></p>
<pre><code>console.log($('.element').css('background-position'));
</code></pre>
<p>Outputs <code>0px 0px</code></p>
<p>What I want to do is:</p>
<pre><code>$(this).css('background-position-x', '-162px');
</code></pre>
<p>How to make it work ?</p>
<p>Thank you very much.</p>
|
javascript jquery
|
[3, 5]
|
1,943,051
| 1,943,052
|
get column names to array
|
<p>how to get colum names to array in System.Data.DataTable?</p>
|
c# asp.net
|
[0, 9]
|
3,883,317
| 3,883,318
|
How to track down a page reload in javascript
|
<p>I am debugging a page that has a jquery dialog that contains a textbox and an ok button.</p>
<p>When a user hits enter, the page is reloading and the textbox ID & value are being passed to the page reload as get parameters. e.g. </p>
<pre><code>http://example.com?tex_box_id=text_entered_in_text_box
</code></pre>
<p>I cannot figure out what is causing this behavior and can't figure out how to best track it down since the page itself is reloading.</p>
<p>I have tried stepping through all the jquery code, but did not have any luck. I can only assume that somebody somewhere attached a key press listener, but I can't figure out who. I know I can work around this by preventing theirs from running, but I still really want to figure out why it is happening. </p>
<p>Note that this does NOT happen if you click the OK button, only if you hit enter when you are in the text box</p>
|
javascript jquery
|
[3, 5]
|
2,081,908
| 2,081,909
|
How can I check if a value is inside a object list?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5181493/how-to-find-a-value-in-a-multidimensional-object-array-in-javascript">How to find a value in a multidimensional object/array in Javascript?</a> </p>
</blockquote>
<p>I've these JavaScript objects in an array:</p>
<pre><code>[{"id": 3}, {"id": 32}, {"id": 33}, {"id": 34}]
</code></pre>
<p>How can I perform an IF statement like this:</p>
<pre><code>list = [3,32,33,34]
if x in list:
"in the list!"
else:
"not in the list"
</code></pre>
<p>How can I do this using jQuery/Javascript?</p>
<p>Any clues?</p>
<hr>
<p>Edit:</p>
<p>This is a JSON output:</p>
<pre><code>[{"id": 3}, {"id": 32}, {"id": 33}, {"id": 34}]
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,180,934
| 5,180,935
|
how can I make a text entry field
|
<p>How can I make a text entry field that takes the input characters and displays it in another place, character by character as a the typest type them!</p>
|
php javascript
|
[2, 3]
|
1,971,756
| 1,971,757
|
is this a bug? please check it out
|
<h1>html</h1>
<pre><code><div contentEditable="true">testing....</div>
</code></pre>
<h1>jQuery</h1>
<pre><code>$(document).ready(function(){
$('[contenteditable]').removeAttr('contenteditable');
});
</code></pre>
<p>above codes is fine and working. you can feel it <a href="http://jsfiddle.net/hRR3b/" rel="nofollow">here</a>.</p>
<p>Now, try this</p>
<pre><code>$('[contentEditable]').removeAttr('contentEditable');
// notice the CamelCase of the string contentEditable
</code></pre>
<p>in FF 3.6, it gives an error on the console</p>
<blockquote>
<p>An invalid or illegal string was
specified" code: "12 <br> elem[ name ]
= value;</p>
</blockquote>
<p>and the div is still editable.</p>
<p>I suspected it was the jQuery selector, but is not. By further inspection, it was the argument passed on the <code>.removeAttr('contentEditable');</code>. It works when all small letters. So, I thought it should be all small letters. I'm curious so I tried adding <code>CLass</code> as an attribute and do <code>.removeAttr('CLass');</code>. But then it works without error.</p>
<p>So, how come <code>contentEditable</code> is giving me that error?</p>
<hr>
<h1>update</h1>
<p>from Kobi, it seems that it actually accept any case except, <code>contentEditable</code> (I did try too).</p>
<p><a href="http://en.wikipedia.org/wiki/CamelCase" rel="nofollow">CamelCase</a></p>
|
javascript jquery
|
[3, 5]
|
4,757,020
| 4,757,021
|
unable to solve Timer_Tick
|
<p>i have same problem as this question.<a href="http://stackoverflow.com/questions/5764875/se-the-clientscriptmanager-registerforeventvalidation-method-in-order-to-registe">se the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation</a> i havent any problem with <code><%@ Page EnableEventValidation="false" %></code>.I solve it and i try </p>
<pre><code>protected void Timer1_Tick(object sender, EventArgs e)
{
Label2.Text = Convert.ToString((Convert.ToInt32(Label2.Text) - 1));
if (Convert.ToInt32(Label2.Text) == 0)
{
Timer1.Dispose();
Submit();
}
}
</code></pre>
<p>Code work fine means <code>submit ()</code> is work if i call from submit button.If its call from <code>Timer_Tick</code> its not work.And timer is not stop or dispose.What is a problem plz suggest?</p>
<p>timer:</p>
<pre><code><asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
</asp:Timer>
<asp:Label ID="Label1" runat="server" Text="Remaining Time:(Min)"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="100"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,854,549
| 4,854,550
|
What does (button) mean?
|
<p>I am a beginner at Java, and have come across this line of code:</p>
<pre><code>Button orderButton = (Button)findViewById(R.id.order);
</code></pre>
<p>What does the <code>(Button)</code> mean when it is inside the parenthesis? </p>
<p>What is the term for putting it inside like that? </p>
|
java android
|
[1, 4]
|
5,719,905
| 5,719,906
|
Running a Python program from PHP in the background (Python output on cmd) and displaying the counter in PHP
|
<p><strong>I need to run a Python script from PHP in the background, and the Python script will output its content to cmd (I need to display cmd) and display a live counter in the PHP file as long as the Python script is running.</strong></p>
<p>I have tried all the exec and system commands, but I am unable to obtain the desired results. Help :) </p>
<pre><code>#!C:\python27\python
import feedparser,serial
from set import *
print "Content-Type: text/html" # HTML is following
while MAX:
gmail = feedparser.parse(PROTO + USERNAME + ":" + PASSWORD + "@" + SERVER + PATH)
total_g = len(gmail.entries)
facebook = feedparser.parse(FACEBOOKFEED) # here feedparser does the hard work of loasding the rss feed
total_f = 1
if i ==0:
print ("Unread:{0}".format(total_g))
if total_g ==0:
#mySerial.write(0)
#time.sleep(10)
print("no mail")
elif total_g>0:
gmail_latest = gmail.entries[i]
g_title = gmail_latest.title
g_author = gmail_latest.author
print ("Gmail stream")
print (g_title)
print (g_author)
print("")
#mySerial.write("[{0}] {1} ".format(total_g,g_title))
#time.sleep(20)
i+=1
if total_f ==0:
#mySerial.write(0)
#time.sleep(10)
print("No New update")
elif total_f>0:
noti = facebook['items'][j].title
time_f = facebook['items'][j].published
print("Facebook stream")
print(noti + "\n"+ time_f)
print("")
#mySerial.write(noti +"\n"+ time_f)
j+=1
#time.sleep(20)
#tweet = feedparser.parse("https://"+USERNAME+":"+PASSWORD+"@twitter.com/statuses/friends_timeline/" + str(USERID) + ".rss")
# mySerial.flushOutput()
</code></pre>
|
php python
|
[2, 7]
|
4,102,389
| 4,102,390
|
How can I extract a URL from url("http://www.example.com")?
|
<p>I need to get the URL of an element's background image with jQuery:</p>
<pre><code>var foo = $('#id').css('background-image');
</code></pre>
<p>This results in something like <code>url("http://www.example.com/image.gif")</code>. How can I get just the "http://www.example.com/image.gif" part from that? <code>typeof foo</code> says it's a string, but the <code>url()</code> part makes me think that JavaScript and/or jQuery has a special URL type and that I should be able to get the location with <code>foo.toString()</code>. That doesn't work though.</p>
|
javascript jquery
|
[3, 5]
|
3,334,133
| 3,334,134
|
jquery/js - i have a bunch of values (strings). i want to send it to another url via POST, how do i do this?
|
<p>i have this (simplified)</p>
<pre><code><script>
dataToSend = 'dummy data here';
function sendIt() {
//code here
}
</script>
<a href='#' onclick='sendIt();'>Click here to send data</a>
</code></pre>
<p>what would i need to put in sendIt() to do a POST submit (not ajax, i want the user to be sent to the page too). </p>
<p>using jquery</p>
|
javascript jquery
|
[3, 5]
|
728,412
| 728,413
|
Can only access jQuery.ajax not $.ajax
|
<p>I have a strange problem. I have loaded jquery-min javascript in my file. But I can only access jQuery.ajax not $.ajax. $.ajax is said to be undefined. Why is that?</p>
|
javascript jquery
|
[3, 5]
|
3,395,468
| 3,395,469
|
toggle class on hover?
|
<p>I have written the following code:</p>
<pre><code>$(document).ready(function () {
$("#rade_img_map_1335199662212").hover(function () {
$("li#rs1").addClass("active"); //Add the active class to the area is hovered
}, function () {
$("li#rs1").addClass("not-active");
});
});
</code></pre>
<p>The problem is it doesnt seem to toggle the class on hover?</p>
<p>But how can i get it so that the class toggles based on hover and non-hover..?</p>
|
javascript jquery
|
[3, 5]
|
5,296,829
| 5,296,830
|
Test for empty jQuery selection result
|
<p>Say I do </p>
<pre><code>var s = $('#something');
</code></pre>
<p>and next I want to test if jQuery found #something, i.e. I want to test if <code>s</code> is empty.</p>
<p>I could use my trusty <code>isempty()</code> on it:</p>
<pre><code>function isempty(o) {
for ( var i in o )
return false;
return true;
}
</code></pre>
<p>Or since jQuery objects are arrays, I suppose I could test <code>s.length</code>.</p>
<p>But neither seem quite in the idiom of jQuery, not very jQueryesque. What do you suggest?</p>
|
javascript jquery
|
[3, 5]
|
4,784,248
| 4,784,249
|
Random number after js file include
|
<p>I have a problem with a page that includes two js files. In firebug it shows that every time the page loads those two files get included with the prefix ?_=someRandomNumber</p>
<p>I don't know where that random number is generated from and I guess it is the reason the files are not being cached and are downloaded each time the page is hit.</p>
<p>Here is the firebug snapshot</p>
<pre><code>GET http://127.0.0.1:8500/file1.js?_=1251379620583
GET http://127.0.0.1:8500/file2.js?_=1251379620583
200 OK
697ms jquery-1....2.min.js (line 19)
GET http://127.0.0.1:8500/file1.js?_=1251379622773
GET http://127.0.0.1:8500/file2.js?_=1251379622773
200 OK
148ms
</code></pre>
<p>My include is very simple</p>
<pre><code><script type="text/javascript" src="file1.js"></script>
<script type="text/javascript" src="file2.js"></script>
</code></pre>
<p>I am also using jQuery in the application.</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
5,964,251
| 5,964,252
|
Saving and restoring state in android
|
<p>I have searched through this and a few other sites for the answer, but I have been unable to find it. I am trying to save a boolean and an int using onSaveInstanceState and onRestoreInstanceState, but I can't seem to get it to work. It doesn't crash or anything, but it either isn't saving it or it isn't restoring it, or I am stupid and have no idea what I am doing. </p>
<hr>
<p>Here is what I have for my activity, do I need to have it in my onCreate somewhere or something?</p>
<pre><code>public class CannonBlast extends Activity {
/** Called when the activity is first created. */
private panel panelStuffz;
@Override
public void onCreate(Bundle savedInstanceState) {
final Window win = getWindow();
super.onCreate(savedInstanceState);
panelStuffz = new panel(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(panelStuffz);
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState){
savedInstanceState.putInt("HighLevel", panelStuffz.getLevel());
savedInstanceState.putBoolean("soundstate", panelStuffz.getSound());
super.onSaveInstanceState(savedInstanceState);
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
panelStuffz.setHighLevel(savedInstanceState.getInt("HighLevel"));
panelStuffz.setSound(savedInstanceState.getBoolean("soundstate"));
}
@Override
public void onResume(){
super.onResume();
}
@Override
public void onPause(){
super.onPause();
panelStuffz.setThread(null);
}
@Override
public void onStop(){
}
</code></pre>
<p>I tried putting stuff in the onStop, but it crashes, which is why its empty, in case that matters, thanks in advance</p>
|
java android
|
[1, 4]
|
227,083
| 227,084
|
Get the first empty select box recursively
|
<p>I have multiple <code>select</code> boxes in my document and some of them are load with page load and some of them created dynamically. for example:</p>
<pre><code><select>
<option>select one</option>
</select>
<select></select>
<select>
<option>select two</option>
</select>
<select>
<option>select three</option>
</select>
<select>
</select>
</code></pre>
<p>and more are created dynamically some of with and some are empty.</p>
<p>I want to get the first empty <code>select</code> among them at page load and click on a button again want to get the first empty <code>select</code> box <strong><em>from the last one I get</em></strong> and continue this until no such <code>select</code> box further exists.</p>
<h3>NOTE <em>from the last one means</em>,</h3>
<p>If I get the first empty <code>select</code> box from first, then one <code>button</code> click search will start from that <code>select</code> box and continue until again get an empty <code>select</code> and so on.</p>
|
javascript jquery
|
[3, 5]
|
5,537,951
| 5,537,952
|
Difference between HttpContext.Current.Response/Request And Page.Request/Response
|
<p>Please, can you explain me what is the difference between HttpContext.Current.Response/Request And Page.Request/Response. </p>
<p>Thank you</p>
|
c# asp.net
|
[0, 9]
|
1,354,254
| 1,354,255
|
JQuery Plugin: calling jConfirm from asp.net (code behind)
|
<p>i am using jquery <a href="http://labs.abeautifulsite.net/projects/js/jquery/alerts/demo/" rel="nofollow">plugin</a> and i got stuck in how to display the confirmation window from code behind and if the user choose "ok" than go ahead delete otherwise ignore.</p>
<pre><code>jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
jAlert('Confirmed: ' + r, 'Confirmation Results');
});
</code></pre>
<p>anybody have done similar?</p>
|
asp.net jquery
|
[9, 5]
|
406,751
| 406,752
|
TrimEnd() not working
|
<p>I want to trim the end off a string if it end like this ", ". That's a comma and a space.</p>
<p>I've tried TrimEnd(', ') but this doesn't work. It has to be only if the string ends this way so I can't just use .Remove to remove the last 2 characters. Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
6,018,873
| 6,018,874
|
How can I pass a Context object to a thread on call
|
<p>I have this code fragment:</p>
<pre><code>public static class ExportDatabaseFileTask extends AsyncTask<String, Void, Boolean>
{
private final ProgressDialog dialog = new ProgressDialog(ctx);
protected void onPreExecute();
protected Boolean doInBackground(final String... args);
protected void onPostExecute(final Boolean success);
}
</code></pre>
<p>I execute this thread as</p>
<pre><code>new ExportDatabaseFileTask().execute();
</code></pre>
<p>As you see I use a ctx as Context variable in the new ProgressDialog call, how do I pass a context to the call method?</p>
<p>to this one:</p>
<pre><code>new ExportDatabaseFileTask().execute();*
</code></pre>
|
java android
|
[1, 4]
|
1,237,649
| 1,237,650
|
Retrieve search string from text box on master page for internal search
|
<p>Currently, I have a text box and a button on my master page for entering and submitting a search string. The search is internal to my website. The user would enter the search string then click on the search button. The search button redirects to the search results page. When the search results page is loaded, it currently searches through the controls on the previous page to find the search string textbox to retrieve the search string.</p>
<p>This all works fine except when a search is entered from the log-in page due to an exception: <em>The current user is not allowed to access the previous page</em>.</p>
<p>So I'm wondering what might be a better way to retrieve the search string. I'd prefer not to clutter the redirect url with it. I'm not adverse to storing it in the Session collection but am having trouble figuring out how to get it there before the Page load event occurs.</p>
<p>Below is the pertinet code:</p>
<p>From the master page:</p>
<pre><code><asp:TextBox ID="SearchTextBox" runat="server" />
<asp:ImageButton ID="SearchButton" runat="server" Text="Search" PostBackUrl="~/Search.aspx" ImageUrl="~/Graphics/btn_search.png" ImageAlign="AbsMiddle" />
</code></pre>
<p>From the search results page:</p>
<pre><code>private string getSearchTextBoxText(Control ctrl)
{
if (ctrl.HasControls())
{
foreach (Control child in ctrl.Controls)
{
string s = getSearchTextBoxText(child);
if (s != null)
return s;
}
}
else if (ctrl.ID == "SearchTextBox")
{
return ((TextBox)ctrl).Text;
}
return null;
}
protected void Page_Load(object sender, EventArgs e)
{
log.Debug("Entering " + MethodBase.GetCurrentMethod().Name);
string lastSearchText = Label1.Text;
string searchText = null;
try
{
searchText = PreviousPage != null ? getSearchTextBoxText(PreviousPage) : getSearchTextBoxText(this);
}
catch(Exception ex)
{
log.Error("Exception occurred attempting to retrieve the search string", ex);
}
...
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,635,935
| 2,635,936
|
Why statements after while loop is not getting executed?
|
<p>The problem for me nothing gets executed after while loop? what's the issue with that? (The lines after the end of while loop never gets executed)</p>
<pre><code>client = serverSocket.accept();
BufferedReader in = new BufferedReader(
new InputStreamReader(client.getInputStream())
);
while ((line = in.readLine()) != null) {
Log.i("line",line);
line111 +=line;
Log.i("line111",line111);
}
//Any code below this is not executed
Log.i("shan","Shan");
</code></pre>
|
java android
|
[1, 4]
|
1,414,705
| 1,414,706
|
What data types do the RangeValidator control support?
|
<p>explain the rangevalidator control,is it take string also? explain thank you</p>
|
c# asp.net
|
[0, 9]
|
1,329,992
| 1,329,993
|
Extract text from html: looking for a good sax-like parser or advices with a dom parser
|
<p>I have an html document formatted this way:</p>
<pre><code><p>
some plain text <em>some emphatized text</em>, <strong> some strong text</strong>
</p>
<p>
just some plain text
</p>
<p>
<strong>strong text </p> followed by plain, <a>with a link at the end!</a>
</p>
</code></pre>
<p>I'd like to extract the text. With dom like parsers I could extract each paragraph <p>, but the problem is inside: I'd have to extract text from inner tags too and have a resulting string with the same order, in the example above, first paragraph, I want to extract:</p>
<pre><code>some plain text some emphatized text, some strong text
</code></pre>
<p>and for this purpose I guess a sax like parser would be better than a dom, given that I can't know inner tags number o sequence: a paragraph can have zero or more inner tags, of different type.</p>
|
java android
|
[1, 4]
|
2,960,578
| 2,960,579
|
Find out if X509Certificate2 is revoked?
|
<p>How can I figure out if an <code>X509Certificate2</code> has been revoked?
I assume the <code>Verify()</code> method checks it, but it doesn't explicitly state it in the help.
Does anybody know?</p>
<p>Also: does the Verify() check if the certificate is expired?</p>
|
c# asp.net
|
[0, 9]
|
3,555,143
| 3,555,144
|
Android clipPath - fill type
|
<p>I have two Bitmaps one over another. I want to perform clipPath over the later one (the foreground) so that the background image gets visible.</p>
<p>so I do:</p>
<pre><code> protected void onDraw(Canvas canvas) {
canvas.drawBitmap(backgroundBitmap, 0, 0, mBitmapPaint);
canvas.save();
canvas.clipPath(clipPath, Region.Op.XOR);
canvas.drawBitmap(foregroundBitmap, 0, 0, paint);
canvas.restore();
}
</code></pre>
<p>The clipping is ok but the Path is not. I get something like an Arc and I want to get Path clip only in the area where my finger passed. Sort of erasing for the upper Bitmap so that the lower one gets visible at the parts where my finger passed.</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,090,525
| 1,090,526
|
Pass uploaded file as a parameter to javascript method
|
<p>I am passing the uploaded file as a parameter in the JavaScript method. Then Firebug is throwing error like <code>SyntaxError: illegal character</code>.</p>
<pre><code><input type="file" id="fileUpload" name="employerLogoUpload" />
<a id="_fileUploadLink" href="#" onClick="javascript:ajaxFileUpload(" +document.getElementById('fileUpload').value+ ");">Upload</a>
</code></pre>
<p>Please help me out.</p>
|
javascript jquery
|
[3, 5]
|
1,856,606
| 1,856,607
|
$.slideUp() not working on elements in a CSS "display:none" parent element
|
<p>I have a site I am designing that has some nested DIV elements that I use as containers to hold expandable buttons.</p>
<p>The user clicks on a button and it expands to expose some more content.</p>
<p>Everything works great until I have a DIV that is inside of a parent DIV with it's display property set to "none".</p>
<p>Is there any way to force the jQuery .slideUp() method to minimize the expandable buttons regardless of whether it is in a display:none parent or not?</p>
<p>OR, what property/properties do I need to set to make $.slideDown() work properly on an element that was setup up in a display:none parent DIV?</p>
|
javascript jquery
|
[3, 5]
|
3,905,750
| 3,905,751
|
Get the current file being processed in ASP.net
|
<p>I have a requirement where I want to trace what file is being processed by .net runtime. I mean if it is processing usercontrol x.ascx then it should return the whole path of that, and if it is processing usercontrol y.ascx it should return that. </p>
<p>There are some candidates properties. </p>
<pre><code>Request.AppRelativeCurrentExecutionFilePath
</code></pre>
<p>or </p>
<pre><code>TemplateControl.AppRelativeVirtualPath.
</code></pre>
<p>Can somebody help me with this, or is there any other property that can give me the path. </p>
|
c# asp.net
|
[0, 9]
|
3,124,990
| 3,124,991
|
jQuery and asp.net not playing nice together
|
<p>Please refer to this page for reference: <a href="http://loadedgranola.valitics.com/_product_83484/blackberry_lime" rel="nofollow">http://loadedgranola.valitics.com/_product_83484/blackberry_lime</a> </p>
<p>I have a jQuery script that runs to replace the h1 tags with a background image. It works great when the document loads but when I click "add to cart", after the javascript alert the jQuery styling breaks. Due to CMS restrictions I have no direct access to their javascript or any of the ASP files but I assume there has to be an easy fix to this.</p>
<p>The code I'm using: </p>
<p><code>jQuery(document).ready(function(){</code></p>
<pre><code> var textReplacer = document.title.replace(/ /g,'');
jQuery("h1").addClass('replaced').css("background","url(../images/h1/" + textReplacer + ".png) no-repeat 0 0");
});
</code></pre>
<p>I have also tried using the function pageLoad(sender, args) { magic but no luck.</p>
|
asp.net jquery
|
[9, 5]
|
46,930
| 46,931
|
JavaScript - ASP.net - Loop through all controls on an asp pannel
|
<p>Is there any way for me too loop though all controls on an asp.net pannel, and for each of the controls check the type to see if it is of asp type TimeInput?</p>
<p>The JS basicly needs to replicate this serverside VB.net code</p>
<pre><code> 'this is checking that something has been entered into at least one of the time input boxes
Protected Sub valCusAllTextBox_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valCusAllTextBox.ServerValidate
'When the Save or Submit button is clicked the Page.IsValid() command causes the "valCusAllTextBox" custom validator control
'(which was dragged on to the page) to call this event - where we do our customised error checking
args.IsValid = False 'args.IsValid is a system function
'check all controls within the Overtime Claim panel
For Each ctrl As Control In pnlOvertimeClaim.Controls
If TypeOf ctrl Is TimeInput Then
If CType(ctrl, TimeInput).TimeInMinutes <> 0 Then
args.IsValid = True
Exit For
End If
End If
Next
If txtOnCallAllow.Text.Trim() <> "" Then
args.IsValid = True
End If
If txtMealAllow.Text.Trim() <> "" Then
args.IsValid = True
End If
End Sub
</code></pre>
|
asp.net javascript
|
[9, 3]
|
1,793,702
| 1,793,703
|
How to improve the rendering of a custom 'data calendar' in asp.net
|
<p>I've been asked to improve a ASP.Net C# page. It currently shows a years worth of daily prices for a product. The page looks similar to a wall planner, with each input control showing a price for that day. </p>
<p>The page will be used to change the price of this product for that year. Currently the 'wall planner' table control is being generated cell-by-cell in the code behind. </p>
<p>There is a lot of code used to implement this but essentially it does the following.</p>
<p><strong>A table is built... dynamically</strong></p>
<ol>
<li>New Table control defined</li>
<li>12 new TableRow controls defined (months)</li>
<li>Each row has 31 TableCell controls added to it (Each with a unique id e.g. cell_yy_mm_dd)</li>
</ol>
<p><strong>Its filled with data</strong></p>
<ol>
<li>365 days of prices are retrieved from the database (Price and Date).</li>
<li>Foreach used to loop over the dataset</li>
<li>Date checked with the TableCells id. If there is a match, a new TextBox is added to the cell.</li>
</ol>
<p>This is causing a huge strain on the server (specifically memory usage). It seems so over engineered there must be a better way of doing it!</p>
<p>What would be a better method to implement such functionality?</p>
|
c# asp.net
|
[0, 9]
|
1,994,876
| 1,994,877
|
How to get the values of sub objects of json objects while using object.key method?
|
<p>By using an api and getting a response .In response, i have got the list of objects in deals named object and the count of these object is 19 .I have used the below function to get the 'keys' and 'values' of each object.But some keys which is ultimately an object has sub object that contains keys and values ,i have tried but i m unable to access them.I have given below the snippet of response of an api call.Here I'm able to access the object at index 0's active but for business i got [object object] because it has keys and values inside it i.e 'id',that i'm unable to access ,i want to access them too.</p>
<pre><code> meta: Object
response: Object
deals: Array[20]
0: Object
active: 1
business: Object
id: 608290.....
</code></pre>
<p>Below is the function to get the keys as well as values of all the objects</p>
<pre><code>function getAllobjectData(data) {
$.each(data.response.deals, function (i, deals) {
console.log("value of index " + i);
var keys = [],
values = [];
$.each(deals, function (key, value) {
keys.push(key);
values.push(value);
var subkey = [],
subvalue = [];
</code></pre>
<p>This part i add and tried to get the subobjects keys and values but it didnt work and i dont know is this a correct way. </p>
<pre><code>$.each(key, function (subkey, subvalue) { <-------------
alert(subkey + ": " + subkey); -
}); -
console.log('subkey ' + (i + 1) + ' is ' + subkey); -
console.log('subvalue ' + (i + 1) + ' is ' + subvalue); -
-----------------------------------------------------------------------------
});
console.log('keys ' + (i + 1) + ' is ' + subkey);
console.log('values ' + (i + 1) + ' is ' + subvalue);
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,986,488
| 2,986,489
|
News Bar with jQuery
|
<p>I need to make a horizontal "breaking-news" style bar with jQuery. I pick new from the server (the easy part) and I need some way to make them continually scroll from left to right. Any jQuery plugin to help me? thanks</p>
|
javascript jquery
|
[3, 5]
|
2,205,900
| 2,205,901
|
Lock tab key with javascript?
|
<p>Hey guys.. How to lock or disable and again the tab key with javascript</p>
|
javascript jquery
|
[3, 5]
|
3,493,354
| 3,493,355
|
Passing data through a hyperlink WITHOUT include the data in the URL
|
<p>I know how to pass data through a URL and how to receive the data using <code>$_GET</code> but I don't want the variables to show up in the URL.</p>
|
php javascript
|
[2, 3]
|
1,866,606
| 1,866,607
|
Is it possible to run Android 2.2 app on Android 2.2+ Platforms (Gingerbraid, Ice Cream Sandwich etc.)
|
<p>I was wondering if it's possible because I am interested in developing applications for the Android platform, but I'm just starting.</p>
|
java android
|
[1, 4]
|
2,780,918
| 2,780,919
|
PHP Jquery DropDownSelectList Multiple Variables with same name
|
<p>I am using the Select->DropDownCheckList from <a href="http://dropdown-check-list.googlecode.com/svn/trunk/src/demo.html" rel="nofollow">http://dropdown-check-list.googlecode.com/svn/trunk/src/demo.html</a>... with a PHP back end...</p>
<p>This checklist submits (on form post) each selection as an individual variable, so for example:</p>
<p>brand=Apple
brand=Microsoft
brand=Google</p>
<p>And when doing $_POST["brand"] in php I only get 1 of them, not all three... is there a way I can iterate through these items or some other way to access them? Alternatively does anyone know how to change the jquery plugin above to send back in the form brand=Apple,Microsoft,Google...?</p>
<p>Thanks</p>
|
php jquery
|
[2, 5]
|
1,017,725
| 1,017,726
|
problem with jquery move image
|
<p>how can get x,y when mousedown in image and then mouse move in the image and then mouseup get x,y</p>
<p>(2 x,y 1-x,y when mouse down 2-x,y when mouse up)
all the event in the one image.
and language jquery</p>
<p>this my code by this not working(image stick to mouse and only mouse_d called)</p>
<p>var mx1;
var my1;</p>
<p>$("document").ready(function ()
{
$("img#ground").bind("mousedown",mouse_d);
$("img#ground").bind("mouseup",mouse_u);
$("img#ground").bind("dragstart",mouse_d);
});</p>
<pre><code> function mouse_d(event)
{
mx1=event.pageX;
my1=event.pageY;
}
function mouse_u(e)
{
mx2=e.pageX;
my2=e.pageY;
mx2=mx1-mx2;
my2=my1-my2;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,891,110
| 1,891,111
|
Changing Selected Option Select menu .attr
|
<p>I am trying to pre-fill a form that containes select menu's, using JSON, i am using the key as the #id tags for the select menu's
but i cant seem to get it to work i have tried different selectors but still no luck,</p>
<p>here is my code</p>
<pre><code> $(document).ready(function () {
var p = {
"weight":"39",
"height":"1.24",
"age":"34"
};
for (var key in p) {
if (p.hasOwnProperty(key)) {
if ($("#" + key + " option [value=" + p[key] + "]").length) {
$("#" + key + " option [value=" + p[key] + "]").attr('selected', 'selected');
}
}
}
});
<select id="age">
<option value="33">33</option>
<option value="34">34</option>
</select>
<select id="height">
<option value="1.25">1.25</option>
<option value="1.24">1.24</option>
</select>
<select id="weight">
<option value="38">38</option>
<option value="39">39</option>
</select>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,393,036
| 2,393,037
|
Automated copy of selected text in pdf file loaded using web browser control in c#.net
|
<p>This is what I have done:</p>
<ol>
<li>I have loaded a pdf file in web browser,</li>
<li>Now I want to select text from that file and paste into a text box.</li>
</ol>
<p>Can anyone help me?</p>
|
c# asp.net
|
[0, 9]
|
3,881,705
| 3,881,706
|
Organizing Levels of Abstraction
|
<p>I have an SQL Server database with tables.</p>
<p>On top of this, I have a class for each table that uses LINQ and has Add, Remove, Get, Update functions.</p>
<p>On top of that I want to have more project specific methods.</p>
<p>For example, one of my highest level function is to Assign a task to an employee.</p>
<p>My thought would be to have another set of classes which would have this functionality, for example, the initial Task class has:</p>
<pre><code> public static IEnumerable<Task> GetAll(Schedule schedule)
{
KezberPMDBDataContext db = new KezberPMDBDataContext();
return from p in db.Tasks
where p.ScheduleID == schedule.ScheduleID
select p;
}
</code></pre>
<p>So for example, to assign a task, I need to GetUnscheduledTasks. I could have:</p>
<pre><code> public static IEnumerable<Task> GetUnscheduled()
{
return Data.Tasks.GetAll(emptySchedule);
}
</code></pre>
<p>I'm basically trying to have: low level exchange data with mid level, and top level exchange data with mid level.</p>
<p>How should I organize or refactor my code to keep it clean and modular?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,102,103
| 5,102,104
|
jQuery form processing: require vs. not required
|
<p>I'm building a form system with jquery and using <em>basic</em> validation (if a form has the required values and is of the required type) as a front line system (I validate at the backend too) for validating as the user submits, this is to prevent useless requests when possible (eg: submitted a completely empty form)</p>
<p>What is the "proper" way to handle this? My default idea is to apply a class to the elements, like so:</p>
<pre><code><input type="text" name="something" class="required">
</code></pre>
<p>or</p>
<pre><code><input type="text" name="something" class="optional">
</code></pre>
<p>and then simply looping through and checking if the classes match, is this an "okay" way to do it or is there a better way? I could apply custom attributes but I'd feel bad and I don't know if all browsers support this. </p>
<p>Note: These fields aren't necessarily the same every time, hard coding into the js isn't a possibility (or imo a good idea). </p>
|
javascript jquery
|
[3, 5]
|
2,355,350
| 2,355,351
|
How do I save text input into preferences with onSaveInstanceState?
|
<p>This app is simple and all I want it to do is just keep the text in the text field even after I close the app. I looked through some tutorials but I can't seem to figure out how to get it to save with <code>onSaveInstanceState</code> and <code>onRestoreInstanceState</code>. How can I do it?</p>
<p>Here is notes.java:</p>
<pre><code>public class notes extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.notes);
Button wg = (Button) findViewById(R.id.button3);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent();
setResult(RESULT_OK, intent);
finish();
}
});
}
}
</code></pre>
|
java android
|
[1, 4]
|
3,521,206
| 3,521,207
|
Should I use telerik radgrid or windsor container for developing .NET applications
|
<p>I recently was given some code in c# ASP.NET and I was going through it and it seems as though the person who coded this before me used telerik radgrid and windsor container. I looked these up and I understand what telerik radgrid does (http://www.telerik.com/help/aspnet/grid/grdataglance.html), but If i am just starting out is it really worth it to use these plugins? or is it much better to just do it by scratch. Also I was wondering if someone could explain what exactly does windsor container do: <a href="http://www.castleproject.org/container/gettingstarted/index.html" rel="nofollow">http://www.castleproject.org/container/gettingstarted/index.html</a> and if it is necessary? The website is just a basic content management system as of right now. Thanks guys!</p>
|
c# asp.net
|
[0, 9]
|
921,582
| 921,583
|
Android javax.naming.* replacement?
|
<p>I am trying to find an API for my android application that will replace the javax.naming package for DNS look up information. The java.net.InetAddress gives me some of the information that I need for my DNS tool, but fails to look up the MX and NS records.</p>
<p>Does anyone have a suggestion on the API's I should be using to accomplish this?</p>
|
java android
|
[1, 4]
|
3,467,411
| 3,467,412
|
Close was never explicitly called
|
<p>I have a listview that is sourced by an sqlite db. I call fillData() at several different points to update the listview.</p>
<pre><code>private void fillData() {
mDbHelper.open();
Cursor c = mDbHelper.fetchAllNotes(table, columns, selection, selectionArgs, null, null);
startManagingCursor(c);
String[] from = new String[] { "quantity", "color", "style" };
int[] to = new int[] { R.id.textQuantity, R.id.textColor, R.id.textStyle };
setListAdapter(new SimpleCursorAdapter(this, R.layout.recordrow, c, from, to) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = super.getView(position, convertView, parent);
return v;
}
});
}
</code></pre>
<p>That works... problem is, when I open/close/jump around activities, I get errors in logcat. It doesn't crash the program though. The errors are:<br>
<br>
Please ensure you explicitly call close() on your cursor<br>
and<br>
close() was never explicitly called on database<br><br></p>
<p>So under }); if I put mDbHelper.close() it crashes saying database not open. If I put c.close(), my listview never populates. I've tried putting them in various other places and it gives me errors saying cursor/database already closed. Any ideas on what to do?</p>
|
java android
|
[1, 4]
|
1,892,988
| 1,892,989
|
How to add 3 functions in javascript using noConflict()
|
<p>I am using three different js plugins for three functions
1. Slide show
2. Smooth Scroll (to a id or a link inside the page)
3. Photo pop-up similar to light box </p>
<pre><code>I used the following
*jQuery.noConflict()(function(){
// code using jQuery
});
// other code using $ as an alias to the other library*
</code></pre>
<p>Help me out to add the third function</p>
|
javascript jquery
|
[3, 5]
|
905,240
| 905,241
|
How does else if work in javascript
|
<p>Is this correct?</p>
<pre><code>if(condition)
{
}
elseif(condition)
{
}
else
{
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,308,430
| 5,308,431
|
android fromhtml cannot recognize all HTML tag
|
<p>As far as I know, fromhtml of Android can recognize a few HTML tags like "<code><b></code>, <code><i></code>, <code><u></code>, <code><a></code>" and so on. But I cannot convince how to render following HTML code for android with fromhtml attribute.</p>
<pre><code>String html = "<code style='background:#f0f0f0'>this is code</code><pre>this is pre</pre><table><tr><td>this is table</td></tr></table>";
textView.setText(Html.fromHtml(html);
</code></pre>
<p>It's only for <strong>TextView</strong>, not for <strong>WebView</strong>. any solution will be appreciated.</p>
|
java android
|
[1, 4]
|
3,868,461
| 3,868,462
|
How to reset a fragment's view?
|
<p>If I have a fragment where I dynamically set a view with onCreateView(), how would I go about calling it again? </p>
<p>I want to implement some kind of "refresh" where the view changes based on the JSON response. I tried making a new function that does midnightSV.removeAllViews(), but how can I call onCreateView() again?</p>
|
java android
|
[1, 4]
|
4,302,115
| 4,302,116
|
Detecting loss of connection between server and client
|
<p>How will the server know of client connection loss? does this trigger an event? is this possible to store code (server side) so that it can execute before the connection loss happen?</p>
<p>This connection loss can happen if:</p>
<ul>
<li>being idle for too long. </li>
<li>client side terminated.</li>
</ul>
<p>etc.</p>
<p>This i am asking in particular to Jsp and php.</p>
|
java php
|
[1, 2]
|
2,822,847
| 2,822,848
|
JavaScript/jQuery - textchange
|
<p>I have a html- <code>input type="text"</code>, and I want to add this tag an event handler that will work when the text is changes. The problem is that this input is getting his value from antoher javascript function and then the event handler isn't working.</p>
<p><em>For example</em></p>
<p>This is the event:</p>
<pre><code>$("#inputid").change(function(){
alert('bla bla')
}
</code></pre>
<p>And this what need to raise the event</p>
<pre><code>function inputvalue(){
$("#inputid").val="bla"
}
</code></pre>
<p>Unfortunately when the value of the input is changing (from the function inputvalue),it doesn't raise the event. If I put the value of the input manually the event is working</p>
<p>Any idea why the javascript doesn't reconize the text change from a script?</p>
|
javascript jquery
|
[3, 5]
|
963,717
| 963,718
|
jquery preloading multiple images
|
<p>I managed to do preloding of 1 image like this:</p>
<pre><code>var img = new Image();
$(img).load(function () {
//do something after
}).attr('src', response.image1);
</code></pre>
<p>How can I make the same for multiple pictures. Let's assume that my response is a json object which has several image sources.
Thanks!</p>
|
javascript jquery
|
[3, 5]
|
4,575,535
| 4,575,536
|
jquery trigger function is not working no error nor correct result
|
<p>hey guys i have the ff code,it gives alert msg when i <strong>manualy</strong> do it.<br>
bt i want to do it programatically using jquery as follows:<br>
the html code: </p>
<pre><code> <input type="text" id="inpt" />
</code></pre>
<p><strong>js code:</strong> </p>
<pre><code> $("#inpt").keypress(function(e) {
if (e.keyCode == '13') {
alert("enter key pressed");
}
});
</code></pre>
<p>//call the abv event handler</p>
<pre><code> r=$("#inpt");
r.focus();
e = $.Event('keypress');
e.which =13; // ENTER_KEY
$(r).trigger(e);
</code></pre>
<p>It doesnt show an alert message and there is no error message<br>
pls help!</p>
|
javascript jquery
|
[3, 5]
|
126,058
| 126,059
|
How to get the object reference inside a JQuery callback function?
|
<p>Let's say that we have a javascript object called aObject and the test() function is used as a callback function in JQuery</p>
<pre><code>var aObject = {
aVariable : 'whatever value',
test : function() {
// Trying to access property. But doesn't work as expected since I am getting the DOM element, not the aObject reference
var temp = this.aVariable;
}
}
var anInstanceOfAObject = $.extend({}, aObject);
anInstanceOfAObject.someFunction = function () {
// I have to put "this" in a variable since "this" in the context below refers to the DOM element, not the instance of the object
var placeHolder = this;
$('some random div.element').theJavascriptFunction({
"theJavascriptCallbackFunction": placeHolder.test,
});
}
</code></pre>
<p>Inside that test() function, normally the context of "this" is the DOM element. My question is how to reference aObject since we can't use "this" to reference it.</p>
<p>EDIT: I am not sure if the syntax above is the correct/preferred way to instantiate an Object. I see some examples using this syntax</p>
<pre><code>var aObject = function() {....
</code></pre>
<p>Please inform me if this seems to be relevant to the problem.</p>
|
javascript jquery
|
[3, 5]
|
724,350
| 724,351
|
Reload when setTimeout function finishes
|
<p>I want to reload window after a this custom function finishes:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
setTimeout(function () {
$('#order_form').dolPopupHide({});
}, 3000);
//window.location.reload();
});
</script>
</code></pre>
<p>Is there a way I can add the reload to the setTimeout function so it doesn't run until the timeout is over?</p>
|
javascript jquery
|
[3, 5]
|
4,394,362
| 4,394,363
|
Android - Sending pdf
|
<p>I am trying to send a .pdf file to Google Cloud print, using Google Docs as printer.
Google docs get the document, but it appears empty, do somebody know the possible problem?</p>
<p>For send the pdf, I read it as an string and:</p>
<pre><code>str = URLEncoder.encode(pdf);
OutputStream out = urlConnection.getOutputStream();
out.write(str.getBytes());
out.close();
</code></pre>
<p>I send more things, I only copy here a part</p>
<p>(Fixed a error, out.getBytes() -> str.getBytes())</p>
|
java android
|
[1, 4]
|
2,261,693
| 2,261,694
|
position of div in particular div
|
<p>i have one card window div in which</p>
<pre><code> <div id="cards_window" class="popup_window ui-dialog ui-corner-all" title="Cards">
<div id="cards_title">
Cards <div id="cards_window_close" class="ui-button ui-icon ui-icon-circle-close popup_close"></div>
</div>
<div id="cards">
<div id="cards_pending"><h3>Cards Pending</h3></div>
<div id="cards_received"><h3>Cards Received</h3></div>
</div>
</div>
</code></pre>
<p>i am rendering in this the my all cards instances at particular positions and i want pending card to be in position in pending div and recievend in the received div for that
what i should do but i am getting the div scattereed in the complete cards div.</p>
|
javascript jquery
|
[3, 5]
|
549,132
| 549,133
|
Jquery chaining a click event does not trigger
|
<p>My hover events are triggered, if I removed the hovered events, click still does not get triggered. What could be the problem?</p>
<pre><code>items = '<li></li>';//some html content
list.html(items);
list.show().children().
hover(function () {
alert('hover');
}, function () {
alert('gone');
}).
click(function () {
alert('clicked'); //this is never reached when I click a list item.
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,844,697
| 2,844,698
|
search and replace text in all java files in a package
|
<p>I am using a few functions in my application which i want to replace with other functions (to make it backward compatible)
My question : is it possible to find & replace some specific text in all java files in a package with some tool, or do i have to do it manually on every java file? I have a LOT of java files in the package.</p>
<p>For eg : i want to replace </p>
<pre><code>getExternalCacheDir()
</code></pre>
<p>with something like </p>
<pre><code>Environment.getExternalStorageDirectory + "/Android/data/<package_name>/cache/"
</code></pre>
<p>the IDE i'm using is Eclipse Helios. Any solutions?</p>
|
java android
|
[1, 4]
|
5,984,674
| 5,984,675
|
use of jquery next() in this queue function
|
<p>I was reading about jquery <code>queue()</code> <a href="http://stackoverflow.com/a/3314877/1252748">here</a>. The first answer is pretty comprehensive:</p>
<pre><code>var theQueue = $({}); // jQuery on an empty object - a perfect queue holder
$.each([1,2,3],function(i, num) {
// lets add some really simple functions to a queue:
theQueue.queue('alerts', function(next) {
// show something, and if they hit "yes", run the next function.
if (confirm('index:'+i+' = '+num+'\nRun the next function?')) {
next();
}
});
});
// create a button to run the queue:
$("<button>", {
text: 'Run Queue',
click: function() {
theQueue.dequeue('alerts');
}
}).appendTo('body');
// create a button to show the length:
$("<button>", {
text: 'Show Length',
click: function() {
alert(theQueue.queue('alerts').length);
}
}).appendTo('body');
</code></pre>
<p><a href="http://jsfiddle.net/mkBJk/" rel="nofollow">jsfiddle</a></p>
<p>I can't understand how <code>next()</code> (line 8) is working however. I get that if I comment it out the "next" confirm box fails to pop up until I press the button again, but I thought <code>next()</code> was used primarily for traversing the dom. Here though, it seems like it's telling the function to run again. </p>
<p>Also, if the queuing of the <code>confirm</code> boxes is within the <code>each()</code> function, why would they all be queued successfully without the <code>next()</code>?</p>
|
javascript jquery
|
[3, 5]
|
5,956,154
| 5,956,155
|
jQuery event delegation with non-trivial HTML markup?
|
<p>I have two DIVs, first one has a link in it that contains the id of the second DIV in its HREF attribute (<a href="http://jsbin.com/azimo/edit" rel="nofollow">complete setup on jsbin</a>). </p>
<p>I want to animate the second DIV when user clicks on the first - anywhere on the first. I also want to use event delegation because I'll have many such "DIV couples" on a page (and I'm using a JS snippet from this <a href="http://stackoverflow.com/questions/663842/jquery-unbinding-events-speed-increases/663886#663886">SO answer</a>). </p>
<p>If user clicks on the DIV itself, it will work - just check firebug console output. The problem is, if user clicks on one of the SPANs or the link itself, it doesn't work anymore.</p>
<p>How can I generalize the click handler to manage clicks on anything inside my DIV?</p>
<p>Here's the JS:</p>
<pre><code>$('#a').click(function(e) {
var n = $(e.target)[0];
console.log(n);
if ( n && (n.nodeName.toUpperCase() == 'DIV') ) {
var id = $(n).find('a').attr('hash');
console.log(id);
$(id).slideToggle();
}
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,654,166
| 3,654,167
|
What is the best way to keep track of the id of an element selected from an auto-suggest textbox?
|
<p>I have an auto-suggest textbox. A user can either pick an already existing item in the database of type in a new one.</p>
<p>How do i keep track of the id if item was selected (Store the id of the list of items coming from the db)?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.