Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,789,462
1,789,463
PHP ajax request return string
<p>Im getting an error 200 in my ajax request. Im wanting to post 1 value which is a email address to the page in my ajax request. Could someone tell me what is wrong</p> <p>Error:</p> <pre><code>message=:[object Object], text status=:parsererror, error thrown:=SyntaxError: JSON.parse: unexpected end of data </code></pre> <p>JQuery</p> <pre><code>$('#checkemail').click(function() { $.ajax({ url:'http://' + location.host + '/buyme/include/getemailaddress.php', type:'POST', contentType: "application/json; charset=utf-8", data: {email:$('#email').val()}, dataType:"json", success: function(msg) { alert(msg); }, error: function(ms, textStatus, errorThrown) { alert(errorThrown); } });/**/ }); </code></pre>
php jquery
[2, 5]
2,353,468
2,353,469
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]
1,267,762
1,267,763
Export a excel file from a location using jquery or javascript
<p>I am having an excel file on my c drive in a folder.Now i want to export/open it from jquery/javascript. Please help me out.</p>
javascript jquery
[3, 5]
2,675,843
2,675,844
Handling "other" option in dropdown select with free text input field
<p>I'm trying to figure out the best way to handle a dropdown list where one of the options "other" shows a hidden text field (via jQuery), where the user can then enter text. Should both the dropdown and the input field be given the same "name" attribute, then server side code runs a check on the values of each in order to know what one is the active value - e.g if the value of the select box is "other", then check the value of the text input field - if this isn't the default value ("enter text"), then it's ok to use this value and save it to the database. Is this a messy approach to this problem? </p> <p>EDIT: this is my client side code for show/hiding the "other" field.</p> <pre><code>$('.select_change').live("click change", function(){ //check if value is other $(this).parent().find(".hidden").toggle($(this).val() == 'other'); }); </code></pre>
php jquery
[2, 5]
1,556,967
1,556,968
jQuery slideToggle - callback function on slideUp action only
<p>Does anyone know a good way to fire a callback function on the slideUp event only during a slideToggle? The default callback function fires on both slideUp and slideDown.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,658,630
3,658,631
Print both in Android and pure Java
<p>How to print both to Log.e/d/etc. and to System.out/err/etc.? I have some code that I test on desktop and sometimes I use it on Android and I want to see logs there too.</p>
java android
[1, 4]
1,907,684
1,907,685
how to deploy the asp.net project on server
<p>i create one website. the excel file has name and mail id information. the mail id fetch by excel file when i give excel file name after send mail automatically to this mail id without design the subject, from,to ,cc,bcc,content. how to i create this project. now i export the excel file to ms-access.then i fetch name and mail id from ms-access database. then how to i send email automatically without designing and how to deploy the project on ftp.i don't know how to create please help me. regards, Padmapriya.S </p>
php asp.net
[2, 9]
3,737,924
3,737,925
how to acces the responseText in the jqxhr.complete function
<p>first of all i'm a complete javascript and jQuery noob so i'm sorry if this question is dumb. but i really haven't found the answer in the jQuery documentation or on google</p> <p>i'm trying to perform an action on the response when the request is completed but i can't access responseText. i was under the impression the an jqxhr objext has a member responseText. but i get the following error 'responseText is not defined'.</p> <pre><code>this.load = function(fileName, actionFunction){ var jqxhr = $.post(SERVER,{command : "load", filename : fileName}) .complete(function(){ actionFunction(responseText); }); } </code></pre> <p>EDIT</p> <p>if i do</p> <pre><code>.complete(function(responseText){ actionFunction(responseText);} </code></pre> <p>or what Dave Ward suggest</p> <p>i don't get an error but nothing happens</p> <p>i know it isn't the actionFunction() because if i input a string manually for testing purposes it does what i expect it to do.</p> <p>when trying to see what parameter gets past on (prinintg it to the console in actionfunction) i get [object Object]; even when trying to convert it to a string (String(parameter)) </p> <p>END EDIT</p> <p>what am i doing wrong or how do i access responseText in the .complete function ?</p> <p>tnx in advance</p>
javascript jquery
[3, 5]
5,995,871
5,995,872
how to change the value of a Div according to whats typed into a form input
<p>I know if I want to change the value of an input on a form according to what a user types into another input using:</p> <pre><code>$('#inputName').change(function() { $('#inputURL').val($('#inputName').val()); }); </code></pre> <p>But I'd like to have it so when someone types into the input it updates a Div with the text instead. IE they type into #inputName and this happens:</p> <pre><code>&lt;div id="personsName"&gt; text appears here as they type&lt;/div&gt; </code></pre> <p>How'd I go about doing that? I doesn't work when I change #inputURL into #personsName :(</p>
javascript jquery
[3, 5]
988,426
988,427
Adding a keydown event to a jQuery modal popup window with dynamic content
<p>I have created functions to create a Yes/No confirm window that popups with jQuery that I use in a .net project to confirm responses from the user. I have generated buttons that trigger functions depending on what you click on.</p> <p>//load a specailized popup for confirming things in a localized manner function popupConfirm(TitleKey, InstructionsKey, YesFunction, NoFunction) {</p> <pre><code>//create the service to give us the content var agpc = new AjaxServices.AjaxPopUps(); //get the results and open the popup with the functions aligned agpc.GetLocalizedStrings(new Array(TitleKey, InstructionsKey, "Yes", "No"), function (results) { var content = jQuery.parseJSON(results.toString()); //get the buttons for confirm/or not var YesNoButtons = jQuery('&lt;div&gt;&lt;/div&gt;', { id: 'YesNoButtons' }); var yesButton = jQuery('&lt;a&gt;' + content.Yes + '&lt;/a&gt;'); var noButton = jQuery('&lt;a&gt;' + content.No + '&lt;/a&gt;'); //add the event handlers yesButton.click(YesFunction); noButton.click(NoFunction); //set a nice pointer for mouse over yesButton.css({ cursor: 'pointer' }); noButton.css({ cursor: 'pointer' }); YesNoButtons.append(yesButton).append(noButton); //show the box openPopup("Non-JSON", YesNoButtons, eval('content.' + TitleKey), eval('content.' + InstructionsKey)); }); } </code></pre> <p>Well now comes the difficult part. The company also wants keypresses to trigger the yes/no functions. An enter key should trigger yes and escape should trigger no. I have no real idea how I will do this with this type of setup.</p> <p>You can ignore most of the code in there. It is to get localized strings from the server. It the adding the keydown() event that I can't figure out.</p> <p>Any ideas?</p>
jquery asp.net
[5, 9]
733,193
733,194
jQuery slide down toggle, impossible?
<p>I want to do a slide down with jQuery, but I can't find it anywhere. </p> <p>I do <strong>not</strong> want it to <a href="http://api.jquery.com/slideDown/" rel="nofollow">scale as it slides</a><br> I do want it to perform <a href="http://see.weareinto.com/3tyP" rel="nofollow">this action</a> ( click slide ), but vertically down, not horizontally right.</p> <p>UPDATE :</p> <p>So here's the final functional code!</p> <pre><code>$(this).toggle( "slide", { direction: 'up', duration: 'slow', easing: 'easeOutQuart' } ); </code></pre>
javascript jquery
[3, 5]
2,943,533
2,943,534
Android string extraction
<p>I have an abstract class which contains method for setting header text. It looks like:</p> <pre><code>TextView header = (TextView) findViewById(R.id.hTitle); header.setText(getString(this.getHeaderStringID())); </code></pre> <p>At this moment methods that override the abstract getHeaderStringID() return integers like 0x7f040001. 1 I wonder whether there's a way to utilize concatenation or somewhat similar to achieve this:</p> <pre><code>header.setText(getString(R.string.!getHeaderStringID!)); </code></pre> <p>In desired case getHeaderStringID would return string like "sAboutHeader"</p> <p>2 I'm new to Java - can I get rid of creating header object. If I don't do like that, eclipse validator says that the appropriate method isn't found and doesn't let me launch app. </p>
java android
[1, 4]
4,782,310
4,782,311
jQuery cannot get the file part from href attribute
<p>I am trying to get the href value of an anchor tag using jquery, instead of getting the absolute url, jquery returns just the url without the file part: This is what i mean:</p> <p>My Html/php</p> <pre><code>$url = "http://localhost/mysite/assets/data.txt"; &lt;a class='view-chart' href="&lt;?php echo $url?&gt;"&gt;View Chart&lt;/a&gt; </code></pre> <p>My jQuery Code:</p> <pre><code>var url = $('a.view-chart').attr('href'); alert(url); </code></pre> <p>I get this on the alert:</p> <pre><code>http://localhost/mysite/assets/ </code></pre> <p>but when I view source on the browser, I see</p> <pre><code>http://localhost/mysite/assets/data.txt </code></pre> <p>But if I do:</p> <pre><code>&lt;a class='view-chart' href="http://localhost/mysite/assets/data.txt"&gt;View Chart&lt;/a&gt; </code></pre> <p>I get the correct alert message i.e:</p> <pre><code>http://localhost/mysite/assets/data.txt </code></pre>
php jquery
[2, 5]
1,408,818
1,408,819
fadeout and fadein between two different pages in jquery
<p>Apologies if this may sounds simple, all im trying to do is fadeout the current page and fadein another page. However I'm having difficulties. I know how to do it between divs, the following fades out the leftcolumn div and inputs this in together with the myform on the stage3.php page. My question is how do i fadeout stage2.php and fadein stage3.php?</p> <pre><code>$("#leftcolumng").fadeOut(500, function(){ $("#leftcolumng").load('stage3.php #myform', function () { $(this).fadeIn(50); </code></pre> <p>});</p>
javascript jquery
[3, 5]
2,731,482
2,731,483
What is the equivalent to Java's string.getBytes() in C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7089640/equivalent-of-getbytes-in-java-to-c-sharp">Equivalent of getBytes() in Java to C#</a> </p> </blockquote> <p>In Java:</p> <pre><code>String s="abcde"; byte bar[] = s.getBytes(); </code></pre> <p>In C#:</p> <pre><code>for (int i = 0; i &lt; s.Length; i++) { bar[i] = Convert.ToByte(s.Substring(i, 1)); } </code></pre> <p>I worked Java example getBytes to convert C# code. But the above C# code does not work.</p>
c# java
[0, 1]
4,014,387
4,014,388
proper onclick format
<p>What is the proper way of doing this?</p> <pre><code>$chatterhtml .= '&lt;span style="float:right;" &gt; &lt;a href="javascript:void(0);" onClick="deletecmnt(this, "'.$val['id'].'", "'.BASE_URL.'");" title="Delete Chatter"&gt;x&lt;/a&gt; &lt;/span&gt;'; </code></pre> <p>I am receiving an error in Firefox <code>SyntaxError: syntax error deletecmnt(this,</code> but this worked up until I changed from a input text to text area. </p>
javascript jquery
[3, 5]
2,637,373
2,637,374
Removing a replacing character using jquery
<p>In a variable I have a string value Agriculture &amp; Development. I want to remove Whitespaces and character '&amp;' from the string Agriculture &amp; Development so that it looks like Agriculture_Development using jquery or javascript.</p>
javascript jquery
[3, 5]
3,116,052
3,116,053
Check if javascript file was loaded
<p>I am loading the following javascript files from a CDN. Is there any way I can check if these have been loaded correctly and if not, load them from a local folder?</p> <p><a href="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js</a> http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.min.js <a href="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js</a></p> <p>I know I can check the jquery file but not sure about the others. Any tips?</p>
javascript jquery
[3, 5]
384,251
384,252
how can I clean up this javascript jquery
<p>I have these two functions.</p> <p>The first is well written because someone who knows how to write js did it.</p> <p>The second I did.</p> <pre><code>var GetURLParameter = function($param){ var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&amp;'); for(var i = 0; i &lt; sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == $param) { return sParameterName[1]; } } } if(GetURLParameter('filter')!= "undefined"){ $('#'+GetURLParameter('filter')).parent().parent().children('li.active').removeClass('active') $('#'+GetURLParameter('filter')).parent().addClass('active'); } </code></pre> <p>I would like to simplify the calls as I'm repeating the line <code>GetURLParameter('filter')</code> but I don't know how I can make it work like the key word <code>this</code></p>
javascript jquery
[3, 5]
2,884,623
2,884,624
How to set a variable a users referal
<p>I am trying to create some stats and need to print a users referal site, or search keyword. How to get a Users referal site or search keyword with javascript and print it?</p>
javascript jquery
[3, 5]
5,833,869
5,833,870
Javascript - How to remove all extra spacing between words
<p>How can I remove all extra space between words in a string literal?</p> <pre><code>"some value" </code></pre> <p>Should become</p> <pre><code>"some value" </code></pre> <p>Also, </p> <pre><code>" This should become something else too . " </code></pre> <p>Becomes</p> <pre><code>"This should become something else too ." </code></pre> <p>Do not worry about moving the <code>.</code>. Just as above is fine. I know I can use <code>$.trim(str)</code> to achieve the trailing/ending space removal. But, I'm not sure how to do the 1 space between words trick.</p>
javascript jquery
[3, 5]
5,656,122
5,656,123
Prevent single word of being edited in a Textarea
<p>Hey guys What I want to achieve is the following;</p> <p>I have a textarea filled with text in our CMS. That text contains some special strings that are variable names. In the site these variables are replaced with something else (e.g "$!test;" will be replaced with "Hello this is a test").</p> <p>Now I want to prevent the users from editing these strings in the textarea, but making the whole textarea disabled or readonly ofcourse has no use.</p> <p>I was hoping that maybe there are some ways to do this, even if I need a WYSIWYG editor like TinyMCE or CKEditor.</p> <p>Thanks in advance guys</p> <p>Cheers! Maikel</p>
javascript jquery
[3, 5]
5,567,428
5,567,429
Indexing through Android string resources
<p>OK, I've got the code to allow me to index through the string resources. Now, how do I get the value of a specific resource item without knowing its name?</p> <p>Here's the index loop:</p> <pre><code>Field[] fLst = R.string.class.getFields(); for(Field f : fLst){ Log.i(dbgTag, "Field Entry: R.string." + f.getName()); } </code></pre> <p>Thanks for your efforts ...</p>
java android
[1, 4]
4,086,793
4,086,794
Android: Grouping of ListView
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1606320/android-custom-separator-or-even-item-in-listview-depening-on-content-of-item">Android: custom separator (or even item) in ListView depening on content of item</a> </p> </blockquote> <p>I am new to the android . I want to do the Grouping of listview in which the "titles" and "contents" of listview must be fetch from the database. I tried it with the help of BaseAdapter but it doesn't work. Can anybody help me? Thanks.</p>
java android
[1, 4]
5,447,882
5,447,883
How to find out what JavaScript code is slowing down my page
<p>Some code in my page is making my browser slow after 20-30 min. I need to know which one. What tools can i use to debug this out.</p> <p>Following js files are being loaded </p> <ol> <li>Jquery</li> <li>Jquery ui</li> <li>History</li> <li>Mustache </li> </ol> <p>Yes i <strong>had</strong> settimeout and thought that to be the culprit but alas after removing it too, it's still a bit slow. </p>
javascript jquery
[3, 5]
863,348
863,349
Can I run some custom script after ASP.NET client side page validation fails?
<p>I'm trying to run some client side script if, <em>and only if</em>, the client side Page validation fails, and can't figure out where I can hook it in.</p> <p>If i bind my JavaScript function to the OnClientClick of the button that submits the form, it runs before the client side validation. If I bind it to the OnSubmit of the form, that only fires if the validation passes.</p> <p>Any ideas of how or where I can hook something like this up? Or if you have other suggestions, I'm open to them.</p> <pre><code>&lt;form id="frm" runat="server" onsubmit="FUNCTION HERE WONT FIRE IF VALIDATION FAILS"&gt; &lt;asp:requiredfieldvalidator id="vld" runat="server" controltovalidate="txt"/&gt; &lt;asp:textbox id="txt" runat="server"&gt;&lt;/asp:textbox&gt; &lt;asp:button id="cmd" runat="server" OnClick="dosomething" OnClientClick="FUNCTION FIRES BEFORE VALIDATION OCCURS"&gt; &lt;/form&gt; </code></pre>
javascript asp.net
[3, 9]
4,211,292
4,211,293
How to get and then change this drop-down value to default?
<p>I have a drop-down list as,</p> <pre><code>&lt;select id='idleReason' onChange="loadXMLDoc(this.value)" size="1"&gt; &lt;option value="nothing" selected="selected"&gt;Select a site&lt;/option&gt; &lt;option value="Option 1"&gt;Option 1&lt;/option&gt; &lt;option value="Option 2"&gt;Option 2&lt;/option&gt; &lt;option value="Option 3"&gt;Option 3&lt;/option&gt; &lt;option value="Option 4"&gt;Option 4&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Now I want when <strong>loadXMLDoc()</strong> javascript function to be called on change, which will have some other events in it. But I am not able to perform one thing. I want that when the value is selected from the drop down, then the event go to <strong>loadXMLDoc()</strong> function, and reset the drop-down value to <strong>nothing</strong> (which is default value). </p> <p>Can someone please give me any idea to implement this in jQuery or Javascript? Thanks.</p>
javascript jquery
[3, 5]
1,845,746
1,845,747
Why is a click event not stopped by stopping mousedown/mouseup?
<p>Coulda sworn this wasn't how it used to work, but with jquery my click event is firing even if I return false on both mousedown and mouseup.</p>
javascript jquery
[3, 5]
3,225,559
3,225,560
Strip "http://" from pasted text into textbox
<p>I'm a total newbie when it comes to Javascript/jQuery so hopefully you can help me.</p> <p>I have a textbox where most people are gonna paste links into. Is there a nice way for the textbox to detect that a link has been pasted (starts with <code>http://</code>) and then remove the protocol dynamically in the textbox without having to push a button or so afterwards?</p>
javascript jquery
[3, 5]
5,568,766
5,568,767
Understanding "this" keyword
<p><a href="https://github.com/jquery/jquery/commit/6e066a4db72ff6b0d12dd8a43faec0a80e4a1fed#L0L31">In this commit</a> there is a change I cannot explain</p> <pre><code>deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); </code></pre> <p>becomes</p> <pre><code>deferred.done( arguments ).fail( arguments ); </code></pre> <p><a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/this#section_5">AFAIK</a>, when you invoke a function as a member of some object like <code>obj.func()</code>, inside the function <code>this</code> is bound to <code>obj</code>, so there would be no use invoking a function through <code>apply()</code> just to bound <code>this</code> to <code>obj</code>. Instead, according to the comments, this was required because of some preceding <code>$.Callbacks.add</code> implementation.</p> <p>My doubt is not about jQuery, but about the Javascript language itself: when you invoke a function like <code>obj.func()</code>, how can it be that inside <code>func()</code> the <code>this</code> keyword <strong>is not bound</strong> to <code>obj</code>?</p>
javascript jquery
[3, 5]
3,744,368
3,744,369
ASP.Net form submission that returns CSV
<p>I'm having trouble getting my ASP.Net page to return CSV on submit being clicked. Here's the asp button definition I have for the submit button in Form.aspx:</p> <pre><code>&lt;asp:Button id="submitreport" name="submitbutton" text="submit" OnClick="Report_Submit" runat="server" /&gt; </code></pre> <p>And this is the corresponding function in Form.aspx.cs:</p> <pre><code>public void Report_Submit(object sender, EventArgs e) { Debug.WriteLine("GETS HERE?"); Response.Charset = "UTF-8"; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetAllowResponseInBrowserHistory(true); Response.ContentType = "text/csv"; Response.AddHeader("Content-Disposition", "attachment; filename='" + DateTime.Today.ToString() + ".csv'"); Response.Write("test,output"); Response.End(); } </code></pre> <p>When this is ran in Visual Studio I don't even see the debug print line. Does anybody know what's wrong with my setup?</p> <p>Edit: I know for certain that the pages are set up right because if I put a breakpoint on my empty Page_Load function in Form.aspx.cs VS does break there. Besides that the breakpoint at the debug write line is skipped over on the form submit and the same page is returned again.</p> <p><strong>Update</strong> By creating a new project with just the button and the handler the Report_Submit() function is called and the CSV file is correctly generated. Since that narrows it down a little bit, does anybody know what could be going on in my other VS 2008 project that's causing this not to work?</p>
c# asp.net
[0, 9]
1,832,081
1,832,082
ASP.NET Generate a table from list with dynamic number of rows and columns
<p>I have a list of items which I want the user to be able to tick which are appropriate to them.</p> <p>Currently I have a <code>&lt;ul&gt;</code> generated by a <code>Repeater</code> with checkbox and label controls placed in side, all working fine.</p> <p>However, the <code>&lt;ul&gt;</code> is taking up too much space on the screen and I need to condense it. I think the best approach would be a table that expands based on the number of items, 9 resultining a 3x3 grid, 12 a 3x4 grid, 16 a 4x4 grid etc up to a maximum width of 6 rows.</p> <p>Any suggestions for where to start?</p>
c# asp.net
[0, 9]
5,719,409
5,719,410
Pageindex is not work properly
<p>i try in button control:</p> <pre><code>protected void btnImgBack_Click(object sender,EventArgs e) { try { gdvFile.DataSource = GetFiles(); gdvFile.DataBind(); gdvFile.PageIndex=1; } catch(Exception ex) { throw ex; } } </code></pre> <p>If <code>btnImgBack</code> is click i want to go back in page 1 of grid .But instead of going page 1 i am in same page.<code>PageIndex</code> is not work for this or i mistake some thing else?Thanks.</p>
c# asp.net
[0, 9]
5,165,165
5,165,166
how to stop video player after it has played a video in android
<p>I'm trying to play a video from a website in an android app. I got the video to play but there are two things I'm concerned about:</p> <ol> <li><p>When I rotate the phone while the video is playing, it reloads the video and starts from the beginning again.</p></li> <li><p>After the video has ended it seems like it is still doing something and I can't hit the back button and return to previous activity.</p></li> </ol> <p><strong>Java file:</strong></p> <pre><code>public class IntroVideo extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.intro_video); ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); try { String link = "http://northeastvision.org/vids/tube_rush.mp4"; final VideoView video = (VideoView) findViewById(R.id.videoDisplay); final ProgressDialog mProgressDialog = new ProgressDialog(this); mProgressDialog.setMessage("Loading video Please wait..."); mProgressDialog.setIndeterminate(true); mProgressDialog.setCancelable(false); mProgressDialog.show(); video.setMediaController(new MediaController(IntroVideo.this)); Uri uri = Uri.parse(link); video.setVideoURI(uri); video.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { video.start(); mProgressDialog.dismiss(); } }); } catch (Exception e) { Toast.makeText(this, "Error Connecting!", Toast.LENGTH_SHORT).show(); } } </code></pre> <p><strong>Layout</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" &gt; &lt;VideoView android:id="@+id/videoDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/RelativeLayout&gt; </code></pre>
java android
[1, 4]
583,684
583,685
find() not working
<p>I'm creating a bunch of <code>li</code> elements dynamically </p> <pre><code>$.each(data.attributes.listingImages, function (i, obj){ if(i == 1){ $('#js-carousel-menu').append('&lt;li media class="active"&gt;&lt;a media-frame&gt;&lt;img class="js-carousel-item" src=" '+obj.thumbnail+ ' " /&gt;&lt;/a&gt;&lt;/li&gt;' ); }else{ $('#js-carousel-menu').append('&lt;li media&gt;&lt;a media-frame&gt;&lt;img class="js-carousel-item" src=" '+obj.thumbnail+ ' " /&gt;&lt;/a&gt;&lt;/li&gt;' ); } </code></pre> <p>then when i try search for the 'active' <code>li</code> its not finding it</p> <pre><code>$gallery = $(this.el).find('#js-carousel-menu'); var _this = $gallery.find('li.active'); </code></pre> <p>however if i trace out <code>$gallery</code> it give me :</p> <pre><code>&lt;ul&gt; &lt;li media&gt;...&lt;/li&gt; &lt;li media class="active"&gt;...&lt;/li&gt; &lt;li media&gt;...&lt;/li&gt; ... &lt;li media&gt;...&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>am i missing something? thanks </p>
javascript jquery
[3, 5]
4,227,176
4,227,177
Jquery plugin hovercard not work in dynamically generated content
<p>Jquery plugin Hovercard works well in simple HTML code but does not work when i used it in javascript code (dynamically creating html code through javascript). Maybe this is also a general problem, how can jquery plugin work in js code generated content? </p>
javascript jquery
[3, 5]
4,806,406
4,806,407
Raw DOM element vs. jQuery object
<p>I'm looking at the following example of explicit iteration from <a href="http://jqfundamentals.com/chapter/jquery-basics" rel="nofollow">http://jqfundamentals.com/chapter/jquery-basics</a>:</p> <pre><code>$( 'li' ).each(function( index, elem ) { // this: the current, raw DOM element // index: the current element's index in the selection // elem: the current, raw DOM element (same as this) $( elem ).prepend( '&lt;b&gt;' + index + ': &lt;/b&gt;' ); }); </code></pre> <p>The comments refer to <code>elem</code> as a raw DOM element, but then the code calls <code>.prepend()</code> on <code>elem</code>. </p> <p>I'm just getting started with jQuery, but it's my understanding you can only call a jQuery method on a jQuery object - <em>not</em> on a raw DOM element. Am I misunderstanding?</p>
javascript jquery
[3, 5]
1,513,789
1,513,790
code a number into letters
<p>Lets say I have something like 97463</p> <p>I want to code it into letters say kljhs</p> <p>I'm using php/javascript at the moment, but I guess its a universal problem. </p> <p>Whats the most efficient way to do this in a way thats reversible? </p> <p>(reversible meaning given numbers I can make the letter code and then later given just the number code I can return the letters)</p>
php javascript
[2, 3]
2,893,171
2,893,172
epub file read and display in adnroid
<p>i weak in English sorry ,i want to build a epub reader application in android like fbreader, GMreader,pageturn etc. if any one known and tell me that how to start and which jar file and plugin is required, i know the about fbreader plugin, but i don't know that how it plugin using programming please tell me step by step. </p>
java android
[1, 4]
2,569,027
2,569,028
asd scroller - how to pause on hover JS/jQuery
<p>I have a simple scroller for ads ;] Need help whit pause it on hover.</p> <pre><code>$(document).ready(function(mnmTicker){ var mnmAdsInterval = 2000; /* Do not modify code below */ var mnmAdsLenght = m3ads_numberadverts; function mnmSlideAds(){ hT = $('.someClass').find('a'); hT2 = hT; slideMargin = document.getElementsByClassName('a')[0].offsetHeight; $(".someClass .a:first").clone().appendTo(".someClass"); $(".someClass .a:first").animate({"marginTop":-+slideMargin,},1800, function(){ $(this).remove(); }); }; var interval = setInterval(mnmSlideAds, mnmAdsInterval); [/code] </code></pre> <p>BTW. Im testing this:</p> <pre><code>$('.someClass .a').hover(function() { clearInterval(interval); }, function() { interval = setInterval(mnmSlideAds, mnmAdsInterval); }); </code></pre> <p>but do not work ;/</p>
javascript jquery
[3, 5]
2,734,626
2,734,627
How to trigger dropdownlist's SelectedIndexChanged event by clicking enter or left mouse down?
<p>I have a dropdownlist on a page like this;</p> <pre><code>&lt;asp:DropDownList ID="ddlCities" runat="server" AutoPostBack="true" ClientIDMode="Static" OnSelectedIndexChanged="ddlCities_SelectedIndexChanged"&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>This works great in normal conditions. But I have to change behaviour of dropdownlist due to client's actions.</p> <p>So I mean, when client focused dropdownlist and moved down to other list items, <code>SelectedIndexChanged</code> event is triggered. But I don't want this. I want, when user focused an element of dropdownlist, <code>SelectedIndexChanged</code> event <strong>will not be</strong> triggered, and pressing enter or left mouse down events will trigger <code>SelectedIndexChanged</code> event only.</p> <p>Is there any way to achieve this?</p>
c# asp.net
[0, 9]
4,019,393
4,019,394
How to set up Python server side with javascript client side
<p>So there is already a Python program set up that runs on the console that I must build upon. I will be building a web GUI interface for the application using Javascript. How would I:</p> <p>a. Go about handling the input/output of this Python program without touching the original code.</p> <p>b. Go about sending console-line inputs to the Python program via Javascript calls. I've looked into raw HTTP requests/AJAX, but I'm not sure how exactly I would go about sending that as input to the Python program.</p>
javascript python
[3, 7]
4,367,088
4,367,089
File.Exists - Wrong?
<p>i'm trying to see if the picture exists but this says that isnt there, and the path is correct! The path is correct, and it has a picture, but this allways go to "else".</p> <pre><code>string path = @"c:\folder\pic.jpg"; if (File.Exists(path)) { //Do something here } else { } </code></pre>
c# asp.net
[0, 9]
3,029,911
3,029,912
To insert Image in text file in asp.net using C#.net
<p>Is it possible to insert image in file in asp.net using c#.net. Please do the helpfull as soon as possible. </p>
c# asp.net
[0, 9]
5,261,789
5,261,790
Javascript in asp.net masterpage head content seems not working
<p>I'm using a ready made jquery date picker with ASP.NET text boxes. I'm also using MasterPage so here's what I've done so far -</p> <p><strong>Page linked to Master Page</strong></p> <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"&gt; &lt;link href="overcast/jquery-ui-1.8.15.custom.css" rel="Stylesheet" type="text/css" /&gt; &lt;script src="js/jquery-1.5.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/jquery-ui-1.8.14.custom.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $(function () { $("#txtBeginDate").datepicker(); $("#txtEndDate").datepicker(); }); &lt;/script&gt; &lt;/asp:Content&gt; </code></pre> <p><strong>Two text box controls</strong></p> <pre><code>&lt;asp:TextBox ID="txtBeginDate" runat="server" Placeholder="Select Begin Date"&gt;&lt;/asp:TextBox&gt; to &lt;asp:TextBox ID="txtEndDate" runat="server" Placeholder="Select End Date" /&gt; </code></pre> <p>But when I place cursor into these text boxes, the date picker doesn't show. </p> <p>Please advice.</p>
jquery asp.net
[5, 9]
3,632,144
3,632,145
Change form url query parameter with jquery on input change state
<p>Trying to create an "add to cart" button with quantity of items to add, i've added an <code>&lt;input id="product_quantity" value="1" onChange="updateQuantity()" /&gt;</code> to a main <code>form</code> so whenever i change a value inside that <code>input</code> it should update a form's action url withing a query parameter to corresponding value from <code>input</code> field.</p> <p>Here is the overview in HTML:</p> <pre><code>&lt;form action="index.php?option=com_virtuemart&amp;view=cart&amp;task=add&amp;virtuemart_product_id[]=1&amp;virtuemart_category_id[]=1&amp;quantity[]=1&amp;format=json"&gt; &lt;input type="product_quantity" value="1" onChange="updateQuantity();"/&gt; &lt;input type="submit" /&gt; &lt;/form&gt; </code></pre> <p>So how to change a form's action url parameter string <code>&amp;quantity[]=XXX</code> to a specific value which is typed in <code>input</code>'s field ?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,639,326
4,639,327
PHP's exit; in Javascript?
<p>What is the equivalent of PHP's exit; in Javascript/jQuery?</p> <p>I need to stop my script early depending on certain conditions... The only answers I could find from search was stopping forms from submitting...</p>
javascript jquery
[3, 5]
1,228,627
1,228,628
Removing images that a user has clicked on
<p>I am working on a memory matching game. I have some code that checks if two images that the user clicked on have the same source and removes the images if they do have the same source.</p> <pre><code>(function compareClicked() { var lastclicked = ""; $("img").click(function() { var path = $(this).attr("src"); if( lastclicked == path) { $('img').hide(1000, function () { $(this).remove(); }); } else { if( lastclicked != "") alert("Not a match"); } lastclicked = path; }); })(); </code></pre> <p>However, as you can see, when they have the same source, it removes all of the images on the page - even if the user did not click any them. How can I change it so it only removes the two images that the user clicked on?</p>
javascript jquery
[3, 5]
1,293,578
1,293,579
Make sure elements are equal height
<p>I have an issue with two adjacent div "columns". It is a common use case that one of them might be gargantually taller than the other one, and this can be a usability issue, since users drag'n'drop items from one div to the other.</p> <p>Using jQuery, I'd like to make sure that these two columns are always equal height. Not just on page load, but also if their inner content ever changes, or they're animated with jQuery or the page is resized or any other possible reason the height of taller div changes, the other one will follow.</p> <p>What would be the fastest processing way of achieving this? (I'd like minimal lag on redraws on window resizing)</p> <p>Thanks a lot in advance!</p>
javascript jquery
[3, 5]
3,706,308
3,706,309
Convert a javascript piece of code into php
<p>I just want to properly translate this</p> <pre><code>foo.push(("000" + parseInt(foo1.charAt(loc3), 16).toString(2)).slice(-4)); </code></pre> <p>into php.</p> <p>Anyone can help me?</p>
php javascript
[2, 3]
5,160,852
5,160,853
using javascript function to initialize php variable
<p>hi i want to initialize php variable in javascript function and than call the php function with php initialized variable. Please help me for solving this problem... </p> <pre><code> &lt;?php function printDiv($abc) { echo '&lt;div align="center" width="100%"&gt; ' . $abc . ' &lt;/div&gt;'; } ?&gt; &lt;script type="text/javascript"&gt; function callPhpFunction(jsabc) { &lt;?php $abc ?&gt; = jsabc; document.write("&lt;?php printDiv($abc) ?&gt;"); } &lt;/script&gt; </code></pre>
php javascript
[2, 3]
3,621,901
3,621,902
Return C++ char to C#
<p>I have a C++ project in which I have to return some variables from C++ to C#.</p> <p>These char variables are in the main program: </p> <p>char test1[MAX_Q_LEN], test2[MAX_Q_LEN], test3[MAX_Q_LEN];</p> <p>After I finish doing something with these variables in my C program, I have to return the values of these variables in a C# program.</p> <p><strong>ReturnChar.h</strong></p> <pre><code>extern "C" RETURNCHAR_API TCHAR* __cdecl testString(); </code></pre> <p><strong>ReturnChar.cpp</strong></p> <pre><code>extern "C" RETURNCHAR_API TCHAR* testString() { return ; } </code></pre> <p><strong>TestImport C#</strong></p> <pre><code>static class TestImport { [DllImport("MyDLL.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr testString(); } public partial class MainWindow : Window { public MainWindow() { try { InitializeComponent(); textBox1.Text = ReturnSomething() } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private static string ReturnSomething() { IntPtr t = TestImport.testString(); String result = Marshal.PtrToStringAuto(t); } </code></pre> <p>I tried with the above approach but I am not able to find out how to return the above char values. Also, this should not be an independent function because the values shoud be fetched only after executing the main which will give the right values in these variables.</p> <p>Any suggestions?</p>
c# c++
[0, 6]
5,448,169
5,448,170
Android Download Listner
<p>Is there any way to find out that the download is successfully or not. i am using following code to download files from other mobiles phones p2p, but some time other user is out of wifi range. the i wanted to know that the source is out of range so download is not possible at that time.</p> <p>is there any listener type thing that can help me ?</p> <pre><code>Uri uri=Uri.parse(downLoadLink); Environment .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) .mkdirs(); lastDownload = mgr.enqueue(new DownloadManager.Request(uri) .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE) .setAllowedOverRoaming(false) .setTitle(aryToReturn.get(position).name) .setDescription("File Downloding...") .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,aryToReturn.get(position).name)); </code></pre>
java android
[1, 4]
2,967,393
2,967,394
Need help to use this
<p>Can any one please make it simple or clear to me how the coder has used (this) here in the last line:</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Set up click listeners for all the buttons View continueButton = findViewById(R.id.continue_button); continueButton.setOnClickListener(this);&lt;----------------------------------- } </code></pre>
java android
[1, 4]
4,140,235
4,140,236
Jquery - Pseudo-recursive function with "this" element
<p>I'm trying to apply a cool animation effect on a list with Jquery using a pseudo-recursive function.</p> <p>It works pretty well for the first item, but after the first loop, the <code>this</code> which was selecting <code>#column-left section</code> becomes the <code>li</code> so of course, the function does not find the next <code>li:hidden</code> because it is already inside. Is there a way for me to come back to my original <code>this</code> once the "this" has changed or maybe do something different ?</p> <pre><code>$("#column-left section").mouseenter(function fadeItem(){ console.log(this); $(this).find('ul li:hidden:first').delay(500).fadeIn(fadeItem); }); </code></pre> <p>Thank you very much for your help.</p>
javascript jquery
[3, 5]
5,642,050
5,642,051
jQuery submit ajax form with 2 submit buttons
<p>im trying to achieve the following, in php i have a form like this:</p> <pre><code>&lt;form method="post" id="form_1" action="php.php"&gt; &lt;input type="submit" value="add" name="sub"/&gt; &lt;input type="submit" value="envoi" name="sub"/&gt; &lt;/form&gt; </code></pre> <p>the form action file is:</p> <pre><code>&lt;?php if( $_POST["sub"]=="add"){ ?&gt; &lt;script&gt; alert("") &lt;/script&gt; &lt;?php echo "ZZZZZZ"; ?&gt; &lt;?php } ?&gt; </code></pre> <p>so this means if i press sub with value add an alert prompt will come up, how can i do the same thing(differentiate both submit) but using a Ajax request:</p> <p>the following code so does not work:</p> <pre><code> $(function(){ $('form#form_1').submit(function(){ var _data= $(this).serialize() $.ajax({ type: 'POST', url: "php.php?", data:_data, success: function(html){ $('div#1').html(html) } }) }) }) &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="1" style="width: 100px;height: 100px;border: 1px solid red"&gt;&lt;/div&gt; &lt;form method="post" id="form_1" action="javascript:;"&gt; &lt;input type="submit" value="add" name="sub"/&gt; &lt;input type="submit" value="envoi" name="sub"/&gt; &lt;/form&gt; &lt;/body&gt; </code></pre>
php javascript jquery
[2, 3, 5]
1,198,545
1,198,546
Send array from jQuery(ajax) to PHP
<p>class <code>email</code> is an array of email addresses. How do i get the array in jQuery and then send the data with AJAX to send.php along with class <code>title</code> and <code>message</code>?</p> <pre><code> &lt;input type='text' size='30' class='email' value='[email protected]' /&gt; &lt;input type='text' size='30' class='email' value='[email protected]' /&gt; &lt;input type='text' size='30' class='email' value='[email protected]' /&gt; &lt;input type='text' size='30' class='title' value='testing title' /&gt; &lt;input type='text' size='30' class='message' value='testing message' /&gt; &lt;script type="text/javascript"&gt; $(function() { var title = $('.title').val(); var message = $('.message').val(); var dataString = 'title=' + title + '&amp;message=' + message; $.ajax({ type: "POST", url: "send.php", data: dataString, success:function () { } }); }); &lt;/script&gt; </code></pre> <p>send.php</p> <pre><code>&lt;?php $email = $_POST['email']; $title = $_POST['title']; $message = $_POST['message']; foreach($email as $value) { //send email } ?&gt; </code></pre>
php jquery
[2, 5]
4,269,605
4,269,606
What is the cost of finding a node in JQuery?
<p>I always save the result of the <code>find()</code> in order to avoid multiple sub tree traversal if I need the value several times:</p> <pre><code>var $a_bar = $('div.foo').find('a.bar'); $a_bar.removeClass(...); // ... code here $a_bar.bazz(); </code></pre> <p>instead of </p> <pre><code>$('div.foo').find('a.bar').removeClass(...); // ... code here $('div.foo').find('a.bar').bazz(); </code></pre> <p>I am wondering if it is not a micro-optimization... So what is the cost/complexity of finding a node in <code>JQuery</code>?</p>
javascript jquery
[3, 5]
5,617,110
5,617,111
Uncaught TypeError: Property '$' of object [object Window]
<p>I've been working on a site recently that is now coming up with jQuery errors! It has been behaving fine until recently when I have noticed these errors in chromes console. These seem to be coming up within the google hosted jQuery. I've tried using previous versions of jQuery as well but it keeps showing the errors.</p> <p>It's online at <a href="https://www.upsandgeneratorparts.com/auction/" rel="nofollow">https://www.upsandgeneratorparts.com/auction/</a></p> <p>the header file is <a href="http://pastebin.com/PiKigvhg" rel="nofollow">http://pastebin.com/PiKigvhg</a></p> <p>This is the error that is showing:</p> <pre><code>Uncaught TypeError: Property '$' of object [object Window] is not a function (anonymous function) e.extend.globalEval jquery-1.7.2.min.js:2 e.extend.globalEval jquery-1.7.2.min.js:2 f.fn.extend.domManip jquery-1.7.2.min.js:4 e.extend.each jquery-1.7.2.min.js:2 f.fn.extend.domManip jquery-1.7.2.min.js:4 f.fn.extend.append jquery-1.7.2.min.js:3 f.fn.extend.html jquery-1.7.2.min.js:4 e.extend.access jquery-1.7.2.min.js:2 f.fn.extend.html jquery-1.7.2.min.js:4 f.fn.extend.load.f.ajax.complete jquery-1.7.2.min.js:4 f.Callbacks.o jquery-1.7.2.min.js:2 f.Callbacks.p.fireWith jquery-1.7.2.min.js:2 w jquery-1.7.2.min.js:4 f.support.ajax.f.ajaxTransport.send.d jquery-1.7.2.min.js:4 </code></pre> <p>Is there a way of using noconflict to sort this or another handy function or am i just missing something out completely!</p> <p>Oliver</p>
javascript jquery
[3, 5]
745,530
745,531
How to format a dollar?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript">How can I format numbers as money in JavaScript?</a> </p> </blockquote> <p>I am doing a divide and multiply to figure out the value of a field and the value looks like this</p> <pre><code>$32560.000000000004.00 </code></pre> <p>I am setting the value like this</p> <pre><code>sq_footage = $("#sq_footage").val(); sq_footage_total = (((sq_footage / 36) * factor) * average )* 30; if(factor != ""){ $("#new_calc").val("$" + sq_footage_total + ".00"); } </code></pre> <p>Is there a way to format it like </p> <pre><code>$32,560.00 </code></pre>
javascript jquery
[3, 5]
3,475,457
3,475,458
Need help to call the java script from c#
<p>I need to format the value as currency like ($1,000), i am having the code with me but i need to know how to call the java script from c#</p> <p><strong>aspx.cs page</strong> (code page</p> <pre><code>x= 2345 textbox1.text = x.ToString();// i need the format currency here </code></pre> <p><strong>JavaScript</strong> </p> <pre><code>function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents&lt;10) cents = "0" + cents; for (var i = 0; i &lt; Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num + '.' + cents); } </code></pre> <p>Please help me how to call the format currency from c# file , I need to display the format value in text box.</p>
javascript asp.net
[3, 9]
5,931,124
5,931,125
Android Improve SQLite Performance Optimise
<p>I have an onCreate that currently opens an sqlite database and reads off 4 values. I then have a conditional and depending on what activity has sent it there it either displays those values or updates two values and then displays the other.</p> <p>Now if I run this activity without updating the database it is lightning fast. Whereas if I run two queries to write to the database it can be sluggish. Is there anything I am able to do to optimise this.</p> <p>The problem is the display stays on the previous activity until the sqlite updating has completed. This seems to be the problem.</p> <p>Sorry for what is most likely a rubbish explanation. Please feel free to ask me to better describe anything.</p> <p>Any help appreciated.</p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reason); //Opens DB connection type = b.getString("TYPE"); get(); if(type.equals("next")){ update();} db.close(); } public void get(){ Cursor b = db.rawQuery("SELECT * FROM " + DB_TABLE2 +" WHERE _id='1'" , null); b.moveToFirst(); id = b.getInt(b.getColumnIndex("nextq")); nextvalue = b.getInt(b.getColumnIndex(type)); if(nextvalue==0){nextvalue=1;} b.close(); nextvalue ++; } public void update(){ db.execSQL("UPDATE " + DB_TABLE2 + " SET nextq='" + nextvalue + "'" + " WHERE _id='1'"); db.execSQL("UPDATE " + DB_TABLE + " SET answered_correctly='" + anscorrect +"' , open ='1' WHERE _id='" + id + "'"); } </code></pre>
java android
[1, 4]
3,196,482
3,196,483
Interacting controls within a Grid
<p>I've been designing a website which has a grid on the page. The grid has multiple comboBoxes within it. These comboboxes interact. ie When one value is changed by the user another one has it's value change or is disabled/enabled etc.</p> <p>I find in order to do this I have to use FindControl a lot. Like in the selectedindexchanged event of one combobox I'll need to find another comboBox.</p> <p>This seems rather a messy way of doing things. It also seems like it leaves the system open to errors the compiler won't find say if a combobox has it's id changed later on down the line.</p> <p>Can someone tell me is there a better way of going about this?</p>
c# asp.net
[0, 9]
5,182,635
5,182,636
JQuery - work with divs
<p>I want to set another class for the clicked menu-part. Clicking generates url with #NAME. Here is my menu:</p> <pre><code> &lt;div id="head_menu"&gt; &lt;a href="#order"&gt;&lt;div name="order" id="menu_part"&gt;make order&lt;/div&gt;&lt;/a&gt; &lt;a href="#portfolio"&gt;&lt;div id="menu_part"&gt;portfolio&lt;/div&gt;&lt;/a&gt; &lt;a href="#contacts"&gt;&lt;div id="menu_part"&gt;contacts&lt;/div&gt;&lt;/a&gt; &lt;a href="#vacancies"&gt;&lt;div id="menu_part"&gt;vacancies&lt;/div&gt;&lt;/a&gt; &lt;a href="#about"&gt;&lt;div id="menu_part"&gt;about company&lt;/div&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I need to add class: 'menu_choosed' for clicked part. Here is my jquery-code:</p> <pre><code>$(document).ready( function() { currentPage = window.location.hash; $('#head_menu&gt;div').each( function() { if( currentPage == $(this).hash ) { $(this).addClass("menu_choosed"); } } ) } ) </code></pre> <p>I really don't know, how to filter values :( Help, please.</p>
javascript jquery
[3, 5]
192,820
192,821
ExecuteStoreQuery passing parameter to SQL statement
<p>Could someone help with passing a parameter object into my <code>ExecuteStoreQuery</code>. I'm executing this from my Entities db and then creating my procedure on the fly is this possible and is my SQL correct. I need to pass a <code>Id</code> parameter value into my SQL statement</p> <pre><code>var node = db.ExecuteStoreQuery&lt;Node&gt;(@" @Id int // not sure about this declaration for parameter with c as ( select Id, Name, ParentId,[0] as level from Department d union all select d.Id, d.Name, d.ParentId, [level] + 1 from Department d join c on d.ParentId = c.Id) select * from c where c.Id = @Id" "Departments", System.Data.Objects.MergeOption.NoTracking, new object{ Id: department.Id} // &lt;--parameter object not working); </code></pre>
c# asp.net
[0, 9]
4,846,393
4,846,394
Testing if URL and querystring is valid
<p>What is the best way to test if a url &amp; querystring is valid? For example, after a login redirect I want to make sure the target url is valid. If not, go to a default page.</p> <p>We seem to have a problem with the querystring, starting with "ReturnUrl=", being duplicated and that throws an exception. We'd rather have it go to a default page.</p>
c# asp.net
[0, 9]
2,421,755
2,421,756
Why does my app skip an if statement?
<p>I have a tictactoe app, with an array of 3x3 imageButtons, all of them pointing to a common <code>onClick()</code> method. This method gets the imageButton id and gets the array coordinates of the clicked button. I am making a special Tic tac toe, where once you have placed 3 pieces, you can't place any more, but you can move them to any other free spot. For that, I have two variables counting the remaining pieces for each "team". </p> <p>Then, on the <code>onClick()</code> method, I handle the moving or placing differently. Placing works ok, but for moving, I have 4 variables, that are a buffer of X and Y coordinates of the piece we are moving. I also have a boolean variable, holding if the spot from which we are moving the piece is already chosen. This is false from default. If it is false, it waits until you input the spot. Then comes the problem. I have an if statement asking if the boolean variable is false. It is false(as I can see on the debugger) but the programm appars to skip it. What could be the problem?</p>
java android
[1, 4]
809,041
809,042
detecting browser close all conditions
<p>This question has been asked many times before but none of the previous ones hit all the issues. I have a shopping cart that I store in session state. I'd like to detect when the user leaves the site so I can ask if they'd like to save their cart. I'd prefer not to automatically store the cart, I hate sites that I re-visit and there's all this leftover stuff in the cart that I'm no longer interested in.</p> <p>I've tried onbeforeunload but it fires when the user hits the back/previous buttons. Is there any way from within onbeforeunload I can determine the url where the browser will be going next? Then I can check if it is local and ignore it, otherwise if leaving the site for good a prompt can be displayed.</p> <p>Maybe I am not getting something? How do you handle this situation?</p>
javascript asp.net
[3, 9]
1,049,083
1,049,084
Double to String, how to delete 0 after dot
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/703396/how-to-nicely-format-floating-types-to-string">How to nicely format floating types to String?</a> </p> </blockquote> <p>I have number: </p> <pre><code>Double d1=(Double)0; Double d2=(Double)2.2; Double d3=(Double)4; </code></pre> <p>When I use to String, I get 0.0, 2.2, 4.0, but I want to see 0, 2.2, 4. How can I do it?</p>
java android
[1, 4]
2,291,675
2,291,676
How to send variable to php from javascript and return the result back to JS
<p>I have this code.</p> <pre><code>var book = document.getElementById('txtBook').value; switch(book.toUpperCase()) { case "GEN": var bk = "101"; break; case "EXO": var bk = "101"; break; case "LEV": var bk = "101"; break; case "DEU": var bk = "102"; break; ... and so on... } </code></pre> <p>I want to replace my <code>switch</code> with a database query. Since I learn from searching here that I can't do it straight from JS, I need to pass it to php Variable.</p> <p>I want to know how to pass my <code>var book</code> to a php page like for example getbook.php</p> <p>I will then make a query on php side. I want that result back to my JS for further processing.</p> <p>I prefer method with no page refresh required.</p> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
2,403,283
2,403,284
Prevent Refresh 'Jump' with Javascript
<p>I've noticed that if you are on a page and you have scrolled down a good bit, if you refresh the page, most browsers will jump you back down to your position. Is there any way to prevent this? </p> <p>I have looked at two options and neither are consistent across Webkit / Firefox.</p> <pre><code> window.scrollTo(0, 1); $('html, body').animate({ scrollTop: 0 }, 0); </code></pre> <p>Any ideas? </p> <p>You can check a google search result for an example.</p>
javascript jquery
[3, 5]
3,929,268
3,929,269
dynamically add a name anchor tag within dynamic content page
<p>I have a page that lists over 100 items and I need to dynamically add a name="" tags to the beginning of each new section of items that starts with the next alphabet.</p> <p>For example:</p> <pre><code>&lt;a name="a"&gt;&lt;/a&gt; &lt;h1&gt;Amazon River&lt;/h1&gt; &lt;h1&gt;Arrow Heads&lt;/h1&gt; &lt;a name="b"&gt;&lt;/a&gt; &lt;h1&gt;Bear Claws&lt;/h1&gt; &lt;h1&gt;Bee Traps&lt;/h1&gt; &lt;h1&gt;Dodge Ball&lt;/h1&gt; &lt;a name="f"&gt;&lt;/a&gt; &lt;h1&gt;Football Players&lt;/h1&gt; &lt;h1&gt;Fig Newtons&lt;/h1&gt; .... &lt;a name="y"&gt;&lt;/a&gt; &lt;h1&gt;Yorktown&lt;/h1&gt; &lt;h1&gt;Yikes&lt;/h1&gt; &lt;a name="z"&gt;&lt;/a&gt; &lt;h1&gt;Zebra&lt;/h1&gt; &lt;h1&gt;Zoo Mobile&lt;/h1&gt; </code></pre> <p>I am only familiar w/ php, somewhat familiar w/ javascript, not sure what one it would take to accomplish this.</p> <p>I will type out the "code" in theory, so you have an idea of what I want to accomplish</p> <pre><code>$letter = range(a-z); if($title == first_letter_character($letter)) { print '&lt;a name="'.$letter.'"&gt;&lt;/a&gt;'; $letter++; // goes to next letter in range } </code></pre> <p>Also, there may be some letters that may not have an item.</p> <p>Any help is appreciated.</p>
php javascript
[2, 3]
1,025,141
1,025,142
Can I send a string to a php file from my mobile Java app?
<p>I want to be able to send a parameter to a php page that contains a devices IMEI/MEID.</p> <p>I then want the php page to take that IMEI parameter and check a list of IMEI's to see if the IMEI sent as a parameter from my Java mobile app is contained in a database, if it is then return true.</p> <p>I only know the very basics of php but I believe this should be possible?</p> <p>If so can anyone point me in the right direction of what php functions I should be looking into?</p> <p>And also the best way to pass the parameter from java?</p>
java php
[1, 2]
4,989,940
4,989,941
fade in/out between two divs on a loop
<p>How would i go about make two divs fade in/out alternating between the two, so that only one is visible at a time? And also make it in a never ending loop?</p> <p>Thanks in advance!!</p> <p>I know it should be done with the .fadeOut and .fadeIn - but not sure how to make it loop over and over again.</p>
javascript jquery
[3, 5]
2,286,281
2,286,282
Find Html Inside a String Using Jquery
<p>I am not sure how practical this question is , but what i am trying to do is find html inside a string and then append pre tags to it using jquery. let say i have a variable with following string.</p> <pre><code>var string = "Some normal text &lt;html&gt;&lt;body&gt;&lt;div&gt; This is the html &lt;/div&gt; &lt;/body&gt;&lt;/html&gt;"; </code></pre> <p>Html inside the string is dynamic and can contain any tags , what i want is to find the starting and ending of html and append,prepend pre tags accordingly.</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,298,223
3,298,224
How to detect left click anywhere on the document using jQuery?
<p>I have this right now:</p> <pre><code>$(document).click(function(e) { alert('clicked'); }); </code></pre> <p>In Firefox, this event is firing when I left-click OR right-click. I only want it to fire when I left-click.</p> <p>Does attaching a click handler to the document work differently than attaching it to other elements? For other elements, it only seems to fire on left clicks.</p> <p>Is there a way to detect <em>only</em> left clicks besides looking at e.button, which is browser-dependent?</p> <p>Thanks</p>
javascript jquery
[3, 5]
750,218
750,219
Python script executing by PHP
<p>I've got a question. I'm gonna make few charts on my website, but I would like to have all the time fresh data.</p> <p>I've got a TXT file: <code>temperature.txt</code><br> It's getting information every 1 minute about temperature. Now, I would like to make a chart for example "Temperature in last hour". I would like to make HTML/PHP page to show me a chart.</p> <p><strong>What's my problem?</strong><br> I would like to use python script to:<br> Get last 60 lines from <code>temperature.txt</code> and save them as <code>Temperature1Hour.txt</code> in my <code>/htdocs/</code> folder.</p> <p>And I don't know how to write PHP script to execute my Python script. It's server-based only, client will click a button on site and everything will execute on server.</p> <p>Is it possible? If yes, How? Is there any php function to start python script?</p>
php python
[2, 7]
3,806,530
3,806,531
javascript within php
<p>I am trying to do the following in jquery</p> <pre><code>&lt;?php echo "&lt;script&gt;"; echo "$(document).ready(function(){"; echo "$('#mainbody-wrapper').removeClass('mainbody-wrapper')"; echo ";"; echo "$('#mainbody-wrapper').addClass('newStyle')"; echo ";"; echo "contentHeight=$('.content').css('height') + 20"; echo ";"; echo "alert(contentHeight)"; echo ";"; echo "$('#mainbody-wrapper').css('height',contentHeight)"; echo ";"; echo "$('#subcontent-wrapper').remove()"; echo ";"; echo "})"; echo "&lt;/script&gt;"; </code></pre> <p>?></p> <p>But the variable contentHeight output 300px20. I want to do javascript addition, but its getting concatenated. How can this be achieved?</p>
php jquery
[2, 5]
714,503
714,504
How long will take from an average C# developer to an average Java developer?
<p>I know the ideas and features between C# and Java programming language is very similar. So as a senior C# web developer(average) how long will it take to make it feel comfortable programming Java web applications? Will it just like from VB.net to C#? </p>
c# java
[0, 1]
5,435,933
5,435,934
Java: updated class files not used
<p>I'm developing a Java program through Eclipse locally, and debugging on a remote machine. Whenever I make a change to my program, I copy the corresponding class file to the bin directory on the remote machine. I run my program (a simulator) through a python script via the OS.system command.</p> <p>The problem is that my program <em>sometimes</em> does not use the updated class files after they have been moved over. </p> <p>The problem persists even if I log out and back into the remote machine. What's really strange is that, as a test, I deleted the bin directory entirely on the remote machine, and was still able to run my program. </p> <p>Can anyone explain this? </p>
java python
[1, 7]
3,982,593
3,982,594
good jquery content separators
<p>just wondering if anyone knows of any pre built content switchers powered by jquery like the one depicted below (only have a screenshot, otherwise I wouldn't be asking :P):</p> <p><img src="http://i.stack.imgur.com/bALm6.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
5,818,330
5,818,331
Code only executes once but should continue
<p>The code below should prevent the popup from closing if you mouseover it, or the button, however, it only works once on reload and then stops working. </p> <pre><code>$('.popover3-test').popover({ placement:'bottom', template: $('.popover2'), trigger: 'manual', }).mouseenter(function(e) { $(this).popover('show'); var t = null; $(".popover2, .popover3-test") .mouseleave(function() { t = setTimeout(function() { $('.popover2').hide(); }, 1000); // Or however many milliseconds }) .mouseenter(function() { if(t !== null) clearTimeout(t); }); }); </code></pre> <p>Demo: <a href="http://jsfiddle.net/MnpWV/1/" rel="nofollow">http://jsfiddle.net/MnpWV/1/</a></p>
javascript jquery
[3, 5]
1,972,749
1,972,750
C# advantages and disadvantages over C++
<p>I use C++ for more than 10 years(high school, university, and now at work). I had some time between projects and started to learn C#. I wanted to make simple things(in my opinion). </p> <ul> <li>to get a form window handle</li> <li>to call a function written in C++ and compiled as dll</li> <li>to populate a PropertyGrid at run time</li> <li>to use a form in another form(parent-child windows)</li> <li>to convert a byte array to a string</li> <li>to change build path</li> </ul> <p>and much more things that I think are usual things when somebody creates an application.</p> <p>With the help of stackoverflow members I managed to do almost all the things I wanted, but everything seems to be more complicated than in C++.</p> <p>There are many syntax/IDE flaws:</p> <ul> <li>It does not convert any int value to bool(check for null for example is weird)</li> <li>Use of "out" when calling a function, the function was already defined using "out" keyword</li> <li>The sources must be in same folder(or sub-folder) as the project</li> <li>obj folder in same folder as the project</li> <li>When I double click on a source file the IDE opens Design instead of code</li> </ul> <p>I don't want to put this language in a corner and forget about it. I want to know the good things about it. My first contact with C# let me the impression that I don't have freedom, that everything I must do requires more code that same thing in C++.</p> <p>Can you help we with good/bad things of C# in comparison with C++? Something simple like:</p> <blockquote> <p>C++ - converts int values to bool values -> check for NULL is simple</p> <p>C# - does not converts int values to bool -> check for null requires more code</p> </blockquote> <p>Thank you!</p>
c# c++
[0, 6]
431,932
431,933
Jquery click alert()
<p>Do you know why this method click doesn't show alert? Because I'm not able to catch this event.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; jQuery(function () { jQuery(".jtable-command-button.jtable-edit-command-button").click(function () { alert("asdas"); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;My First JavaScript&lt;/h1&gt; &lt;p id="demo"&gt;This is a paragraph.&lt;/p&gt; &lt;button class="jtable-command-button jtable-edit-command-button" title="Edytuj pozycję"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I give you for all of you points for help [closed] thanks</p>
javascript jquery
[3, 5]
641,415
641,416
How to access complex object in jquery
<p>The beans are defined as,</p> <pre><code>class A { String id; } class B { A a; String name; } </code></pre> <p>From the controller class, an object of B is returned, I can access name but not a.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#name").change(function(){ $.post('test.htm',{name: $("#name").val()},function(data){ alert(data.name); alert(data.a.id); }); }); }); &lt;/script&gt; </code></pre> <p>How can I access attributes of class A in the post function?</p>
java jquery
[1, 5]
5,013,676
5,013,677
How do I keep a div in the center of the page?
<p>I'm using jQuery to create a "dialog" that should pop up on top of the page and in the center of the page (vertically and horizontally). How should I go about making it stay in the center of the page (even when the user resizes or scrolls?)</p>
javascript jquery
[3, 5]
2,281,487
2,281,488
Variable from JavaScript to PHP
<p>Here is the code:</p> <pre><code> $('#sousmenu a').click (function (){ startSlideshow(&lt;?php echo json_encode(glob("photos-" .$_GET["folder"]. "/*.jpg"));?&gt;); return false; }); </code></pre> <p>The question is I like the HREF to change and get caught by PHP, now it doesn't do anything, but writing the <code>?folder=portraits</code> works.</p> <p><a href="http://www.studioteknik.com/html2/photo-portfolio.php" rel="nofollow">Here is the page</a>.</p> <p><em><strong></em> Simpler <em>*</em></strong> Maybe I am not clear, it happens sometimes!</p> <p>I want the link href to be send to this PHP function,</p> <pre><code>&lt;?php echo json_encode(glob("photos-" .(i what the href link). "/*.jpg"));?&gt; </code></pre> <p>so clicking on the link <code>animaux</code> will send <code>animaux</code> to the <code>glob()</code> PHP function and will get all the .jpg files in the <code>photos-animaux</code> folder.</p> <p>Clicking on the portraits will send the photo-portraits, etc.</p>
php javascript jquery
[2, 3, 5]
5,386,335
5,386,336
Is it realistic for an android newbie to successfully complete a project in 30 days and submit it to ADC2?
<p>Just for the disclaimer, I'm not trying to win the prize in Android Developer Challenge, but just want to participate.</p> <p>I heard about the Android buzz lately and got interested in it. And today I stumbled upon a site talking about Android Developer Challenge 2. Luckily, the submission hasn't ended but unfortunately it starts tomorrow, August 1. Since this is a new opportunity I want to give it a try but I think I'm a little bit late.</p> <p>I have configured the development platform and got some tutorials. I wanted to know if I could successfully develop a project within 30 days and submit it. Or is it really a big task which needs months of preparation. I just want to know if it is worth a try.</p> <p>And for the record I know nothing about Androids except that it is an open source platform for application development on mobiles. I know Java but not competent, so may be need to touch up on that too.</p> <p>It would be nice, if I get some real pointers on what I'm about to embark on. If it isn't possible I may need to pace down and enjoy other things in life too.</p> <p>So is is possible to complete a small and decent app within 30 days or is it already late and if so are there any suggestions?</p> <p>Thanks Chris</p>
java android
[1, 4]
4,069,482
4,069,483
How can I select an element with a certain exact text with jQuery
<p>I know :contains() could be used to select all elements that contain the specified text. but is there a way to find an <strong>exact</strong> match ?</p> <p>What I mean is using <code>jQuery(':contains(josh)')</code> will also apply to nodes with joshua or joshephin. Is there a way to find out a specific text?</p>
javascript jquery
[3, 5]
3,335,723
3,335,724
Access object child properties using a dot notation string
<p>I'm temporarily stuck with what appears to be a very simple JavaScript problem, but maybe I'm just missing the right search keywords!</p> <p>Say we have an object</p> <pre><code>var r = { a:1, b: {b1:11, b2: 99}}; </code></pre> <p>There are several ways to access the 99:</p> <pre><code>r.b.b2 r['b']['b2'] </code></pre> <p>What I want is to be able to define a string </p> <pre><code>var s = "b.b2"; </code></pre> <p>and then access the 99 using </p> <pre><code>r.s or r[s] //(which of course won't work) </code></pre> <p>One way is to write a function for it that splits the string on dot and maybe recursively/iteratively gets the property. But is there any simpler/more efficient way? Anything useful in any of the jQuery APIs here?</p>
javascript jquery
[3, 5]
905,017
905,018
How get user location using user IP Address?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1409108/how-to-get-visitor-location-country-state-and-city-using-asp-net">How to get visitor location ( country, state and city ) using ASP.NET</a> </p> </blockquote> <p>How get user location using user IP address using asp.net?</p>
c# asp.net
[0, 9]
5,898,361
5,898,362
keyboard - resizing viewgroup, overlaying viewgroups and custom editor view
<p>im writing a keyboard and there are a number of things i want to do:</p> <p>1) i want to be able to dyamically resize the the keyboard view. I have a custom view for my keyboard, created by my InputMethodService.onCreateInputView</p> <p>i've tried calling invalidate, requestLayout, forceLayout, on the keyboard view, on its parent and on the view root but nothing seems to call the onMeasure code again in my layout to allow it to resize.</p> <p>2) i would also like to have a view group that goes over the edit window and possibly over the rest of the screen. for example if the user preses a button i want to draw above thier finger (which could be over the editor window) what the are pressing or some additional information.</p> <p>3) i would like to be able to disable the editor window and do this my self, so for example i can change how this functions</p>
java android
[1, 4]
1,697,259
1,697,260
how to write this java code in c#
<p>I have this java code, that I want to translate to c#:</p> <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); ps.printf("\n\n+++++ %s %s\n",Environment.UserName, new SimpleDateFormat("MM/dd/yyyy HH:mm:ss aa").format(new Date())); </code></pre>
c# java
[0, 1]
2,006,315
2,006,316
Insert Data in database
<p>I am using jquery first time ,so please help me out . I search lot but not get the answer.</p> <p>Here The Code.I am using jquery Raty Plugin from this site : <a href="http://www.wbotelhos.com/raty/" rel="nofollow">http://www.wbotelhos.com/raty/</a> by Washington Botelho.All this work fine .Problem is that I want to store the value of score in database . but not getting how to store this value .Any suggession how I achieve this. Thanks In Advance.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $('#click').raty({ click: function(score) { //alert( 'score: ' + score); } }); }); &lt;/script&gt; &lt;label&gt;Deal Type:&lt;/label&gt; &lt;div id="click"&gt;&lt;/div&gt;&lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
4,007,758
4,007,759
Not able to access Data inside Javascript Array
<p>HI , </p> <pre><code> var jsonObj = [] ; for (var i = 0; i &lt; data.jobs.length; i++) { jsonObj.push({id: data.jobs[i].Dater, optionValue: data.jobs[i].INCPU}); } alert(jsonObj); </code></pre> <p>I am getting as result as </p> <pre><code>[object Object],[object Object],[object Object] </code></pre>
javascript jquery
[3, 5]
5,469,886
5,469,887
Simple JQuery Flip-Card animation customisation
<p>I have a working Jquery flip card animation. When you click the front panel, it flips to the back panel and vice versa. Now I added 3 links onto the front panel, and I want each link to flip to its own back panel and back, but I'm not getting it to work. My working example: NOTE: I attached the flipcard js file as a resource (jquery.quickflip.source.js)</p> <p><a href="http://jsfiddle.net/gGAW5/24/" rel="nofollow">http://jsfiddle.net/gGAW5/24/</a></p> <p>So basically when you click on Panel 1, it should only show Panel 1 Back, and when you click Panel 1 Back, it should go back to the front Panel, not the other back panels as it does now. So each link has its OWN back panel.</p> <p>Would appreciate any help.</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,080,027
1,080,028
Accessing value from the controls within a dynamically loaded web user control (asp.net c#)
<p>I have created a web user control (MemberDetails.ascx) which is loaded dynamically on a page (Member.aspx) for my website. The control has some TextBoxes. I want to store the values inputted by a user in these TextBoxes to a database on the click event of a button that is on the Member.aspx page (i.e. not a part of user control).</p> <p>I'll use a small code for example.</p> <p>Member.ascx page:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="MemberDetails.ascx.cs" Inherits="Users_MemberDetails" %&gt; &lt;div align="center"&gt; &lt;table runat="server" align="center" bordercolor="Black" id="tbl1"&gt; &lt;tr&gt; &lt;td&gt;First Name:&lt;/td&gt;&lt;td&gt;&lt;asp:TextBox ID="txtFname" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Last Name:&lt;/td&gt;&lt;td&gt;&lt;asp:TextBox ID="txtLname" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>Member.aspx.cs :</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Users_Booking : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { UserControl Memberuc; Memberuc = (UserControl)LoadControl("MemberDetails.ascx"); Memberuc.ID = "Memberuc1"; PlaceHolder1.Controls.Add(Memberuc); } protected void btnSave_Click(object sender, EventArgs e) { /*Code for saving the input to a database*/ } } </code></pre> <p>I have tried several methods (using properties and FindControl etc.) to do it using suggestions on various forums, but nothing worked for me. Please post the required code. Thanks.</p>
c# asp.net
[0, 9]
5,355,932
5,355,933
Pros and cons of using HTML5 vs frameworks for cross-platform mobile development
<p>I'm going to start developing an app for my job, and I would like to know what is the best approach. The app will be a basic tracker for some application that we have, and since our employers uses both Android and Apple phones I don't want to develop the app twice just so it could work on both platforms.</p> <p>Is it worth developing an HTML5 app that could work on all the devices or should I use some the frameworks like appcelerator? Are there strong pros and cons for either approach?</p>
android iphone
[4, 8]
1,383,695
1,383,696
how to set a default dropdownlist selecteditem
<p>I have a login page where user enters Username(textbox), Password(textbox), and location(dropdownlist) then login. </p> <p>On the server page, for the location dropdonwlist I have a connection string to access SQL server database to get all locations from location table and bound the data to the dropdownlist. </p> <p>For the dropdownlist.SelectedItem, What I want to do is that once user enters Username, onChange, the default location for the particular user should be the selected location before the user clicks Login. This default location is defined by locationID(FK) in the Login table which has loginId, username, password, and locationID as its columns. I want the process of retrieving locationID (accessing a DB table) to happen on the server side, then pass the locationID to the client side where I can call a function to select a default dropdownlist item according to the locationID. What's the way to accomplish this?? Thanks</p> <p>Programming Language C# Database SQL Server 2005</p>
c# javascript
[0, 3]
4,930,011
4,930,012
how to send json to php file to save on server
<p>Im developing a javascript/php/ajax application and have stumbled across some problems.</p> <p>Im confident at javascript and ajax but my php is a little rusty.</p> <p>My aim is to get a json file from the server, modify it using javascript, and then save this modified json back to the server.</p> <p>After some research it was obvious that the modified json file must be sent to a php file, this php file will then do the saving.</p> <p>HOW do i send a json string from javascript to php? OR how do I get the php file to pick up the json variable from the javascript?</p> <p>im assuming the php will be something like:</p> <pre><code>&lt;?php $json = $_POST["something"]; ?&gt; </code></pre> <p>but how do i send or "post" the javascript variable to the php file?</p> <p>I was thinking about creating a hidden html form, setting a hidden textbox to the json string, then posting the html form</p> <p>But surely there must be a way without including the html middle man?</p> <p>Im looking for answer WITHOUT jQuery. Seeing as this is an application i would like a relieve the dependancy of jQuery. </p>
php javascript
[2, 3]