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
2,549,070
2,549,071
alert not being fired when I append a new div
<p>On this fiddle <a href="http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/46/" rel="nofollow">http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/46/</a> the divs 'Hello 01' &amp; 'Hello 02' fire an alert when they are clicked. When i click 'Add New' a new div is added but when I click on this div the alert is not fired even though it is styled with same css .</p> <p>How can I amend this so that the alert is fired when a new div is appended ?</p> <p>Code from jsFiddle for posterity</p> <p>JS</p> <pre><code>$(function() { $(".myDivs").click(function() { alert('Clicked'); }); $("#button").click(get); function get() { $(".connected").append("&lt;div class=\"myDivs\"&gt;hello&lt;/div&gt;"); } }); </code></pre> <p>HTML</p> <pre><code>&lt;div class="connected"&gt; &lt;div class="myDivs"&gt;Hello 01&lt;/div&gt; &lt;div class="myDivs"&gt;Hello 02&lt;/div&gt; &lt;/div&gt; &lt;input name="Button3" type="button" value="Add New" id="button"&gt; </code></pre> <p>​ ​</p>
javascript jquery
[3, 5]
5,155,003
5,155,004
c14n with Android
<p>Is there a way to make an xml in canonical form on android?</p> <p>The canonicalizers from some apache projects don't work as they depend on some javax.xml.* packages which aren't available on android.</p>
java android
[1, 4]
5,835,060
5,835,061
Why does BitmapFactory.decodeByteArray return null?
<p>It's the simple code and instead of getting result to set the Bitmap, I get null. Can anyone tell me where I am making a mistake?</p> <pre><code>String test = "test"; byte[] byteA = test.getBytes(); Bitmap bmp = BitmapFactory.decodeByteArray(byteA, 0, byteA.length); //&lt;- I get null here ImageView image = (ImageView) findViewById(R.id.image); image.setImageBitmap(bmp); </code></pre> <p><strong>UPDATE</strong></p> <p>Ok, so I cannot convert text to image like I thought I could. How about this way? Will this create a bitmap? </p> <pre><code> Paint paint = new Paint(); paint.setStyle(Paint.Style.FILL); paint.setColor(Color.RED); paint.setTextSize(16); paint.setAntiAlias(true); paint.setTypeface(Typeface.MONOSPACE); Bitmap bm = Bitmap.createBitmap(16, 16, Bitmap.Config.ALPHA_8); float x = bm.getWidth(); float y = bm.getHeight(); Canvas c = new Canvas(bm); c.drawText("Test", x, y, paint); </code></pre>
java android
[1, 4]
2,405,539
2,405,540
How to CLOSE not HIDE a div on click using jquery?
<p>I have a modal window with an embeded video, this video plays but then once the mask (outer window) is clicked, the sound etc is still playing in the background.</p> <p>This is the code:</p> <pre><code>//if mask is clicked $('#mask').click(function () { $(this).hide(); $('.window').hide(); }); </code></pre> <p>I need the window to close not hide. I tried, .remove which works but then once another video is clicked the div has been removed completely and won't play.</p> <p>HELP !</p> <p>EDIT- I am using this jquery modal window:</p> <p><a href="http://www.queness.com/resources/html/modal/jquery-modal-window.html" rel="nofollow">http://www.queness.com/resources/html/modal/jquery-modal-window.html</a></p> <p>Then im adding a iframe provided by the client to the "dialog".</p>
javascript jquery
[3, 5]
2,975,166
2,975,167
jQuery ordered actions
<p>Does anybody know how to make a jQery function that has more than one action and every action will be fired only after its precedent is complete like:</p> <pre><code>$('#myelement').addClass('loading').load(loadUrl).removeClass('loading'); </code></pre> <p>here the first action which is adding the class name is ok, the second is also ok, but the problem comes with the last action which is supposed to remove the class after the load is finished, but here it will be fired even before the loading is finished and will cancel the first action so that it will look like none of the first nor the third action are present.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
1,978,318
1,978,319
How do I prevent default tab switching functionality in JQuery?
<p>I have created the tabs below.</p> <pre><code>&lt;ul class="idTabs"&gt; &lt;li&gt;&lt;a href="#basic_info" id="basic_info_link" &gt;Personal&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#add_info" id="add_info_link"&gt;Address&lt;/a&gt;&lt;/li&gt; &lt;li style="width:194px;"&gt;&lt;a href="#payment_info" id="payment_link" style="border-left:none;width:194px;"&gt;Bank&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="basic_info"&gt;&lt;!--HTML Code --&gt;&lt;/div&gt; &lt;div id="add_info"&gt;&lt;!--HTML Code --&gt;&lt;/div&gt; &lt;div id="payment_info"&gt;&lt;!--HTML Code --&gt;&lt;/div&gt; </code></pre> <p>The tabs work fine, but the problem is that on clicking these tabs heading I want to prevent to go to next tab.</p>
javascript jquery
[3, 5]
2,935,274
2,935,275
How to pass an object to this js function?
<p>Code:</p> <pre><code>function setMaps() { var geocoder = new google.maps.Geocoder(); var result = ""; $('.map_canvas').each(function(){ geocoder.geocode( { 'address': $(this).attr('address'), 'region': 'de' }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { result += results[0].geometry.location.lng()+","; result += results[0].geometry.location.lat(); } else { result = "Unable to find address: " + status; } $(this).gmap({ 'center': result }); }); }); } </code></pre> <p>This method should show multiple maps on one page.</p> <p>HTML:</p> <pre><code>&lt;div class="map_canvas" address="Berlin, Zoo"&gt; &lt;/div&gt; </code></pre> <p>The problem is that <code>$(this).gmap({ 'center': result });</code> does not work:</p> <pre><code>Uncaught TypeError: Cannot set property 'position' of undefined </code></pre> <p>Any idea how to pass the map_canvas object to the callback function?</p>
javascript jquery
[3, 5]
1,311,955
1,311,956
i have problem in uploading files to specific folder it is permession not enough
<p>I'm having aproblem uploading files to a specific folder on my web server. How can I give permession to this folder and what is the vital user in that case ?</p> <p>Please help me, thanks in advance.</p>
c# asp.net
[0, 9]
3,567,450
3,567,451
jQuery Table to CSV export
<p>I'm using the jQuery Table to CSV Plugin. I've altered the popup so that it tells the browser to download a CSV file.</p> <p>It was:</p> <pre><code>function popup(data) { var generator = window.open('', 'csv', 'height=400,width=600'); generator.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;CSV&lt;/title&gt;'); generator.document.write('&lt;/head&gt;&lt;body &gt;'); generator.document.write('&lt;textArea cols=70 rows=15 wrap="off" &gt;'); generator.document.write(data); generator.document.write('&lt;/textArea&gt;'); generator.document.write('&lt;/body&gt;&lt;/html&gt;'); generator.document.close(); return true; } </code></pre> <p>I've changed it to:</p> <pre><code>function popup(data) { window.location='data:text/csv;charset=utf8,' + encodeURIComponent(data); return true; } </code></pre> <p>It works, for the most part. It still requires that you find your spreadsheet software, and create your own filename...because it creates a strange file name (Example: 14YuskG_.csv.part).</p> <p>Any suggestions on how to improve this?</p>
javascript jquery
[3, 5]
2,132,994
2,132,995
How do I check to see if a resource exists in Android
<p>Is there a built in way to check to see if a resource exists or am I left doing something like this.</p> <pre><code> boolean result; try { int test = mContext.getResources().getIdentifier("my_resource_name", "drawable", mContext.getPackageName()); if (test != 0) result = true; } finally { result = false; } </code></pre> <p>Also, do I even need the try/finally?</p>
java android
[1, 4]
3,181,243
3,181,244
SmtpMail.Send(_MailMessage); doesn't work
<p>I am using default smpt virtula server to send mail using c# but it doesn't send any mails and also it doesn't throw any exceptions public static void SendEmail(string _FromEmail, string _ToEmail, string _Subject, string _EmailBody) {</p> <pre><code> // setup email header . SmtpMail.SmtpServer = "localhost"; MailMessage _MailMessage = new MailMessage(); _MailMessage.From = _FromEmail; _MailMessage.To = _ToEmail; _MailMessage.Subject = _Subject; _MailMessage.Body = _EmailBody; try { SmtpMail.Send(_MailMessage); } catch (Exception ex) { throw new ApplicationException("error has occured: " + ex.Message); } } </code></pre> <p>please help!</p>
asp.net c#
[9, 0]
3,777,447
3,777,448
change Content in TabActivity
<p>I have a problem with a change Content in TabActivity.</p> <pre><code>public class MbankActivity extends TabActivity { Intent intentMap; ... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ... intentMap = new Intent().setClass(this,MapaActivity.class); tabSpecMap = tabHost .newTabSpec("Map") .setIndicator("Map", ressources.getDrawable(R.drawable.ic_launcher)) .setContent(intentMap); ... } ... } </code></pre> <p>and i try change Content</p> <pre><code>intentMap= new Intent().setClass(this,AnotherMapActivity.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); </code></pre> <p>but this not work.</p> <p>I try too:</p> <pre><code>getTabHost().setCurrentTab(2); //old class in run Intent aa=new Intent().setClass(this,,AnotherMapActivity.class) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); this.getLocalActivityManager().startActivity("Map", aa); // </code></pre> <p>new class is run but tab is view from old class ?!? ;/</p> <p>how can I change the content?</p>
java android
[1, 4]
769,101
769,102
The method getContentResolver() is undefined for the type Discoverer
<p>I am getting the error <code>getContentResolver() is undefined for the type Discoverer</code></p> <p>Below is my code. Please help me out</p> <p>i start by using</p> <pre><code> new Discoverer((WifiManager) getSystemService(Context.WIFI_SERVICE)) .start(); </code></pre> <p>and this follows in the class file</p> <pre><code> public void run() { try { DatagramSocket socket = new DatagramSocket(DISCOVERY_PORT); socket.setBroadcast(true); socket.setSoTimeout(TIMEOUT_MS); android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID); sendDiscoveryRequest(socket); listenForResponses(socket); } catch (IOException e) { Log.e(TAG, "Could not send discovery request", e); } } </code></pre> <p>and the mainactivity part</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID); new Discoverer((WifiManager) getSystemService(Context.WIFI_SERVICE)) .start(); setContentView(R.layout.startscreen); </code></pre>
java android
[1, 4]
4,255,972
4,255,973
Adding rows to a table with jQuery
<p>I am trying to develop a plugin for jQuery. This is my first plugin, and I am stuck in the initial phase. </p> <p>I need to do following things: I need to find the "add row" link from the table and bind to the click event. When the link is clicked, it should add a new row by cloning the existing template row. Initially the template row is hidden.</p> <p>Following is the HTML.</p> <pre><code>&lt;table id='grid1'&gt; &lt;tr&gt; &lt;td&gt;&lt;a href='#' id='add_row'&gt;Add New Row&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table id='data_table'&gt; &lt;tr&gt;&lt;th&gt;Col1&lt;/th&gt;&lt;th&gt;Col2&lt;/th&gt;&lt;th&gt;Col3&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Data1&lt;/td&gt;&lt;td&gt;Data2&lt;/td&gt;&lt;td&gt;Col3&lt;/td&gt;&lt;/tr&gt; &lt;tr id='template_row'&gt; &lt;td&gt;&lt;input type='text' /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type='text' /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type='text' /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>And my jQuery so far:</p> <pre><code>(function($) { $.extend($.fn, { editableGrid: function() { function addRow() { //code to clone here but i need the instance of main table here ie grid1 } this.find('#add_row').bind("click",addRow); } }); })(jQuery); </code></pre>
javascript jquery
[3, 5]
1,531,782
1,531,783
Is it possible to access an html document from a different PHP script than the one that generated it?
<p>Here is the scenario: I have a page that is logging data to MYSQL. I have another page that reads that data and allows it to be viewed. When a new piece of data is logged I would like to have the first script check and see if the viewing page is open in the browser, and if so append the newest data to the end of the view. Also - could anyone point to some info giving an overview of how PHP and the browser interact? I think I have the concept of the DOM down for javascript...but as far as PHP it just appears that once the page is sent, that's it...</p>
php javascript
[2, 3]
1,944,164
1,944,165
jQuery process groups of checkboxes
<p>So I have several groups of checkboxes that are all related. More specifically, it is a permission system. Each user group has their set of permissions, so Admin gets view/read/create, Member gets view/read/create, and so on. Each group will have checkboxes for each permission, so as to select which groups can do what.</p> <p>Processing with PHP is cake, can just do <code>name="permission[$group_id][]"</code> and that's pretty much it. However being not very fluent with Javascript, I'm having a bit of trouble processing it with jQuery in the same fashion. Ultimately I need to be able to pass the checkboxes to a PHP script with AJAX. I also have to be able to populate the checkboxes with AJAX/Javascript.</p> <p>Any pointers appreciated.</p>
javascript jquery
[3, 5]
1,588,551
1,588,552
Use an array to query whether one of the strings exists in window.location.href
<p>I currently search the window.location.href individually:</p> <p>window.location.href: <code>http://www.example.com/6CATA/folder/file.html</code></p> <pre><code>var searchWinHref = window.location.href; if(searchWinHref.indexOf("/6CATA/") &gt; -1) { alert('6CATA is in the window.location.href'); } </code></pre> <p>Which triggers the alert.</p> <p>How can I adapt this to query the variable searchWinHref to match one of the strings in an array?</p> <pre><code>var searchWinHref = window.location.href; var searchWinArray = ['6CATA', '6CATB', '6CATC']; if(searchWinHref.indexOf(searchWinArray)) { alert('alert which code is in the window.location.href'); } </code></pre>
javascript jquery
[3, 5]
1,524,594
1,524,595
LINQ / LAMBDA expression for the below code
<p>I am having a checked list box from which i extracted the checked items value and saved it to database. Now when i am returning back to form i am having only the value [id] as a List. Now i want to display those selected values from this list of int.</p> <p>I think i am clear to you. </p> <p><strong>[Update]</strong></p> <p>Hi, I solved my issue , using the below code. But i want to know is there any more optimized solution than this one. As its iterating unneccesarily</p> <pre><code>private void ProcessRequest() { if (Session["DeniedReason"] != null) { List&lt;int&gt; deniedList = (List&lt;int&gt;)Session["DeniedReason"]; if(deniedList!=null) { if(deniedList.Count&gt;0) { foreach (int deniedValue in deniedList) { foreach (ListItem item in cblDeniedList.Items) { if (string.Compare(item.Value,deniedValue.ToString())==0) { item.Selected = true; } } } } } } } </code></pre> <p>LINQ / Lambda expression if any..that would be great.</p>
c# asp.net
[0, 9]
5,659,140
5,659,141
Passing $this in JavaScript
<p>How would I rewrite this to use a common function, pretending that the common function would eventually have more than the 1 line of code in it:</p> <pre><code>$('.insert').hover(function() { $(this).css('cursor','pointer'); }); $('.delete').hover(function() { $(this).css('cursor','pointer'); }); </code></pre>
javascript jquery
[3, 5]
1,128,650
1,128,651
message box show in asp.net problem
<p>I have an email compose page. When the user clicks on the "Send" button, if there is any error, the page is redirected to an error page. If the email is sent out successfully, it displays a javascript alert message. The way it's done now is using a label control, LblMessage.Text="alert('Your email has been sent successfully!');"; All of this works fine. Now I want to redirect the user to the home page. So if the email is sent out successfully, I want to display the javascript alert message, then do a redirect to home page. But if I add the response.redirect after the alert code, the alert never shows up. I tried changing the endReponse to true and false, it did not work. Any suggestions? </p>
c# asp.net
[0, 9]
4,870,567
4,870,568
How to disable certains items in listbox control when binding
<p>i have an datatable with valuees like this</p> <pre><code>names ------ kumar kiran ram bala ---- anu sita geetha ----- asha abc tsdf dsf sdf sdfrt sdfsdfd sdfdsfsdf -------- </code></pre> <p>i am binding my table to listview like this</p> <pre><code>ListItem ddlItem; foreach (DataRow dr in dt.Rows) { ddlItem = new ListItem(dr["names"].ToString()) lbx.Items.Add(ddlItem); } </code></pre> <p>here even i need to bind my datatable wih all the values except"-----" these values . it should be in disable mode even though user tries to selected it will not get selected how can we get it achived. any help on this would be great thank you</p>
asp.net javascript
[9, 3]
3,508,882
3,508,883
Parse string value pair in javascript
<p>I have an attribute of a list object in html like this:</p> <pre><code>&lt;ul&gt; &lt;li id="myID" add-param="{"type1":"myType1","type2":"myType2"}"&gt;Test&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Having the list item with specified ID, how could I get the value myType1,myType2 by the key type, type2 ?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,297,278
4,297,279
Pass C# Values To Javascript
<p>On loading the page I want to pass a value to my javascript function from a server side variable.</p> <p>I cannot seem to get it to work this is what I have:</p> <p>Asp.Net</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { string blah="ER432"; } </code></pre> <p>Javascript</p> <pre><code>&lt;script type="text/javascript"&gt; var JavascriptBlah = '&lt;%=blah%&gt;'; initObject.backg.product_line = JavascriptBlah; &lt;/script&gt; </code></pre> <p>Adding this to the page</p> <pre><code> public string blah { get; set; } protected void Page_Load(object sender, EventArgs e) { blah="ER432"; } </code></pre> <p>I still am getting an error: CS0103: The name 'blah' does not exist in the current context</p> <p>Also I would like to try and accomplish this without using hdden fields</p>
c# javascript asp.net
[0, 3, 9]
1,679,912
1,679,913
jQuery click event on 1000 divs, optimize approach?
<p>I'm building a system for selling tickets to events. Right now there are about 1000 diffrent seats to choose from as a visitor. Maby one day it will be up to 5000.</p> <p>Right now I have a div for each spot and then some jQuery to reserv the spot with ajax. So that meens that I have about 1000 divs and more alarming my jQuery selector sets a click event on each div.</p> <p>Is there a better approach on this? </p> <p>I want to trigger ajax when a div is pressed, not reloading the page.</p>
javascript jquery
[3, 5]
5,395,809
5,395,810
$(window).load() works differently on IE and FF
<p>I was working with <code>$(window).load()</code> ...and found one issue. Actually as per this function first window should load and then any implementation under this function should start working. This works fine for IE but not for FF. in FF its working like <code>$(document).ready()</code></p> <p>can somebody suggest any alternate approach, or the reason why FF behave like this.</p>
javascript jquery
[3, 5]
937,542
937,543
Something like a Map<String, Object> I can use to store data in jquery?
<p>I have some JSON objects I'd like to store in a map for the lifetime of my app. For example, my app shows a listing of Farms. When a user clicks one of the Farm links, I download a Farm representation as JSON:</p> <pre><code>Farm 1 Farm 2 ... Farm N </code></pre> <p>every time the user clicks one of those links, I download the entire Farm object. Instead, I'd like to somehow make a global map of Farms, keyed by their ID. Then when the user clicks one of the above links, I can see if it's already in my map cache and just skip going to the server.</p> <p>Is there some general map type like this that I could use in jquery?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,489,839
1,489,840
Algorithm for computing a score for move and time based game
<p>I am creating a puzzle game that consists of moves and time.</p> <p>Obviously the more moves you end the game with would mean you did better or a level than with a low amount of moves left upon completion. </p> <p>The time counts from 0 and goes until the player completes the level. The less time it takes the player to complete the level this would mean he/she has done better than using a lot of time to complete the level.</p> <p>So with this being said, what would be the best way to calculate the players final score to equal a score over 1000 using this information.</p> <p>P.S I know for some of you this may be easy task, but i would just like some guidance on this.</p> <p>Thanks a lot. </p>
java android
[1, 4]
2,275,482
2,275,483
How to perform javascript inside C# event
<p>I am inside an event and inside this event I want to have a javascript alert display a message to a user. But I cannot seem to get this to work.</p> <pre><code>protected void dgvStaff_Deleting(object sender, Infragistics.Web.UI.GridControls.RowDeletingEventArgs e) { // Code stub object test = e.Row.Items[0].Text; //ScriptManager.RegisterStartupScript(this, this.GetType(), "alertbox", "ShowPopup('Select a row to rate');", true); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertbox", "ShowPopup('Select a row to rate');", true); if (objGatewayFunctions.CheckStaffAssignment(e.Row.Items[0].Text.ToString(), ConfigurationManager.AppSettings.Get("Connection").ToString()) == true) { } } </code></pre> <p>Any idea what I am doing wrong here?</p>
c# asp.net
[0, 9]
624,745
624,746
Alert Dialog Icon Won't Set
<p>I have a 14x14 png file (icon_alert.png) in my drawable-hdpi folder. This is how I am setting the icon:</p> <pre><code>alertDialog.setIcon(R.drawable.icon_alert); </code></pre> <p>The icon is not there when the dialog is shown.</p>
java android
[1, 4]
3,027,985
3,027,986
Select td elements if checkbox is on
<p>I have this table, from which i'd like to select all the <code>td</code> elements value if the checkbox is <code>checked</code> and then put all the elements in some array or string, so that i can transfer it to server side.</p> <pre><code>&lt;table id="tableDg"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" class = "chkbCsm" &gt;&lt;/input&gt;&lt;/td&gt; &lt;td width="10%" align="center"&gt;&amp;nbsp;&amp;nbsp;&lt;input type="hidden" id="nameText" readonly="true" value="{name}"&gt;{name}&lt;/input&gt;&lt;/td&gt; &lt;td width="22%" align="center"&gt;&amp;nbsp;&amp;nbsp;&lt;input type="hidden" id="nameText" readonly="true" value="{host}"&gt;{host}&lt;/input&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>Here is what i am doing on jquery side, but it does the selecting thing irrespective of the checkbox being on. Please somebody help me get it in some array.</p> <pre><code>$('#tableDg tbody tr').live('click', function (event) { $(this).find('td').each( function( index, item ) { if ( $(this).has(':hidden') ) { alert( $(this).find(':hidden').val() ); } }); }); </code></pre> <p><strong>Added</strong> a jsFiddle link</p> <p>Take a look <a href="http://jsfiddle.net/abhisheksimion/vAYFL/2/" rel="nofollow">here</a></p>
javascript jquery
[3, 5]
664,860
664,861
pass php variable via AJAX with jquery
<p>I want to send a variable <code>$stuff</code> frome <code>page.php</code> to <code>load.php</code> via POST</p> <p>I have something like this in javascript</p> <pre><code>$.post("load.php", {'start': count }, function(data){ $("#posts").append(data); }); </code></pre> <p>I know I need to modify {'start': count } but im confused as to how to pass $stuff in since it isn't a javascript variable.</p> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
1,938,792
1,938,793
ASP.NET Getting a blank page after submitting a form (beginner)
<p>I am trying to make some game, I'm not going to explain what is it because it's not really important, anyway, the problem is the following form: </p> <p><a href="http://pastebin.com/8XwdDFWY" rel="nofollow">http://pastebin.com/8XwdDFWY</a></p> <p>after submitting that form I'm getting a blank page.</p> <p>Here's the server side code which that form navigates to:</p> <p><a href="http://pastebin.com/tfeAMxrF" rel="nofollow">http://pastebin.com/tfeAMxrF</a></p> <p>Thank for helpers!</p>
c# asp.net
[0, 9]
4,480,588
4,480,589
Calendar with quick note
<p>Is there any JavaScript or jQuery widget calendar which allow to add some information to days? This "notes" will be added not by user - prepared against to page load.</p> <p>For example: User pick date and read notes for these day.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,560,832
2,560,833
Popping a modal with Javascript
<p>I have the following in an html file:</p> <pre><code>&lt;div id='confirm'&gt; &lt;div class='header'&gt;&lt;span&gt;Stay Online&lt;/span&gt;&lt;/div&gt; &lt;div class='message'&gt;&lt;/div&gt; &lt;div class='buttons'&gt; &lt;div class='no simplemodal-close'&gt;No&lt;/div&gt;&lt;div class='yes'&gt;Yes&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>which is a simplemodal from <a href="http://www.ericmmartin.com/projects/simplemodal-demos/" rel="nofollow">http://www.ericmmartin.com/projects/simplemodal-demos/</a></p> <p>and I created a java script timer</p> <pre><code>if (iniTimer == 15){ // call the Confirm class to launch the confirm box. } iniTimer = setTimeout("ClockCount()",1000); </code></pre> <p>in its own .js file and when the timer equals 15 secs I want it to pop this div from within javascript. Is this possible and if so could you please tell me how to do it?</p> <p>Thank you very much,</p> <p>Frank G.</p>
javascript jquery
[3, 5]
1,344,839
1,344,840
Is it possible to print a function as a string in Python?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1562759/can-python-print-a-function-definition">Can Python print a function definition?</a> </p> </blockquote> <p>In Javascript, it is possible to print a function's code as a string?</p> <p>Example in Javascript:</p> <pre><code>function thisFunctionPrintsItself(){ return thisFunctionPrintsItself.toString(); } </code></pre> <p>Is it possible to do the same in Python?</p>
javascript python
[3, 7]
4,531,497
4,531,498
Calling main thread in asp.net C#
<p>I am calling method in separate thread. After sometime or after some event occurs I want to call main threads method. I am using C# in asp.net website.</p> <p>To call separate thread i am using below code</p> <pre><code> Thread thread = new Thread(new ThreadStart(threadMethod)); thread.Start(); </code></pre> <p>From threadMethod how to call main method?</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,569,539
2,569,540
is it possible to disable the submit behaviour of a server side button using Javascript
<p>is it possible to disable the submit behaviour of a server side button using Javascript? Note: I dont want to disable the button, the user will click the button but it will not submit/get any value from server.</p> <p>scenario:</p> <pre><code> &lt;asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" OnClientClick="Check()" /&gt; </code></pre> <p>javascript:</p> <pre><code>function Check() { var res = confirm(" Are u sure whatYou have selected ") if (res) { alert("yes"); } else { //Here I need to disable the submit behavoiur } } } } </code></pre>
asp.net javascript
[9, 3]
3,275,625
3,275,626
Jquery dynamic dropdown event not firing
<p>Hi i am trying to create dropdownlists dynamically and populating the contents via an ajax call, this sort of works in the sense that the drop down is created and populated as required but its 'change' event does not fire. I am posting the code below, if anyone can spot something obvious, can you please let me know regards</p> <pre><code>$(document).ready(function () { $("#positions select").change(function (e) { alert("in"); var id = $("#category_id").val(); $.getJSON("/Category/GetSubCategories/" + id, function (data) { if (data.length &gt; 0) { alert(data.length); var position = document.getElementById('positions'); var tr = position.insertRow(7); var td1 = tr.insertCell(-1); var td = tr.insertCell(-1); var sel = document.createElement("select"); sel.name = 'sel'; sel.id = 'sel'; sel.setAttribute('class', 'category'); td.appendChild(sel); $.each(data, function (GetSubCatergories, category) { $('#sel').append($("&lt;option&gt;&lt;/option&gt;"). attr("value", category.category_id). text(category.name)); }); } }); }); }); </code></pre>
javascript jquery
[3, 5]
1,341,688
1,341,689
Make an ajax request with elements attributes with jquery
<p>I want to make an ajax request where I want to give all my elements attributes. For exemple i select all my elements : </p> <pre><code>var elements = $('.droppable') </code></pre> <p>and then i make my ajax :</p> <pre><code> $.ajax({ url: "test.html", data: {myelements : elements}, success: function(){ } }); </code></pre> <p>How can i do to give all my elements attributes as <strong>height, width, position, top, left</strong>... to my ajax request. I have to make an array myself or there is an other way?</p> <p>I want to do that because i want to save in database all the absolute position of my elements.</p> <p>Thank you for help.</p>
javascript jquery
[3, 5]
3,443,017
3,443,018
asp.net c# ÅÄÖ UTF-8
<p>I have problem with special chars like ÅÄÖ they prints out like "Ã¥ ä ö Ã… Ä Ö"</p> <p>FB.ui({method: 'apprequests', title: 'We LOVE U!', message: 'å ä ö Å Ä Ö', filters: ['app_non_users'], }, requestCallback);</p>
c# asp.net
[0, 9]
5,247,487
5,247,488
How do I make a Generic Data Access Class?
<p>ASP.net C# 3.5 Framework, working in Visual Studio 2008 currently.</p> <p>What I want is a Generic Data Access Class. I have seen several of them but what I want is to see one that I pass the Connection String and the SQL statement and it will return a List of Objects or when only one item an Object or when no response needed a boolean to let me know if it succeeded?</p> <p>I hope this makes sense if not let me know and I will explain more.</p>
c# asp.net
[0, 9]
2,633,584
2,633,585
Smallest WYSIWG editor you can find?
<p>I am searching for the smallest WYSIWG editor i can find. </p> <p>I have tried TinyMCE, CKEditor etc. but i can not find a small one, all has hundreds of kb js files to load.</p> <p>I dont need image upload etc, even if i like the one Stackoverflow using so think i need some that more shows like Word but really basic features.</p> <p>I am using jQuery in the project and i it is a ASP.NET MVC 3.0 project but i really like jQuery and normal html instead of ASP.NET components.</p> <p>But i am open for ideas about everything that are really basic and tiny size.</p> <p>Someone has any idea?</p>
javascript jquery
[3, 5]
2,638,500
2,638,501
form submits before onsubmit function has finished
<p>I'm calling the JavaScript function onsubmit of form but form has submit before finished the submit function.If I use the alert in the onsubmit function it finish the function first then submit the form.I used the settimeout function in place of alert but it didn't work.How can I submit the form after the onsubmit has complete.</p> <pre><code>function chat1close(name){ var abc; abc=window.frames[0].test(); $.ajax({ type:'GET', url:'modules/closechat.php?abc='+abc+'&amp;name='+name, success:function(data){ } }); document.getElementById("hello").innerHTML=" "; alert("yes"); return true; } </code></pre>
javascript jquery
[3, 5]
575,770
575,771
jqTransform and ASP.NET does work, why?
<p>I get this message while pressing on ASP:Button in IE 8 in Compatibility Mode while my form has jqTransform applied to it.</p> <p>"A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$ButtonRegister="register..."). " </p> <p>Without it works fine, if i don't override Compatibility Mode with </p> <pre><code>&lt;meta http-equiv="X-UA-Compatible" content="IE=7" /&gt; </code></pre> <p>i have half of my controls ugly with jqTransform </p> <p>any help ? Why is 'span' passed ?</p>
asp.net jquery
[9, 5]
5,884,833
5,884,834
jQuery won't update height
<p>I'm having problems with the jQuery .height() function.</p> <p>Final result should be an div with an dynamic height as the text changes. Therefore I have an wrapper div and an content div inside that wrapper. The text is in hidden div's somwhere else in the DOM, and 'imported' with .html() function and an simulated fadeIn/Out with setting the opacity to 0 and then back to 1.</p> <p>When I try to change the content, the wrapper resizes, but with the old height value. I just can't manage to get the current value of the content div...</p> <p>This is where the magic should happen...</p> <pre><code>nav.click(function() { contDiv.animate({opacity:0}, 200, function() { contDiv.html(currCont); contDiv.animate({opacity:1}, 200); }); wrapper.animate({height:contDiv.height()},200); }); </code></pre>
javascript jquery
[3, 5]
4,456,358
4,456,359
ASP.net Get Path
<p>I have </p> <pre><code>C:\Softwares\Test\ASPnetTest\Project11\Shared\Public\Images\ </code></pre> <p>How to convert it to</p> <pre><code>Shared\Public\Images\ </code></pre> <p>Thank you.</p>
c# asp.net
[0, 9]
3,326,756
3,326,757
Change part of name with Javascript and jQuery
<p>I have a few <code>select</code> elements on my page and i want to remove a part of the name.</p> <p>Their name look something like this:</p> <pre><code>ctl02$fieldname </code></pre> <p>The part that i want to remove is: <code>ctl02$</code>. So that it leaves me with <code>fieldname</code> only.</p> <p>That part that i want to remove always starts with <code>ctl</code> then a two digit number ending with a <code>$</code>.</p> <p>I tried it with the following code, but that didn't do the trick:</p> <pre><code>$(".elements select").each(function() { this.setAttribute("name", this.getAttribute("name").replace(/ctl([0-9]+)\$$/, "")); }); </code></pre> <p>Anyone any idea how i can do this?</p> <p>Here's a demo: <a href="http://tinkerbin.com/Klvx5qQF" rel="nofollow">http://tinkerbin.com/Klvx5qQF</a></p>
javascript jquery
[3, 5]
3,160,678
3,160,679
ASPX server code is being created in .aspx file
<p>just moment ago I discovered strange behaviour of my visual studio environment. I'm using ASP.net web application. When the webform is added, and i'm trying to place button on webform, instead of declaring button_Click event in code-behind file (WebForm.aspx.cs) this declaration is placed in aspx.file as follows:</p> <pre><code>&lt;script runat="server"&gt; protected void Button2_Click(object sender, EventArgs e) { } </code></pre> <p> Earlier everything worked correctly. What am i missing?</p>
c# asp.net
[0, 9]
5,694,399
5,694,400
image preloader not working in IE
<p>I have the following code to preload images:</p> <pre><code>preloader : function(images) { var imgCount = images.length; var counter = 0; $.each(images, function(i, n) { alert('hi'); // load each image $("&lt;img /&gt;").attr("src", n).load(function() { counter++; if(imgCount == counter) { $('#loader').hide(); $('#wheel').show(); } }); }); } </code></pre> <p>which I'm calling like so:</p> <pre><code>preloader(['../images/image1.png','../images/image2.png','../images/image3.png']); </code></pre> <p>It works fine in firefox but in IE it doesn't work. I get all 3 alerts back so the each loop runs but it only ever loads the first image. If I out just one image in the array I get in to the final if statement and the div's are shown and hidden. But any more than one image and Ie trips up. As i say this works fine in FF so it's not a problem with paths to images or images missing etc.</p> <p>Any idea? I'm really stumped on this.</p>
javascript jquery
[3, 5]
3,595,141
3,595,142
How to make resolution free app
<p>I have set 320x480 size for canvas/widget of app. How can I make it resolution free.I have to draw some tips on particular location using AbsoluteLayout.If I change size of canvas/widget then the tips are displaying at wrong coordinates.</p>
java android
[1, 4]
1,400,051
1,400,052
Append select data to URL using jQuery
<p>I am having problems trying to add a parameter to a URL using jQuery based off of the value of a Select element. Here is my code so far:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $("#sel-1").change(function() { $(this).closest("form").submit(); }); var input = $("&lt;input&gt;").attr("type", "hidden").attr("name", "state").val($("#sel-1").val()); $('.start-form').append($(input)); }); &lt;/script&gt; &lt;form action="process.php" class="start-form"&gt; &lt;fieldset&gt; &lt;div class="row"&gt; &lt;label for="sel-1"&gt;Select &lt;strong&gt;State&lt;/strong&gt;&lt;/label&gt; &lt;select id="sel-1"&gt; &lt;option value="Select"&gt;Select&lt;/option&gt; &lt;option value="AK"&gt;AK&lt;/option&gt; &lt;option value="CA"&gt;CA&lt;/option&gt; &lt;option value="TX"&gt;TX&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;input type="submit" class="hidden"/&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>For some reason no matter which option I select, the URL will become process.php?state=Select. What I need it to do is become process.php?state=TX or whatever option the user selects.</p> <p>Any help is greatly appreciated!</p>
javascript jquery
[3, 5]
5,111,099
5,111,100
PHP + jQuery - How to form submit, process and redirect on success?
<p>Stupid question (I seem to be leading all my questions with this phrase), but I was wondering if anyone out there had an elegant solution for processing forms via php and jquery and then redirects</p> <blockquote> <p><strong>[HTML FORM]</strong> --> <em>submits via jquery post to</em> --> <strong>[PHP FILE]</strong> --> <em>upon success redirects to</em> --> <strong>[SUCCESS HTML PAGE]</strong> <em>(and if not success returns back to [HTML FORM]</em></p> </blockquote> <p><strong>HTML FORM example</strong></p> <pre><code>&lt;form action="procRegister.php" method ="post" id="registerAccount" name="registerAccount"&gt; ...fields here ladeeda... &lt;/form&gt; </code></pre> <p><strong>JQUERY POST example</strong></p> <pre><code>$("form#registerAccount").submit(function(){ $.post( "procRegister.php", $("form#registerAccount").serialize(), function(data){alert(data.msg);}, 'json' ); return false; }); </code></pre> <p><strong>PHP PROCESSING example</strong></p> <pre><code>&lt;?php header('Content-type: application/json'); $return['msg'] = 'Alright!'; echo json_encode($return); ?&gt; </code></pre> <p>If everything works correctly then the page would pop up an alert box saying "Alright!". Now, how and where would I implement the redirect upon success? i.e. Instead of sending "Alright" how would I redirect the user to, say a CONFIRMATION page?</p>
php jquery
[2, 5]
2,170,871
2,170,872
Getting values from different input fields with same class name
<p>I'm working on an image sharing site, and right now I'm working on rendering out a users albums on a page. Each of the albums contains of at least on image, and I want to show all the albums as boxes with four thumbnails (the first four images in the album) in each of the boxes.</p> <p>The images file names is stored in the value of a hidden input field in each of the boxes, and what I want to do is to get all the file names from each of the album boxes and show them as thumbnails.</p> <p>The part that I need help with is how I shall get the file names from each of the album boxes, one by one. The code below doesn't work by obvious reasons, but how can it be rewritten so it works? All the input fields has the same class name.</p> <p>Thanks in advance!</p> <pre><code> if ($('.hiddenAlbumNames').length &gt; 0){ var images = $(this).val(); // the rest of the code (creating images and putting them in the album boxes) } </code></pre>
javascript jquery
[3, 5]
1,237,023
1,237,024
Creating a Game Server
<p>I'm interested in creating a server for an undetermined multiplayer game, either PC or mobile based. Any game server would obviously be event driven, asynchronous, and fast. I'm very experienced in web development, where it's common to use a framework such as Symfony for PHP or Django for Python. </p> <p>Is there anything comparable to web frameworks for high performance game server development? ROS (Robot operating system) is an example of a complex C/C++ framework which is optimized for real time performance and includes common robot functionality. Is there something comparable designed for games?</p> <p>Right now I'm most interested in creating a browser based WebGL game or an iPhone game. As such, I'm thinking of using Django as my request handler, and just doing communication over AJAX. I know that'd work nicely for a PC web game, but I'm not sure what the best ways of doing remote communication with an iPhone/other mobile device. Is it common to use a web framework to arbitrate mobile apps?</p> <p>This is an open ended question, so any advice, thoughts, or links to further readings are much appreciated. If anyone has any good reading material I'd love to take a look.</p>
android iphone
[4, 8]
4,598,307
4,598,308
How to show X number of divs at a time in Javascript?
<p>Assuming I have an array of names:</p> <pre><code>var myarray = ["A", "B", "C", "D", ... "J"] </code></pre> <p>Say if I have 10 entries in my array and I only want to show 3 at any given time. How do I make it such that each entry, if shown, is shown in a div of red color with a "Back" link and a "Next" link? When I click next, it will show the next 3; when I click on previous it will show the previous 3.</p> <p>Example:</p> <p>Initially 3 Divs are Shown</p> <pre><code>"A" "B" "C" </code></pre> <p>Clicking on "next" shows</p> <pre><code>"D" "E" "F" </code></pre> <p>Clicking on "previous" shows</p> <pre><code>"A" "B" "C" </code></pre> <p>Clicking on "next" 3 times shows only 1 div "J"</p> <p>How to go about this with Javascript or jQuery? Any sample is appreciated.</p>
javascript jquery
[3, 5]
5,330,799
5,330,800
How can I run Ajax functions syncrronously from Javascript?
<p>I have the following code:</p> <pre><code>$('#DoButton').click(function (event) { event.preventDefault(); $("input:checked").each(function () { var id = $(this).attr("id"); $("#rdy_msg").text("Starting" + id); doAction(id); }); }); function doAction(id) { var parms = { Id: id }; $.ajax({ type: "POST", traditional: true, url: '/adminTask/doAction', async: false, data: parms, dataType: "json", success: function (data) { $("#rdy_msg").text("Completed: " + id); }, error: function () { var cdefg = data; } }); } </code></pre> <p>When the button is clicked it checks the form and for each checked input it calls doAction() which then calls an Ajax function. I would like to make it all synchronous with a 2 second delay between the completion of one call and the running of the next. The delay is to give the user time to see that the last action has completed. </p> <p>By setting async=false will that really make the ajax function wait?</p> <p>How can I add a 2 second wait after the Ajax has run and before the next call to doAction?</p>
javascript jquery
[3, 5]
3,270,633
3,270,634
Efficiency with java strings
<p>When we extend DefaultHandler, we usually override the characters function.</p> <p>I was wondering which would be a more efficient way to extract the String supplied... </p> <hr> <ol> <li><p><strong>Would it be using a for loop and a StringBuilder?</strong></p> <pre><code>@Override public void characters(char[] ch, int start, int length) throws SAXException { StringBuilder sb = new StringBuilder(length); for(int i=start; i&lt;start+length; i++) sb.append(ch[i]); String values = sb.toString(); } </code></pre></li> <li><p><strong>Would it be using a simple substring?</strong></p> <pre><code>@Override public void characters(char[] ch, int start, int length) throws SAXException { String values = (new String(ch)).substring(start, start + length); } </code></pre></li> <li><p><strong>Is there another approach?</strong></p></li> </ol>
java android
[1, 4]
3,985,092
3,985,093
Jquery date difference
<p>I have this code for calculating date difference (without weekends) between two input fields, and printing the difference in days in a third text box. The date format is yy-mm-dd (because of mysql).</p> <pre><code>&lt;script type="text/javascript"&gt; $("#vazi_od, #vazi_do").change(function() { var d1 = $("#vazi_od").val(); var d2 = $("#vazi_do").val(); var minutes = 1000*60; var hours = minutes*60; var day = hours*24; var vazi_od1 = getDateFromFormat(d1, "yy-mm-dd"); var vazi_do1 = getDateFromFormat(d2, "yy-mm-dd"); var newvazi_od=new Date(); newvazi_od.setFullYear(vazi_od1.getYear(),vazi_od1.getMonth(),vazi_od1.getDay()); var newvazi_do=new Date(); newvazi_do.setFullYear(vazi_do1.getYear(),vazi_do1.getMonth(),vazi_do1.getDay()); var days = calcBusinessDays(newvazi_od,newvazi_do); if(days&gt;0) { $("#razlika").val(days);} else { $("#razlika").val(0);} }); &lt;/script&gt; </code></pre> <p>But, when i pick the start and the end date, nothing happens in the field that should show the difference in days... Any help?</p>
javascript jquery
[3, 5]
2,383,402
2,383,403
Iterating through viewgroup
<p>Given a new screen in android i would like to iterate through all the viewgroups and views in order to discover all buttons,text fields, spinner etc... is this possible ?</p>
java android
[1, 4]
1,789,350
1,789,351
run function at ready and keyup event
<p>Is there another in jquery to run a function at page load and at a keyup event instead of the way I'm doing it?</p> <pre><code>$(function() { totalQty(); $("#main input").keyup(function() { totalQty(); }); }); </code></pre>
javascript jquery
[3, 5]
66,196
66,197
jQuery: Setting Functions Per Page
<p>I currently have a single jQuery script page that I include in my ScriptManager on my MasterPage (I use ASP.NET). All of my custom scripts for all my pages go in this page. I know some people like to break it up into multiple pages but I prefer having them all in one place. Anyways, I have one <code>$(document).ready(function(){ //do stuff// });</code> on this page. All of my other functions I name and then place in the document.ready function, ie:</p> <pre><code>$(document).ready(function(){ Function1(); //necessary for page1.aspx, page2.aspx but not 3 or 4 Function2(); //etc., necessary for some but not other pages }); function Function1() { // whatever, etc // } </code></pre> <p>My question centers around the efficiency of this. A lot of these functions only have any sort of application on certain pages, but not on all. Would it be better to include some page-specific coding, ie, determine what page we're on, and then if we're on the correct page, go ahead and perform the function, or does it not even matter? I was under the impression that it didn't matter, but I would like to be sure.</p> <p>Thanks</p>
asp.net jquery
[9, 5]
4,368,368
4,368,369
Simulate :focus state on a div when key pressed
<p>I want previous and next navigation using left and right arrow keys. I want the state of the links to change to :focus upon pressing of the arrow keys as well for tactile feedback. Perhaps addClass could work too, but I can't figure it out.</p> <p>Code is here: <a href="http://jsfiddle.net/wBWTx/" rel="nofollow">http://jsfiddle.net/wBWTx/</a></p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,909,001
3,909,002
Replacing old DLL with new DLL
<p>My client lost the source code of their web application and wanted to make few small changes to it. I used RedGate's .Net Reflector to extract the source code from the DLL. Using the class files generated I was able to make changes at the desired place and re-generate the DLL. The application pool used by the application is "default" with version 1.1 and I think the application was also created using .Net framework 1.1, but I used visual studio 2008 to open the project and create the new DLL. also the old DLL had some version number. My question is: since the application is already online, will replacing the new DLL create any problem? Since the time frame given to us to replace the DLL is very small as the application can not stay offline for long, I want to make sure that everything goes fine. Am I following the right way? Or, do I have to create the new DLL using the same framework(1.1)? What else do I need to do to keep the application running smooth without any problem. Kindly excuse me for this lame question but this is the first time I am in this sort of scenario. Thanks.</p>
c# asp.net
[0, 9]
2,876,221
2,876,222
Control access on certain users
<p>My website is mainly divided into 3parts. One for administrator, mostly maintenance pages to update database. One for general users who browse the page with accounts logged in. One is for anonymous to browse and check out our products. How could I restrict the users/anonymous to get to my admin pages and how do I restrict anonymous to purchase? </p>
c# asp.net
[0, 9]
2,155,842
2,155,843
On Click, knowing if the element clicked is a checkbox?
<p>I used to use the following to know if a clicked item was a checkbox:</p> <pre><code>if ($(e.target).className === 'checkbox') {} </code></pre> <p>After upgrading to the latest version of jQuery this now returns undefined for Chrome, Safari and Firefox.</p> <p>What is the best way to determine if a click happened on a checkbox?</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,436,887
2,436,888
JQuery Path location
<p>am using Asp.Net C# 2.0. My website is working fine in local. Website contains 2 js files included in master page. It works fine in local environment, but when i publish my website i get "Object expected" error on page load, and thus the js functions are not working in published website. </p> <p>Currently I am writing:</p> <pre><code> &lt;script src="/javascripts/jquery.hotkeys-0.7.9.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>in the master page.</p> <p>Looking forward for help.</p>
asp.net jquery
[9, 5]
2,845,006
2,845,007
InProc Session or save to database (using EF4.1)
<p>While rebuilding a site I'm having a rethink on various aspects of my site.</p> <p>One thing my current site does is store the shopping cart in session (InProc) through the various page requests of the buy process.</p> <p>I'm thinking of moving away from using the session state and instead saving the cart to a database using Entity Framework where necessary.</p> <p>Will I see a massive impact on performance in storing the cart this way?</p>
c# asp.net
[0, 9]
3,168,814
3,168,815
loading js dynamically with jquery
<p>I'm conditionally loading a script if the browser is IE8. I'm using jquery's .getScript function because I need to run something after the script is loaded. The problem is in the format of the URL. I've got it working when downloading the script that's on my hard drive directory but I can't get it to work when loading the script from a site.</p> <p>This is what I have, I'm sure it's a simple fix but I'm not getting it to work:</p> <pre><code> $.getScript("https://github.com/malsup/corner/blob/master/jquery.corner.js", function () { //does something here }); </code></pre> <p>Thanks for your fix.</p>
javascript jquery
[3, 5]
2,668,875
2,668,876
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]
5,223,178
5,223,179
setInterval & the global scope: Running setInterval once on click
<p>When a user lands on my homepage, I use setInterval to cycle through some classes for a visual effect:</p> <pre><code> var toggleSlide = setInterval( function() { $('#cs-main nav li.cycle').removeClass("cycle" || " ").next().last().addClass("cycle"); },600); </code></pre> <p>I'd like this effect only to run once when the user clicks on the splash page, and the site is loaded via ajax:</p> <pre><code> $("#splash").live('click', function () { $(this).fadeOut('slow', function () { $('#main').load('client.html', function () { }).fadeIn(); var toggleSlide = setInterval( function() { $('#cs-main nav li.cycle').removeClass("cycle" || " ").next().last().addClass("cycle"); },600); }); return false; }); </code></pre> <p>The issue I am running into is (I'm assuming) because setInterval runs in the global scope, anytime <code>#cs-main nav li.cycle</code> appears on a page, setInterval does its thing. This is problematic because this class appears on my subpages, whereas my intention is only to have it run once when the user clicks on #splash.</p>
javascript jquery
[3, 5]
3,244,578
3,244,579
Should I avoid using javascript and jquery in my website?
<p>I use some jquery and JS functions to validate forms and to check for example if that field is empty or password is less than 6 characters, and stuff like that, and I noticed that if someone disabled JS, then these functions would be useless, and no more protection of forms, which can be better made using PHP, so should I avoid them now because this could cause an insult to my website ?</p>
javascript jquery
[3, 5]
3,088,401
3,088,402
Operating System Detection by Java or JavaScript
<p>I need to detect OS name &amp; version in Java. That I can do by </p> <pre><code>String os_name = System.getProperty("os.name", ""); String os_version = System.getProperty("os.version", ""); </code></pre> <p>but the problem is that this is not reliable. Sometimes it returns incorrect information, and I can't detect all operating systems, except the most popular Windows, MacOS, Linux etc, and this even provides wrong information in the case of 64 bit operating systems. I need to detect any OS with any kind of specification. I am unable to find the right solution for this.</p> <p>Maybe I can do this with JavaScript? If it's impossible in Java then please tell me how to do it with JavaScript.</p> <p>Any input or suggestions highly appreciated.</p> <p>Thanks in advance.</p> <p>Best regards,</p> <p>**Nilanjan Chakraborty</p>
java javascript
[1, 3]
1,410,138
1,410,139
ASP.NET C# code behind
<p>I'm working on developing a solution for my website that will grab headlines and news articles from my database and display the 4 latest Headlines on my homepage with links to the full articles. I created a custom form that displays the information in a format that I would like. I tried creating a method in the code behind that would create one of these objects and populate itself with information from the database. This method would be invoked 4 times to display them in a vertical list. This is not going as smoothly as I thought it would. Does anybody have any ideas on how I could go about doing this. This code has to be dynamic since it will pull open a different article every time to display on the homepage. I'm new to the datagrids so if there is something that I can customize for this please point me in the right direction. </p> <p>Thanks,</p>
c# asp.net
[0, 9]
5,624,584
5,624,585
How to get Scroll position in Auto Complete
<p>I am using Jquery AutoComplete. <code>http://api.jqueryui.com/autocomplete/</code></p> <p>The problem i am facing is when this jquery auto complete fetch me the result it shows me all in one line. i want that it should show 10 result and rest in scroll.</p> <pre><code>$("#&lt;%=txtProductName.ClientID %&gt;").autocomplete({ source: function (request, response) { $.ajax({ url: '&lt;%=ResolveUrl("~/Service.asmx/GetProductAutoComplete") %&gt;', data: "{ 'prefix': '" + request.term + "'}", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", success: function (data) { response($.map(data.d, function (item) { return { label: item.split('-')[0], ID: item.split('-')[1], rt: item.split('-')[2] }; })); }, error: function (response) { alert(response.responseText); }, failure: function (response) { alert(response.responseText); } }); }, select: function (e, i) { $("#&lt;%=txtQuantity.ClientID %&gt;").val('1'); $("#&lt;%=hdfProductID.ClientID %&gt;").val(i.item.ID); }, minLength: 0, autoFocus: true, scroll:true }); </code></pre>
jquery asp.net
[5, 9]
4,546,262
4,546,263
How to add two or more variables in jQuery ( mirror of .= operator in PHP)
<p>Sorry i am so new to jQuery and not sure how to do that. </p> <p>Basically in php i can do something like this:</p> <pre><code>$result = ''; $result .= 'Hi'; $result .= ' there'; echo $result; </code></pre> <p>I am just asking if there's an exact copy or alternative in jQuery. instead of adding variables with plus sign which works for me, but I want all variables to be added up to the large variable, just i do in php.</p> <p>Thanks very much. </p>
javascript jquery
[3, 5]
5,531,676
5,531,677
Problem with sending Array of ArrayList to WebService as Parameter
<p>I have a array of <code>ArrayList</code> as shown below:</p> <pre><code>ArrayList[] m; </code></pre> <p>My web service method takes this type as parameter.</p> <p>How can I send it to web service?</p> <p>When I do so the Web Service changes my array of <code>ArrayList</code> to <code>Object[][]</code>!</p>
c# asp.net
[0, 9]
1,120,726
1,120,727
Android Random Number
<p>I m generating one random card from array. and assigning it.' Below is the code..but its is showing an error. What is the problem?</p> <pre><code>public void rand() { String rank[]= {"tclub1.png", "tclub2.png", "tclub3.png", "tclub4.png", "tclub5.png", "tclub6.png", "tclub7.png", "tclub8.png", "tclub9.png", "tclub10.png","tclub11.png", "tclub12.png", "tclub13.png"}; Random randInt = new Random(); int b = randInt.nextInt((rank.length)); showcard1.setBackgroundResource(b); } </code></pre>
java android
[1, 4]
2,241,607
2,241,608
Clone form and increment ID
<p>Consider the following form:</p> <pre><code>&lt;form&gt; &lt;input type="button" value="Input Button"/&gt; &lt;input type="checkbox" /&gt; &lt;input type="file" id="file"/&gt; &lt;input type="hidden" id="hidden"/&gt; &lt;input type="image" id="image" /&gt; &lt;input type="password" id="password" /&gt; &lt;input type="radio" id="radio" /&gt; &lt;input type="reset" id="reset" /&gt; &lt;/form&gt; </code></pre> <p>Utilizing Javascript (and jQuery), what would be the easiest way to clone the entire form and increment each individual id within, to ensure uniqueness. </p> <p>Using jQuery I would assume you would clone the form initially via <code>clone()</code> and iterate through the cloned objects <code>id</code> and add the new id <code>fieldname1</code>, <code>fieldname2</code> etc. However, my knowledge of jQuery isn't too great and this project is almost killing me. </p> <p>Any help would be great!</p>
javascript jquery
[3, 5]
1,886,839
1,886,840
What's the best way for the user to add multiple details to single area of input?
<p>In my project the user has to detail his management expenses in four different areas. At first we had a simple table (<a href="http://85.94.221.106/table.html" rel="nofollow">this one</a>) where he had to write all the data grouping all the expenses description in a textarea, now we want him to detail each area, so i have to give the user the possibility to add "rows" to each area. That means that if his "Impegni" expenses consists of three entries he must enter three "rows".</p> <p>My idea is to use jquery to let the user add rows and modify the rowspan of the first column when the user adds/remove a row (that is, if you need to enter another row for "Impegni" i create a new row under the third row and add "colspan=2" to the "impegni" cell) but maybe there is a better way to handle this kind of input.</p> <p>I try to explain it even better: the four rows that are present in my table are the "master" areas and the user must add details to those areas. Creating new "sub-rows" for each area it's an idea, but maybe there is a better way to handle it!</p> <p>EDIT - another idea is to have four different tables (one for each one of the "master" rows) and show hide them with tabs (look at example five on <a href="http://dev.sencha.com/deploy/ext-4.0.0/examples/form/dynamic.html" rel="nofollow">this</a> page) but i don't know how to handle the sum of all the rows</p> <p>What do you suggest?</p>
php jquery
[2, 5]
1,851,760
1,851,761
Query regarding Switch Content Script
<p>First off, i'm a front end designer/developer with very very minimal javascript and PHP knowledge.</p> <p>I'm using the 'Switch Content Script' which I found on Dynamic Drive - <a href="http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm" rel="nofollow">http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm</a></p> <p>This is how i've incorporated it in to the site i'm developing for a friend <a href="http://www.davidatkinson.com/ss-testarea" rel="nofollow">http://www.davidatkinson.com/ss-testarea</a></p> <p>My question is, with that Switch Content Script, is it possible to modify it to have one of the content DIVS display automatically when visiting the site?</p> <p>In the source code you'll see that I managed a botch job (I know, I can see you cringing now) using jQuery toggle script. I've commented out the HTML as it was conflicting with the PHP contact form i'm using. When you click the send button, the page refreshes, and by doing so it was displaying panel I was loading by default. So for now, i've decided to pass on using the jQuery botch job, in the hope someone may be able to help me with modifying the Switch Content Script.</p> <p>I was thinking of just using the jQuery toggle script (as i've done <a href="http://jsfiddle.net/YpeeR/66/" rel="nofollow">here</a>) instead of the Switch Content Script, but I figure i'm going to come across the same stumbling blocks?</p> <p>If anyone can help, the whole site can be downloaded <a href="http://www.davidatkinson.com/ss-testarea/site.zip" rel="nofollow">here</a></p> <p>Thanks in advance :)</p>
javascript jquery
[3, 5]
1,571,369
1,571,370
How to set the calendar in android for particular hour
<p>I dont want to add the year or month.Just the hour , minutes and seconds for each day. How to use it the Calendar object to do it ? This is my code</p> <pre><code>// get a Calendar object with current time Calendar cal = Calendar.getInstance(); // add 5 minutes to the calendar object cal.add(Calendar.HOUR, 4); cal.add(Calendar.MINUTE, 40); Intent i = new Intent(this, Receiver.class); i.putExtra("alarm_message", "O'Doyle Rules!"); // In reality, you would want to have a static variable for the request code instead of 192837 PendingIntent sender = PendingIntent.getBroadcast(this, 192837, i, PendingIntent.FLAG_UPDATE_CURRENT); // Get the AlarmManager service AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender); </code></pre>
java android
[1, 4]
2,127,040
2,127,041
Mystery blank space in aspx panel
<p>I have a simple for loop that adds items in an array to a Panel control.</p> <p>Before the items are added to the panel I am outputting the information into a table via new Literal Control.</p> <p>Anyhow whenever I add this line</p> <pre><code>Panel1.Controls.Add(new LiteralControl("&lt;table border='1' cellspacing='10'&gt;")); </code></pre> <p>I end up with</p> <pre> -----------HUGE white space------------- x x x x x ------------------------Then my table follows below it. blah1 blah 2 blah3 blah 4 </pre> <p>As soon as I comment out the line above the white space goes away, but of course my table breaks as well.</p> <p>Any ideas?</p>
c# asp.net
[0, 9]
853,925
853,926
How to run background coding by selecting data shown in the listview
<p>I am trying to use list view for dynamic display of data from database. I want that on clicking that data a background coding should run by getting the ID of the selected data and then it should navigate to another page. </p>
c# asp.net
[0, 9]
5,816,150
5,816,151
How to conditionally load a jQuery plugin?
<p>I have an asp.net UserControl that can be added multiple times to a page. On this UserControl I am using a jQuery plugin that I would only like to load once. I am using the following piece of code to conditionally load jQuery itself:</p> <pre><code>if (typeof jQuery == 'undefined') { // load jquery var script = document.createElement('script'); script.type = "text/javascript"; script.src = "/_layouts/SprocketValidator/jQuery.js"; document.getElementsByTagName('head')[0].appendChild(script); } else { //already loaded } </code></pre> <p>Would there be an equivalent for checking if a jQuery plugin is undefined? The plugin I am using is the <a href="http://digitalbush.com/projects/masked-input-plugin/" rel="nofollow">digitalBush masked input plugin</a>.</p>
javascript jquery asp.net
[3, 5, 9]
3,750,807
3,750,808
Deletion on the ajax callback issue
<p>I have a dashboard in my website which contain some entries in table, each entry in the table have a <code>delete</code> button. When user click over the <code>delete</code> button a Ajax call happens and i am deleting that entry in the callback function. My code :</p> <pre><code>$(".del").live({ click: function () { $.post("/Home/DeleteTemplate", { name: $(this).parent().siblings("td:first").children("a").html() }, function (data) { $(this).parents("tr").remove(); //Inside the callback }); } }); </code></pre> <p>Now my problem is that if i was deleting the row in the callback fuction the row was not removed from the entries immediately. I have to close and open the dashbord again to see the result. </p> <p>But if i delete the entry outside of the callback function then it removed at the same time : </p> <pre><code>$(".del").live({ click: function () { $.post("/Home/DeleteTemplate", { name: $(this).parent().siblings("td:first").children("a").html() }); $(this).parents("tr").remove(); //Outside the callback } }); </code></pre> <p>Whats the problem here?</p>
javascript jquery
[3, 5]
3,184,415
3,184,416
gaming with c++ or c#?
<p>What is the best language for programming a game project and why?</p> <p>Why is the game programing world dominated by c++?</p>
c# c++
[0, 6]
1,880,829
1,880,830
jQuery autocomplete special character (Norwegian) problems
<p>I'm using jQuery's autocomplete function on my Norwegian site. When typing in the Norwegian characters æ, ø and å, the autocomplete function suggests words with the respective character, but not words starting with the respective character. It seems like I've to manage to character encode Norwegian characters in the middle of the words, but not characters starting with it.</p> <p>I'm using a PHP script with my own function for encoding Norwegian characters to UTF-8 and generating the autocomplete list.</p> <p>This is really frustrating!</p> <p>Code:</p> <p>PHP code:</p> <pre><code>$q = strtolower($_REQUEST["q"]); if (!$q) return; function rewrite($string){ $to = array('%E6','%F8','%E5','%F6','%EB','%E4','%C6','%D8','%C5','%C4','%D6','%CB', '%FC', '+', ' '); $from = array('æ', 'ø', 'å', 'ä', 'ö', 'ë', 'æ', 'ø', 'å', 'ä', 'ö', 'ë', '-', '-'); $string = str_replace($from, $to, $string); return $string; } </code></pre> <p><code>$items</code> is an array containg suggestion-words.</p> <pre><code>foreach ($items as $key=&gt;$value) { if (strpos(strtolower(rewrite($key)), $q) !== false) { echo utf8_encode($key)."\n"; } } </code></pre> <p>jQuery code:</p> <pre><code>$(document).ready(function(){ $("#autocomplete").autocomplete("/search_words.php", { position: 'after', selectFirst: false, minChars: 3, width: 240, cacheLength: 100, delay: 0 } ) } ); </code></pre>
php javascript jquery
[2, 3, 5]
2,616,301
2,616,302
sorting an array based on time in javascript
<p>I have an array in the format </p> <pre><code>["09-02-2010", " 05-08-2010", "11-11-2010", "27-09-2010", "10-12-2010", "09-09-2010", "03-09-2010", "13-08-2010", , "11-10-2010","09-06-2010", "08-06-2010", "07-06-2010" ] </code></pre> <p>I am trying to sort the array based on the decreasing order of dates.. </p> <pre><code> dateArray.sort( mdyOrdD); var dateRE = /^(\d{2})[\/\- ](\d{2})[\/\- ](\d{4})/; function mdyOrdD(a, b){ a = a.replace(dateRE,"$3$1$2"); b = b.replace(dateRE,"$3$1$2"); if (a&gt;b) return -1; if (a &lt;b) return 1; return 0; } </code></pre> <p>bt this didnt work our completely.. What could be wrong and is there any other good way to solve this??</p>
javascript jquery
[3, 5]
1,149,299
1,149,300
Data empty in jQuery.get() callback
<pre><code>$.get("http://localhost/test.php", (function(data){ alert(data); })) </code></pre> <p>The alert is empty. I'm new to this, and I can't see what I'm doing wrong. Help?</p>
javascript jquery
[3, 5]
1,710,722
1,710,723
jQuery: Executing multiple actions on the same event on the same element but at two different points in time
<p>We know that multiple calls to $(document).ready(); in the same page is possible. I need something similar for click events.</p> <p>Situation: Another team implemented this somewhere in an external JS file:</p> <pre><code>$('#element').live('click', function() { /* Do this */} ); </code></pre> <p>It's a live() click listener on #element. I cannot modify this code or that file, but I need to take an additional action on the same element on the same event. So, two actions will occur when #element is clicked. In other words, I need this equivalent:</p> <pre><code>$('#element').live('click', function() { /* Do this */} ); /* Some code later... */ $('#element').live('click', function() { /* Add another action */} ); </code></pre> <p>I tried doing the above, but the second call does not fire. It needs to be .live() since #element is being dynamically added.</p> <p>Is there any way to add more actions to the same event on #element? Thanks.</p>
javascript jquery
[3, 5]
2,716,404
2,716,405
The literal of type long is out of range
<p>Hi I am trying to do some calculations for a unit converter im creating and have stumbled upon a problem.</p> <pre><code>out10 = doubleInput / 94605284000000000000000L; </code></pre> <p>Eclipse says that "The literal of type long is out of range", I didn't even think this was possible, but maybe some f you know how to work around it ?</p>
java android
[1, 4]
3,032,845
3,032,846
jQuery: Use live event to add tabindex attributes
<p>Would like all new elements with class <code>.link</code> to have a tabindex.</p> <p>Delegate/Live does not seem to work:</p> <pre><code>$('body').delegate('.link', 'load', function(event){ $(this).attr('tabindex',0); }); </code></pre> <p>Trying to apply this to AJAX loaded elements. And using what I found in <a href="http://stackoverflow.com/a/4889538/183181">this answer</a>, which suggests the "load" event <em>may</em> be possible.</p> <p>I'd like to avoid using trigger, or modifying the AJAX callback.</p>
javascript jquery
[3, 5]
514,495
514,496
Uncaught ReferenceError when executing on different computer
<p>The below script works fine on one of my computers but when executing it on another I get <code>uncaught referenceerror $ is not defined</code>. It is the same error on another similar page. Also it says unable to load resource of the ajax.google... source.</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //add dynamic fields to add more addresses $(document).ready(function() { $('#btnAdd').click(function() { var $address = $('#address'); var num = $('.clonedAddress').length; var newNum = new Number(num + 1); var newElem = $address.clone().attr('id', 'address' + newNum).addClass('clonedAddress'); //set all div id's and the input id's newElem.children('div').each (function (i) { this.id = 'input' + (newNum*11 + i); }); newElem.find('input').each (function () { this.id = this.id + newNum; this.name = this.name + newNum; }); if (num &gt; 0) { $('.clonedAddress:last').after(newElem); } else { $address.after(newElem); } $('#btnDel').removeAttr('disabled'); if (newNum == 2) $('#btnAdd').attr('disabled', 'disabled');//number of field sets that can be added }); $('#btnDel').click(function() { $('.clonedAddress:last').remove(); $('#btnAdd').removeAttr('disabled'); if ($('.clonedAddress').length == 0) { $('#btnDel').attr('disabled', 'disabled'); } }); $('#btnDel').attr('disabled', 'disabled'); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,828,747
1,828,748
How to Json Parsing In asp .net
<pre><code>http://www.taxmann.com/TaxmannWhatsnewService/Services.aspx?service=gettopstoriestabnews </code></pre> <p>This is my web service I have to parse and store all value in <code>String</code> please help me how to parse. </p> <p>using asp.net (C#) so that I can store :</p> <pre><code>news_id as it variable news_title as title variable news_short_description as description news_date as date ; </code></pre> <p>Please help me I'm new in .net I tried but not able to do </p>
c# asp.net
[0, 9]
2,307,094
2,307,095
Android: How to Get 3G/UMTS Signal Strength Values
<p>I am a Cellular RF Engineer and have been trying to get some specific WCDMA/3G/UMTSsignal measurement values out of Android SDK environment. Using the public class <code>SignalStrength</code> I have been successful in getting meaningful GSM values (with the assistance of a Software Engineer) using <code>getGsmSignalStrength()</code>, but only yield "-1" values for <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> respectively which are supposed to return relevant CDMA signal strength values. -1 is definitely not right!</p> <p>My phone was definitely on a UMTS at the time and I can read UMTS parameters in the field test software (to get the field test software going was a hassle in itself).</p> <p>I think it is quite likely that <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> methods are for CDMA networks, not WCDMA (CDMA and WCDMA are different technologies) which leaves me high and dry in terms of trying to get 3G measurements out of the phone. Alternatively, there is some other methods out there but I simply can't find them in the reference material on the web:</p> <p><a href="http://developer.android.com/reference/android/telephony/SignalStrength.html">http://developer.android.com/reference/android/telephony/SignalStrength.html</a></p> <p>Can someone please assist me? There must be a way (after all, field test s/w can get this information) but how? Someone wrote an app called Cellumap which gets UMTS, GSM and CDMA measurement information.</p>
java android
[1, 4]
66,544
66,545
Is this a jquery.live() side effect?
<p>I'm new to jquery. When I was using .live('click', handler) instead of .click(handler), I found the event handler can be triggered even though the object is disabled! Is this a bug of .live() all it is an anticipated behavior? And if do not want the side effect, what should I do? Thanks!</p>
javascript jquery
[3, 5]
3,936,210
3,936,211
trigger Android application from Web Application
<p>Hello all my problem is : We have to create a system in which we need to create both web(ASP.NET C#) and android application and we have to synchronize data on both interface. So <strong>is there any method/Way to trigger Android application from Web Application(ASP.NET C#).</strong></p>
android asp.net
[4, 9]
4,422,054
4,422,055
Why 'this' can be used as the argument here in Java?
<pre><code>public class Activity01 extends Activity implements OnClickListener, ViewFactory { ... @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout main_view = new LinearLayout(this); m_Switcher = new ImageSwitcher(this); main_view.addView(m_Switcher); m_Switcher.setId(SWITCHER_ID); m_Switcher.setFactory(this); m_Switcher.setOnClickListener(this); setContentView(main_view); ... } public void onClick(View v) { ... } } </code></pre> <p>Above code is from an Android project, and below function's argument is set as 'this', why?</p> <pre><code>m_Switcher.setOnClickListener(this); </code></pre> <p>According to the javadoc, here should be like below:</p> <pre><code>public void setOnClickListener (View.OnClickListener l) </code></pre> <p>That means the argument should be this kind: <code>View.OnClickListener</code></p> <p>So why 'this' can be there? Thanks!</p> <p>Note: According to the answers, I gave a more complete code above.</p>
java android
[1, 4]
4,365,557
4,365,558
How to pass ID to a JavaScript function
<p>In HTML, I have:</p> <pre><code>&lt;td&gt; &lt;span id="change_naco"&gt;&lt;/span&gt; &lt;span id="naco"&gt;Food&lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;span id="change_naco"&gt;&lt;/span&gt; &lt;span id="naco"&gt;apples&lt;/span&gt; &lt;/td&gt; </code></pre> <p>The rows come from the MySQL query. I need to load them in the function:</p> <pre><code>&lt;script type="text/javascript"&gt; EditInPlace.defaults['save_url'] = 'php/save.php?id=150'; $('naco').editInPlace({ form_type: 'select', select_options: { '1': 'food', '2': 'apples', '3': 'oranges', '4': 'beer' }, external_control: 'change_naco' }); &lt;/script&gt; </code></pre> <p>I know that I must call my ID's differently, so I can do that by adding a number via PHP, for example, <code>change_naco1, change_naco2, change_naco3</code>, and <code>naco1, naco2, naco3</code>, but do I pass those ID names to the function?</p> <p>It's for edit in place (dropdown menu). It's working fine for one ID, but when I load more lines from the query, it works only for the first one.</p>
javascript jquery
[3, 5]
3,418,690
3,418,691
How to get machine account from which the user login to my application?
<p>How to get the user machine account from which he access the application in the case of <code>Form authentication</code> .</p> <p>I use the following method but it doesn't get the required data:</p> <pre><code>protected string[] TrackUser() { System.Web.HttpContext context = System.Web.HttpContext.Current; string IP = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; string compName = (Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName); string account = Request.ServerVariables["AUTH_USER"]; string[] user_network_data = new string[3]; if (!string.IsNullOrEmpty(IP)) { string[] addresses = IP.Split(','); if (addresses.Length != 0) { IP = addresses[0]; } } else { IP = context.Request.ServerVariables["REMOTE_ADDR"]; } user_network_data[0] = IP; user_network_data[1] = compName; user_network_data[2] = account; return user_network_data; } </code></pre>
c# asp.net
[0, 9]