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,751,176
1,751,177
menu item navigation
<p>I use load in jquery to insert a aspx file which consists of a menu into a asp file. it gets inserted correctly with this code:</p> <pre><code> &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $('#menu').load('Menuin.aspx'); }); &lt;/script&gt; </code></pre> <p>menu is just a div element.</p> <p>So, what happens is the file where i refer the menu i.e. load the menu, on clicking menu item i get navigated to Menuin.aspx and not where the menu item needs to go. Do u know any solution for this?</p>
javascript jquery asp.net
[3, 5, 9]
1,226,460
1,226,461
JavaScript execution order - run this(), then that() when this() has finished?
<p>If for example, I have some jQuery doing something simple like:</p> <pre><code>$("div").fadeIn('fast'); $("div").html('Foo'); </code></pre> <p>That would fade in the div, and set its html to "Foo" whilst it's still fading in, whereas:</p> <pre><code>$("div").fadeIn('fast',function(){ $("div").html('Foo'); }); </code></pre> <p>Will only set the html to "Foo" after the div has completed fading in.</p> <p>Is this sort of thing the way JavaScript works in general? So if I had:</p> <pre><code>//do something var i = 42; var foo = i/1; //do something else var bar = fooBar(); </code></pre> <p>Will it start doing something else whilst it's still doing something, or will it wait patiently for do something to finish before it does something else?</p>
javascript jquery
[3, 5]
978,437
978,438
jQuery - setting the selected value of a select control via its text description
<p>I have a select control, and in a javascript variable I have a text string.</p> <p>Using jQuery I want to set the selected element of the select control to be the item with the text description I have (as opposed to the value, which I don't have).</p> <p>I know setting it by value is pretty trivial. e.g.</p> <pre><code>$("#my-select").val(myVal); </code></pre> <p>But I'm a bit stumped on doing it via the text description. I guess there must be a way of getting the value out from the text description, but my brain is too Friday afternoon-ed to be able to work it out.</p> <p>Any ideas SO people?</p>
javascript jquery
[3, 5]
1,368,617
1,368,618
ASP.Net Multi image upload .net compatible commercial control
<p>We are currently planning on trying to allow a user to be able to select multiple images to upload to an ASP.NET website. Can anyone give me some suggestions as to which commercial and free controls which we can use?</p> <p>Requirements would be that:</p> <ul> <li><p>is browser independent (works on IE, Firefox, Chrome, etc. without requiring extra download)</p></li> <li><p>allows user to preview image(s) before selecting</p></li> <li>easy to integrate into asp.net solution.</li> <li><p>a non javascript control (would prefer a c# based solution)</p></li> <li><p>good API</p></li> <li><p>UI easy to change</p></li> <li><p>simple to develop with</p></li> </ul> <p>Any help is appreciated. Thanks.</p>
c# asp.net
[0, 9]
112,603
112,604
How to load contents in `window.showModalDialog()`?
<p>I want to show the contents, which i am loading form the server into a <code>div</code> using <code>jquery load()</code> </p> <p>function, in the javascripy <code>window.showModalDialog()</code>. My code :</p> <pre><code>$("#templatecontainer").load("/Temp/GetTemp", { temp: $("#temp").val(), function (response, status, xhr) { /* code execute after loading the contents */ }); </code></pre> <p>I know that there is a <code>URL</code> parameter in <code>window.showModalDialog(url)</code> but in my case i am passing some data to server for loading the contents from the server and after loading i have some code to execute in the callback funtion. So these options <code>(data passing &amp; callback funtion)</code> are not present in <code>window.showModalDialog(url)</code>. Help me out please?</p>
javascript jquery
[3, 5]
3,162,463
3,162,464
Get XML file with JQuery?
<p>I save following XML code as XML file.</p> <pre class="lang-xml prettyprint-override"><code>&lt;Z&gt; &lt;F&gt;{"attributes":{"type":"form"}}&lt;/F&gt; &lt;M&gt;&lt;%@ taglib prefix="zf" uri="http://www.zcore.org/tags/form" %&gt;&lt;/M&gt; &lt;/Z&gt; </code></pre> <p>now when I want to load with JQuery I get this error :</p> <blockquote> <p>Timestamp: 5/5/2013 7:05:13 PM Error: not well-formed</p> </blockquote> <p>and this for the <code>&lt;%@ ... %&gt;</code> syntax that I put in the XML file.</p> <p>How can I read this file as XML file without error?</p> <p>Thanks to All.</p>
javascript jquery
[3, 5]
1,710,235
1,710,236
How to clear a input array all elements using jQuery
<p>I have defined my form elements using the html array method like this:</p> <pre><code>&lt;input type="text" maxlength="45" name="Apikey[key]"&gt; &lt;select name="Apikey[developer]"&gt; </code></pre> <p>How can I clear all Apikey array using jQuery?</p> <p>The question is how to clear them? All possible forms fields must be cleared.</p>
javascript jquery
[3, 5]
1,405,028
1,405,029
Android - Listview search inner-text by ignoring Case
<p>I am trying to implement "Listview with search" functionality, in which i am successful to search with the word that we trying to enter in the edittext. But i want to implement to search with inner-text from a string. for that i have tried to implement:</p> <pre><code>string.contains(txtSearch.getText().toString()) </code></pre> <p>I am successful in this as well. But <strong>there is a still problem of "Case sensivity", how do i search for inner-text with ignoring case ?</strong> </p> <p>Can you suggest me what should do i with <strong><code>Contains()</code></strong> to ignore case ?</p>
java android
[1, 4]
1,045,244
1,045,245
Event binding Ctrl-Shift-N
<p>I'm using to jQuery.hotkeys to bind keyboard events.</p> <p>I'm trying to bind <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd></p> <pre><code>$(document).bind('keydown', 'ctrl+shift+n', function(e) { e.preventDefault(); alert('Ctrl+Shift+N'); return false; }); </code></pre> <p>The above is not working. Any ideas?</p>
javascript jquery
[3, 5]
4,413,629
4,413,630
Master/Detail filtering with a dropdownlist ASP.NET C#
<p>I have a gridview with selected value bound to a dropdownlist control. I was following <a href="http://www.asp.net/data-access/tutorials/master-detail-filtering-with-a-dropdownlist-vb" rel="nofollow">this</a> so far I could manage to show some data if a user select a value from the dropdownlist but what I want is to show all records in '-- Choose a category --'</p> <p>Here's the GetUser Method but what I want is C# version of it.</p> <pre><code>Public Function GetProductsByCategoryID(categoryID As Integer) _ As Northwind.ProductsDataTable If categoryID &lt; 0 Then Return GetProducts() Else Return Adapter.GetProductsByCategoryID(categoryID) End If End Function </code></pre>
c# asp.net
[0, 9]
4,992,026
4,992,027
ASP.net or jQuery modal pop-up solution
<p>I am looking for a modal pop-up solution with the following requirements:</p> <p>1.) Usable with ASP.net. 2.) The modal pop-up's height is dynamic, for example: the modal pop-up's height would grow based on how much content was in it and if your content is going to make the pop-up taller than the browser's available height, the content would be scrollable.</p> <p>Currently, we are using the ASP.net modal pop-up extender and if our pop-up is larger than the browser window, you have to click and drag. This becomes a problem when the user has a very small resolution and the modal pop-up's drag handle is obscured by the browser's toolbars.</p> <p>I was just wondering if anyone else has run into this problem, if so, how did they solve it.</p> <p>Thank you in advance, Jim</p>
jquery asp.net
[5, 9]
1,268,594
1,268,595
How to get a child control from a Tr?
<p>I have a hidden field in each <code>Tr</code> in my template:</p> <pre><code>&lt;ItemTemplate&gt; &lt;tr style="" class="ui-selectee trClass ui-widget-content"&gt; &lt;td style="width: 100px"&gt; &lt;asp:HiddenField ID="idField" runat="server" Value='&lt;%# Eval("Id") %&gt;' /&gt; &lt;asp:Label ID="IdLabel" runat="server" Text='&lt;%# Eval("Id") %&gt;' /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID="NameLabel" runat="server" Text='&lt;%# Eval("Name") %&gt;' /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID="EmailLabel" runat="server" Text='&lt;%# Eval("Email") %&gt;' /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; </code></pre> <p>No, in the <code>each</code> loop on the selected <code>Tr</code>, how can I get the hidden field ?</p> <pre><code>$(".ui-selected", this).each(function () { var index = $(".selectable tr").index(this); var idField = ?? }); </code></pre> <p>I've already started with:</p> <pre><code>var idField = $(".selectable tr &gt; [id*='idField']"); </code></pre> <p>But seems it does not work!</p> <p>Any help!</p>
javascript jquery asp.net
[3, 5, 9]
1,743,294
1,743,295
Extract word from string using jquery or javascript
<p>I would like to extract word from tag like</p> <pre><code>&lt;li&gt;{firstname} {last name}&lt;/li&gt; </code></pre> <p>So, can I get extract strings "firstname" and "last name" using javascipt or jquery?</p> <hr> <p>Actually I think I have made some mistake to explain.</p> <p>my String looks like</p> <pre><code>&lt;li&gt;&lt;a href="#contactDetail"&gt;{firstname} {lastname}&lt;/a&gt;&lt;/li&gt; </code></pre> <p>here i would like to know how many parameters available means {first..} {last...} that can be only {fi..} and I would like replace with some other parameters.</p> <p>So, I have a list of array which includes many parameters like firstname, lastname, address and so on... now I would like to replace that with according to what i will get from string.</p> <p>Hopefully, I have tried my best to explain my problem.</p>
javascript jquery
[3, 5]
3,482,638
3,482,639
ASP.Net Web Application Choose Client Side Directory
<p>I have the requirement to allow a user to provide a local directory path via a UI in a web application so that we can save it to our database. Our other program (a winforms app) will then use this path to store files (actually recordings) that they have created via the app. </p> <p>Ideally I would like to remove as much room for human error as possible i.e. only let them use paths that exist so would prefer to have some kind of select directory dialog that forces them to use existing directories however I have read that this is not possible on client side code for security reasons which of course makes total sense but is there some way that this can be achieved? So far I have been unable to find anything of use besides just letting them type it in and I am not happy with the lack of control over the path they enter.</p>
c# asp.net
[0, 9]
1,262,233
1,262,234
PHP to ASP.NET conversion
<p>Does anyone know how to convert the following PHP code to ASP.NET?</p> <pre><code>&lt;?php $myFile = "includes/status.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, 1); $status= $theData; if ( $status == 0) { include('includes/bol_down.php'); } elseif ($status == 1){ include('includes/login_form_up.php'); } fclose($fh); ?&gt; </code></pre>
php asp.net
[2, 9]
505,975
505,976
Code won't execute in $(document).ready but will in developer console
<p>I have some code wrapped in <code>$(document).ready(function(){ /*code*/ });</code>, and all of it works fine, except for one line. The code above it works fine, the code below it works fine, I'm not getting any errors in my console.</p> <pre><code>$('.main-right.category').height( $('.footer').height() + $('.main-right.category').height() ); </code></pre> <p>That doesn't fire. However, if I paste that exactly in the developer console and press enter after the page has loaded, it works. All of the elements exist at page load (meaning none are built dynamically via javascript). Same result in chrome, firefox, IE. </p> <p>Any ideas?</p> <p>edit: I should add that my css is loaded before my javascript, and I've done other CSS related tweaks in this same javascript file that have worked fine.</p> <p>Also, if I console.log $('.main-right.category').height() and $('.footer').height() right above that line of code, they both give non-zero integer values like I'd expect.</p>
javascript jquery
[3, 5]
4,640,595
4,640,596
How to remove class with this JS function
<p>This function is set up so it simply finds the -a's- within the class of menu-option-set, and says, upon click, add the class "selected" and remove the class "selected" from all others within that list.</p> <p>What I want to do is simply have it so if you click the item that already has the class of "selected" then it removes the class of "selected". I know it shouldn't be "return false;" I just have that as a placeholder because I can't figure out the proper coding.</p> <p>Thanks guys! :)</p> <pre><code>var $optionSets = $('.menu-option-set'), $optionLinks = $optionSets.find('a'); $optionLinks.click(function() { var $this = $(this); // Remove Class if already selected --&gt; this is the part that I need help with if ($this.hasClass('selected')) { return false; } var $optionSet = $this.parents('.menu-option-set'); $optionSet.find('.selected').removeClass('selected'); $this.addClass('selected'); });​ </code></pre>
javascript jquery
[3, 5]
4,477,515
4,477,516
JQuery condition with blank input
<p>I need to do multiple checks in a jquery condition ...</p> <p>I am looking for something like this:</p> <p>IF checkbox_A is Checked then</p> <p>If input_A is empty then alert('input_A is Required')</p> <p>else Add a class="continue" to the div below.</p> <pre><code>&lt;button id="btn1"&gt;Continue&lt;/button&gt; </code></pre> <p>Possible?</p>
javascript jquery
[3, 5]
1,815,393
1,815,394
Unable read App.config values from Class Library
<p>This may be the simple question to answer, but I am struggling to resolve.</p> <p>I have <code>Web.config</code> with the following values in my Web Application.</p> <pre><code>&lt;appSettings&gt; &lt;add key ="FirstName" value ="Prasad"/&gt; &lt;add key ="LastName" value ="Kanaparthi"/&gt; &lt;/appSettings&gt; </code></pre> <p>I have <code>App.config</code> with following value in my Class Library (Say Lib). </p> <pre><code>&lt;appSettings&gt; &lt;add key ="FullName" value ="Prasad Kanaparthi"/&gt; &lt;/appSettings&gt; </code></pre> <p>The class library(Lib) is pluggable component, I have added the Class Library(Lib) reference in my Web Application. </p> <p>I have the below code in my Class Library(Lib). When i create instance for <code>GetAppSettings</code> in my web application i can see below responses.</p> <pre><code>namespace Lib { public class GetAppSettings { public GetAppSettings() { var FirstName = ConfigurationManager.AppSettings["FirstName"]; // O/P : Prasad var MiddleName = ConfigurationManager.AppSettings["MiddleName"]; // O/P : Kanaparthi var FullName = ConfigurationManager.AppSettings["FullName"]; // O/P : null } } } </code></pre> <p>The Question is how can i read FullName from <code>App.config</code> which is Class Library (Lib).</p> <p><strong>Note</strong>: Since my Lib is pluggable component, So the consumers can change the <code>FullName</code> of their own. I cannot merge values to Web.confing from App.config..</p>
c# asp.net
[0, 9]
5,192,520
5,192,521
Trigger event automatically once per 24h / per user in ASP .NET Application
<p>What selection of solution do I have if I want to launch particular piece of code for logged in user, <strong>but not more often then once per day</strong> (it can change in the future to run once per 6 hours though). I though about setting a cookie that will store a date when code was launched the last time, but I still have to check that cookie's value with every request in global.asax when request start event is raised. Are there any other more efficient solutions?</p> <p>Ah, and also that event result is particular JavaScript code being rendered to user's page. So I need <strong>HttpResponse</strong> instance when the event is launched.</p> <p>Thanks,Pawel</p>
c# asp.net
[0, 9]
4,770,770
4,770,771
Get all folders and files in a directory
<p>i have this directory: </p> <p>/mnt/sdcard/App/Downloads/Files/Documents/ as the root directory or folder of my app. the said directory contains other set of folder and files which i need to show the folder, subfolder and files exact paths in the Logcat.</p> <p>how can i do that without needing to click anything in the view, just on launch, the exact paths will show up in the Logcat.</p>
java android
[1, 4]
427,624
427,625
gridview updating a particular record after search
<p>1.I have one grid having 100 records and it is in updatepanel. 2.I have implimented search using jquery. 3. when i found that record after search then i when i go for for editing all the records are comming. 4. what i want is to have only that record to display for updating. here is my code</p> <pre><code>$(document).ready(function () { GridFilter(); }); function pageLoad(sender, args) { if (args.get_isPartialLoad()) { GridFilter(); } } function GridFilter() { $('#ContentPlaceHolder1_gvTransactionType').GridviewFix().dataTable({ "bPaginate": false, "sDom": 't&lt;"clear"&gt;', "bSort": false }) .columnFilter({ sPlaceHolder: "head:after", aoColumns: [{ type: "text" }, { type: "text" }, { type: "text"}] }); } </code></pre> <ol> <li><p>i have use js to maitain the scroll position for this gridview</p> <pre><code> var totalRows = $("#&lt;%= gvTransactionType.ClientID %&gt; tr").length; alert( totalRows ); var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); function BeginRequestHandler(sender, args) { //Get x and y position of scrollbar before partial postback xPos = $get('scrollDiv').scrollLeft; yPos = $get('scrollDiv').scrollTop; } function EndRequestHandler(sender, args) { //Set x and y position back to the scrollbar after partial postback $get('scrollDiv').scrollLeft = xPos; $get('scrollDiv').scrollTop = yPos; } </code></pre> <p>So any one can say how to handel this.</p></li> </ol> <p>Thank You</p>
javascript jquery asp.net
[3, 5, 9]
5,341,741
5,341,742
Ventrilo Status on your website
<p>I'm looking for some examples of how you would show the status of a ventrilo server on your website. What I would like is the ability to show who is logged on and what channel they are logged into. I have found sites that you can purchase, but would like to either find a open source or free solution.</p> <p>If there is not a solution already in place, some information on how this would be accomplished in either php or c#/asp.net, as I do have both options available. </p> <p>Edit: Now, I would really like to know how this is done.</p>
c# php asp.net
[0, 2, 9]
582,387
582,388
Javascript not executing in iPhone
<p>I want to execute javascript code from my iPhone application using UIWebView.</p> <p>But only html part is executing while javascript part is not executing. It's also not showing an error.</p> <pre><code>NSMutableString *htmlCode = [NSMutableString stringWithString:@"&lt;!DOCTYPE HTML&gt;"]; [htmlCode appendString:@"&lt;html&gt;&lt;head&gt;&lt;tilte&gt; sadaf &lt;/title&gt;"]; [htmlCode appendString:@"&lt;h1&gt;My First Web Page&lt;/h1&gt;"]; [ htmlCode appendString:@" &lt;p id='demo'&gt;This is a paragraph.&lt;/p&gt;"]; [self.webView loadHTMLString:htmlCode baseURL:nil]; webView.delegate= self; [webView stringByEvaluatingJavaScriptFromString:@"&lt;script type='text/javascript'&gt;document.getElementById('demo').innerHTML=Date();&lt;/script&gt; "]; </code></pre>
javascript iphone
[3, 8]
3,795,402
3,795,403
Applying Jquery Accordion on a class
<p>How to apply jquery accordion function to a div with a particular class... i.e. div id='abc'we use $("#abc").accordion(); but how to accomplish if we have div class='abc'??</p>
javascript jquery
[3, 5]
3,245,270
3,245,271
How to poll a directory in ASP.NET?
<p>I want to poll a directory to check whether new file is added to the directory in ASP.NET web application (C#). If any new file is added I want to read that file.</p> <p>Can anybody give me an idea how to do that?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
1,982,602
1,982,603
Getting the count of divs which are children of some divs
<p>I want to get the count of some divs. Here is my page structure as a picture. I want to get the count of cityUnderText divs.</p> <p><img src="http://i.stack.imgur.com/UPfvm.png" alt="enter image description here"></p> <p>I am using these script codes but I m getting <strong>0</strong> but I need just <strong>6</strong>.</p> <pre><code>var h = $("div.cityUnderText").length; alert(h); var h = $(".cityUnderText").length; alert(h); </code></pre>
javascript jquery
[3, 5]
2,747,773
2,747,774
jquery form change
<p>In jQuery, is there a simple way to test if ANY of a forms elements have changed?</p> <p><strong>EDIT:</strong> I should have added that I only need to check on a click() event.</p> <p><strong>EDIT:</strong> Sorry I really should have been more specific! Say I have a form. And I have a button with the following:</p> <pre><code>$('#mybutton').click(function() { //here is where is need to test. if( FORM has changed ) { do something } }); </code></pre> <p>how would I test if the form has changed since it was loaded?</p>
javascript jquery
[3, 5]
620,913
620,914
get element from function in Jquery Method
<p>I made a jquery function that needs to run a user function onclick of the element. The problem is that i need access to the element I am calling the function on. How would i go about accomplishing this. An example of the function is </p> <pre><code> $("#domelement").yesNoDialog({ title:"Ineligible to Register", message:"Stackoverflowtest", yesFunction:function(){ location.href = "www.stackoverflow.com" //How do i grab an attribute from #domelement in here? ie $("domeElement").attr("stuff"); } }); </code></pre> <p>The simplified version of the Jquery Method is as follows</p> <pre><code>(function($) { $.fn.yesNoDialog = function(options) { options = $.extend({}, $.fn.yesNoDialog.defaultOptions, options); this.each(function() { $(this).click(function(){ options.yesFunction(); }); }); return this; }; })(jQuery); </code></pre>
javascript jquery
[3, 5]
4,898,860
4,898,861
Problem removing a dynamic form field in jquery
<p>I'm trying to remove a dynamic form field by click a button. It will also subtract whatever values it had from the total amount from my calculation. This is the code:</p> <pre><code>function removeFormField(id) { var id = $(id).attr("name"); $('#target1').text($("#total" + id).map(function() { var currentValue = parseFloat(document.getElementById("currentTotal").value); var newValue = parseFloat($("#total" + id).text()); var newTotal = currentValue - newValue; document.getElementById("currentTotal").value = newTotal; return newTotal; }).get().join()); $(id).remove(); } </code></pre> <p>Okay, it will do the subtraction portion of the code with no problem, this issue is with the last line to remove the field. If I comment out the rest of the code it will work, but not with the rest of the code. I know this is something simple, yet I can't seem to wrap my mind around it. Can someone please help?</p>
javascript jquery
[3, 5]
2,678,163
2,678,164
How to check if enterkey is pressed in a TextBox in asp.net
<p>I have a asp.net Text Box which accepts date in the format MM/DD/YYYY. After entering the date i will hit enter key.if enter key i need to execute server side code.How can we achieve this ?</p> <p>The problem with Text box is it will fire the Text Changed event only if it looses the focus.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,680,189
4,680,190
How to change time zone for an asp.net application
<p>I need to set default timezone for my ASP.NET to Asia/Dhaka or GMT+6 timezone. But i cannot find a way to change it globally. There is a lot of reference on Stackoverflow and rest of the web for doing this by getting timezone info and calculating correct time for each time i need a DateTime object.</p> <p>But trust me, I don't want to do this in this way. So dont give me any suggestion like that. I want to set the timezone to Asia/Dhaka or GMT+6 preferably from web.config. (Similar we do in php with php.ini) So that each time i need DateTime object the time is evaluated with my timezone no matter what the timezone is for server.</p> <p>Is this possible? If possible then how?? Thanks in advance for the solution :)</p>
c# asp.net
[0, 9]
4,841,387
4,841,388
why print dialog is not opened in IE when printing a dive content using javascript?
<p>I want to print a dive content using javascript and jquery and using following code:</p> <pre><code> n = window.open('M80Print.aspx', '_blank', 'status=no,toolbar=no,menubar=yes,height=400px,width=640px'); n.document.write($('#&lt;%=Print.ClientID %&gt;').html()); n.print(); </code></pre> <p>It works in Fire Fox and Chrome but print dialog is not opened in IE. I use IE8. wht to do?</p>
javascript jquery
[3, 5]
5,650,121
5,650,122
Loading multiple images using BitmapFactory [OutOfMemoryException]
<p>I'm trying to load 30 images into a Bitmap array using BitmapFactory but no matter what I do I keep getting OutOfMemoryException.. I tried resizing it and doing the scale way down.. people usually do 4-8 I tried 12,16,20, nothing works.. </p> <p>I have a loop where it loads in a string of URLs and opens a new httpurlconnection each time around, downloads the image, and attempts to save it as a bitmap. the images are roughly 300kb each.</p> <p>I've read other people having this issue with just one or two images so I'm not sure how what I'm looking to do is even possible.. I understand that jpegs and pngs are compressed format and the filesize is wayyy bigger on the phone because its an uncompressed bitmap, but there must be a way to efficently save a bunch of pictures in an array.. because i've seen it done before.</p> <p>I tried the bitmap.recycle() and it took about 20 seconds to load, but didnt memoryerror, then when I tried viewing the image from the bitmap it gave me the 'cannot view recycled image' ? </p> <p>Not sure if anyone else has tried to load many pictures (30-100) and save it in a bitmap array or if its even possible, but either way, let me know! </p> <p>Thanks.</p>
java android
[1, 4]
4,442,562
4,442,563
Handling client Creation failiers
<p>I am creating a android client app to connect to my server using the following code</p> <pre><code>Socket socket = new Socket(MYIP, PORT); </code></pre> <p>When the server is available it works well , but when the server is not available i want to tell <strong>No server found.</strong> But unfortunately no any exceptions are thrown and my application freezes. </p> <p>What is the recommended way to handle this task</p>
java android
[1, 4]
923,339
923,340
how to target certain time using jquery Countdown - http://keith-wood.name/countdown.html
<p>I am using these jQuery countdown - <a href="http://keith-wood.name/countdown.html" rel="nofollow">http://keith-wood.name/countdown.html</a>.</p> <p>I'm trying to get it to countdown to 17:00 (5:00 PM) everyday but I cannot seem to set the time.</p> <p>Any help welcomed.</p> <p>The code I have is :-</p> <pre><code>$(function() { var now = new Date() var since = new Date(now.getFullYear(), now.getMonth(), now.getDay(), 17, 00); $('#noDays').countdown({until: since, format: 'HMS'}); }); </code></pre> <p>timer is stuck at 0 with this.</p>
javascript jquery
[3, 5]
790,841
790,842
jquery toggle depending on value of textbox
<p>This must be very simple, but I just got stuck with this... I have a list of products with an input field for the quantity and next to it a column with the prices. The prices are displaying two values. One of them is hidden. If the value of the input field goes over a certain value, it should hide the other price. Example: (input: [], show price1price2 )</p> <pre><code>input: [2], show &lt;span class=one&gt;price1&lt;/span&gt; input: [5], show &lt;span class=one&gt;price1&lt;/span&gt; input: [8], show &lt;span class=two&gt;price2&lt;/span&gt; input: [9], show &lt;span class=two&gt;price2&lt;/span&gt; </code></pre> <p>My code so far (example, since I show just 2 products):</p> <pre><code>&lt;form name="formname" action="formaction" method="post"&gt; prod 1&lt;input type="text" value="" class="class1" size="3"&gt;&lt;span class="one"&gt;$1.00&lt;/span&gt;&lt;span class="two"&gt;$2.00&lt;/span&gt; prod 2&lt;input type="text" value="" class="class1" size="3"&gt;&lt;span class="one"&gt;$4.00&lt;/span&gt;&lt;span class="two"&gt;$6.00&lt;/span&gt; &lt;/form&gt; </code></pre> <p>And at the bottom in script tags:</p> <pre><code>$(document).ready(function() { if($('input.class1').val() &gt; 5) { $('.one').show(); $('.two').hide(); } }); </code></pre> <p>What am I missing? The form name perhaps? This is just the first part... </p> <p>My other question would be.. how can I make it so that if the sum of all the input fields (with class1 as class) is more than 5, do the same. (So now depending on the sum of the input fields, rather than each individual one)</p>
javascript jquery
[3, 5]
3,811,134
3,811,135
How do I make a certain javascript function execute on page load for all its elements?
<p>I have a javascript function defined as follows (note that it does not use jquery):</p> <pre><code>function getCalculationFormsByType(selectObject, parentNode, countIndex) { var operationID = parseInt(selectObject.value, 10); var divs = parentNode.getElementsByTagName("DIV"); // the rest of the function goes here, it isn't really important ... } </code></pre> <p>The function is executed in the following way (again, no jquery):</p> <pre><code>&lt;select name="operationChoose[]" onchange="getCalculationFormsByType(this, this.parentNode.parentNode, '1')" &gt; </code></pre> <p>Everything works so far. The problem is that I need to execute this function on page load for all <code>select</code> elements on the page. Like this (my idea uses jquery, but it isn't necessary for the solution):</p> <pre><code>$("document").ready(function(){ $("select[name='operationChoose[]']").each(function(){ getCalculationFormsByType(---I DO NOT KNOW WHAT TO PASS HERE---); }); }); </code></pre> <p>As you can see, my problem is that I don't know what to pass into the function in jQuery. I don't know what those 3 values in javascript are and how can I get them in jQuery's <code>each</code> loop.</p>
javascript jquery
[3, 5]
4,609,866
4,609,867
Combining 2 arrays in javascript
<p>I have 2 arrays in javascript. </p> <pre><code> var A = ['c++', 'java', 'c', 'c#', ...]; var B = [12, 3, 4, 25, ...]; </code></pre> <p>Now from these 2 arrays i want to create another array like :</p> <pre><code> [['c++',12], ['java',3], ['c',4], ['c#', 25] ...]; </code></pre> <p>Both <code>A</code> and <code>B</code> arrays are variable length in my case so how can i do this?</p>
javascript jquery
[3, 5]
3,321,354
3,321,355
Load javascript via jQuery ajax
<p>is it possible to use jQuery %Json function to load a javascriptfile.js asynchronously?</p>
javascript jquery
[3, 5]
4,115,786
4,115,787
Sharing an object between methods in same class (with postback)
<p>I have a user control with a number of methods. I also have a dataset object that I'm filling in one method, but I also need to access that same dataset (and the data in it) in another. </p> <p>I am filling the dataset from some xml that I get from a webservice when someone clicks on a button. The data from the dataset is then bound to a listbox control. When someone selects an item in the list control (I have autopostback set to true on it) it then fires off another method and it's this method where I need to access the data in the dataset, but when I check the immediate window it's telling me that the dataset is set to null.</p> <p>Where am I going wrong?</p> <p><strong>Edited to add psuedocode</strong></p> <pre><code>//Dataset DataSet dsAddress; protected void Page_Load(object sender, EventArgs e) { // Nothing happens to DataSet here } protected void btnPostCode_Click(object sender, EventArgs e) { try { // Dataset has data added here } catch (Exception ex) { lblError.Text = ex.Message.ToString(); } if (!DataHelper.DataSourceIsEmpty(dsAddress)) { //Dataset bound to listbox here } } protected void lstAddressDropdown_SelectedIndexChanged(object sender, EventArgs e) { // Need to access dataset here } </code></pre>
c# asp.net
[0, 9]
4,773,951
4,773,952
Control of forward and backward button of browser
<p>I have a login page and once a person is logged in , he should not be allowed to move back to login page.<br> So , can someone tell me how to disable backward/forward button of browser ?</p>
c# asp.net
[0, 9]
2,627,103
2,627,104
jQuery Delaying Queue
<p>I want to delay things like the css from happening but this method wont work. Any ideas on how I can delay tasks.</p> <pre><code>$(function() { $('.btn').click(function() { $('.divOne').animate({"left": "+=400px"}, "fast").delay(800).css("background-color","yellow"); }); }); </code></pre>
javascript jquery
[3, 5]
4,056,236
4,056,237
background color shows up only when i touch the text
<p>Here is a code snippet</p> <pre><code>int bgColor = Integer.parseInt(summaryReportObj.backgroundColor, 16); lv0.setBackgroundColor(bgColor); </code></pre> <p>The bgColor is blue and shows up only when I touch the text. I want the color to show all the time. When I set background image it displays just great.</p> <p>What am I doing wrong?</p>
java android
[1, 4]
3,334,304
3,334,305
Android/Java - Find text and replace in WebViewClient
<p>I have a WebViewClient that opens in a dialog which i can capture when the URL changes, but on certain URL's I would like to replace certain text but I cant seem to figure out how to get the text of the current webpage that has been loaded so I can search and replace that text.</p>
java android
[1, 4]
4,357,522
4,357,523
When clicking the button, the content doesn't change. - Android
<p>I want to change the content on a button change, but it never works.</p> <pre><code> button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { setContentView(R.layout.blahdyblah); } }); </code></pre> <p>So that's the code, but whenever I want to change setContentView(), it doesn't change, it just clicks and does nothing. If anyone could help me in this task...</p> <p>I've also tried putting the setContentView in another function... That still doesn't work.</p>
java android
[1, 4]
1,704,689
1,704,690
jQuery lightbox plug-in bug
<p>If you visit here: <a href="http://www.egyptevakantie.nl/dahab" rel="nofollow">http://www.egyptevakantie.nl/dahab</a>, click on the "andere plaatsen" tab, and then click on an image it brings up a magnified image, courtesy of the jQuery lightbox plug-in.</p> <p>However, if you do the same here <a href="http://www.egyptevakantie.nl/dahab?rhys=yes" rel="nofollow">http://www.egyptevakantie.nl/dahab?rhys=yes</a> (essentially the same site except for a couple of stylesheets and one or two minor html changes, none of which are in close proximity to the images) the lightbox fails. Instead of overlaying the content the lightbox is appended to the bottom of the page, where it is also displayed weirdly.</p> <p>So far in debugging I've managed to work out that the plug-in still calculates the correct left and top values for where to place the lightbox, but by the time the dhtml is generated the top value has changed completely. </p> <p>Does anyone have any idea why this is happening? </p>
javascript jquery
[3, 5]
2,734,390
2,734,391
Insert new line after two words
<p>I have a text area which is filled from database. In that textarea comma's are replaced by white space using this.</p> <pre><code> document.getElementById('&lt;%=fnl000Db000MESSAGE.ClientId %&gt;').value=document.getElementById('&lt;%=fnl000Db000MESSAGE.ClientId %&gt;').value.replace(/,/g,'\s'); </code></pre> <p>Now I want to insert a new a new line after first two words like this.. eg.. hello admin '\n' welcome </p> <p>how can i get this using javascript. Do i need to use Regex or any other way.</p> <p>I want an output like <br/> Hello Admin<br/> Process are running...</p>
javascript asp.net
[3, 9]
2,231,042
2,231,043
Watermark text in asp.net?
<p>in my web application i am using javascript for water mark text in textboxes it is working fine but for textbox if TextMode property set to Multiline then the water mark text is not displaying is there any particular reason. this is my code...</p> <pre><code>&lt;TextBox ID="txtone" runat="server" tooltip="Enter comments" onblur="if(this.value=='') this.value='Enter text,150 characters only';" onfocus="if(this.value == 'Enter text,150 characters only') this.value='';" value="Enter text,150 characters only"&gt; &lt;/TextBox&gt; </code></pre>
javascript asp.net
[3, 9]
4,544,839
4,544,840
Convert multi-lined variable into a single lined variable using Javascript?
<p>I have a variable:</p> <pre><code> var remoteControlPage = ' &lt;table&gt; &lt;tr&gt; &lt;td class="stats"&gt;sadfsadf&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; '; </code></pre> <p>and I want to use it in a Jquery <code>.html</code> function like this:</p> <pre><code> $("div.devices div.devicePage").html(remoteControlPage); </code></pre> <p>The problem is the html function wont work unless the new content is in a sing line. And this is not desirable when writing html.</p> <p>So I was wondering if there is anyway to convert the <code>var remoteControlPage</code> into a single lined variable?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,156,106
4,156,107
Parse a Text File using Java
<p>could you point me to an example where I can find more information about how to parse a text file in Java and extracting a particular String or reg ex out of It.</p>
java android
[1, 4]
2,978,625
2,978,626
Enable/disable button depending on whether an input in a text box is in a select box
<p>I have nearly finished writing this code: <a href="http://jsfiddle.net/2Jkk9/11/" rel="nofollow">http://jsfiddle.net/2Jkk9/11/</a></p> <p>but I can't figure out how to search the select box for the value in my text box and enable/disabled the button accordingly.</p> <p>That's probably enough explanation.. the code explains all...</p> <p>Thank you :).</p> <p><strong>EDIT</strong> Here's my original code from jsfiddle:</p> <pre><code>&lt;select id="myselect"&gt; &lt;option&gt;apple&lt;/option&gt; &lt;option&gt;banana&lt;/option&gt; &lt;option&gt;pear&lt;/option&gt; &lt;/select&gt; &lt;br&gt;&lt;br&gt; &lt;input id="filter" type="text"/&gt; </code></pre> <p>and</p> <pre><code>$(function() { $('#filter').keyup(function() { // if select box contains input then // $('#mybtn').attr(disabled, 'disabled'); //} //else { // $('#mybtn').removeAttr('disabled'); //} }); }); </code></pre>
javascript jquery
[3, 5]
3,728,094
3,728,095
How to pass a url to a JavaScript function as a parameter?
<p>I just want to pass the base url to a javaScript function. Function call is like as follows </p> <pre><code>&lt;img src="assets/images/c_arow_rite.jpg" onClick="nextMonth('.$bs_url.')"/&gt; </code></pre> <p>It showing an error in the Error Console like </p> <pre><code>Error: SyntaxError: identifier starts immediately after numeric literal Source File: `http://mywebsite/rand/` Line: 1, Column: 15 Source Code: nextMonth(http%3A%2F%2F192.168.1.254%2Frand%2F) </code></pre>
php javascript
[2, 3]
520,416
520,417
extract value from href tag with jquery
<p>Url is generated like this</p> <pre><code>/Home/LoadData?page=2&amp;activeTab=House </code></pre> <p>How can I grab activeTab value?</p>
javascript jquery
[3, 5]
2,002,087
2,002,088
Python Interpreter on Android
<p>So I want to practice python on my Android. Is there a way I can get the interpreter or an interpreter emulator on my device?</p>
android python
[4, 7]
48,042
48,043
Handle/Grip bar convention
<p>Greetings,</p> <p>Because textarea elements do not resize with jquery.touch ( <a href="http://plugins.jquery.com/project/touch" rel="nofollow">http://plugins.jquery.com/project/touch</a> ), I've put an textarea in a table where the first row allows the user to drag the table around and resize it with the textarea growing/shrinking/moving along.</p> <p>It works well, except that users dont seem to 'get' that they can use the bar to resize/move. I was trying to find some 'grip bar' graphics but google isnt helping me.</p> <p>What is the best way to show users that an element can be moved/resized ? Pointer to graphics ( generators ) would be great. Or, does any one know how to make textarea's movable/resizable ?</p> <p>T.</p>
jquery iphone javascript
[5, 8, 3]
4,924,675
4,924,676
How to set time zone for calendar event programmatically?
<p>In android app, while inserting calendar event, how to set time zone for that inserting calendar event. Any help is really appreciated and thanks in advance...</p>
java android
[1, 4]
2,204,688
2,204,689
Delete row from Object
<p>I have an object containing an array:</p> <pre><code>&lt;script type="text/javascript"&gt; var statusData = { Status: [] }; var uniqueCounter = 1 function createJsonFmtData() { // Used as unique id at client side var uniqueCounter =uniqueCounter + 1; statusData.Status.push({ "Name": Name, "Time": Time, "Email": Mail, "Name": Type, "Value": Value, "uniqueId": uniqueCounter }); } function DelNewlyCreStatusRow(rowId) { // First pop elment from json data var val; for (val = 0; val &lt; statusData.Status.length; ++val) { if (statusData.Status[val].uniqueId == rowId) { delete statusData.Status[val]; break; } } &lt;/script&gt; </code></pre> <p>When try to call <code>DelNewlyCreStatusRow</code> it gives the error:</p> <blockquote> <p>TypeError: statusData.Status[val] is undefined</p> </blockquote> <p>I am not able to figure it out here where as I have declared it as global.</p>
javascript jquery
[3, 5]
4,913,340
4,913,341
Is it possible to create a html file using JQuery?
<p>Is it possible to create a html file and save it to a directory using JQuery?</p>
javascript jquery
[3, 5]
2,112,279
2,112,280
Jquery get text value of option on change
<p>I have code like this:</p> <pre><code>&lt;select name="caffe" id="caffe"&gt; &lt;option value="5"&gt;Red&lt;/option&gt; &lt;option value="6"&gt;nmfxnsdnx&lt;/option&gt; &lt;/select&gt; &lt;div id="gll_select"&gt; &lt;script&gt; var caffe = $("#caffe").val(); var cff_name = $("#caffe option:first").text(); $("#gll_select").load("http://localhost/010/form/galleries", {id : caffe}, function(){ $("#gll").on('change', function(){ var cff_name = $("#caffe").text(); get_gallery(cff_name); console.log(cff_name); }); }); &lt;/script&gt; &lt;/div&gt; </code></pre> <p>How can I get text value of the option that has been selected? </p>
javascript jquery
[3, 5]
3,567,439
3,567,440
Setting members of object using function fails
<p>I'm trying to implement a kind of multiplayer extension to a game I'm creating. After a XMLHttpRequest, a game ID is returned, i.e. the ID of a multiplayer session.</p> <p>I'm using the following code, in which Multiplayer is a static class:</p> <pre><code>var Multiplayer = { baseURL: 'http://127.0.0.1:8888/m', gameID: -1, create: function() { $.get(this.baseURL, {'a':'c'}, function(text) { this.gameID = parseInt(text); }); } } </code></pre> <p>It fails, because it seems <code>this.gameID = parseInt(text)</code> cannot be used. When I change it to <code>Multiplayer.gameID = parseInt(text)</code>, it works like a charm.</p> <p>It seems like <code>this.gameID</code> is undefined, while <code>Multiplayer.gameID</code> can both be written to and read from.</p> <p>Is this correct and if so, why is this the case?</p>
javascript jquery
[3, 5]
5,456,870
5,456,871
Scriptlet is not working in head tag
<p>I want to add version number to CSS files for production environment not to force user every time press Ctrl+F5 to download new CSS files after new version is deployed in prod server as the old version is cached in browser.</p> <p>I'm adding build number as querystring param like this.</p> <pre><code>link href="Styles/jquery.Autocomplete.css?&lt;%= Globals.BuildNumber %&gt;" rel="stylesheet" type="text/css" </code></pre> <p>but the output is this</p> <pre><code>link href="../../Styles/jquery.Autocomplete.css?&amp;lt;%= Globals.BuildNumber %&gt;" </code></pre> <p>Looks that scriptlet is not working in head tag, as this is fine in body tag.</p>
c# asp.net
[0, 9]
1,899,586
1,899,587
How do i validate a field based on the input of another field
<p>i have 2 fields and i need to make one of the fields a required fields only if the other field has content of "NO" value in it. So i have researched online and this is what i ended up having. The only question i have and need help with this is the first part of the code where it calls this: .getElementByID. How can i construct that or if you could shed some lights on will be great. thanks.</p> <pre><code>&lt;script&gt; function Validate(source, args) { if (document.getElementById('&lt;%= TextBox1.ClientID %&gt;').value.toUpperCase() == "NO" &amp;&amp; document.getElementById('&lt;%= TextBox2.ClientID %&gt;').value.length == 0) args.IsValid = false; else args.IsValid = true; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="TextBox2 Should Be Filled" Display="Dynamic" ClientValidationFunction="Validate" OnServerValidate="CustomValidator1_ServerValidate"&gt;&lt;/asp:CustomValidator&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Page.Validate(); if (!Page.IsValid) Response.Write("TextBox2 should be filled"); } } protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = !(this.TextBox1.Text.Equals("NO", StringComparison.CurrentCultureIgnoreCase) &amp;&amp; this.TextBox2.Text.Length == 0); </code></pre>
c# asp.net
[0, 9]
2,565,480
2,565,481
Trying to think of a way to dynamically add text for each image
<p>I'm trying to think of a way to make this happen.</p> <p>I'm using a jQuery slideshow to display images, and a simple php script to pull the images from a folder based on which gallery the user selects:</p> <pre><code> $handle = opendir(dirname(realpath(__FILE__)).'/../images/gallery/'.$gallery); while($file = readdir($handle)){ if($file !== '.' &amp;&amp; $file !== '..'){ $pictures .= '&lt;img src="images/gallery/'.$gallery.'/'.$file.'" alt="" /&gt;'; } } </code></pre> <p>I'm doing it this way since there are 6 different galleries, and the amount of photos in each gallery varies, from about 25 - 40 pictures. If I did the site staticly, or had a database running it'd be no problem, but I can't think of a PHP way of doing this.</p> <p>Basically here is an example of what I'm hoping to do: <a href="http://diguiseppi.com/Brad/index.php?cat=Create&amp;do=International-Gallery" rel="nofollow">I hard coded all the images and text</a> </p> <p>But on <a href="http://diguiseppi.com/Brad/index.php?cat=Create&amp;do=Gallery" rel="nofollow">this page</a> I can't think of a good way of doing it</p>
php jquery
[2, 5]
4,036,777
4,036,778
Adding a parameter to callback function inside of callback function
<p>This might have been asked before, but I can't find any good examples on how to accomplish this.</p> <p>I have a callback which is fired. But inside this callback i need to add a new parameter to the ending callback function. How can I do this:</p> <pre><code>var form_to_submit = function() { var parameters = { param1 : "1", param2 : "2" } // do_something with the parameters } first_function(form_to_submit); function first_function(form_to_submit) { if($.isFunction(form_to_submit)) { var token = "new parameter"; // this parameter should be added to parameters in form_to_submit() form_to_submit(); // need to pass on the token to this function call } } </code></pre>
javascript jquery
[3, 5]
3,893,442
3,893,443
Change class view using buttons
<p>I'm trying to have a program go from one class to another by the press of a button. I know this needs to be done with intent, but I'm not sure exactly what action to use for intent. Also, i would rather not try to use OnClickListener since it seems to me to be a bit excessive for what I need to do. Though I could be wrong and I'm just over thinking it. Here's what I have for the code:</p> <pre><code> public void loginScreen(View view) { // Should take user to the next view when button pressed Intent intent = new Intent(this, LoginActivity.class); Button login = (Button) findViewById(R.id.button1); intent.getData(login); startActivity(intent); } </code></pre> <p>I want it to go to the next screen when only button1 is pressed so i don't know if just lines 3 and 6 are the only ones needed, but it won't work if it's just those two. I believe the problem is getData, i don't know what to put there, but i know getData's wrong. I'm probably also missing something else, but I don't know what.</p> <p>Also, forgive me if this isn't easy to follow, first time trying to ask a question here.</p>
java android
[1, 4]
5,680,150
5,680,151
REQUEST_TIME in C#
<p>Is there a similar function in C# that is akin to the PHP functionality of <code>("$_SERVER['REQUEST_TIME']")</code>?</p>
c# asp.net
[0, 9]
5,395,933
5,395,934
Simple javascript document.write isn't working
<p><a href="http://www.jsfiddle.net/T6Jqx/13/" rel="nofollow">Here's the code in question</a></p> <p>I'm trying to create a simple application - each of the three men has a <code>rel="x"</code> attribute attached them. I'm using <code>var regionId = $('img.selected-region').attr('rel');</code> to make the <code>rel</code> of the currently selected item the value of reginId.</p> <p>I want to test this out by performing a simple <code>document.write(regionId)</code> command in a div under the pictures of the men. However, it's not working. Have I put the var regionId definition in the right place in the script window? </p> <p>I'm completely new to javascript so the syntax is confusing to me - and help would be greatly appreciated.</p>
javascript jquery
[3, 5]
5,166,098
5,166,099
Android Game Dev: Draw menus with SurfaceView?
<p>I want to create a menu and level select screen for my Android game but I'm not sure how to go about doing so. I already have the game portion of my game which renders to a SurfaceView object so I was wondering should I also have the menus render to a SurfaceView? If so should it be rendering to the SAME surface view or should the game and each menu screen have their own?</p> <p>Basically I want it set up like so in terms of the activity flow:</p> <pre><code>Main Menu &gt; Level Select &gt; Game </code></pre> <p>I currently have the level select set up as a regular Android UI .xml layout but since I scale the rendered image to fit whatever screen it's playing on I can't do that unless it's drawing to a SurfaceView.</p> <p>Any help or advice is appreciated! :-)</p>
java android
[1, 4]
2,096,676
2,096,677
Why are these nested triggers for jQuery not working?
<p>I am using the following code to load two underscore.js templates. Once the first link is clicked, the skeleton template is loaded. The first trigger executes the find bind, which executes the loadBookmarks function correctly, but the 'loaded' trigger never fires and the loadFriendBookmarks never executes. Why is this? Is there another way to make this happen?</p> <pre><code>$('#bookmarks-link').click(function() { $('#bookmarks-count').text("0"); var skeleton = modalTemplate(); $('#bookmarks').append(skeleton); $('#bookmarks').trigger('skeleton'); }); $('#bookmarks').bind('skeleton', function() { $('#bookmarks .thumbnails').loadBookmarks( getBookmarksUrl(1) ); // If I add an alert('hi') here, it works perfectly. $('#bookmarks').trigger('loaded'); }); $('#bookmarks').bind('loaded', function() { $('#bookmarks .thumbnails a').each(function() { $(this).bind('click', function() { $('#bookmarks .bookmarks-table tbody').empty(); $('#bookmarks .bookmarks-table tbody').loadFriendBookmarks( getFriendBookmarksUrl($(this).attr('data-item')) ); }); }); }); </code></pre> <p>So interesting enough, the triggers do work correctly: If I stick an alert in between loadBookmarks and trigger, everything works fine. If I take it out, then it doesn't. Any idea why?</p>
javascript jquery
[3, 5]
2,090,105
2,090,106
How do you move html from one div to another with Jquery without breaking javascript
<p>I have two divs for different sections of my webpage, a working and a reference section. One is fixed size, the other is variable sized and they are vertically stacked. I am trying to design it so that if you want to work on something in the reference pane, you click a link and it swaps all the data between the two panes. My idea was to do the following:</p> <pre><code>var working = $("#working_pane").html(); var ref = $("#reference_pane").html(); $("#working_pane").html(ref); $("#reference_pane").html(working); </code></pre> <p>The problem with this, is it seems that any javascript referenced inside of these panes (for example, in place editors) get broken upon switching. No javascript errors occur, it's just that nothing happens, like the javascript ties are broken.</p> <p>Is there any to move the html without breaking the javascript contained?</p>
javascript jquery
[3, 5]
1,962,812
1,962,813
Show/Hide a text box
<p>I have this code that Show/Hide a text box if I select a category from a dropdown list. It's working fine, but what I want is if someone selects a different category then the text box disappears or be replaced with another text box. EX: If I select food then a text box appear, and if I select a different category the previous text box hides again without refreshing the whole page. Here what I've got so far:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function addSubject(){ selectedSubject = document.getElementById('category').value if (selectedSubject == 'food'){ document.getElementById('box').style.display = 'block'; } } &lt;/script&gt; &lt;? include ('connect.php'); $query="SELECT id, name FROM category "; $result=mysql_query($query); ?&gt; &lt;form&gt; &lt;select name="category" id="category" onchange="addSubject()"&gt; &lt;option&gt;Select Category&lt;/option&gt; &lt;?php while($row=mysql_fetch_array($result)) { ?&gt; &lt;option value=&lt;?php echo $row['id']?&gt;&gt;&lt;?php echo $row['name']?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;div class="box" id="box" style="display: none;"&gt; &lt;div&gt; &lt;span&gt;Title :&lt;/span&gt;&lt;input type="text" name="text" size="8" maxlength="7" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>Like always thanks in advance</p>
php javascript
[2, 3]
5,293,109
5,293,110
Is it a good idea to put class parameters in a session object?
<p>I recently asked a question about storing the results of a database search in which I put a datatable with over 100,000 records into a session object and then would retrieve that session on another page and bind it to a gridview and display the results. This is obviously not very good, so instead of doing that, is a good option to store the parameters for the search in a session object and pass that to the results page and run the search query on that page instead.</p>
c# asp.net
[0, 9]
3,594,971
3,594,972
Why is it allowed to make a non-static reference from static object?
<p>Here is an example: </p> <pre><code>public class Test extends Activity { Button button; public int i; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button = (Button) findViewById(R.id.Button01); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { i = 10; // How can this be possible? } }); } } </code></pre>
java android
[1, 4]
2,430,158
2,430,159
Is it possible to use 2 versions of jQuery on the same page?
<p><em>NOTE: I know similar questions have already been asked <a href="http://stackoverflow.com/questions/613808/is-it-possible-to-load-multiple-different-version-of-jquery-on-the-same-page">here</a> and <a href="http://stackoverflow.com/questions/1117463/two-jquery-versions-on-the-same-page">here</a>, but I'm looking for additional clarification as to how to make this work or good reasons for avoiding it entirely.</em></p> <p>I'm adding functionality to an existing web site that is already using an older version of the jQuery library (1.1.3.1). I've been writing my added functionality against the newest version of the jQuery library (1.4.2). I've tested the website using only the newer version of jQuery and it breaks functionality, so now I'm looking at using both versions on the same page. How is this possible?</p> <p>What do I need to do in my code to specify that I'm using one version of jQuery instead of another? For example, I'll put <code>&lt;script&gt;</code> tags for both versions of jQuery in the header of my page, but what do I need to do so that I know for sure in my calling code that I'm calling one version of the library or another?</p> <p>Maybe something like this:</p> <pre><code>//Put some code here to specify a variable that will be using the newer //version of jquery: var $NEW = jQuery.theNewestVersion(); //Now when I use $NEW, I'll know it's the newest version and won't //conflict with the older version. $NEW('#personName').text('Ben'); //And when I use the original $ in code, or simply 'jquery', I'll know //it's the older version. $('#personName').doSomethingWithTheOlderVersion(); </code></pre> <p><em>UPDATE: After reading some of the answers, I'm starting to wonder if it's even a good idea to try to play this game at all...</em></p>
javascript jquery
[3, 5]
3,151,374
3,151,375
org.apache.commons.net.nntp crashing android
<p>Hay Guy, I'm using org.apache.commons.net.nntp to connect to a nntp server, however running a simple nntp.connect(host, port) crashes the android.</p> <p>Anyone got any ideas? Do java packages work with android straight out of the box? or do they need editing?</p> <p>Thanks</p> <pre><code>import org.apache.commons.net.nntp.*; public class newsdroid extends Activity { NNTP usenet; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); try { usenet.connect("ssl-eu.astraweb.com", 563); } catch (SocketException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } </code></pre>
java android
[1, 4]
784,458
784,459
namespace conflict
<p>I got:</p> <pre><code>using System.Diagnostics; using System.Reflection; namespace Site { public abstract class General { private static string _version; public static string Version { get { return _version; } } static General() { Assembly assembly = Assembly.GetExecutingAssembly(); FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); _version = fileVersionInfo.ProductVersion; } } } </code></pre> <p>The code works fine and I can get the version anywhere I need accessing <code>Site.General.Version</code>. Now I'm trying to use the inline tag <code>&lt;% = Site.General.Version %&gt;</code> but I'm getting a error message saying <code>System.ComponentModel.ISite</code> does not contain a definition or 'General'.... I think there's a namespace conflict because of the <em>interface</em> <code>ISite</code>.</p> <p>How can I solve this?</p>
c# asp.net
[0, 9]
374,763
374,764
Constraint - Derived Class must have a default Constructor
<p>I want to Constraint that the Derived Class must have a Default Constructor. I am currently thinking it in a perverted way</p> <pre><code>template &lt;typename Derived&gt; class Base{ public: Base(){ } virtual ~Base(){ new Derived; } }; </code></pre> <p>Another idea comes to mind is to keep a pure virtual create() method with no arguments.</p> <p>But is there any other way ? Other than these two. I am thinking it in C++ way. But Is there any way to do this in PHP (I expect negetive answer LOL)</p>
php c++
[2, 6]
4,187,768
4,187,769
jQuery - Many toggle sliders, only one visible at the time
<p>I have four jquery sliders in a page with these scripts:</p> <pre><code>$(document).ready(function(){ $("#information").click(function(){ $("#information_show").slideToggle("medium"); }); }); $(document).ready(function(){ $("#menu").click(function(){ $("#menu_slide").slideToggle("medium"); }); }); $(document).ready(function(){ $("#books").click(function(){ $("#books_toggle").slideToggle("medium"); }); }); $(document).ready(function(){ $("#content").click(function(){ $("#content_div").slideToggle("medium"); }); }); </code></pre> <p>So for example when I click on the div <code>#information</code> the <code>#information_toggle</code> is visible. I wounder if there is any way to make the sliders only show one at once.</p> <p>Example: When click on <code>#books</code>, the <code>#books_toogle</code> show. Now when click on <code>#menu</code> the <code>#menu_slide</code> shows, at the same time the <code>#menu_slide</code> shows <code>#books_toggle</code> toogle/close automatic. So only one hidden div will show at once.</p>
javascript jquery
[3, 5]
452,294
452,295
In jQuery how can I parse out and execute JavaScript using getJSON
<p>In the following code:</p> <pre><code> function main() { jQuery(document).ready(function($) { /******* Load HTML *******/ var jsonp_url = "http://184.72.244.64/test.fwx?callback=?"; $.getJSON(jsonp_url, function(data) { $('#DivTagToInsertTheHTML').html(data.html); }); }); } </code></pre> <p>I would like to deliver a considerable amount of JavaScript through to the client browser, using this function. The reason I need to use this is I need to retrieve it from an outside server which breaks the "same origin policy". So when I get the JavaScript inside JSON, how do I parse it out and execute it?</p> <p>Is there a better way of doing this?</p> <p>Tanks in advance Jeff</p>
javascript jquery
[3, 5]
5,392,566
5,392,567
Make a hyper link on Html link with Jquery
<p>I have Html contents like</p> <pre><code>&lt;span&gt; http://j.mp/eUcRNK &lt;/span&gt; </code></pre> <p>I want to hyperlink on above html text like this</p> <pre><code>&lt;span&gt; &lt;a href="http://j.mp/eUcRNK" class="link" target="_blank"&gt; http://j.mp/eUcRNK &lt;/a&gt; &lt;/span&gt; </code></pre> <p>How I can do that..</p>
javascript jquery
[3, 5]
4,834,343
4,834,344
Simple jquery ajax response on error
<p>A couple of questions, first with this var string below, the 1 one works but I need to get the second one working, there is a snytax error because I am not sure how to write it</p> <pre><code>var string = 'id='+ id ; var string = 'id='+ id 'USER=1'; </code></pre> <p>Second; This ajax call below, it post to delete.php to delete a comment, it works but I would like to add in some error handling. Once I add it into the backend, how can I make it show an error in jquery ?</p> <pre><code>$.ajax({ type: "POST", url: "delete.php", data: string, cache: false, success: function(){ commentContainer.slideUp('slow', function() {$(this).remove();}); $('#load').fadeOut(); } </code></pre>
php jquery
[2, 5]
3,172,430
3,172,431
Selected Spinner array into TextView
<p>I have my spinner pulling from an array,(that works).. What I want to happen is I have several textviews that will map to whatever is selected from the spinner array... e.g British Columbia. then the Texviews will all say british columbia. I figure i should be using a setText of some kind but have been on able to find an example anyhelp would be appreciated. Here is my spinner code:</p> <pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner); ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource( this, R.array.material_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); final TextView tv34=(TextView) findViewById(R.id.tv34); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) { tv34.setText(parent.getItemAtPosition(pos).toString()); } public void onNothingSelected(AdapterView&lt;?&gt; parent) { // Do nothing. } }); </code></pre>
java android
[1, 4]
5,967,854
5,967,855
How to set an object param name with a string in JavaScript?
<p>I'm writing a plugin for jQuery where I need to send a little piece of data to the server, but I need to set the var name of the json object I send:</p> <pre><code>var params = {name:'var_name'} $.post('page.php', {params.name:'the value'}, function () { /* etc. */ }); </code></pre> <p>how can I do it?</p>
javascript jquery
[3, 5]
1,176,163
1,176,164
jQuery MaskMoney - set input to to beginning of field
<p>I made this <a href="http://jsfiddle.net/Qct6U/" rel="nofollow">jsfiddle</a> to demonstrate my problem. When I focus on the field the cursor goes to the end. You start typing cents before you dollars. I do not want this behavior. I want it to type dollars until the user presses '.'</p> <p>Some help would be greatly appreciated.</p>
javascript jquery
[3, 5]
4,916,968
4,916,969
".resize" event don't work with "offset" together
<p>Can anyone tell me what is wrong with this code? it just crashes my browser and that's all...</p> <pre><code>$(window).resize(function() { var p = $("#outer_wrap"); var offset = p.offset(); alert("left: " + offset.left + ", top: " + offset.top); }); </code></pre>
javascript jquery
[3, 5]
3,207,359
3,207,360
Retrieving an element by array index in jQuery vs the each() function
<p>I was writing a "pluginable" function when I noticed the following behavior (tested in FF 3.5.9 with Firebug 1.5.3).</p> <pre><code>$.fn.computerMove = function () { var board = $(this); var emptySquares = board.find('div.clickable'); var randPosition = Math.floor(Math.random() * emptySquares.length); emptySquares.each(function (index) { if (index === randPosition) { // logs a jQuery object console.log($(this)); } }); target = emptySquares[randPosition]; // logs a non-jQuery object console.log(target); // throws error: attr() not a function for target board.placeMark({'position' : target.attr('id')}); } </code></pre> <p>I noticed the problem when the script threw an error at <code>target.attr('id')</code> (<code>attr</code> not a function). When I checked the log, I noticed that the output (in Firebug) for target was:</p> <pre><code>&lt;div style="width: 97px; height: 97px;" class="square clickable" id="8"&gt;&lt;/div&gt; </code></pre> <p>If I output <code>$(target)</code>, or <code>$(this)</code> from the <code>each()</code> function, I get a nice jQuery object:</p> <pre><code>[ div#8.square ] </code></pre> <p>Now here comes my question: why does this happen, considering that <code>find()</code> seems to return an array of jQuery objects? Why do I have to do <code>$()</code> to <code>target</code> all over again?</p> <pre><code>[div#0.square, div#1.square, div#2.square, div#3.square, div#4.square, div#5.square, div#6.square, div#7.square, div#8.square] </code></pre> <p>Just a curiosity :).</p>
javascript jquery
[3, 5]
373,998
373,999
If-statement dont get true, but it should
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java">How do I compare strings in Java?</a> </p> </blockquote> <p>I dont understand why the the first (same for other ones) <code>if</code> in sendMessage never gets true. The reciever String is exactly what it should be to be true?! </p> <p>When i run this and press <strong>send to Alice</strong> I get 3 Toast:</p> <ol> <li>Send to Alice (=value of reciever)</li> <li><em>[a blank toast]</em> (=value of phoneNumber)</li> <li><p>You have to choose a message (=nevermind this!)</p> <pre><code>public void onSend(View src){ Button b = (Button)src; sendMessage(b.getText().toString()); } public void sendMessage(String reciever){ String phoneNumber = ""; Toast.makeText(this, reciever, Toast.LENGTH_LONG).show(); if (reciever == "Send to Alice"){ phoneNumber = "01230340645"; Toast.makeText(this, "hej", Toast.LENGTH_LONG).show(); } else if (reciever == "Send to Bob"){ phoneNumber = "020312039"; } else if (reciever == "Send to John"){ phoneNumber = "0102308013"; } Toast.makeText(this, phoneNumber, Toast.LENGTH_LONG).show(); if (_message == ""){ Toast.makeText(this, "You have to choose a message!", Toast.LENGTH_LONG).show(); } else { Intent sms = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:" + phoneNumber)); sms.putExtra("sms_body", _message); startActivity(sms); _message = ""; } } </code></pre></li> </ol>
java android
[1, 4]
4,987,438
4,987,439
Failed to save image to sdcard
<p>I try to download an image with this code and save it : in this line:</p> <pre><code>OutputStream os =new FileOutputStream(f); </code></pre> <p>i try it on the emulator.my app get exception that there is no permission to save to this path:</p> <pre><code>java.io.FileNotFoundException: /mnt/sdcard/InterFlora/1221618532: open failed: EACCES (Permission denied) </code></pre> <p>i also add this line :</p> <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; </code></pre> <p>this is the code:</p> <pre><code> RetreiveImage extends AsyncTask&lt;String, Void,Bitmap&gt; { Item m_item; File f; public RetreiveImage(Item aItem , File aFile){ m_item = aItem; f = File (m_Sdcard.getAbsolutePath() + "/myFolder"); } @Override protected Bitmap doInBackground(String... params) { try { Bitmap bitmap=null; InputStream is=new URL(m_item.small).openStream(); OutputStream os =new FileOutputStream(f); os.close(); return bitmap; } catch (MalformedURLException e) { return null; } catch (IOException e) { return null; } } } </code></pre> <h1>Edit</h1> <pre><code>File m_Sdcard = Environment.getExternalStorageDirectory(); File cacheDir =new File (m_Sdcard.getAbsolutePath() + "/MyFolder"); if(!cacheDir.exists()) cacheDir.mkdirs(); </code></pre>
java android
[1, 4]
1,172,522
1,172,523
Can PHP be more like python?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1266911/does-php-have-an-equivalent-to-pythons-list-comprehension-syntax">Does PHP have an equivalent to Python&#39;s list comprehension syntax?</a> </p> </blockquote> <p>Does PHP have any equivalent of the simple and awesome list comprehension in python? Specifically, can I do <code>a = [x for x in xrange(1,20)]</code> in PHP w/o annoying loops?</p>
php python
[2, 7]
1,722,309
1,722,310
Repeater Paging
<p>I am using the following code for paging inside a repeater. I have the paging size set to 3. If there are exactly 3 speech bubbles - the next button is displayed and when I selected I'm redirected to an empty page. However, if there are 4 sepeech bubbles, everything is fine. Is there a way to make sure that if the page size is 3 - no buttons are displayed? Thanks!</p> <pre><code> PagedDataSource pagedData = new PagedDataSource(); pagedData.DataSource = ds.Tables[0].DefaultView; pagedData.AllowPaging = true; pagedData.PageSize = 3; pagedData.CurrentPageIndex = pageNum; Repeater1.DataSource = pagedData; Repeater1.DataBind(); cmd.Connection.Close(); cmd.Connection.Dispose(); if (pageNum == 0) { btnPrev.Visible = false; } if (pageNum &gt;= Math.Floor((decimal)ds.Tables[0].Rows.Count / 3)) { btnNext.Visible = false; } } protected void btnNext_Click(object sender, EventArgs e) { // Redirects to next page Response.Redirect("negativestorydetail.aspx?guid=" + id + "&amp;name=" + name + "&amp;role=" + company_role + "&amp;member=" + mem_id + "&amp;company=" + co_id + "&amp;project=" + proj_name + "&amp;proj_id=" + proj_id + "&amp;tag=" + tag + "&amp;page=" + Convert.ToString(pageNum + 1)); } protected void btnPrev_Click(object sender, EventArgs e) { // Redirects to previous page Response.Redirect("negativestorydetail.aspx?guid=" + id + "&amp;name=" + name + "&amp;role=" + company_role + "&amp;member=" + mem_id + "&amp;company=" + co_id + "&amp;project=" + proj_name + "&amp;proj_id=" + proj_id + "&amp;tag=" + tag + "&amp;page=" + Convert.ToString(pageNum - 1)); } </code></pre>
c# asp.net
[0, 9]
1,198,120
1,198,121
How to select a tag with a variable value in jQuery
<p>I am very new to jquery/javscript. I have a simple question.</p> <p>Lets say i have a tag like this:</p> <pre><code>&lt;Table id="mytable" &gt; &lt;Table&gt; </code></pre> <p>And i want to add some rows to this table.</p> <p>Then we do like:</p> <pre><code>$("#mytable").append("&lt;tr&gt;&lt;td&gt;value&lt;/td&gt;&lt;/tr&gt;"); //some thing like this may not be having the right syntax </code></pre> <p>Now my question is lets the id of the table is in a variable for example:</p> <pre><code>var table="mytable"; //which is coming from the back end </code></pre> <p>Now my using the "table" variable how can I append the row..?</p> <p>Is that going to be </p> <pre><code>$("#"+table).append("&lt;tr&gt;&lt;td&gt;value&lt;/td&gt;&lt;/tr&gt;");// </code></pre> <p>Can some one help me out in this simple thing? Thanks, Swati</p>
javascript jquery
[3, 5]
2,132,339
2,132,340
I tried trial and error with jquery, but it doesn't work
<p>I have a form with many selects created with php. The form has 3 type of selects: the second select is conditioned on the choice of the first and the third is conditioned on the choice of the second. Every select has an id like this: type[00], type [01], type[02]; make[00], make[01], make[02]; model[00], model[01], model[02] ...</p> <p>I use <a href="http://forum.codecall.net/topic/59341-php-sql-jquery-and-ajax-populate-select-boxes/#sthash.i2ISGn69.dpbs" rel="nofollow">this script</a>. I tried to edit the code to suit my needs, but I know nothing of java or jquery. I think that the problem is the function finishAjax becuase I don't know how to say it that the id is different for any select.</p> <pre><code>$(document).ready(function() { $('select[id^="type"]').change(function(){ $('select[id^="make"').fadeOut(); $.post("ajax/ajax_make.php", { type: $('select[id^="type"]').val() }, function(response){ setTimeout("finishAjax('make', '"+escape(response)+"')", 400); }); return false; }); $('select[id^="make"').change(function(){ $('select[id^="model"').fadeOut(); $.post("ajax/ajax_model.php", { type: $('select[id^="type"]').val(), make: $('select[id^="make"').val() }, function(response){ setTimeout("finishAjax('model', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response){ $('select[id^="'+id+'"]').html(unescape(response)); $('select[id^="'+id+'"]').fadeIn(); } </code></pre>
javascript jquery
[3, 5]
3,617,644
3,617,645
Scroll to a div within a div on certain action
<p>Is it possible to scroll to a particular div automatically when called upon in JavaScript/jQuery?</p> <p>I can use <code>$('div[compid="' + compid + '"]')</code> to get the correct div but I need to force the div with that particular compid to be scrolled to on the screen.</p> <pre><code>$(document).delegate(".heading",'click',function(){ $(this).next().slideToggle('slow'); }); </code></pre> <pre><code>&lt;div id="listings"&gt; &lt;div class="heading" compid="80" usedspec="33"&gt;&lt;div class="content"&gt;content in here&lt;/div&gt;&lt;/div&gt; &lt;div class="heading" compid="81" usedspec="34"&gt;&lt;div class="content"&gt;content in here&lt;/div&gt;&lt;/div&gt; &lt;div class="heading" compid="82" usedspec="35"&gt;&lt;div class="content"&gt;content in here&lt;/div&gt;&lt;/div&gt; &lt;div class="heading" compid="83" usedspec="36"&gt;&lt;div class="content"&gt;content in here&lt;/div&gt;&lt;/div&gt; &lt;div class="heading" compid="84" usedspec="37"&gt;&lt;div class="content"&gt;content in here&lt;/div&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,087,061
5,087,062
Repeat jQuery ajax request
<p>I make an ajax request to the server. And sometimes I receive 502 error. So, if that happened error() method is called.</p> <p>How can I repeat request if receive an error? The code should looks like this:</p> <pre><code>$.ajax({ url: 'http://server/test.php', type: 'GET', dataType: 'jsonp', cache: 'false', timeout: 32000, success: function(data) { //some actions here }, error: function(jqXHR, textStatus, errorThrown) { console.log("Error[refresh]: " + textStatus); console.log(jqXHR); // here I want to repeat the request like "this.repeat()" }, }); </code></pre>
javascript jquery
[3, 5]
1,951,854
1,951,855
Parameter is not valid exception when saving image in winform
<p>I am getting a parameter is not valid exception..While saving the image</p> <p>Here is my code to save the image</p> <pre><code>if (!File.Exists(pictureBox1.Tag.ToString())) { Image image = pictureBox1.Image; image.Save(pictureBox1.Tag.ToString(), ImageFormat.Jpeg); } else { string delStr = pictureBox1.Tag.ToString(); pictureBox1.Image.Dispose(); File.Delete(delStr); Image image = pictureBox1.Image; image.Save(delStr, ImageFormat.Jpeg); pictureBox1.Image = Image.FromFile(delStr); } </code></pre>
c# asp.net
[0, 9]
3,778,798
3,778,799
how to make system tray alert using php or jquery or java?
<p>I am writing a program which requires to alert the user when a particular event occurs, it can be a balloon tip, or system tray alert like skype, or antivirus alert? </p>
php javascript jquery
[2, 3, 5]
3,463,449
3,463,450
display content of a URL in a div
<p>I am opening a popup window in the following format :</p> <pre><code>window.open('http://URL', 'invitationwindow', 'height=250,width=500,scrollbars=yes,resizable=yes,status=yes') </code></pre> <p>How I do I Get the content of the popup in a div in the same page. I mean, I don't want the popup but the content of it should be displayed in the same page from where the popup is fired. </p> <p>How can this be done using Jquery? I know <code>.append()</code> and <code>.html()</code> will add content to div, but in this case I am getting content from the URL like <a href="http://example.com" rel="nofollow">http://example.com</a> . </p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,665,109
1,665,110
What are the tools/frameworks used to build C# ASP.net applications?
<p>I am basically a java programmer who wants to move to .net. I haven't worked in .NET companies so I don't have any idea about the tools they use. In a Java company people use Maven, Hibernate and frameworks such as JSF or Tapestry.</p> <p>My questions are: </p> <p>What are the tools/frameworks that .NET/C# companies use? Do they use ASP.NET MVC? Do they use any ORM tool? Do they use any framework?</p> <p>I will be happy if someone could tell me about this.</p>
c# asp.net
[0, 9]
5,545,657
5,545,658
javascript get digits after last non-numeric charachter
<p>I have 3 input in form</p> <pre><code>&lt;input type="text" name="full" /&gt; &lt;input type="text" name="FilterLeft" /&gt; &lt;input type="text" name="FilterRight" /&gt; </code></pre> <p>When user typing in $(#full), function must be devide value into left side after last non-numeric symbol, and right side after last non-numeric symbol. For example, if user typed <code>'6s3f23234'</code>. I want to divide it into <code>$('#FilterLeft').val('6s3f')</code> and <code>$('#FilterRight').val('23234')</code>. How to do this? thanks.</p>
javascript jquery
[3, 5]