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
295,850
295,851
repeat element by javascript
<p>I want to repeat these elements: contain a cell and select menu bring data from the database through while</p> <pre><code>&lt;div id="orginal"&gt; &lt;td width="99"&gt; &lt;select name= "certificate" id="xx" onchange="BK.Ajax.Updates('newfile.php?id='+document.getElementById('xx').value,'ajx');" size="1"&gt; &lt;option&gt;.....&lt;/option&gt; &lt;? $sql_company=mysql_query("select * from company"); while ($row=mysql_fetch_array($sql_company)) { echo "&lt;option value='$row[id]'&gt; "; echo $row['name'] ; echo "&lt;/option&gt;"; } ?&gt;&lt;/select&gt; &lt;/td&gt; </code></pre> <p></p> <p>in another div:</p> <pre><code>&lt;div id="wrapper"&gt; &lt;/div&gt; </code></pre> <p>Using Javascript code:</p> <pre><code>&lt;script language="javascript"&gt; function repeat() { var el = document.createElement('div'); var oldHTML = document.getElementById('orginal').innerHTML; el.innerHTML = oldHTML; document.getElementById('wrapper').innerHTML = el; } &lt;/script&gt; </code></pre>
php javascript
[2, 3]
2,200,898
2,200,899
Is it possible to convert this simple jQuery snippet to JavaScript?
<p>I have this simple jQuery snippet (very simple with jQuery) and I want to convert this to javascript which seems to be really hard. </p> <p>For example, I have no idea what to do with the .each - function.</p> <p>Hope you can help, give me a hint or solve the problem quickly.</p> <pre><code> $("#rTab div[id^=tab]").each(function(){ if( !$.trim( $(this).html() ).length ) { id = $(this).attr("id"); //alert(id); $("#rTab li[rel="+id+"]").hide(); } }); $(".tabContent").hide(); $(".tabContent:first").show(); //click MUSS live $("ul.tabs li").live('click',function() { $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".tabContent").hide(); //MUSS rel, weil href mit location.hash in product.php so nicht läuft var activeTab = $(this).attr("rel"); $("#"+activeTab).fadeIn(); }); </code></pre>
javascript jquery
[3, 5]
2,913,992
2,913,993
Where do I put javascript when using an asp.net user control?
<p>I have a user control with a "More Info" link. When clicking that link, I want a div to appear which gives the user more information.</p> <p>Where do I put the javascript? It doesn't appear to work when placing at the top of my user control. How do you handle javascript and jquery when you are using a user control? I have jquery included in my master page. My regular asp.net pages have javascript and those work.</p> <p>EDIT: It appears that the way to do client side coding in a user control is to do output a script via server side, similar to how the asp.net server controls work. What is disappointing is that jquery is so awesome but all the examples are strictly embedded on the html/aspx page. Is there a resource out there for jquery with asp.net that I haven't found yet?</p>
asp.net javascript jquery
[9, 3, 5]
2,215,800
2,215,801
Using jQuery, a Dropdownlist should only be visible if at least 1 checkbox is selected
<p>I have links that when clicked, select all the checkboxes or deselect them.</p> <p>I also have a dropdown list that I want to be made visible only if at least one of the checkboxes are selected.</p> <p>What is the best way to do this?</p> <p>Should I write login inside the code that selects/deleselects them or is there a better way to do this?</p>
javascript jquery
[3, 5]
2,664,570
2,664,571
Show more/less without stripping Html tags in JavaScript/jQuery
<p>I want to implement readmore/less feature. i.e I will be having html content and I am going to show first few characters from that content and there will be a read more link in front of it. I am currently using this code :</p> <pre><code> var txtToHide= input.substring(length); var textToShow= input.substring(0, length); var html = textToShow+ '&lt;span class="readmore"&gt;&amp;nbsp;&amp;hellip;&amp;nbsp;&lt;/span&gt;' + ('&lt;span class="readmore"&gt;' + txtToHide+ '&lt;/span&gt;'); html = html + '&lt;a id="read-more" title="More" href="#"&gt;More&lt;/a&gt;'; </code></pre> <p>Above input is the input string and length is the length of string to be displayed initially. There is an issue with this code, suppose if I want to strip 20 characters from this string: <code>"Hello &lt;a href='#'&gt;test&lt;/a&gt; output"</code>, the html tags are coming between and it will mess up the page if strip it partially. What I want here is that if html tags are falling between the range it should cover the full tag i.e I need the output here to be <code>"Hello &lt;a href='#'&gt;test&lt;/a&gt;"</code> . How can I do this</p>
c# php javascript asp.net jquery
[0, 2, 3, 9, 5]
560,151
560,152
Load up javascript files after ajax call
<p>Hi how do i go about loading up my javascript files after an ajax call has been made, reason being it seems once i click submit, some javascript functions do not end up working. I tried using "$getscript" however it was a bit buggy especially in google chrome? This is what my call looks like;</p> <pre><code>function InsertStatus() { var fStatus1 = document.getElementById('&lt;%=txtStatus.ClientID %&gt;').value; $.ajax({ type: "POST", url: "WebServices/UserList.asmx/InsertUserStatus", data: "{ 'fStatus': '" + fStatus1 + "' }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data.d == "Successful") { $("#col-3").load(location.href + " #col-3&gt;*", ""); $.getScript('scripts/script.js', function () { }); } else { alert("its false"); $.getScript('scripts/script.js', function () { }); } } }); }; </code></pre>
javascript jquery asp.net
[3, 5, 9]
594,702
594,703
External javascript file not working
<p>I have some javascript that's loading just perfectly at the bottom of my site. I wanted to externalize this aforementioned js, so I'm now linking to the code externally, but now the code breaks and is pointing to an error (not within the js file but the jquery file). What changes when the js is externalized? Are variables retrieved in the same way? </p> <p>Thanks</p>
javascript jquery
[3, 5]
2,991,371
2,991,372
Jquery image scroller not switching to next image
<p>I have an image scroller that I am trying to implement. The image scrolling works, but it is moving vertically instead of horizontally. Here is what I got so far:</p> <pre><code>&lt;a href = "#" id = "btnNext"&gt;Next Image&lt;/a&gt; $('#btnNext').click(function () { //Calls new image with value true, meaning next image newImage(true); return false; }); function newImage(direction) { //Get the current selected item (with selected class), if none was found, get the first item current_image = $('#imageGallery li.selected').length ? $('#imageGallery li.selected') : $('#imageGallery li:first'); //If determines slideshow direction if (direction) { //Next image //Get next sibling next_image = (current_image.next().length) ? current_image.next() : $('#imageGallery li:first'); } else { //Previous image //Get previous sibling next_image = (current_image.prev().length) ? current_image.prev() : $('#imageGallery li:last'); } //Clear selected class $('#imageGallery li').removeClass('selected'); //Reassign selected class to current image next_image.addClass('selected'); //Scroll images $('#images').scrollTo(next_image, 800); } </code></pre> <p><strong>Update:</strong> Here are my quesions: 1) How do I edit this to make it move horizontally? 2) Is there a way to make an image scroller like this without using .scrollTo()? </p>
javascript jquery
[3, 5]
1,322,150
1,322,151
Problem with jQuery
<p>I trying to create a auto-complete search script (jQuery + PHP) but I have a big problem with this script.</p> <p>My jQuery code is:</p> <pre><code>$(document).ready(function() { $("#search").keyup(function() { var search = $("#search").val(); if (search.length &gt; 0) { $.ajax({ type: "POST", url: "search.php", data: "q="+search, dataType: "text", cache: false, success: function(result){ $("#autocomplete").fadeIn("fast"); $("#autocomplete").html(result); } }); } }); $("#autocomplete").click(function() { var complete = $(this).attr("title"); alert(complete); $("#search").focus(); }); }); </code></pre> <p>PHP code:</p> <pre><code>&lt;?php include("config.php"); header("Content-type: text/html; charset=UTF-8"); $search = $_POST['q']; if(mb_strlen($search, "UTF-8") &gt; 0) { $query = "SELECT * FROM `search` WHERE `title` LIKE '%$search%' ORDER BY `title` ASC"; $result = mysql_query($query) or die(mysql_error()); $num = mysql_num_rows($result); if($num == 0) { echo "Няма резултати"; } else { while ($row = mysql_fetch_assoc($result)) { echo "&lt;a href=\"javascript:void(0)\" class=\"link\" title=\"{$row['title']}\"&gt;{$row['title']}&lt;/a&gt; &lt;br /&gt;"; } } } ?&gt; </code></pre> <p>but error is in jQuery cuz it can't to get <code>attr("title")</code> of links... </p> <p>Please help and sorry for my English :) </p>
php javascript jquery
[2, 3, 5]
3,180,154
3,180,155
redirecting with javascript injected from code behind not working
<p>this is the property which give me site root path</p> <pre><code>public static string SiteRootPath { get { string host = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); string appRootUrl = HttpContext.Current.Request.ApplicationPath; if (string.IsNullOrEmpty(appRootUrl) || appRootUrl == "/") { return host + "/"; } else { return host + appRootUrl + "/"; } } } </code></pre> <p>i do like this</p> <pre><code>string path = EMS.DAL.DALHelper.SiteRootPath + "Home.aspx"; </code></pre> <p>then i do this</p> <pre><code>string script = "&lt;script language='javascript' &gt;alert('User registered successfully');window.location.replace('" + path + "');&lt;/script&gt;"; Page.RegisterStartupScript("alert", script); </code></pre> <p>This redirects me to home page and works perfectly fine on localhost but not on the IIS where the site is published.</p> <p>when i check the page source only this is found "alert('User registered successfully');" inside script tags ??</p> <p>Not able to solve it.</p> <p>Any ideas ??</p>
c# javascript asp.net
[0, 3, 9]
1,314,540
1,314,541
using html() to get changed content
<p>I have a div that I need to grab the HTML contents of (so naturally I use html())...</p> <p>However, they are text fields. Whenever I grab the contents of the div (that contains the text fields), it grabs the initial HTML and not any data changed by the end user...</p> <p>Here is JS bin version..change the input field, run the function and you see that it will only take the initial value of the field...</p> <p>Any way around this?</p> <p><a href="http://jsbin.com/oleni3/edit" rel="nofollow">http://jsbin.com/oleni3/edit</a></p>
javascript jquery
[3, 5]
1,664,101
1,664,102
Move list box items from one listbox to another listbox?
<p>I am trying to move listbox items between two listboxes.Before that i created two arrraylists for each listbox.so before moving the listbox item i am trying to add the items to the arraylist. here is the code</p> <pre><code> foreach (string st in listbox1.Items) { arraylist1.Add(st1); } </code></pre> <p>but i am getting an exeption Unable to cast object of type 'System.Web.UI.WebControls.ListItem' to type 'System.String'.</p>
c# asp.net
[0, 9]
1,509,379
1,509,380
Front end Changes on backend code placement
<p>I have been at this for a little while until I realized that I can't do front end stuff in the </p> <pre><code> page_load </code></pre> <p>There are no changes reflect. The following demonstrates the code which executes successfully but does not influence the front end</p> <pre><code> if (!(X.IsAjaxRequest || Page.IsCallback) &amp;&amp; Request["type"] == null) { window.Show(); fsm.executeCurrentState(); } else if (Request["type"] != null) { window.Show(); switch (Request["type"]) { case "PopUp": { windowPopUp.AutoLoad.Url = "http://google.com"; windowPopUp.AutoRender = true; windowPopUp.Show(); uLabel.Text = "blah"; break; } } } else { fsm.switchState((int)states.initializeState); fsm.executeCurrentState(); } </code></pre> <p>This is using a front end Ajax request:</p> <pre><code> function sendPopRequest(link) { $.ajax({ url: location.href, type: "POST", data: { type : 'PopUp', URL : link } }); } </code></pre> <p>I can verify that his succesfully passes the variables onto the front end. What I find strange is that it returns false for</p> <pre><code> X.IsAjaxRequest || Page.IsCallback </code></pre> <p>How would I go about making sure this code actually has influence on the front end? I am using EXT.NET which does callbacks to influence its front end using events. The element I am using however cannot be have an event function attached to it.</p>
c# asp.net
[0, 9]
3,705,434
3,705,435
How to disable sorting on column in jQuery.tablesorter?
<p><br><br>i try to find a way how to disable sorting on column. I use jquery tablesorter. And by default if you click on header cell it sort column data, but what i need to do if i don't need to use sorting on one or two column in four columns table. <br><br> Thanks in advanced.</p>
javascript jquery
[3, 5]
3,654,092
3,654,093
Validation function with return value
<p>I have a common validation function <br></p> <pre><code>function connect_and_update_destination() { var flag = true; // Validate IP if (!validate_ip_address()) { alert(protect.lang.enter_valid_ip); return; } if ($('#pjm_alias').val() === '') { $('#pjm_alias').focus(); alert(protect.lang.enter_alias); return; } if ($('#pjm_auth_name').val() === '') { $('#pjm_auth_name').focus(); alert(protect.lang.enter_auth_name); return; } if ($('#pjm_auth_password').val() === '') { $('#pjm_auth_password').focus(); alert(protect.lang.enter_auth_pwd); return; } var ip = $('#pjm_ip1').val()+'.'+$('#pjm_ip2').val()+'.'+$('#pjm_ip3').val()+'.'+$('#pjm_ip4').val(); return establish_connection(ip, $('#pjm_alias').val(), $('#pjm_auth_name').val(), $('#pjm_auth_password').val()); } </code></pre> <p><br> After successful validation it always return <strong>establish_connection()</strong>, My problem is that am calling this <strong>connect_and_update_destination()</strong> like this, <br></p> <pre><code>function first_call(){ connect_and_update_destination(); } function second_call(){ connect_and_update_destination(); } </code></pre> <p><br> When first call i need to return after successful validation <strong>establish_connection()</strong>, But when ever i called its using second function [second_call()] it should not return <strong>establish_connection()</strong> insted of return <strong>establish_connection()</strong> i need to only return . But how can i do this, Means i dont want to enter establish_connection() when ever i call using <strong>second_call()</strong>. <br></p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,609,837
2,609,838
RegisterClientScriptBlock code not executing
<p>I'm using the following code in an attempt to show a dialog with a list of errors on the client:</p> <pre><code> if (rollout.ImportErrors.Count &gt; 0) { ClientScript.RegisterClientScriptBlock(GetType(), "showErrors", "showErrors();", true); } </code></pre> <p>The error count is non-zero and the following script block is emitted, but the script isn't executing. </p> <pre><code>&lt;script type="text/javascript"&gt; //&lt;![CDATA[ $("#error-report").dialog("open")//]]&gt; &lt;/script&gt; </code></pre> <p>If I call the function directly from a Firebug console window, the dialog shows properly, so I know the dialog and my code are working. What am I doing wrong? </p> <p>BTW, this code is in a content page, using a content placeholder that 'injects' code into the element of the rendered page.</p>
asp.net javascript jquery
[9, 3, 5]
3,154,990
3,154,991
How to make sure a POST is requested from specific domain?
<p>Is there any property in <a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx" rel="nofollow">HttpRequest</a> that can make sure if the request is a <code>POST</code> request and it is coming from specific domain?</p> <pre><code>private bool IsRequestedFromDomain(string domain) { // Request.Form is from domain ? return false; } </code></pre>
c# asp.net
[0, 9]
1,051,025
1,051,026
text assign to textbox onclik hyperlink
<p>i have problem on jquery onclick. when onclick happen on a link text box value should fill with the some hard coded text.</p> <p>ex </p> <pre><code> $('#linkBase').click(function() { $('#txtFormula').val("txnword"); }); </code></pre> <p>problem is i want to repeat the "txtword" on the text box when i click on the link as "txtwordtxtwordtxtwordtxtwordtxtword" but currently im getting only once when click the link.</p> <p>any ideas help full</p> <p>thank you</p>
javascript jquery
[3, 5]
2,459,134
2,459,135
Dundas charts to be download(free) & bind with asp.net 3.5
<p>Hello May i know link from which i download free Dundas charts for Asp.net. I have searched but i didnt get it. Thank you. Asp.net c#</p>
c# asp.net
[0, 9]
2,935,993
2,935,994
Press home button to stop service
<p>i want to if the user press home button my service will be stop , this is my code but it's not working for me, please help me:</p> <pre><code>@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_HOME) { stopService(new Intent(this, MyService.class)); return true; } return super.onKeyDown(keyCode, event); } </code></pre> <p>Thanks</p>
java android
[1, 4]
331,919
331,920
JQuery - clone element and change attributes for multiple attributes
<p>I have several elements like this:</p> <pre><code> &lt;div class="image_insert clearfix"&gt; &lt;label for="userfile3"&gt;Image 3&lt;/label&gt; &lt;input type="file" name="userfile3" id="userfile3"&gt; &lt;label for="slika_naziv_eng3"&gt;Image Title&lt;/label&gt; &lt;input type="text" name="slika_naziv_eng3" id="slika_naziv_eng3"/&gt; &lt;/div&gt; </code></pre> <p>And JS for cloning:</p> <pre><code>var img_add = $('.img_add'); img_add.on('click', function(){ var img_ins = $('.image_insert'), i = img_ins.length, clon = img_ins.first().clone().attr({'class' : 'image_insert clearfix', 'name' : 'userfile' + i}).insertAfter(img_ins.last()); }); </code></pre> <p>I need to change all attributes where there is a number. Every time new element is added, it needs to count number of elements and the new number will be number of elements + 1. How can I do this?</p>
javascript jquery
[3, 5]
2,485,962
2,485,963
jquery.val() on the page works, off the page does not? Why?
<p>I had the following: </p> <pre><code>&lt;script type="text/javascript"&gt; var noteid = $('#noteid').val(); &lt;/script&gt; &lt;input type="hidden" name="noteid" id="noteid" value="321"&gt; </code></pre> <p>This works great... but now I'm trying to move the JavaScript off the page into a linked JS file like so: </p> <pre><code>&lt;script type="text/javascript" src="/js/note_beta.js"&gt; &lt;/script&gt; &lt;input type="hidden" name="noteid" id="noteid" value="321"&gt; </code></pre> <p>This ext JS file has the code: "var noteid = $('#noteid').val();" but it isn't working... Is there a trick to getting this to work when it isn't on the page itself?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,498,479
1,498,480
How to debug javascript in firefox via Visual Studio 2008?
<p>I have scripts in my aspx page, in header section.<br /> I want to debug it(with breakpoints) in firefox.</p>
asp.net javascript
[9, 3]
5,032,694
5,032,695
Sending emails through SMTP client using current logged in user
<p>I have web site set up that has some forms authentication through LDAP. I'm sending an email when the currently logged in user clicks a button, however the email is being sent from my address, and not the user. This creates a bit of confusion.</p> <p>What I want to do is send emails using the logged users account without having them enter their user information again.</p> <p>I basically want to do this:</p> <pre><code> MailMessage message = new MailMessage(); message.From = new MailAddress(User.GetIdentity); message.Subject = Subject; message.Body = body; message.IsBodyHtml = true; SmtpClient client = new SmtpClient("address.qweqwe", 25); client.Credentials = new System.Net.NetworkCredential(User.Identity); client.Send(message); </code></pre> <p>Getting the users email isn't a big deal, I've already got methods for that, but I'm not sure how I should go about getting their credentials. They've already logged on to access the page, and I know they have an LDAP email.</p> <p>Is there any way to do this without forcing the user to log in again just to send the email?</p>
c# asp.net
[0, 9]
2,649,531
2,649,532
Whats the easiest way to reactive a submit() action that was cancelled with 'return false'
<p>I have some image buttons that have jQuery event handlers attached to them.</p> <p>I want to make an AJAX call in the click() event to determine if the action should actually be allowed. Because I am doing an async ajax call I have to return 'false' to immediately cancel the event and wait for the response.</p> <pre><code>$('[id^=btnShoppingCartStep_]').click(function() { var stepName = this.id.substring("btnShoppingCartStep_".length); $.ajax({ type: "POST", url: $.url("isActionAllowed"), data: "requestedStep=" + stepName, dataType: "json", success: function(data) { if (data.allowed) { // need to resume the action here } else { AlertDialog(data.message, "Not allowed!"); } } }); return false; }); </code></pre> <p>I need to find the best way to resume the click event if the AJAX call determines that it should be allowed.</p> <p>Any way of doing this that I can come up with seems clumsy, such as :</p> <p>1) remove event handler from the buttons</p> <p>2) simulate a click on the button that was clicked</p> <p>Is there any nice way of doing this that I'm missing?</p>
javascript jquery
[3, 5]
1,210,748
1,210,749
Why do I get a ClassCastException?
<p>I am getting a <code>ClassCastException</code> on running this simple application.</p> <p>I'm trying to use the <code>AlarmManager</code> for the first time.</p> <pre><code>public class AlarmReciever extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { Bundle bundle = intent.getExtras(); String message = bundle.getString("alarm_message"); Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); } catch (Exception e) { Toast.makeText(context, "There was an error somewhere, but we still received an alarm", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } } } </code></pre> <p>this is my manisfest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tcs.mine" android:versionCode="1" android:versionName="1.0"&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".AlarmReciever" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;receiver android:process=":remote" android:name=".AlarmReceiver"&gt;&lt;/receiver&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>What am I doing wrong?</p>
java android
[1, 4]
4,493,924
4,493,925
jQuery keydown event disable
<p>Is it possible to disable an specific key combination? CTRL + U for example?</p> <p>I don't want to allow the user to press ctrl + u in order to see my javascript code. I only had disabled the left click but i would like more "protection".</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,029,216
3,029,217
Jquery get attribute of few ul to create another attribute
<p>I have the following HTML:</p> <pre><code>&lt;ul actualpage=0&gt; &lt;li/&gt; &lt;li/&gt; .... &lt;/ul&gt; &lt;ul actualpage=0&gt; &lt;li/&gt; &lt;li/&gt; .... &lt;/ul&gt; </code></pre> <p>Im trying to get the value of actualpage of each ul and create a new attribute. Its easy but not in one jquery sentence... Its possible? Until now i have the following line (between ## simbols the missing part that i need.</p> <pre><code> /* select all uls with attribute actualpage and create a new attribute on each with the current actualpage value */ $('ul[actualpage]').attr('newactualpage',##Current value of actualpage attr of UL##); </code></pre>
javascript jquery
[3, 5]
3,639,116
3,639,117
Hard-coding button's width in dimension units
<p>I've got the hard-coded layout, consisting of buttons, and need to enlarge some of them. I found <code>Button</code>'s method <code>setWidth(int value)</code>, accepting width in pixels, but I need to set value in dp. So, how can I set dp value in program code?</p>
java android
[1, 4]
136,660
136,661
Facing the error Microsoft JScript runtime error: 'BBDN' is undefined in asp.net
<p>I am facing the following errors while running the dotnet application Microsoft JScript runtime error: 'BBDN' is undefined Microsoft JScript runtime error: 'YAHOO' is undefined</p> <p>I had declared at the top of page as below:</p> <pre><code>&lt;%@ Register TagPrefix="busyboxdotnet" Namespace="BusyBoxDotNet" Assembly="BusyBoxDotNet" %&gt; </code></pre> <p>and in html tags I have mentioned the following code in the .aspx page:</p> <pre><code>&lt;busyboxdotnet:busybox id="BusyBox" runat="server" Width="250px" Height="50px" Text=" " Overlay="False" ShowBusyBox="OnLoad" Image="GreenBar"&gt;&lt;/busyboxdotnet:busybox&gt;&lt;busyboxdotnet:busybox id="BusyBox2" runat="server" Width="250px" Height="50px" Text=" " Image="GreenBar"&gt;&lt;/busyboxdotnet:busybox&gt; </code></pre> <p>and </p> <pre><code>&lt;script type="text/javascript" src="BusyBoxDotNet.axd?res=BBDN.js$YAHOO.js$dom.js$event.js$animation.js$BrowserSniff.js$Common.js$BusyBox.js"&gt;&lt;/script&gt; </code></pre> <p>But I am not getting why this error is coming? Can anybody will help me?</p>
javascript asp.net
[3, 9]
2,829,107
2,829,108
Calling jQuery's DOM ready function from another function
<p>Is it possible to call jQuery's <code>$(document).ready</code> function from within another Javascript function? I have a button, which when clicked should call the jQuery DOM ready function. Is this possible? </p>
javascript jquery
[3, 5]
1,138,277
1,138,278
java from command line over and over
<p>i have a PHP application that invokes a command line to execute some specific operations.</p> <p>The command line calls a 'java -jar somefile.jar arg1 arg2'</p> <p>The problem is that this is slow, since it has to startup the jar every time it get's invoked.</p> <p>Is there any way keep the java machine code in cache or is there any way to optimize the whole process? </p> <p>Thanks, joel</p> <p>Update: The JAR was developed by our team.</p> <p>To use as a service, i'll have to install some java server (tomcat or alike), right?</p> <p>And how about a java php bridge? Can that be any faster?</p>
php java
[2, 1]
4,422,887
4,422,888
Wrap element between two elements in JavaScript/jQuery?
<p>How can one create an element that wraps the content between two elements?</p> <p>Here's a simplified example of the code I'm dealing with:</p> <pre><code>&lt;p&gt; Some text some text &lt;span class="foo"&gt;some more text&lt;/span&gt; additional text. &lt;/p&gt; &lt;p&gt; I am bad at coming up with &lt;span class="foo"&gt;fake text&lt;/span&gt;, I should have looked it up lorem ipsum somewhere. &lt;/p&gt; </code></pre> <p>What I would like is that all the text between the end of the first span and the beginning of the second span to be wrapped in a div so that I can, for example, color the text differently.</p> <p>Is such a thing possible? If not, are there any clever ways around this?</p> <p>EDIT: I'm not entirely sure how I'd like the code to look at the end of the day. I only care about the result, which is that I'm able to apply specific styling to the text between the spans despite the fact that they have different parents. It would be really great if I could, for example, even set out the text and put a border around it, so that the end result looks something like:</p> <p>Some text some text some more text</p> <pre><code>------------------------------ |additional text | |I am bad at coming up with | ----------------------------- </code></pre> <p>fake text, I should have should have looked up lorem ipsum somewhere.</p>
javascript jquery
[3, 5]
5,469,486
5,469,487
Javascript document load bug
<p>I have the code below in which I've added 1 alert at the start and one at the end.</p> <p>I get the first alert but the last alert never pops up.</p> <p>Can anyone see why ?</p> <p>Here is the code:</p> <pre><code>&lt;script language="javascript"&gt; $(document).ready(function() { alert('start'); var month = getURLParameter('month') - 1; //-1 cause javascript months start in 0 var currentYear = getURLParameter('year'); var defaultDate = new Date(currentYear, month, 1); //Set to first day of the month $("#date").datepicker({ defaultDate: defaultDate }); alert('end'); }); &lt;/script&gt; </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
4,412,907
4,412,908
Bluetooth paired list in android using python
<p>Suppose I have paired 3 bluetooth devices(X, Y, Z) with my android phone. Now I want to get the names and other details of X, Y, Z using python script. For that I need to the list of all the paired devices and store them in a list variable inside the python script.</p> <p>Can you help me with some sample python script. Please.</p>
android python
[4, 7]
1,588,116
1,588,117
Javascript or jQuery: Download and redirect
<p>Currently some guys programmed this in a HTML page:</p> <pre><code>&lt;script&gt; location='http://example.com/downloadable.zip'; &lt;/script&gt; </code></pre> <p>They want to redirect the user to another page once the file has started downloading. I can only modify this page but not the destination page.</p> <p>What would be a good and clean javascript solution for making a user download the file and once he had accepted (or rejected) it, redirect him to another location? The solution may be jQuery code</p> <p>NOTE: The downloading and redirection must be done automatically when accessing the page</p>
javascript jquery
[3, 5]
1,166,440
1,166,441
Passing gridview rows to WebMethod
<p>I want to send Gridview rows to WebMethod. What is the best way to send the collection from javascript to Code behind as a parameter?</p>
javascript asp.net
[3, 9]
2,414,509
2,414,510
jqvmap - regionclick method not firing unless called in browser console
<p>I'm using the JQVMap plugin (http://jqvmap.com/) to create a map. The plugin has a method called onRegionClick that lets you call a function if a region on the map is selected. </p> <p>I'm loading the map dynamically using a function called loadSlide, but for some reason the onRegionClick method isn't being called, nor is the bind method I've called afterward. Strangely, if I load that bind method into my browser console after the page has loaded, it works great. </p> <p>I'm totally happy to provide more code/context if necessary, but I'm at my wit's end with this. Anyone familiar with this plugin and have experience with this problem? Thanks!</p> <p>Pertinent code below:</p> <pre><code>function loadSlide(url,data) { data.slide_id = $('#slide-data input#slide_id').val(); $.getJSON(url, data, function(response) { $('#slide-content').replaceWith(response.html); if ( $("#vmap").length &gt; 0 ) { $('#vmap').vectorMap({ map: 'usa_en', backgroundColor: null, color: '#6a1912', hoverColor: '#fdb33f', selectedColor: '#fdb33f', enableZoom: true, showTooltip: true, onRegionClick: function(event, code, region) { event.preventDefault(); $('input[type=hidden]#state-click').val(code.toUpperCase()); console.log($('input[type=hidden]#state-click').val()); } }); $('#vmap').bind('regionClick.jqvmap', function(event, code, region) { $('input[type=hidden]#state-click').val(code.toUpperCase()); console.log($('input[type=hidden]#state-click').val()); }); setClickHandlers(); } }); } </code></pre>
javascript jquery
[3, 5]
911,661
911,662
Jquery multiple forms in same page
<p>I have the following dynamically generated HTML</p> <pre><code>&lt;div id="1"&gt; &lt;form name = "inpForm"&gt; &lt;input name="FirstName" type="text"/&gt; &lt;input type="submit" value="Submit"/&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id="2"&gt; &lt;form name = "inpForm"&gt; &lt;input name="FirstName" type="text"/&gt; &lt;input type="submit" value="Submit"/&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>The outer divs have different IDs but the form names are the same. I am using Jquery to perform some validation when the form is submitted. However, when the second form is submitted, I always get the values of the first form.</p> <pre><code>$(document).ready(function () { $('form[name="inpForm"]').live('submit', function () { alert($('input[name="FirstName"]').val()); return false; }); }); </code></pre> <p>How can I modify myJquery to find the "FirstName" element that matches the current form where the submit was triggered? Thanks</p>
javascript jquery
[3, 5]
4,840,793
4,840,794
Get value inside a text field - JavaScript - jQuery
<p>I have a page portion as below;</p> <pre><code>&lt;input name="test1" type="text" id="test1" class="test1"&gt; &lt;button value="hi" id="but"&gt;hi&lt;/button&gt; </code></pre> <p>I want to get data inside text field entered by user. I tried the following;</p> <pre><code>$(document).ready(function(){ var test2 = $('#test1').val(); $('#but').click(function() { alert(test2); }); }); </code></pre> <p>When user clicks button <code>hi</code>, the page alerts the text inside text field. But the alert is coming blank (without text) even with text inside. When I reload the page, the text inside text field remains there and when I click the button again, script works well alerting the text inside. Again when I clear the text and I give another text, and when I click button, the alert is coming with previous text.</p> <p>I am using jQuery.</p> <p><a href="http://jsfiddle.net/wdKWw/" rel="nofollow"><strong>Here</strong></a> is the fiddle.</p> <p>I want to get alert with text inside the text area. How can I do this?</p>
javascript jquery
[3, 5]
1,290,412
1,290,413
Allocation of digits in the price list
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1068284/format-numbers-in-javascript">Format numbers in javascript</a><br> <a href="http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript">How to print a number with commas as thousands separators in JavaScript</a> </p> </blockquote> <p>I want to separate the zeros of the gap in the price list.</p> <p>As example</p> <p>current: 150000 wanted: <strong>150 000</strong></p> <p>current: 2730000 wanted: <strong>2 730 000</strong></p> <p>Using jQuery and all browsers (Chrome, Firefox, IE, Opera)</p> <p>UPD I want to dynamically add spaces when entering numbers</p> <pre><code>Step by step: user entered 10, in input 10 100 - 100 1000 - 1 000 10000 - 10 000 100000 - 100 000 1000000 - 1 000 000 </code></pre> <p>UPD I used regex <code>val.replace(/(\S)(?=(\S\S\S)+(?!\S))/g, "$1 ");</code> It's correct works in FF only</p>
javascript jquery
[3, 5]
2,239,757
2,239,758
How can I tweet in twitter account from an android imulator?
<p>Here, I have an edit text and a button, I want to tweet what i write something in edit text after clicking the button.</p>
java android
[1, 4]
5,091,631
5,091,632
Can't Change CSS Bottom with jQuery
<p>I'm having trouble getting the "else" bit of this working. Anyone know what the problem is?</p> <pre><code>var navOpen = false; if (navOpen == false) { $("nav").click(function() { $(this).css("bottom","0"); navOpen = true; }); } else { $("nav").click(function() { $(this).css("bottom","-84"); navOpen = false; }); } </code></pre>
javascript jquery
[3, 5]
5,187,079
5,187,080
Doing a redirect in jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8824141/how-to-redirect-from-one-url-to-another-url">How to redirect from one URL to another URL?</a> </p> </blockquote> <p>I have the following jQuery function in which I am trying to re-direct to another page -- how would I do this?</p> <pre><code>$.post('/ajax/change_qc_status/', { 'qc_note': qc_note, 'user': user }, function(request){ $.get('/summary/90') // this does nothing } ); </code></pre> <p>Note that if I go to the page <code>/summary/90</code> it is the correct page. </p>
javascript jquery
[3, 5]
2,010,100
2,010,101
How does one add arrays of elements to the DOM in jQuery?
<p>Coming to jQuery from a functional background, I am fond (perhaps unreasonably so) of elegant chains of functions. I often find myself dealing with arrays of elements, such as those that may result from $.map, and my ability to manipulate these arrays in the DOM seems quite limited. Here's some sample code that runs through the results of a Google search, rendering the result titles:</p> <pre><code>var newResultsDiv = $('&lt;div id="results" /&gt;'); $.each(searcher.results, function() { newResultsDiv.append('&lt;p&gt;' + this.title); }); $("#searchresults").append(newResultsDiv); </code></pre> <p>I find this excessively verbose. Ideally, I would do something along these lines instead:</p> <pre><code>$.map(searcher.results, function(elem) { return $('&lt;p&gt;' + elem.title); }).wrapAll('&lt;div id="results" /&gt;').appendTo('#searchresults'); </code></pre> <p>I've tried this out, along with several variants using different forms of append and wrap. They all appear to be incapable of handling the plain-old-Javascript array that jQuery.map spits out. They're designed to work with jQuery's own set collection. At least, that's my guess, as messing around with these functions in the Firebug console seems to confirm the problem.</p> <p>I am hoping that someone here has the wisdom to show me an elegant way to do what I'm trying to do. Is there one?</p>
javascript jquery
[3, 5]
1,095,457
1,095,458
Picklist Control help
<p>Sorry for the brief title, I wasn't sure how to word this. Basically I am looking for some help to create (or the source code to an existing control) that will produce and picklist as shown in the image below.</p> <p><a href="http://img807.imageshack.us/i/picklistcontrol.png/" rel="nofollow">http://img807.imageshack.us/i/picklistcontrol.png/</a></p> <p>It needs to display the full length value once clicked but otherwise it should have a truncated value. This needs to be in classic asp or javascript/jquery.</p> <p>Any help would be greatly appreciated.</p> <p>EDIT:</p> <p>Sorry but I didn't realise this would be a problem but the solution must work in IE7 and greater.</p>
javascript jquery asp.net
[3, 5, 9]
1,144,633
1,144,634
Jquery "Delay is Not A Function" with Jquery 1.6.4
<p>I looked at some of the other questions on here pertaining to this problem but they were all using an older version of Jquery. I am having a problem with the latest version of jquery which I am grabbing from the goolge link:</p> <p><a href="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js</a></p> <p>When I execute this code it is giving the error "delay is not a function". It didn't use to do this and I can't figure out why it might be doing it now. </p> <pre><code>$('.news_title_main').children('ul').delay(1500).slideUp(1000).queue(function(next) { removeLast(); }); </code></pre>
javascript jquery
[3, 5]
2,285,556
2,285,557
Programmatically assigned eventhandler not showing up in HTML onClick attribute
<p>I'm currently having a problem with event handlers assigned in the code-behind not appearing in the HTML code of the .aspx page. Below is the code fragment that does that:</p> <pre><code>HtmlTable table = new HtmlTable(); HtmlTableRow row = new HtmlTableRow(); foreach(XmlNode item in IDList) { LinkButton btn = new LinkButton(); btn.Text = item.InnerText; btn.Click += new EventHandler(btn_Click); HtmlTableCell cell = new HtmlTableCell(); cell.Controls.add(btn); row.cells.add(cell); } table.rows.add(row); </code></pre> <p>Something like that, more or less. So when I run the page and inspected the buttons using FireBug, I noticed that the eventhandler names for the buttons created have been changed to the LinkButtons' unique ID(ct125, 126, 127, etc), I think, and not "btn_Click"</p> <p>I'm hoping to hear if anyone else has faced this problem before and found a solution for it. Thanks.</p>
c# asp.net
[0, 9]
2,935,094
2,935,095
EditText of input type with number of no duplicates in android
<p>Could anyone please tell me how to implement an <code>EditText</code> which only accepts numbers and won't allow any duplicated digits?</p> <p>For example, <code>123</code> or <code>234</code> would be fine, but <code>112</code> and <code>223</code> should not be allowed.</p>
java android
[1, 4]
5,872,893
5,872,894
Use jQuery.post() result in javascript function
<p>I've got no clue how to do the following, so I wasn't sure what to search for either.</p> <p>For validating my registration form I've a javascript function that checkes the existence of the inserted username in the database onblur of the username textfield. </p> <pre><code>function checkUsername(username){ $.post("checkmail.php", {username: username} , function(data){ var $response=$(data); var response = $response.filter('#username-response').text(); if(response == "taken") { document.getElementById('username').style.borderColor = rood; valid = false; } }); </code></pre> <p>}</p> <p>This works fine, but now I want to validate it again onsubmit of the form in case users decide to submit an existing username.</p> <pre><code>function validateForm() { var valid = true; //checks different fields //now check voor username existence var username = document.getElementById('username').value; checkUsername.call(username); if (!valid) { return false; } else { return true; } } </code></pre> <p>I'm not familiar enough with Javascript to get this working. Probably thinking in the wrong direction...</p>
javascript jquery
[3, 5]
1,693,259
1,693,260
Post and query mysql database
<p>on one page I have the following code:</p> <pre><code>$("#photolist").dragsort({ dragBetween: true, dragEnd: saveOrder, placeHolderTemplate: "&lt;li class='placeHolder'&gt;&lt;div&gt;&lt;/div&gt;&lt;/li&gt;" }); function saveOrder() { var data = $("#photolist li").map(function() { return $(this).children().find('img').attr('id'); }).get(); $("input[name=SortOrder]").val(data.join("|")); var map = $('input[name=SortOrder]').val(); $.ajax({ type: 'POST', url: 'updatephotoposition.php', data: "map=" + map, success: function(){ alert("success"); } }); }; </code></pre> <p>It is definitely firing because the alert is functioning.</p> <p>on my page updatephotoposition.php I use the following code:</p> <pre><code>&lt;?php include '../dbconnect.php'; $map = explode('|', $_POST['map']); foreach ($map as $position =&gt; $ID) { $query = "UPDATE Photos SET Position = '$position' WHERE PhotoID = '$ID';"; $result = mysql_query($query) or die(mysql_error()); } ?&gt; </code></pre> <p>But my database isn't getting updated, can anyone see a problem with this set up?</p> <p>Post data sent: <code>82|83|84|85|86|81|87|88|89</code></p> <p>EDIT: This has suddenly started working</p>
php jquery
[2, 5]
3,382,316
3,382,317
Bind('pageinit') fails to call method
<p>I'm trying to bind a page initialize event from, afaik, jquerymobile, to a method so I can set my header, this is done, because later I wish to set it dynamically. But my event doesn't even trigger :'-( Any help would be appreciated.</p> <pre><code>$('#mapmode').bind('pageinit', function(event) { initPageHeader(); }); function initPageHeader(){ alert('oldhtml'); var oldhtml=document.getElementById('header').innerHTML; document.getElementById('header').innerHTML=""; var html = oldthml + '&lt;a href="#" data-rel="back" data-role="button" &gt;&lt;img'+ ' align="middle"src="../images/back.png" alt="back" vspace="2"/&gt;&lt;/a&gt;&lt;h1&gt;'+ '&lt;img align="middle"src="../images/main_header.png" alt="logo" vspace="2"/&gt;'+ '&lt;/h1&gt;&lt;a href="#first" data-role="button" data-inline="true"&gt;'+ '&lt;img align="middle"src="../images/home.png" '+ 'alt="picture to take you to the first page"/&gt;&lt;/a&gt;' document.getElementById('header').innerHTML=html; } </code></pre>
javascript jquery
[3, 5]
2,464,265
2,464,266
Can you get (using jQuery if possible) the current scrolled position of an element?
<p>I am using this code on a 'down' button to scroll text in an overflowed div.</p> <pre><code>var textHeight = text.outerHeight(); var pageDown = $('#page-down'); var pageUp = $('#page-up'); pageDown.bind('click', function() { pageUp.fadeIn(500); text.animate({ scrollTop: '+=' + textHeight + 'px'}, 500); }); </code></pre> <p>This is working nicely, but I need a method to determine when the scroll down button should disappear ... i.e. when the last content has appeared inside the div.</p> <p>Is there a property or method to get the scrolled position within that div? Thanks</p>
javascript jquery
[3, 5]
3,021,197
3,021,198
passing the value of dropdownlist into gridview
<p>I have a dropdownlist populated by my database, below is my code:</p> <pre><code>&lt;asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsNames" DataTextField="Name" DataValueField="Id"&gt; &lt;/asp:DropDownList&gt; &lt;asp:SqlDataSource ID="dsNames" runat="server" ConnectionString="&lt;%$ ConnectionStrings:dbProfilesConnectionString %&gt;" SelectCommand="SELECT Lname+', '+Fname AS Name,Id FROM tblProfile"&gt; &lt;/asp:SqlDataSource&gt; </code></pre> <p>Beside my Dropdownlist, I have a button and below I have a Gridview, what I want to achieve is whenever I select one of the name in my Dropdownlist, then when I click the button the name should be added in gridview. I am using asp.net with c#.</p>
c# asp.net
[0, 9]
451,704
451,705
How to keep a Bitmap in memory
<p>Following up on <a href="http://stackoverflow.com/questions/8814455/storing-a-bitmap-resource-in-a-static-variable">Storing a Bitmap resource in a static variable</a>, it seems that storing a static reference to an <code>android.graphics.Bitmap</code> in a <code>View</code> may leak a reference to that first <code>View</code> that instantiated it. What's the idiomatic way to solve this in Android? I do not want to call <code>BitmapFactory.decodeResource(resource, id)</code> each time an instance of this view is instantiated because this will be done (many times) in every single Activity. I want this small <code>Bitmap</code> to always remain in memory. So, what is the correct way to do the following:</p> <pre><code>public class MyView extends View { private static Bitmap star; public MyView(Context context) { synchronized(this) { if (star == null) { star = BitmapFactory.decodeResource(getResources(), R.drawable.star); } } } // ... } </code></pre>
java android
[1, 4]
6,003,687
6,003,688
Hiding all elements with the same class name?
<p>I'm trying to hide elements with the same class name (float_form), but I'm also trying to use the script below to show them (all of the float_form class divs are initially hidden). I've looked at a lot of jquery solutions, but I can't seem to make any of them work for this. </p> <pre><code>function show(a) { var e = document.getElementById(a); if (!e) return true; if (e.style.display == "none") { e.style.display = "block" } else { e.style.display = "none" } return true; } ​ </code></pre> <p><strong>Edit:</strong> Sorry if it wasn't clear, I do not intend to use Jquery(and I know that this is not jquery). I am looking for a way to use javascript to recognize repeated classnames that are not in style= display:none; without compromising the show/hide ID element since there is a loop with the div id as the key. The html for the div looks like below, with {item.ID} being a while loop.</p> <pre><code> &lt;div class="float_form" id="{item.ID}" style="display: none;"&gt; </code></pre>
javascript jquery
[3, 5]
1,657,080
1,657,081
Orientation change in phonegap
<pre><code>window.onresize = function(){ updateOrientation(e); } function updateOrientation(e) { alert("hey"); deviceWidth = $('body').width(); if (deviceWidth == 320) { currentOrientation = "portrait"; } else if (deviceWidth == 480) { currentOrientation = "landscape"; } // fire a function that checks the orientation every x milliseconds setInterval(checkOrientation, 500); // check orientation function checkOrientation() { deviceWidth = $('body').width(); if (deviceWidth &gt;= '1200') { newOrientation = "portrait"; } else if (deviceWidth &lt;= '900') { newOrientation = "landscape"; } // if orientation changed since last check, fire either the portrait or landscape function if (newOrientation != currentOrientation) { if (newOrientation == "portrait") { changedToPortrait(); } else if (newOrientation == "landscape") { changedToLandscape(); } currentOrientation = newOrientation; } } // landscape stuff function changedToLandscape() { alert('Orientation has changed to Landscape!'); } // portrait stuff function changedToPortrait() { alert('Orientation has changed to Portrait!'); } } </code></pre> <p>i am using this to detect the orientation change in android tablet using phonegap. somehow the code is not working. any suggestions? It is unable to generate an event for orientation change am guessing.</p>
javascript android
[3, 4]
2,347,757
2,347,758
Using javascript var in jQuery .html
<p>Very simple question:</p> <p>Is it possible to display a var in .html, using jQuery?</p> <pre><code>var inscr = '&lt;?php echo "test"; ?&gt;'; $j('#myPlaceHolder7').html('&lt;li class="button3"&gt;+inscr&lt;/li&gt;'); </code></pre> <p>Thanks!</p> <p>Thanks everyone for the quick help!</p>
javascript jquery
[3, 5]
4,157,594
4,157,595
variables showing as undefined in firebug when they are defined
<p>here is my site <a href="http://iadprint.com/products?product=Business%20Card" rel="nofollow">http://iadprint.com/products?product=Business%20Card</a></p> <p>when i select a value for quantity a price is supposed to show in the pricing div on the top right. this used to work but for some reason today in firebug under dom i can see that a few variables show undefined. when i do the ajax call iadprint.com/ajax.php?id=1 the data shows correctly and the variables in the js are all defined. what can be wrong? here are the variables that i am seeing undefined.</p> <pre><code>woCoating_price woColor_price woDesign_price woJob_Name_price woPDF_Proof_price woQuantity_price woRound_Corners_price woTurnaround_price </code></pre>
javascript jquery
[3, 5]
5,121,739
5,121,740
How to send and recieve an ajax request with jQuery?
<p>I am new to jquery and am having trouble following the documentation. I have a variable in javascript (that I already obtained from an html form) that I would like to send using AJAX to the server. I want to the server to do whatever it needs to do with that value and then reply with either "success" or "failure" (I know how to do the backend part). How do I send the request and then recieve the reply with jQuery?</p>
java jquery
[1, 5]
2,214,792
2,214,793
Android Spinner Issues
<p>How can make my spinner into a option list, but I want the list to be dynamic?</p> <pre><code> private void populateList() { Cursor cursor = getContacts(); String[] fields = new String[] { ContactsContract.Data.DISPLAY_NAME }; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.contact_entry, cursor, fields, new int[] {R.id.contactEntryText}); mContactList.setAdapter(adapter); spinner.setAdapter(adapter); } </code></pre>
java android
[1, 4]
1,394,315
1,394,316
Dynamically update site
<p>If I have a site with a list of words on it, say 50 words, and I send a query to delete one of these words from the database, how can I dynamically update the site to display the remaining 49 words without having to reload the page? </p>
php javascript
[2, 3]
1,809,884
1,809,885
How to append query parameter at runtime using jQuery
<p>Through JavaScript I am appending one query parameter to the page url and I am facing one strange behaiviour.</p> <pre><code>&lt;div&gt; &lt;a href="Default3.aspx?id=2"&gt;Click me&lt;/a&gt; &lt;/div&gt; $(function () { window.location.href = window.location.href + "&amp;q=" + "aa"; }); </code></pre> <p>Now I am appending <code>&amp;q=aa</code> in default3.aspx and in this page the <code>&amp;q=aa</code> is getting added continuously, causing the URL to become:</p> <pre><code> http://localhost:1112/WebSite2/Default3.aspx?id=2&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa </code></pre> <p>One would say just pass it like <code>&lt;a href="Default3.aspx?id=2&amp;q=aa"&gt;Click me&lt;/a&gt;</code>, but I cant do that. The value of this query parameter is actually the value of an HTML element which is in default3.aspx. I have to add it in runtime.</p> <p>What are the ways to achieve this?</p>
javascript jquery
[3, 5]
2,550,574
2,550,575
Tool to translate old javascript into jQuery
<p>I know there are lots of tools on the net that can make our lives easier, for us, developers, including some that are quite powerful.</p> <p>I ask if you know a tool to translate old javascript into jQuery?</p> <p>A tool that can help make this stuff ? Because I have to translate thousands of lines of code in jQuery, and I think I have about 15 years... :)</p> <p>Thanks !</p>
javascript jquery
[3, 5]
4,249,265
4,249,266
How can I get the URL of a link?
<p>How can I get the URL of a link?</p> <pre><code>$('.l').eq(0).href </code></pre> <p>is what I want to do, but it's undefined. </p> <hr> <p>So given a jQuery selected anchor element, how do you get the href property?</p>
javascript jquery
[3, 5]
359,528
359,529
getElementById("blah").classname = "whatever" Not working
<p>Heya, I've got some code that I think ought to be working (though I really am fumbling around in the dark here) - I'm just trying to dynamically change a class name on a div tag. </p> <p>I'm trying to change the div class on id "slider" from "visible" to "hidden". Everything else about this code works just fine, but the class won't change. What am I doing wrong?</p> <p>I've tried checking to see if the browser was correctly evaluating for IE 6 - it is. The code in the first part of the if statement that initializes slider when it's not IE6 works. And if I replace document.getElementById with something else, that code works too. So it must be a problem with the way I'm calling getElementbyId? It's just doing nothing in IE6.</p> <p>Here's what I've got: </p> <pre><code>&lt;script type="text/javascript"&gt; $(window).load(function() { var isIE6 = false; if(/MSIE 6/i.test(navigator.userAgent)) { isIE6 = true; } if(!isIE6) { $('#slider').nivoSlider({ effect:'fade', slices:1, animSpeed:500, pauseTime:3000, startSlide:0, directionNav:false, directionNavHide:true, controlNav:true, controlNavThumbs:false, controlNavThumbsFromRel:false, controlNavThumbsSearch: '.jpg', controlNavThumbsReplace: '_thumb.jpg', keyboardNav:true, pauseOnHover:true, manualAdvance:false, captionOpacity:0.8 }); } else { document.getElementById('slider').className = "hidden"; } }); &lt;/script&gt; &lt;div id="slider" class="visible"&gt; &lt;img src="/img/nivoslider/slide1.jpg" /&gt; &lt;img src="/img/nivoslider/slide2.jpg" /&gt; &lt;img src="/img/nivoslider/slide3.jpg" /&gt; &lt;/div&gt;&lt;!-- end slider --&gt; </code></pre>
javascript jquery
[3, 5]
8,181
8,182
page in background while trying to open new page using code behind
<p>I am trying to open a new page from the code. For this I used the following code on button click event</p> <pre><code>string pageURL = UIConstants.Url.PrintUserBRCs + "?" + UIConstants.ReportType + "=" + UIConstants.DetailReport; string script = string.Format("window.open('{0}', null, 'height=600, width=800, status=yes, location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes, titlebar=yes')", pageURL); Page.ClientScript.RegisterClientScriptBlock(GetType(), "LaunchTemplate", script, true); </code></pre> <p>The new page is opening properly but it has the issue that the new page goes in the background while the old page appears at top.</p> <p>I need to show the new page opened at top of previous page. How can I do that.</p> <p>Thanks in advance.</p>
c# javascript
[0, 3]
2,054,129
2,054,130
How stop an HTML form from submitting if user is not signed in, but allow submit if user is signed in?
<p>In my app, a user must be signed in to submit form info.</p> <p>After a user clicks on the form submit button, my jQuery checks if a user is signed in. </p> <p>If not signed in, then an error message pops up, requesting sign in/up. I can now successfully stop the default action (submit). </p> <p>However, how do I also allow the default action if the user is already signed in? With my current code, the default action is also blocked if the user is signed in.</p> <p>Here's my code:</p> <pre><code>jQuery('.member-only').click(function(event) { var $element = jQuery(this); var SignedIn; jQuery.ajax({ type: 'POST', url: '/ajax/member', dataType: 'json', success: function(data) { var $err = jQuery('&lt;div&gt;&lt;/div&gt;') .addClass('member-check') .html(data.msg) .css('left', $element.position().left); SignedIn = data.SignedIn; if (!(data.SignedIn)) { // not signed in $element.after($err); $err.fadeIn('slow'); return false; } } }); jQuery('.member-check').live('click', function() { jQuery(this).fadeOut('slow', function() {jQuery(this).remove(); }); }); if (!SignedIn) { event.preventDefault(); event.stopImmediatePropagation(); return false; // block default submit } }); </code></pre> <p>Thanks.</p>
php javascript jquery
[2, 3, 5]
865,763
865,764
Retrieving values from dynamically created RadioButtonList
<p>My code-behind (c#) file declares RadioButtonLists dynamically for any given number of questions in my database using a while() loop:</p> <p>I add items to each tmpRBL in a for loop.</p> <p>I register each RadioButtonList to a child panel which I create at the beginning of each iteration of the while() loop.</p> <p>I then add each panel to the parent panel.</p> <pre><code>while(reader.Read() { ... RadioButtonList tmpRBL = new RadioButtonList(); temp = "RadioButtonList" + count.ToString(); tmpRBL.ID = temp; tmpRBL.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Vertical; tmpRBL.TextAlign = System.Web.UI.WebControls.TextAlign.Left; ... for (int i = 1; i &lt;= numAnswers; i++) { tmpItem = new ListItem("", i.ToString()); tmpRBL.Items.Add(tmpItem); } ... p.Controls.Add(tmpRBL); ... questionPanel.Controls.Add(p); } </code></pre> <p>How can I retrieve the selectedIndexes of these dynamically created RadioButtonLists? I've spent the better part of the day trying various fixes from other similar questions online, but have had no luck.</p> <p>If I use 'Inspect Element' in Chrome, I am able to see the RadioButtonLists in their desired locations ostensibly with the ID I have assigned (RadioButtonList1, RadioButtonList2, etc), but I everything I try ends up with a null object. </p> <p>I'm relatively new to C# and this is my first time dealing with dynamic controls, so big thanks in advance for any help offered.</p>
c# asp.net
[0, 9]
3,602,223
3,602,224
Jquery, Add elements every 2 seconds
<p>I'm trying to create a growth map similar to <a href="http://projects.flowingdata.com/walmart/" rel="nofollow">http://projects.flowingdata.com/walmart/</a>.</p> <p>I am using <a href="https://github.com/marioestrada/jQuery-gMap" rel="nofollow">https://github.com/marioestrada/jQuery-gMap</a> to do the maping</p> <p>What i've got so far is a button that when I click it I want to start the animation. The onclick code is: </p> <pre><code>&lt;script&gt; $("input.buttonB").click(function(){ window.setTimeout(function() { $('#map_canvas').gMap('addMarker', { latitude: 41.60252, longitude: -100.32855, content: 'Some HTML content' } ); }, 2000); window.setTimeout(function() { $('#map_canvas').gMap('addMarker', { latitude: 11.60252, longitude: -110.32855, content: 'Some HTML content' } ); }, 2000); }); &lt;/script&gt; </code></pre> <p>Problem is, the markers don't appear on screen every 2 seconds. The window waits 4 seconds then displays both of them at the same time.</p> <p>Any suggestions?</p>
javascript jquery
[3, 5]
1,931,300
1,931,301
Caching asp.net pages
<p>I am bulding an app and I tried YSlow and got Grade F on most of my practices. I have loads of jscript that am working on reducing. I want to be able to cache some of these because the pages get called many times.</p> <p>I have one master age and I wanted to cache the scripts and css files.</p> <p>How do I achieve this? Are there any recommended best practices? Are there any other performance improvements that I can make?</p>
c# asp.net
[0, 9]
2,780,882
2,780,883
How to store a copy of complete web page at server side as soon as it is rendered on client browser?
<p>Requirement is to keep a copy of complete web page at server side same as it is rendered on client browser as past records.These records are revisited. </p> <p>We are trying to store the html of rendered web page. The html is then rendered using resources like javascript, css and image present at server side. These resources keep on changing. Therefore old records are no longer rendered perfectly.</p> <p>Is there any other way to solve above? We are also thinking converting it into pdf using IText or apache FOP api but they does not consider javascript effect on page while conversion. Is there any APIs available in java to achieve this? </p> <p>Till now, no approach working perfectly. Please suggest.</p> <p>Edit: In summary,requirement is to create a exact copy of rendered web page at server side to store user activities on that page. </p>
java javascript
[1, 3]
4,778,957
4,778,958
How to tell if string time-A is before time-B?
<p>if I have 4 variables</p> <p>startTime; endTime; startMerid; endMerid;</p> <p>startMarid and endMarid are either going to be 'AM' or 'PM'.</p> <p>but startTime and endTime are going to be strings like 'dd:dd'</p> <p>so it may be start:<code>12:30 PM</code> and end:<code>5:30 PM</code></p> <p>How can I validate that the end time is not before the start time?</p> <p>Thanks!!</p>
javascript jquery
[3, 5]
4,936,230
4,936,231
Javascript VS C#
<p>Maybe a strange and green question, but</p> <p>Is there anything C# can't do what javascript can... And considering JQuery?</p> <p>except for the fact that one is clientside, and the other serverside? Or am I asking a very stupid question now?</p> <p><strong>EDIT:</strong> to be more specific: I mean web programming, and indeed maybe a more useful question is:</p> <p><strong>> What can I do client side that I can't do server side, and vice versa?</strong></p> <p><strong>> Are there more reasons to use both languages if you keep "server/clientside" out of scope?</strong></p> <p><strong>> some developers avoid javascript. why?</strong></p>
c# javascript
[0, 3]
2,210,484
2,210,485
Dealing with JavaScript in a large web application (reusability, bundling, unit testing...)
<p>Maybe somebody can advise what tool, approach, reference I can use to achieve the following goals for a large web application when it comes to JavaScript: reusability, bundling, unit testing, many developers, stuff like that. For example I've checked out browserify tool but there's practically no documentation, no book nothing.</p>
javascript jquery
[3, 5]
3,472,689
3,472,690
Java Thread checkAccess
<p>I was pondering, playing around with some code. I came across the following method in the Thread class: <code>checkAccess()</code>. </p> <p>The documentation (literally) says <em>"Does nothing."</em> Why would this possibly be in the Thread class if it does nothing? - Are we possibly dealing with developer trolls?</p> <p>Screenshot:</p> <p><img src="http://i.stack.imgur.com/Afw40.png" alt="enter image description here"></p>
java android
[1, 4]
5,300,567
5,300,568
Fail to connect to camera service
<p>I had my camera set to <code>this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</code> and it works fine but if I change it to <code>PORTRAIT</code> instead of <code>LANDSCAPE</code> then it crashes with the following error...</p> <pre><code> 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): FATAL EXCEPTION: main 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): java.lang.RuntimeException: Fail to connect to camera service 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): at android.hardware.Camera.native_setup(Native Method) 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): at android.hardware.Camera.&lt;init&gt;(Camera.java:110) 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): at android.hardware.Camera.open(Camera.java:90) 07-30 12:51:37.655: ERROR/AndroidRuntime(22069): at org.digital.com.CamLayer.surfaceCreated(CamLayer.java:3 </code></pre> <p>The method it crashes in is.. </p> <pre><code> public void surfaceCreated(SurfaceHolder holder) { synchronized(this) { mCamera = Camera.open(); Camera.Parameters p = mCamera.getParameters(); p.setPreviewSize(800, 480); mCamera.setParameters(p); try { mCamera.setPreviewDisplay(holder); } catch (IOException e) { Log.e("Camera", "mCamera.setPreviewDisplay(holder);"); } mCamera.startPreview(); mCamera.setPreviewCallback(this); } } </code></pre> <p>It crashes at <code>mCamera = Camera.open();</code></p> <p>My Manifest file has <code>&lt;uses-permission android:name="android.permission.CAMERA"&gt;&lt;/uses-permission&gt;</code></p> <p>How do I fix this so I can view my app in Portrait?</p>
java android
[1, 4]
4,291,286
4,291,287
jQuery - Selecting elements from string
<p>I need to select first table and then second table from the html in string. I know this can be done by selector <code>:eq(0)</code> and <code>:eq(1)</code>, but</p> <pre><code>var firstTable = $("table", "&lt;table&gt;&lt;/table&gt;").length; </code></pre> <p><code>firstTable == 0</code>. Why?</p>
javascript jquery
[3, 5]
3,685,265
3,685,266
how to display and image using external jquery in my html file
<p>i am new to jquery, can anyone tell me how to display and image using external jquery in my html file.</p> <p>i want my html to be clean and load the image where the image path is mentioned in the external jquery file.</p> <p>my jquery file will be like this testjquery.js</p> <pre><code> // url to load the image (which i dont know ,whats the code for it) </code></pre> <p>and in my html file.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; (function() { var test = document.createElement('script'); test.type = 'text/javascript'; test.async = true; test.src = 'testquery.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(test, s); test.onload=function(){ // function to load the external image } })(); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
143,693
143,694
How to create own jQuery-like function in JavaScript?
<p>How can i create a function which looks like the jquery callback $</p> <p>Say i want to call a element with id= "mydiv".</p> <p>i want to be able to call it like </p> <pre><code>var div = $("mydiv").value; </code></pre> <p>i think the function should look like </p> <pre><code>function $(element) { return document.getElementById(element); } </code></pre> <p>Is that the right way to do it, or do you prefer another way to solve it?</p>
javascript jquery
[3, 5]
2,325,165
2,325,166
JQuery: Check value of input
<p>How can I check if the number entered in the input-field is higher of even as th value in my 'min' field?</p> <pre><code> &lt;tr&gt; &lt;td&gt;Steeeeaak&lt;/td&gt; &lt;td&gt;&lt;input type="hidden" name="amount_5_min" value="10"/&gt; &lt;input type="text" name="amount_5" size="4" value="10"/&gt;&lt;/td&gt; &lt;td&gt;-&lt;/td&gt; &lt;td&gt;&lt;a href="/item/delete/eventId/2/hash/a8b5dzp9rks7164wh30j2anqh13w/itemId/5"&gt;Verwijder&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>As you can see the first part of the name of both fields are the same ... Any possibilities here? I do a submit at the end of the form, so I guess I have to do something on submit?</p> <p>Thx!</p>
javascript jquery
[3, 5]
1,210,353
1,210,354
jquery and asp.net scriptlet usage issue
<pre><code>function submitValues(url, params) { var form = [ '&lt;form method="POST" action="', url, '"&gt;' ]; form.push('&lt;input type="hidden" name="', key, '" value="', params[key], '"/&gt;'); form.push('&lt;/form&gt;'); jQuery(form.join('')).appendTo('body')[0].submit(); } </code></pre> <p>if i write this line like</p> <pre><code>form.push('&lt;input type="hidden" name="mydata" value="', &lt;% =System.Web.Configuration.WebConfigurationManager.AppSettings["websiteUrl"] %&gt;, '"/&gt;'); </code></pre> <p>then i am getting error....not being able to handle this. need suggestion to rectify the code. thanks</p>
jquery asp.net
[5, 9]
652,688
652,689
Javascript select all button in php
<p>Hi All First of all I don't know Javascript, I got this script from the internet but can't get it to work. If someone can please be so kind and assist me. I'm trying to create a "check all" &amp; "uncheck all" button on my form for my checkboxes, if I click the button it does not select anything. Where am I going wrong?</p> <pre><code>&lt;?php session_start(); ?&gt; &lt;head&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; &lt;!-- &lt;!-- Begin function CheckAll(chk) { for (i = 0; i &lt; chk.length; i++) chk[i].checked = true ; } function UnCheckAll(chk) { for (i = 0; i &lt; chk.length; i++) chk[i].checked = false ; } // End --&gt; &lt;/script&gt; &lt;/head&gt; </code></pre> <p>And then the form:</p> <pre><code>$sql0 = "SELECT * FROM ..... $result0 = mysql_query($sql0); echo "&lt;form name='myform' action='...' method='post'&gt;"; while($row0 = mysql_fetch_assoc($result0)) { $test_id=$row0['id']; $test_name=$row0['test_name']; echo " &lt;table width=600px&gt;"; echo " &lt;tr&gt;"; echo " &lt;td width=30px&gt;&lt;input name='question[$test_id][]' type='checkbox' value='1' /&gt;&lt;/td&gt;"; echo " &lt;td width=580px align=left&gt;$test_name&lt;/td&gt;"; echo " &lt;/tr&gt;"; echo " &lt;/table&gt;"; } echo "&lt;/P&gt;"; echo "&lt;input type='button' name='Check_All' value='Check All' onClick='CheckAll(document.myform.check_list)'&gt;"; echo "&lt;input type='button' name='Un_CheckAll' value='Uncheck All' onClick='UnCheckAll(document.myform.check_list)'&gt;"; echo "&lt;/form&gt;"; </code></pre>
php javascript
[2, 3]
4,982,630
4,982,631
window.print() is not printing the whole page
<p>I have a page <img src="http://i.stack.imgur.com/BqNg8.png" alt="screenShot"></p> <p>I want to print this page. On print button i am using something like this</p> <pre><code>&lt;input id="print" type="submit" onclick="window.print();" /&gt; </code></pre> <p>But the problem is it is not printing the whole page. Like it only print that is currently in the view. When i click on the print button then till <code>Email:[email protected]</code> page print. It does not print the text below the scrollbar. </p> <p><img src="http://i.stack.imgur.com/CwK2J.png" alt="textBelowScrollbar"></p> <p>How can i print the whole text. Like suppose i have a very big page and i am using tabs to accommodate my page. And when click on print button, then i want to include the whole page including tabs. How can i do it? </p> <p>Thanks</p>
javascript jquery
[3, 5]
171,267
171,268
JS parseInt() issue
<p>I know I might be doing something wrong. Can anyone please point out why I'm getting top as object??</p> <pre><code>$(document).ready(function(){ topwithpx='0px'; alert(topwithpx); topstr=topwithpx.substr(0,topwithpx.length-2); alert(topstr); top=parseInt(topstr); alert(top); });​ </code></pre> <p><a href="http://jsfiddle.net/kjMs9/" rel="nofollow">http://jsfiddle.net/kjMs9/</a></p> <p>Thanks all: 'top' is reserved keyword (Window.top). My bad. Accepting first ans. +1 to all for quick ans.</p>
javascript jquery
[3, 5]
5,265,300
5,265,301
Programmatically fill field in activity of another application?
<p>How i can programmatically fill fields in activity of another application? It is possible? What is right way? Add: My app is root-granted. I know what is package is now in foregraund. I have name of open activity and name of field in activity. Also I have my value whitch i need to push in this field.</p>
java android
[1, 4]
1,550,076
1,550,077
Radio button value
<p>I have a dynamically generated radio button as fiven below</p> <pre><code>echo '&lt;tr&gt; &lt;td colspan="2"&gt;Login System&lt;/td&gt; &lt;td colpan="2"&gt; &lt;input type="radio" name="login_system'.$i.'" value="COMMON" checked="checked" /&gt;Common &amp;nbsp &lt;input type="radio" name="login_system'.$i.'" value="INDIVIDUAL"&gt;Individual &lt;/td&gt; &lt;/tr&gt;'; </code></pre> <p>and i need to take its value using javascript. Below is the code i have written for that</p> <pre><code>d['login_system']=$('input[name="login_system'+index+'"]').val(); </code></pre> <p>But always I am getting value of first radio button even if I have selected second. Can anyone help me?</p>
javascript jquery
[3, 5]
42,381
42,382
C# method gives me an error
<p>I have created one method in c# that has two parameters. I have just changed its parameter name but now it is giving me old parameters value. And the error is coming while runtime.</p> <p>This is new method which i have changed its parameter</p> <pre><code>public void UpdatePagedDataSet(string configKey, string configValue) { ---SOME CODE--- } </code></pre> <p>This is old method works fine</p> <pre><code>public void UpdatePagedDataSet(string CONFIGKEY, string CONFIGVALUE) { ---SOME CODE--- } </code></pre> <p>Error:</p> <pre><code>could not find a non-generic method 'UpdatePagedDataSet' that has parameters: CONFIG_VALUE, configKey, configValue </code></pre> <p>What is the mistake i have done...??</p>
c# asp.net
[0, 9]
3,254,074
3,254,075
Dynamically changing master pages
<p>ok so I created this master page file and in its Page_PreInit added the code to change master page at run time after detecing a visitor's country:-</p> <p>Now, while researching I came across this thread that says "Setting the master page in Page_PreInit event is against the design and spirit of MVC..what is this supposed to mean ??? </p> <p>If not this way, how else am I supposed to change master pages at run time???</p>
c# asp.net
[0, 9]
3,236,786
3,236,787
How to define Variable similer to Session variable in ASP.NET
<p>I want to define a variable or object like session, to stored data about each user, and i want to access this object in many pages, could u please tell me if there is a way. thanks</p>
c# asp.net
[0, 9]
3,263,404
3,263,405
Using getScript in a main.js file to reduce load size
<p>Does it make sense to make use of <code>$.getScript();</code> in jQuery to do something like the following:</p> <pre><code>$("#action-one").click(function() { $.getScript('scripts/action-one.js'); }); $("#action-two").click(function() { $.getScript('scripts/action-two.js'); }); </code></pre> <p>Would reduce the size of your main.js file making load times faster? Also means code is only ever loaded if it's used, could come into issues if the same code is loaded over and over though ..</p> <p>(I'm not doing this at the moment but it just crossed my mind if you have very large js files)</p>
javascript jquery
[3, 5]
2,014,252
2,014,253
Apply mask a string in C# asp.net?
<p>Hi all in my project i want a currency in three formats,.</p> <pre><code>1) ...999,999,999 2) ...999,999,999.00 3) ...999,999,99 </code></pre> <p>The format is specified in mysql data table field. My project is in ASP.NET so I can't use MaskedTextBox . Code I tried:</p> <pre><code>String.Format("{999,999,999}",rate); </code></pre> <p>and </p> <pre><code>rate.ToString("999,999,999). </code></pre> <p>How to get the mask string?</p>
c# asp.net
[0, 9]
5,797,792
5,797,793
Detect network connection bandwidth (Android)
<p>I need to determine programmatically the bandwith of the network connection (not the same as network type (WIFI/3G)). How can i do this? Timing a (short) download?</p> <p>thanks</p>
java android
[1, 4]
3,429,504
3,429,505
Width, padding giving auto in IE7
<p>I am trying to coding for padding, width based on previousSibbling Div id. Based On Prev Div id's Width, Padding, I will calculate current width,padding. It is working in Mozilla. But IE PrevSibbling Div's Width, padding coming as "auto" and i tried to add 10px to width. But it is not working. Div functionality working as "auto" properties only. Please suggest me. Code is too simple. two simple divs only.</p>
javascript jquery
[3, 5]
3,245,571
3,245,572
How can I execute a PHP script from Java?
<p>I have a php script which is executed over a URL. (e.g. www.something.com/myscript?param=xy)</p> <p>When this script is executed in a browser it gives a coded result, a negative or positive number.</p> <p>I want to execute this script from Java code(J2EE) and store that result in some object.</p> <p>I'm trying to use <code>httpURLConnection</code> for that. I establish a connection but can not fetch the result. I'm not sure if I execute the script at all.</p>
java php
[1, 2]
159,736
159,737
android widget that download and prints bitmaps don't work
<p>I need to create a widget that will download on the sdcard some bitmaps every minute and will print them on the screen. i have tried to do with </p> <pre><code>private class MyTime extends TimerTask </code></pre> <p>but is don't work. the widget don't update:( the images have 30K in total. can you help me with this i need only a sample of the code and where i can put my code for the widget to work. this is the code:</p> <pre><code>public class MyWidget extends AppWidgetProvider { public int tt=0; @Override public void onUpdate( Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds ) { if(tt==0) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 10000); tt=1; } } private class MyTime extends TimerTask { RemoteViews remoteViews; AppWidgetManager appWidgetManager; long t=0,lastUpdate=0; ComponentName thisWidget; public MyTime(Context context, AppWidgetManager appWidgetManager) { this.appWidgetManager = appWidgetManager; remoteViews = new RemoteViews(context.getPackageName(), R.layout.main); thisWidget = new ComponentName(context, MyWidget.class); } @Override public void run() { DateFormat dateFormat = new SimpleDateFormat("dd/MM HH:mm"); //get current date time with Date() Date date = new Date(); remoteViews.setTextViewText(R.id.Clock,dateFormat.format(date)); appWidgetManager.updateAppWidget(thisWidget, remoteViews); if(t==0 || t + 100000&lt;=System.currentTimeMillis()) { checkUpdate(); display(); t=System.currentTimeMillis(); } } </code></pre>
java android
[1, 4]
189,264
189,265
ASP.NET EventHandling
<p>I create a servercontrol for ASP.Net. For being short and precise I just list the things I do:</p> <p>(1) Call EnsureChildControls in OnInit</p> <p>(2) Create a dynamic table in CreateChildControls:</p> <pre><code>Table aTable = new Table(); aTable.ID = this.ID + "$" + T; TableRow aRow = new TableRow(); aRow.ID = aTable.ID + "$R" + &lt;COUNTER&gt;.ToString(); TableCell aCell = new TableCell(); createLinkButton(row, col, caption, aCell, aRow.ID); this.Controls.Add(aTable); </code></pre> <p>(3) Have a function like:</p> <pre><code>void aLinkButton_Command(object sender, CommandEventArgs e) { // Some stuff return; } </code></pre> <p>(4) Have a function like:</p> <pre><code>void createLinkButton(int row, int col, string caption, TableCell aCell, string baseID) { LinkButton lb = new LinkButton(); lb.ID = baseID + "$" + row.ToString() + col.ToString(); lb.Command += new CommandEventHandler(aLinkButton_Command); lb.Text = caption; lb.CommandName = "&lt;command&gt;"; aCell.Controls.Add(lb); return; } </code></pre> <p>But: The event is never called. The href is redered for postback, but the wired event never gets triggered.</p> <p>No ideas anymore :(</p> <p>Any ideas</p>
c# asp.net
[0, 9]
2,892,004
2,892,005
Python data passing
<p>I need exchange data between python daemon (cluster nods send data to this daemon) and php script (apache) which, is accessed by webbrowsers. What do you recommend as technology which could establish some connection between them. Both, python daemon and apache/php is on the same machine. </p> <p>Thank you.</p>
php python
[2, 7]
2,635,408
2,635,409
Which one is better performance to use for .click in the below list
<blockquote> <p>Please vote for me which one in the below list is better?</p> </blockquote> <p>I have HTML:</p> <pre><code>&lt;div id="container"&gt; &lt;button class="btn"&gt;Click Here 1&lt;/button&gt; &lt;button class="btn"&gt;Click Here 2&lt;/button&gt; &lt;button class="btn"&gt;Click Here 3&lt;/button&gt; &lt;button class="btn"&gt;Click Here 4&lt;/button&gt; &lt;button class="btn"&gt;Click Here 5&lt;/button&gt; &lt;button class="btn"&gt;Click Here 6&lt;/button&gt; &lt;!-- A lot of buttons --&gt; &lt;button class="btn"&gt;Click Here n - 2&lt;/button&gt; &lt;button class="btn"&gt;Click Here n - 1&lt;/button&gt; &lt;button class="btn"&gt;Click Here n&lt;/button&gt; &lt;/div&gt; </code></pre> <p>And Javascript with jQuery is:</p> <h3>Case 1.1:</h3> <pre><code>$(".btn").click(function(e){ //@todo something here }); </code></pre> <h3>Case 1.2:</h3> <pre><code>var doSomething = function(e) { //@todo something here } $(".btn").click(doSomething); </code></pre> <h3>Case 2:</h3> <pre><code>$("#container").click(function(e){ if( $(e.target).is(".btn") ) { //@todo something here } }); </code></pre> <p>I am confused a litle bit what are different between them?</p>
javascript jquery
[3, 5]
5,696,541
5,696,542
How do I use jQuery to insert PHP tags through the DOM?
<p>Here is what I'm trying to do...</p> <pre><code>$("div").prepend("&lt;div id='comment-number'&gt;&lt;?php the_comment_number(); ?&gt;&lt;/div&gt;"); </code></pre> <p>Is there some way to get this to work?</p> <pre><code>&lt;div class="gallery-item"&gt; &lt;div class="comment-number"&gt;&lt;!--?php echo htmlspecialchars(the_comment_number()); ?--&gt;&lt;/div&gt; &lt;/span&gt; &lt;span class="gallery-icon"&gt; &lt;a href="http://mysite.com/test/photos/attachment/fff/"&gt;&lt;img src="http://mysite.com/test/wp-content/uploads/2011/06/fff-150x150.gif"&gt;&lt;/a&gt; &lt;/span&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]