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,549,135
1,549,136
About select option value
<p>Hmm...this question may sounds silly , hope you all don't mind...</p> <p>If I have a drop list:</p> <pre><code> &lt;select name="myoption" onchange="document.textbox.value=this.value"&gt; &lt;option value="1"&gt;A&lt;/option&gt; &lt;option value="2"&gt;B&lt;/option&gt; &lt;option value="3"&gt;C&lt;/option&gt; &lt;/select&gt; &lt;input type="text" name="textbox" id="textbox"&gt; </code></pre> <p>So with this now the textbox will display what is selected , but is it possible to display the A,B,C instead of 1,2,3? </p> <p>Actually I need a drop-list which will display 2 different values to 2 textbox,such as if A is selected,textbox1 will display "A" and textbox2 will display "1".</p> <p>I don't know if it is possible and I tried for some times already...can someone give me some hints?</p> <p>Thanks in advance.</p>
php javascript
[2, 3]
4,425,337
4,425,338
how to call function from another page in java?
<p>i have defined all my java files in packages... i have one function which i have defined on some page and i just want to use it on another page... how would i do that...</p>
java android
[1, 4]
2,900,446
2,900,447
How to make a slideup selectable box for user to pick a defined theme color with Jquery?
<p>I would like to find out how to make a selectable theme image, such that when you on hover the image it will scroll up a selectable/clickable defined theme color.</p> <p>It will be something like that on default: </p> <p><img src="http://i.stack.imgur.com/LdHtv.png" alt="Image on default"></p> <p>After you hover your mouse, it will scroll to top and overlaps the default image, with clickable color themes, which means each of the color tabs are clickable:</p> <p><img src="http://i.stack.imgur.com/8eoZC.png" alt="Image when hover, with selectable themes"></p> <p>I will like to know what to go about creating something like that, and how is it possible to pass the selected value to the database/wherever.</p> <p>Kindly advise. Thanks.</p> <p><strong>edit:</strong> I have put up the codes on jsfiddle - <a href="http://jsfiddle.net/GgfNq/1/" rel="nofollow">http://jsfiddle.net/GgfNq/1/</a> but it works with Chrome, but not ff. </p> <p>Is there any way to convert it into jQuery and also how to proceed with the second part where the color boxes can show up the 7 selectable boxes, and clicking it to return a result or which color template to deploy. </p> <p>Note also that the color tones as shown on hover are already pre-set tones for the templates, I do not wish to allow users to pick colors based on from color palette. Upon clicking on the pre-defined color tones e.g. black|white, the template will update the black and white color tones. (users do not select colors aside from the pre-defined)</p>
javascript jquery
[3, 5]
4,097,844
4,097,845
url referral difference between internet explorer and google chrome browser
<p>when i am referring a page using response.redirect in my web page, it is working with Internet Explorer. However, the same is not working when I browse my website using Google Chrome. Even when I am trying to print the values using response.write it is not working in Google Chrome. (I am using asp.net with c#)</p>
c# asp.net
[0, 9]
1,217,112
1,217,113
Set image of a button to apps icon
<p>I have a button in my app that launches another app (the user can choose which one with a longClick like this)</p> <pre><code>btnNavigation.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { // Pick an application Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY); pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent); startActivityForResult(pickIntent, 1); return false; } }); </code></pre> <p>with the onActivityResult i get back an intent</p> <p>Now i'd like to set the image of btnNavigation to the icon of the app the user has chosen</p> <p>How can i get the icon from the package the user chose?</p>
java android
[1, 4]
3,156,011
3,156,012
Date Validation not working using JavaScript
<p>I have two two date fields - from date and to date, and i need to validate 3 things</p> <ul> <li>Both the values are entered or not</li> <li>Date datatype check </li> <li>To date must be greater than from date.</li> </ul> <p>But my script is not working.</p> <p>can some body please check?</p> <p>Thanks</p> <pre><code> function checkBothDates(sender,args) { var from = document.getElementById(sender.From); var to = document.getElementById(sender.To); var behaviorId = sender.behavior; var from_value = from.value; var to_value = to.value; if((from_value == "")&amp;&amp;(to_value == "")) { args.IsValid = true; } else { if((from_value != "")&amp;&amp;(to_value != "")) { if((isValidDate(from_value))&amp;&amp;(isValidDate(to_value))) { if(from_value &lt; to_value) { args.IsValid = false; sender.errormessage = "To date must be greater than or equal to the from date"; } } else { args.IsValid = false; sender.errormessage = "Please enter valid dates in both the fields"; if(behaviorId != null) { openCollapsiblePanel(behaviorId); } } } else { args.IsValid = false; sender.errormessage = "Please make sure you enter both the values"; if(behaviorId != null) { openCollapsiblePanel(behaviorId); } } } } function isValidDate(val) { var format = 'dd/MM/yyyy' var regexp = /^\d{1,2}\/\d{1,2}\/\d{4}$/; if (!regexp.test(val)) { return false; } else { try { $.datepicker.parseDate(format,val,null); return true; } catch(Error) { return false; } } } </code></pre>
javascript jquery
[3, 5]
487,104
487,105
jquery <-> php logic on which side
<p>I have a question about where to put the logic between jquery and php. I´m writing a small website where users can input different values. Those values are added together and multiplied with an value saved in a mysql database and outputed again to the user.</p> <p>My question is whats the better way for doing this.</p> <blockquote> <p>A: Let Jquery serialize the form and send all values to php. Php catches the Post vars and the value from the database, calculates everything, writes the sum to the database and gives everything back to the user.</p> <p>B: When the User starts the Script the value of the Database is send from PHP to the User Form. Now Jquery does all calculations. When everything is ready, the Sum is send back to PHP and written in the Database.</p> </blockquote> <p>The reason why I´m asking is A: seems to be safer with the validation of given values. But B: is more frindly to the server. (Jquery ajax is fired on Keyup, means the value would be queried from the database everytime the user edits the form.)</p> <p>regards,</p> <p>toni</p>
php jquery
[2, 5]
5,109,690
5,109,691
How do I make the website execute links?
<p>I'm making a small webpage that is going to execute links, en specifics magnet links. But the webserveruserrole does not carry enough mojo (rights, <code>Process.Start()</code>) to make that happen.</p> <p>I've tried to look for this user role but could not find it.</p> <p>How do I make the webserver execute/start <code>magnet:?xt</code> links?</p>
c# asp.net
[0, 9]
2,510,256
2,510,257
Organizing Javascript with callbacks
<p>I am trying to figure out the best way to organize a bunch of AJAX methods on my site. The problem is that I want to run a bunch of callbacks after each one is received. Here's an example (assume each method runs asynchronously):</p> <pre><code>Log_in_user if response received and call was successful get_user's_data if response received and call was successful alert user </code></pre> <p>Hopefully by now the problem is clear. Because each method runs asynchronously, the code will not run in order. If instead, I want to pass the next function to run as a callback to run after the function that proceeds it, I will have to pass an increasingly large number of callbacks to the first function depending on how many things I want to happen after each asynchronous method returns. For example, in this case, I will have to pass two callbacks to the Log_in_user function Log_in_user(get_user's_data,alert_user). The more callbacks I have running after each other, the more callbacks I will have to pass to the original Log_in_user function.</p> <p>Is there a more modular and better organized way to do this?</p>
javascript jquery
[3, 5]
1,591,319
1,591,320
How can delete Click event?
<p>How can I completely delete the $(selector).click() event?</p> <p>I created option buttons and I would like to stop the click event so that the user won't be able to change the option already selected.</p> <p>How to complete the overriding of the click (or any other) event on jquery?</p>
javascript jquery
[3, 5]
1,070,164
1,070,165
add jquery click event to asp:button prevents button from entering code behind event?
<p>I must be loosing it, but i'm not sure what :-)</p> <p>i have a standard asp:button control with a code behind click event.</p> <p>then, to prevent double click i disable the button on client click:</p> <pre><code>$('#&lt;%=BTN_GCR_CheckCardValue2.ClientID %&gt;').bind('click', function () { $('#&lt;%=BTN_GCR_CheckCardValue2.ClientID %&gt;').attr('disabled', 'disabled'); }); </code></pre> <p>the disabled works, and the page posts back (enters the load event of the page), but doesn't enter the code behind event.</p> <p>this jquery code is with the <code>bind</code> method, also tried it with <code>click</code>, same result.</p> <p>what am i overlooking?</p> <p>EDIT the button</p> <pre><code>&lt;asp:Button ID="BTN_GCR_CheckCardValue2" runat="server" CssClass="individual_small_inputs" OnClick="BTN_GCR_CheckCardValue2_Click" Text="CHECK" /&gt; </code></pre> <p>which leads to</p> <pre><code>&lt;input type="submit" name="ctl00$ctl00$CPHMainSection$CPH_LeftSection$BTN_GCR_CheckCardValue2" value="CHECK" id="ctl00_ctl00_CPHMainSection_CPH_LeftSection_BTN_GCR_CheckCardValue2" class="individual_small_inputs" /&gt; </code></pre>
jquery asp.net
[5, 9]
5,003,242
5,003,243
Calling Pagemethod
<p>Hi i have the following pagemethod, however it dues not seem to be working, i tried debugging it and it does not hit the method. Here is what my method looks like;</p> <pre><code>function InsertStatus() { var fStatus = document.getElementById('&lt;%=txtStatus.ClientID %&gt;').value; PageMethods.InsertStatusUpdate(fStatus, onSucess, onError); function onSucess(result) { alert(result); } function onError(result) { alert('Cannot process your request at the moment, please try later.'); } } </code></pre> <p>And my codebehind;</p> <pre><code> [WebMethod] public static string InsertStatusUpdate(string fStatus) { string Result = ""; int intUserID = -1; if (String.IsNullOrEmpty(HttpContext.Current.User.Identity.Name)) HttpContext.Current.Response.Redirect("/login"); else intUserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); if (string.IsNullOrEmpty(fStatus)) return Result = "Please enter a status"; else { //send data back to database return Result = "Done"; } } </code></pre> <p>When i click my button it goes straight through the onError Method. Can anyone see what i am doing wrong? I found the problem i needed a [System.Web.Script.Services.ScriptService] above the method, due to the fact it is being called by a script. Thanks for all the suggestions.</p>
c# jquery asp.net
[0, 5, 9]
1,371,724
1,371,725
How to wrap similar classes from different packages
<p>I develop an app for android which uses standard <em>android.database.sqlite.SQLiteDatabase</em> as well as <em>net.sqlcipher.database.SQLiteDatabase</em>.</p> <p>These classes are very similar but I have to duplicate some pieces of code just to handle these different types, even if I need to call the same methods.</p> <p>Can anybody advice what would be the best way to create some wrapper around these classes to have single interface for interaction with both types.</p>
java android
[1, 4]
2,466,470
2,466,471
On clicking the anchor tag the outermost div must hide along with its child elements
<p>I have a div tag, which contains a div tag, which contains a ul tag which then contains many li tags. On of these li tags contains an anchor element, which when clicked causes the outermost div to hide.</p> <p>for example</p> <pre><code>&lt;div class="object" id="123"&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" id="hide"&gt;hide outermost div and its child elements&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="object" id="124"&gt; &lt;div&gt; &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" id="hide"&gt;hide outermost div and its child elements&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>on clicking the anchor tag the outermost div must hide along with its child elements.</p> <p>I reckon i need to use parentNode repeatedly.. but is there a simpler way to directly access the outer most div and hence its id. Help would be appreciated. </p>
javascript jquery
[3, 5]
2,759,807
2,759,808
Why is the FileContent zero bytes on all Attachment objects except the first one?
<p>I have one form through which ,Sender text his email-id and password and selects attachment </p> <p>using fileupload,recipients's email id i am getting from database table,email is reaching to recipients fine..but </p> <p>problem is that when i attach a attachment ,attachment's size goes 0 except 1st email-id </p> <p>,which i am getting from table....i have pasted code.. </p> <pre><code>foreach (string email_to in list_emails) { MailMessage mail = new MailMessage(); mail.To.Add(email_to); mail.Subject = "UPDATES FROM ATTENDANCE S/W"; mail.From = new MailAddress(txtFrom.Text.ToString()); mail.Body = txtMessage.Text; if (FileUpload1.HasFile) { string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); Attachment myAttachment = new Attachment(FileUpload1.FileContent, fileName); mail.Attachments.Add(myAttachment); } SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential(txtFrom.Text.ToString(), txtPasswd.Text.ToString()); smtp.EnableSsl = true; smtp.Send(mail); } </code></pre>
c# asp.net
[0, 9]
2,812,125
2,812,126
jQuery Lightbox/Modal Windows for a Pop-Up Web Screen
<p>Within my web application, I was thinking of creating a pop-up screen of a page for a user to do some processing in.</p> <p>I basically want this page to be like a drill-down window of displaying detailed reords based on a button you press from a top-level summary record.</p> <p>Instead of a pop-up, I was thinking of a jQuery lightbox feature / modal window.</p> <p>I'm open for suggestions and good easy examples of lightboxes for displaying web screen and not a photo, pretty much a pop-up window, but with a jQuery look and feel, i.e something that zooms in to the user and then zooms back out to the summary record.</p> <p>Hope someone can assist with examples/urls etc.</p> <p>Thanks. Tony.</p>
javascript jquery
[3, 5]
2,043,711
2,043,712
AJAX Control Toolkit Control Editor Javascript Access
<p>In my aspx, I have the following snippet of code, which correctly renders the Editor Control from the AjaxToolkit</p> <pre><code>&lt;div&gt; &lt;ajaxToolkit:Editor ID="Editor" runat = "server" /&gt; &lt;/div&gt; </code></pre> <p>In C#, to access the content of the Editor is simply:</p> <pre><code>Editor.Content = "some text here" </code></pre> <p>However in JavaScript, I am unsure how to access this. So far, I have tried:</p> <pre><code>var st =$find('&lt;%=Editor.ClientID%&gt;').get_content(); </code></pre> <p>However the $find statement is returning a null value. </p>
javascript jquery asp.net
[3, 5, 9]
5,976,068
5,976,069
how to null a variable of type float
<p>My code is working if my float variable is set to 0, but I want my code to work if my variable is null. How could I do that? Here is a code snippet I wrote:</p> <pre><code>float oikonomia= (float)((float)new Float(vprosvasis7.getText().toString())); if(oikonomia==0){ </code></pre> <p>I have tied <code>if(oikonomia==null)</code> or <code>if(oikonomia=null)</code> but it is not working.</p> <p>P.S.: Another way would be to initially set <code>oikonomia=0;</code> and, if the users change it, go to my if session. This is not working either.</p> <p>Float oikonomia = Float.valueOf(vprosvasis7.getText().toString());</p> <pre><code> if(oikonomia.toString() == " "){ float oikonomia= (float)((float)new Float(vprosvasis7.getText().toString())); oikonomia=0; if(oikonomia==0){ </code></pre> <p>that way is not working too:</p> <pre><code>Float oikonomia = Float.valueOf(vprosvasis7.getText().toString()); if(oikonomia.toString() == " "){ </code></pre>
java android
[1, 4]
2,383,920
2,383,921
assign columns value on rowdatabound in gridview
<p>I am facing a problem in grid view, basically what i am trying to achieve is below: I have a grid view in which my first column is a link button, i have to put a condition where value from my 2nd column is taken and is input to a c# method for poulating a value which i need to assign into my first column.</p> <p>I am trying below code however when i view my grid its showing 1st columns value as blank. Aspx page:</p> <pre><code>&lt;asp:TemplateField HeaderText="FileName" ItemStyle-HorizontalAlign="Center"&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID="btn" runat="server" CommandName="Click"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>aspx.cs</p> <pre><code>if (e.Row.RowType == DataControlRowType.DataRow) { int EmpiD = Int32.Parse(e.Row.Cells[2].Text); DataSet EmpIDDs = GetEMP.getValue(EmpiD); DataRow EmpRow = EmpIDDs.Tables[0].Rows[0]; e.Row.Cells[0].Text = EmpRow[3].ToString(); } </code></pre> <p>Please help me if you have any solution</p>
c# asp.net
[0, 9]
4,704,537
4,704,538
how to add a javascript alert with a PHP script?
<p>let's say i have an input form, wherein, it's use for an email address. this form is part of a long form so i use an alert box instead when other inputs got errors....my question now is, if I checked the email input string via php, if it has been taken , how will I put the message like e.g "this email has been taken" in an alert box if i am using PHP to check it from backend ?..i want an alert box, since I use it with the other input boxes that don't need a backend check e.g</p> <pre><code>alert("$errormessage"); </code></pre>
php javascript
[2, 3]
1,062,620
1,062,621
set outer scoped variable from inner scope in javascript
<pre><code>var lat = 0.0; var lng = 0.0; var jsonData = null; var geocoder = new google.maps.Geocoder(); var miles = $('#milesAway').val(); // find what the user is locating by if ($('#zipCode').is(':visible')) { var zipText = $('#zipCode').val(); if (isValidUSZip(zipText)) { geocoder.geocode( { 'address': zipText }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { lat = results[0].geometry.location.lat(); lng = results[0].geometry.location.lng(); map.setCenter(results[0].geometry.location); } else { alert("Zip Code couldn't be located."); } }); } else { alert('Please enter a valid US zip code.'); } } </code></pre> <p>lat and lng are still set as 0.0 after this thing runs through, why? Shouldn't I be able to set these like this?</p> <p>Edit: I get to the point where they are supposed to be set too, if I put an alert there I can see the values that they are supposed to be set to.</p>
javascript jquery
[3, 5]
5,872,135
5,872,136
Help converting a string date to a DateTime
<p>I'm using the Ajax control toolkit calendar extender on a textbox with a submit button. Simple.</p> <p>The debugger shows that the text is properly being transferred to calling method, but this line of conversion code converts textbox text to 1/1/0001 12:00:00 AM. The text box date is this: 4/15/2011</p> <pre><code>DateTime txtMyDate = Convert.ToDateTime(txtDate.Text); </code></pre> <p>What am I doing wrong?</p>
c# asp.net
[0, 9]
5,687,016
5,687,017
how to convert javascript function to jquery
<p>I am having a javascript function. Which does the show/hide in onChange. I would like to convert it in jquery, how to do it.</p> <p>Javacript function</p> <pre><code>function assocWindowOnLoad() { var option=document.getElementsByName("select_id"); document.getElementById('conent1').style.display='none'; document.getElementById('conent2').style.display='none'; } function assocWindowOnChange(val) { //if user select option Select from drop down if(val=='') { //alert("Please Select option from the dropdown"); assocWindowOnLoad(); } else { //Show or hide piece of code depending on user input document.getElementById('conent1').style.display=(val=='no')?'none':'block'; document.getElementById('conent2').style.display=(val=='no')?'block':'none'; } } </code></pre> <p>HTML Code</p> <pre><code>&lt;body onLoad="assocWindowOnLoad();"&gt; &lt;select name="select_id" id="select_id" onChange="assocWindowOnChange(this.value);" &gt; &lt;option value='' selected="selected"&gt;Select&lt;/option&gt; &lt;option value='no'&gt;1st Option&lt;/option&gt; &lt;option value='yes'&gt;Second Option&lt;/option&gt; &lt;/select&gt; &lt;div id="conent1" class="hide"&gt; &lt;p&gt;some content&lt;/p&gt; &lt;/div&gt; &lt;div id="conent1" class="hide"&gt; &lt;p&gt;some content&lt;/p&gt; &lt;/div&gt; &lt;div id="conent2" class="hide"&gt; &lt;p&gt;some content&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
573,961
573,962
app loads the pdf file from res/raw/pdf file
<p>HI im trying to load apdf file from the raw folder but when i press the buttin nothing happen please help me with that . This is the code</p> <p>public class openpdf extends Activity {</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) findViewById(R.id.pdfbutton); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { File pdfFile = new File( "android.resource://com.mycompany.myapp.PDF/" + R.raw.adham); Uri path = Uri.fromFile(pdfFile); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setDataAndType(path, "application/pdf"); startActivity(intent); } } ); } </code></pre> <p>}</p>
java android
[1, 4]
4,010,136
4,010,137
How to order scripts registered by ScriptManager's Register Script
<p>I want to alert <code>1</code> registering the scripts in this order</p> <pre><code>ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "a", "alert(a);", true); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "b", "var a = 1;", true); </code></pre> <p>But doing this causes a error saying a is undefined.</p> <p>I have different controls located in different parts of the page registering scripts, and some of them need to go first and others need to go last.</p> <p>Is there a way to set order it will render?</p>
c# asp.net
[0, 9]
461,748
461,749
jQuery iPhone 3gs performance
<p>I have a performance related question; specifically to iPhone 3gs. I have a jQuery Mobile site that responded well on my friend's iPhone 3gs until a recent change I've made. Since the change, on the 3gs, the page in question seems to be very slow.....almost unusable. The page still runs great on a galaxy S2, but after checking the benchmarks for javascript I can see the S2 is able to handle javascript much better so I guess there's no surprise there. Also the iPhone 4 should not have a problem going off the benchmark figures.</p> <p>The code I've added is pretty simple. It just removes the href from 12 buttons on the page and handles click events. Here's the code:</p> <pre><code>$(document).ready(function() { $('.mybutton').removeAttr("href"); $('.mybutton').on("click", function(){ if($(this).hasClass("inactive") || $(this).hasClass("active")) { $(this).toggleClass("active inactive"); } // Disable if 1 active button, else inactive if($('.active').length == 1) { $('.inactive').toggleClass("inactive disabled"); } else { $('.disabled').toggleClass("disabled inactive"); } }); }); </code></pre> <p>Is there anything I can do to speed up that code for iPhone 3gs? Should I even be bothered about this phone? Does anyone still use one barring my technologically challenged work colleague? :)</p>
jquery iphone
[5, 8]
5,426,401
5,426,402
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]
4,504,320
4,504,321
Is it possible to include a folder of javascripts files instead of adding them one by one?
<p>Is it possible to include a folder of javascripts files instead of adding them one by one?</p> <p>Something like this:</p> <pre><code> &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/?.js&gt;&lt;/script&gt; </code></pre> <p>instead of:</p> <pre><code>&lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery-1.5.1.min.js") %&gt;'&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery.localscroll-1.2.7-min.js") %&gt;'&gt;&lt;/s &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery.scrollTo-1.4.2.js") %&gt;'&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery.simplemodal.js") %&gt;'&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery-ui-1.8.11.custom.min.js") %&gt;'&gt;&lt;/sc &lt;script language="javascript" type="text/javascript" src='&lt;%# Page.ResolveUrl("~/Scripts/jquery.noselect.min.js") %&gt;'&gt;&lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
4,201,117
4,201,118
Is there any way we can do append on the next element?
<p>Like, we have <code>&lt;div id='target'&gt;&lt;/div&gt;&lt;div id='footer'&gt;&lt;/div&gt;</code></p> <p>i just want to append <code>&lt;div id='target'&gt;&lt;/div&gt;</code> , the result will be like</p> <pre><code>&lt;div id='target'&gt;&lt;/div&gt;&lt;div id='target'&gt;&lt;/div&gt;&lt;div id='footer'&gt;&lt;/div&gt; </code></pre> <p>append just append something inside the element, is there any Jquery method i can do this</p>
javascript jquery
[3, 5]
3,019,137
3,019,138
Default TextBox values
<p>Problem: There are 4 text boxes. If the user does not wish to fill all of them out, then it should display "0" and get saved.</p> <p>For example: I only fill out two textboxes out of the four. I hit Save. It should automatically save the default values ("0") for those two empty textboxes.</p> <p>Here is the code (javascript):</p> <p>This is the Textbox: </p> <pre><code>&lt;td width="20%"&gt; asp:TextBox ID="left" runat="server"&gt;&lt;/asp:TextBox&gt; px &lt;/td&gt; </code></pre> <p>This is the save button:</p> <pre><code> &lt;asp:Button ID="save" Text="Save" OnClick="btn_save_click" OnClientClick="return Validate();" runat="server"/&gt; </code></pre> <p>This is the Validate() function:</p> <pre><code>function Validate() { var value5 = document.getElementById('&lt;%=left.ClientID%&gt;').value; if (value5 == '') { alert("Please enter the missing fields"); return false; } } </code></pre>
javascript asp.net
[3, 9]
5,230,549
5,230,550
Replace a element instead another element by jQuery
<p>I want replace a(or each) element(number) instead another element(number) in a class while running page.</p> <p>I try as following code but doesn't word true, what do i do?</p> <p><strong>DEMO:</strong> <a href="http://jsfiddle.net/yMnDt/" rel="nofollow">http://jsfiddle.net/yMnDt/</a></p> <pre><code>&lt;div class="myGrid"&gt; 1 &lt;p&gt; 123145 &lt;/div&gt;​ $(".myGrid").clone().find('1').replaceWith( "8" ); </code></pre> <p>​</p>
javascript jquery
[3, 5]
1,493,815
1,493,816
document.referrer encoding issue
<p>referrer` and saving the value in a cookie. The result is coming like this with strange characters: </p> <pre><code>http%3A//www.rzammit.com/props/testpage.asp%3Fadv%3D123%26loc%3D45 </code></pre> <p>How I can remove those strange characters so the link will show correctly please?</p> <p>thanks</p>
javascript jquery
[3, 5]
2,440,034
2,440,035
Fire event at a certain time of the day
<p>Is it possible with javascript (jQuery solutions are fine too) to fire an event/call a function at certain times of the day e.g.</p> <p>call myFunctionA at 10:00</p> <p>call myFunctionB at 14:00 etc..</p> <p>Thanks</p> <p>Mark</p>
javascript jquery
[3, 5]
4,801,494
4,801,495
C# static function with this as parameter to Java function
<p>I got a C# project which needs to be rewritten to java. Unfortunately the original programmer cannot be reached and I have some troubles with some of the C# specific things in the project.</p> <p>Lets say we have a class in C# like:</p> <pre><code>public static class MySampleClass : Object { ... public static IEnumerable&lt;MyObject&gt; MyFunc(this MyObject t) { //a lot of code } ... } </code></pre> <p>I dont understand the <strong>this</strong> before the parameter in this function. What does it reference to? I mean we're in a static class and a static function, so whats "this"? Is it just a reference to <strong>t</strong> then?</p> <p>And of course my question would be that this function header is substitute for this in Java:</p> <pre><code>public static Iterable&lt;MyObject&gt; MyFunc(MyObject t) </code></pre> <p>Or do I need to do anything else? </p> <p>Thank you for your help</p>
c# java
[0, 1]
4,462,251
4,462,252
How can i apply java script to access the client id or a control placed in the grid view?
<p>I want to access a dropdown asp control client id placed in the gridview.</p> <pre><code>function validate(){ var ddl = document.getElementById("ctl00_ContentPlaceHolder1_grdProducts_ctl02_ddlSelectSize"); } </code></pre> <p>I want a generalized way to access above id on a rowcommand event click of a gridview that holds a button. And onButton click i am calling method <code>onclientClick(return validate());</code></p>
javascript asp.net
[3, 9]
1,353,429
1,353,430
I want to display this json value to html table
<p>I need to show the the Json value in html table</p> <pre><code>var a=({ "productToShopList" : [ { "ourPrice" : 5750.0, "product" : { "category" : "External Hard Drive", "id" : 2471, "productName" : "Seagate 1TB F A GOFLEX 2.5\"USB 3.0" } ) </code></pre> <p>plz give advice</p>
java javascript
[1, 3]
5,930,460
5,930,461
how to make Dynamic Scrolling list in asp.net
<p>how to make Dynamic Scrolling list in asp.net ?</p> <p>i have a text file that contain sentences, and i want</p> <p>to show those sentences in dynamic scrolling list in my webform (like news)</p> <p>how to do it ?</p> <p>can i get any sample code ?</p>
c# asp.net
[0, 9]
3,041,832
3,041,833
Calling JavaScript function from C# UserControl
<p>I have developed a user control using C# and embedded it in a lotus domino web page by using below code:</p> <pre><code>&lt;OBJECT id="myUserControl" name="myUserControl" classid="clsid:eb6yhhh-f4db-480b-9c75-8d962790dfd34"&gt;&lt;/OBJECT&gt; </code></pre> <p>I would like to know how can i call a javascript function from my C# usercontrol. </p> <p>In V.B 6.0 there was a function which provided this functionality:</p> <pre><code>Hyperlink.NavigateTo("javascript:Test()") </code></pre> <p>But in C# i dont see any such function.</p>
c# javascript
[0, 3]
2,750,456
2,750,457
Restrict single and double quotes in textbox in ASP.NET
<p>I want to restrict sinqles qoutes and double quotes to enter to a Textbox in Asp.net. How can i achieve it? How can i validate the textbox?</p>
c# asp.net
[0, 9]
4,667,303
4,667,304
Dropdown binding and postbacks - ASP.NET
<p>I have a rather complex page. The ASPX page loads a user control which in turn loads a child User control.</p> <p>Parent Control</p> <pre><code>protected override void OnInit(EventArgs e) { //Loads child control } </code></pre> <p>In the child user control, I use custom control that inherits from <code>System.Web.UI.HtmlControls.HtmlSelect</code></p> <p>ASCX:</p> <pre><code>&lt;cust:CustDropDownList id="ctlDdl" runat="server"/&gt; </code></pre> <p>ASCX.CS</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { //Binds CtlDdl here } </code></pre> <p>When the user clicks on the Save button, the controls get user controls get dynamically reloaded, but Iose the value the user has selected in the dropdown. I run into the chicken and egg problem here.</p> <p>I think I need to bind the ctlDdl only on if its not a postback, but that results in the dropdown not getting populated.</p> <p>If I bind it everytime, then i lose user's selection</p> <p><strong>EDIT: Can someone respond to my comment to Jonathan's answer? Thanks</strong></p>
c# asp.net
[0, 9]
663,198
663,199
Specific Button Click
<p>I got a quick question:</p> <p>I want every link in the div to alert a message, but only the anchors. I dont want the div to initiate the alert function. </p> <p>Html:</p> <pre><code>&lt;div id="abc"&gt; &lt;a href='#'&gt; Button 1 &lt;/a&gt; &lt;a href='#'&gt; Button 2&lt;/a&gt; &lt;/div&gt; </code></pre> <p>Javascript:</p> <pre><code>$(document).ready(function(){ $('#abc').click(function(){ alert('a'); }); }); </code></pre> <p>How do I modify the above code?</p>
javascript jquery
[3, 5]
571,569
571,570
Why does my "if (p.exitValue() != 0)" code run twice?
<p>When I execute a shell script using the method below, my "if (p.exitValue() != 0)" code runs TWICE when it is successful... anyone know why? Also, when the shell script fails, the else code runs once, and then the success code runs again anyway. What am I doing wrong? </p> <pre><code>void exec(String commander){ Process p = null; try { p = Runtime.getRuntime().exec(commander); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } StreamGobbler errorGobbler = new StreamGobbler(p.getErrorStream(), "ERROR"); // any output? StreamGobbler outputGobbler = new StreamGobbler(p.getInputStream(), "OUTPUT"); // kick them off errorGobbler.start(); outputGobbler.start(); // any error??? int exitVal = 1; try { exitVal = p.waitFor(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("ExitValue: " + exitVal); if (p.exitValue() != 0) { //SUCCESS Code RUNS TWICE } else { //FAILURE Code Runs Once, then Success Code Runs anyway!! WHY? } } </code></pre>
java android
[1, 4]
3,837,091
3,837,092
Binding a treeview Dynamically and getting selected nodes
<p>I am trying to dynamically (i.e. via code) bind a directory to a asp.net Treeview control and once the data is bound and displayed to the user i want to get a list of nodes the select.</p> <p>I have got the binding and displaying of checkboxes to work fine , but when i query the Treeview1.CheckedNodes it always returns 0. If i do not bind dynamically but created the nodes by hand then it is able to get the selected nodes.</p> <p>Thanks </p>
c# asp.net
[0, 9]
41,442
41,443
how can I intercept a click for all img's ? I have a bunch of images, each needs to reply to a click.
<p>I would like to present images to my users, where they can select them. I need them to select a limited number, say 5, so: The images are shown in a matrix, and the user can click them. I thought:</p> <pre><code>function boom() { this.css('background-color','#fff'); this.data('clicked','yes'); // I should also make checks here to see how many were clicked already } $('img').click(boom); </code></pre> <p>// I thought this would connect all img's that were clicked upon to this function, where I can call the 'this' with the css function... </p> <p>But it doesn't work as I thought it would...</p> <p>Any help would do, thanks !</p>
javascript jquery
[3, 5]
1,943,286
1,943,287
Download XML to string
<p>I tried to download XML by using the code below:</p> <pre><code> @Override protected String doInBackground(String... params) { try { URL url = new URL("http://xx.xx.xx.xx/1.xml"); URLConnection ucon = url.openConnection(); ucon.setRequestProperty("Accept", "application/xml"); InputStream is = ucon.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while ((current = bis.read()) != -1) { baf.append((byte) current); } String str = new String(baf.toByteArray(), "UTF8"); return str; } catch (MalformedURLException e) { Log.e(DEBUG_TAG, "6",e); } catch (IOException e) { Log.e(DEBUG_TAG, "7",e); } return "error"; } </code></pre> <p>and I am getting the error:</p> <blockquote> <p>12-12 08:12:15.434: ERROR/myLogs(10977): java.io.FileNotFoundException: <a href="http://xx.xx.xx.xx/1.xml" rel="nofollow">http://xx.xx.xx.xx/1.xml</a></p> </blockquote> <p>If I open this url in browser is see:</p> <pre><code>This XML file does not appear to have any style information associated with it. The document tree is shown below. &lt;Home&gt; &lt;Child sex="male" age="5" name="Vasya"/&gt; &lt;pets&gt; &lt;Dog age="3" name="Druzshok"/&gt; &lt;/pets&gt; &lt;/Home&gt; </code></pre>
java android
[1, 4]
2,702,241
2,702,242
Can I get the image height from jquery prior to displaying it?
<p>I'm loading around 50 images from json data returned from PHP. To avoid the extra call of PHP getting the image size I'd like to do this on the client side. Is this possible?</p> <p>Here's my current jquery call to build the image list:</p> <pre><code>// Create HTML for the images. var html = ''; $.each(data.profiles, function() { // Can I determine the img height or do I need to wait until the image is loaded? html += '&lt;a href="/view_profile.php?id='+this.user_id+'"&gt;'; html += '&lt;img src="'+this.file_name+'" width="200" height="" style="border:0;"&gt;'; html += '&lt;/a&gt;&lt;br&gt;'; }); </code></pre>
php jquery
[2, 5]
5,854,256
5,854,257
Android, using Edittext
<p>I've got a few questions about edittext.. </p> <p>I'm trying to create a login screen on Android. I'm taking in a username and a password and then sending the results to another method. I've just got a few questions about it...</p> <p>1) If I have two edittext's and the user enters values in both and then hits a "login" button, I want the button to take the values that were entered in the 2 edittext boxes, convert and save them to a string and then pass them to a function. I'm unsure how I'd construct this button. The problem I'm having is making it a string I'm currently doing this.. </p> <pre><code>String user = edittext.getText(); </code></pre> <p>But that doesn't seem to work. Also I'm unsure what way Android saves Edittext inputs.. Will it just automatically save it to the string once the user is no longer working out of the box? e.g will...</p> <pre><code> public boolean onKey(View v, int keyCode, KeyEvent event) { String user = edittext.getText(); } </code></pre> <p>work? If not how would I define it?</p> <p>Thanks.</p>
java android
[1, 4]
3,155,469
3,155,470
javascript iframe contents loading issue?
<p>I have one <code>Iframe</code> in my website.I initialized it <code>src</code> at <code>document.ready event</code>. I placed <code>iframe</code> inside the <code>jquery UI</code> dialog, now every time when we open the dialog, Iframe load its contents, but i want that this loading process happens only once at <code>document.ready</code>.Is this possible?</p>
javascript jquery
[3, 5]
628,393
628,394
How do I write an extension method in JavaScript?
<p>I need to write a few extension methods in JS. I know just how to do this in C#. Example:</p> <pre><code>public static string SayHi(this Object name) { return "Hi " + name + "!"; } </code></pre> <p>and then called by:</p> <pre><code>string firstName = "Bob"; string hi = firstName.SayHi(); </code></pre> <p>How would I do something like this in JavaScript?</p>
c# javascript
[0, 3]
810,828
810,829
Jquery blinking title
<p>So, i need to have a blinking title, this code should work, but for some reason it doesn't.</p> <p>Now console keeps showing me correct title, but title in my browsers doesn't change, what could be wrong?</p> <pre><code>var blink = true; setInterval(function(){ if(blink){ $("title").text("test"); blink = false; console.log($("title")); }else{ $("title").text(""); blink = true; console.log($("title")); } }, 1000); </code></pre>
javascript jquery
[3, 5]
1,880,254
1,880,255
Loading a JSON file with jQuery.getJSON
<p>I am a newbie in JS and I am trying to do something very simple.</p> <p>I have a JSON file named "data.json" and I want to load it, so, I do this:</p> <pre><code>$.getJSON("data.json",function(data){ console.log(data); }); </code></pre> <p>And then I pass that loaded JSON to a function in library that does this:</p> <pre><code>$("#example1").handsontable({ data:data, //&lt;--- error here minRows: 2, minCols: 3, minSpareRows: 1, currentRowClassName: 'currentRow', currentColClassName: 'currentCol', autoWrapRow: true, colHeaders: true }); $("#example1").handsontable('selectCell', 3, 3); </code></pre> <p>Firebug says </p> <pre><code>ReferenceError: data is not defined [Break On This Error] data:data, </code></pre> <p>I thought I already loaded the JSON into the <code>data</code> variable? Any suggestions?</p>
javascript jquery
[3, 5]
2,728,354
2,728,355
How to retrieve InputStream from FTPFile using FTPClient?
<p>I'm making application which needs to read strings from file on FTP Server. I use apache.commons.net.FTPClient for it. I have following code:</p> <pre><code> Log.e("sizzeee", String.valueOf(mClient.listFiles().length)); InputStream stream=mClient.retrieveFileStream(f.getName()); DataInputStream in=new DataInputStream(stream); BufferedReader buf=new BufferedReader(new InputStreamReader(in)); List&lt;String&gt; tasks=new ArrayList&lt;String&gt;(); String s; while ((s=buf.readLine())!=null) { tasks.add(s.trim()); } stream.close(); in.close(); buf.close(); Log.e("sizzeee", String.valueOf(mClient.listFiles().length)); </code></pre> <p>That works correctly, but I have some problems: last Log instruction shows "0" files in current directory! But first Log instruction shows "6" files. Therefore I think that I don't close file stream or something else. Please, inform me about my mistake. Thank you</p>
java android
[1, 4]
860,976
860,977
In jquery: Use attr(“class”) value as a selector?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4096834/in-jquery-use-attrclass-value-as-a-selector">In jquery: Use attr(&ldquo;class&rdquo;) value as a selector? </a> </p> </blockquote> <p>I have fields with multiple classes. I want to use one of those classes as a selector, how do I do this?</p> <p>generic example:</p> <pre><code>&lt;input id="from"/&gt;&lt;div class="error from"&gt;errormessage&lt;/div&gt; &lt;input id="to"/&gt; &lt;div&gt;&lt;input id="when" /&gt;&lt;/div&gt;&lt;div class="error when"&gt;errormessage&lt;/div&gt; </code></pre> <p>Because ther is a div.error with the class from, I want to add a certain class to input#from and the same goes for the input called when. Note that "when" is wrapped in a div. Several variations like this are necessary for the page. Therefore, tree-traversal is not a suitable solution. </p>
javascript jquery
[3, 5]
347,287
347,288
Converting flv file into swf using c#
<p>I have been trying to convert a flv file into swf file. How can I convert the flv video into swf file using C#?</p>
c# asp.net
[0, 9]
548,764
548,765
How can DOM DocumentFragments help in optimizing dom manipulation?
<p>We are thinking of using <code>DOMDocumentFragments</code> as a candidate for optimizing the dom manipulation code . What do you guys think ?</p>
javascript jquery
[3, 5]
411,689
411,690
Jquery/javascript check if the div finished loading?
<p>I have a facebook like button on my website like that:</p> <pre><code>&lt;div class="fb-like" data-href="https://www.facebook.com/xxx" data-send="false" data-width="300" data-show-faces="true"&gt; &lt;/div&gt; </code></pre> <p>I want to use jQuery or java script to check if this div is 100% finished loading on the page and then do other stuff.</p> <p>I used <code>$(document).ready</code> and <code>.load</code> to check but non of them worked (they do the function even before the div finished loading). Does this problem have to do anything with the fact that this div contain an iframe from another website ? what am I doing wrong here ?</p> <p><strong>UPDATE</strong> I just tried this and it did not work at all:</p> <pre><code>$(document).ready(function() { $(".fb-like").load(function (){ alert("Loaded :)"); }); }); </code></pre>
javascript jquery
[3, 5]
515,085
515,086
Jquery .get() - How to pass the value of a text box into the data parameter?
<p>There is one form with a <code>textbox id="name"</code> and a button.</p> <p>After the user clicks the button, I want to execute the <code>$.get()</code> to capture the reply. (I got the .click() correctly so far)</p> <p>How to I pass the value the user enters to the text box as the {data} parameter in the get function?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
762,868
762,869
Set position for new window
<p>hello i open a new window with:</p> <pre><code>&lt;a href ="javascript:NewWindow =window.open('Default.aspx', 'NewWindow' , 'width=400, height=450'); NewWindow.focus()"&gt;Hilfe&lt;/a&gt; </code></pre> <p>at the moment the new window appears in the upper left corner. how can i set the position, so it appears somewhere else?</p>
asp.net javascript
[9, 3]
3,964,937
3,964,938
Should I Learn C# or C++?
<p>When I first became interested in programming, I took a class that introduced me briefly to C++ for a semester (this class mostly focused on topics like "what is a variable", so I know very little about what C++ is capable of). Up next was a year of AP Computer Science, where I learned Java. Don't get me wrong, I love Java, but I feel like I have become so dependent on it. I am pretty good at programming in Java, and I like the extensive packages like Swing and io that give a great degree of power to even a new learner. </p> <p>I have exhausted my school's (extremely) limited supply of Computer Science classes and am looking at Internet tutorials or books to learn on my own. However, I don't want to start learning a language only to realize that it isn't "right" for me.</p> <p>I guess what I am looking for is a widely used, well-known, powerful language that will not only be good for controlling a computer but also for opening doors later in my life.</p> <p>I am specifically looking at C# or C++, although I don't know why. If you think some other language would be better, please suggest it and why. Hopefully this is enough information for someone to answer. If not, please ask me to clarify because I really would like a specific good answer.</p>
c# java c++
[0, 1, 6]
430,333
430,334
tokeninput jquery plugin - preventDuplicates not working
<p>I am using jquery plugin Tokeninput. I need to prevent user from entering duplicate values, the Js code is as follows:</p> <pre><code>$(document).ready(function () { // Configure Tags $('#Tags').tokenInput(tagSource(), { prePopulate: selectedTags(), theme: "facebook", propertyToSearch: "Code", preventDuplicates: true }); function tagSource() { var data = []; @if (Model.SourceTags != null &amp;&amp; Model.SourceTags.Count() &gt; 0) { &lt;text&gt; data = @(Html.Raw(Model.SourceTags)); &lt;/text&gt; } return data; } function selectedTags() { var selectedData = []; @if (Model.SelectedTags != null &amp;&amp; Model.SelectedTags.Count() &gt; 0) { &lt;text&gt; selectedData = @(Html.Raw(Model.SelectedTags)); &lt;/text&gt; } return selectedData; } }); </code></pre> <p>When I select the same item again, the existing item in the Input field is highlighted and nothing is added. </p> <p>Also, when I select a different item, the first item is highlighted and nothing is added.</p> <p>Any idea?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,116,771
1,116,772
how to identify whether the OS is Linux desktop or Android?
<p>Hi I wanted to know what the OS is pro grammatically in Android? what i have tried is to get the system property of "os.name". but it returns the value as "Linux". but this does not help. i wanted to know whether it is Android or not? how to do this?</p>
java android
[1, 4]
3,767,943
3,767,944
Getting class value
<p>I have an image, onclick on wich i make some <code>ajax</code> requests. i need to pass a variable from <code>$_GET[]</code> to my onclick function, so i deside to do the following</p> <pre><code>&lt;img id="img1" class="&lt;?=$_GET['value']"?&gt; /&gt; </code></pre> <p>and jquery</p> <pre><code>$("#img1").click(function() { how can i get the class value here??? }); </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
677,840
677,841
jquery: assigning event from string
<p>I'm using ASP.net and it creates a pager for a gridview that has the following HTML:</p> <pre><code>&lt;td&gt;&lt;a href="javascript:__doPostBack(.....)" class="MyLink"&gt;pagenumber&lt;/a&gt;&lt;/td&gt; </code></pre> <p>The problem is that when the user clicks on the cell but not the actual content of the cell, the script doesn't trigger because it's not linked to the whole cell.</p> <p>So I'm writing a small script to extract the link and assign its value to a click event handler for each cell. This is what I have so far:</p> <pre><code> $('.MyLink').each(function () { var TheLink = $(this).attr('href'); var CellContent = $(this).html(); // alert(CellContent); var LinkExtract = TheLink.split(":"); //alert(LinkExtract[1]); var PagerCell = $(this).parent(); $(PagerCell).click(function () { LinkExtract[1]; }); //problem here $(PagerCell).html(''); $(PagerCell).html(CellContent); }); </code></pre> <p>Both alerts return the expected content. However, the click event doesn't work.</p> <p>Any idea why?</p> <p>Thanks.</p>
jquery asp.net
[5, 9]
1,539,901
1,539,902
Make a form-in-a-div appear on top of content
<p>I am sure this has been asked before but my google-fu was not able to find an answer.</p> <p>I have a page of content and I want it so when a user presses a link or a button a form appears on top of the content. Once filled out and submitted it would get passed on to the ajax to process it.</p> <p>I am sure this has been solved before as I've seen it on websites. Is there a simple way to do this, such as a jquery plugin or another javascript API? </p> <p>Or would I have to write the form in the div by hand, overlay it with z-index in css and hide it. And then when it is called have the form appear? </p> <p>What's the easiest way to solve this? Thanks a lot</p>
javascript jquery
[3, 5]
5,241,880
5,241,881
How do I add fade in effect when I click expand on this script?
<p>I found this content expand/collapse jQuery plugin. I want to add fade-in effect to this plugin when I click on the EXPAND button. </p> <p>How do I do this?</p> <pre><code>$(document).ready(function () { var maxlines = 15; var lineheight = 15; // line height in 'px' var maxheight = (maxlines * lineheight); var allowedExtraLines = 3; var showText = "EXPAND"; var hideText = "CLOSE"; $('.ranking').each(function () { var text = $(this); if (text.height() &gt; maxheight + allowedExtraLines * lineheight) { text.css({ 'overflow': 'hidden', 'line-height': lineheight + 'px', 'height': maxheight + 'px' }); var link = $('&lt;a href="#"&gt;' + showText + '&lt;/a&gt;'); link.click(function (event) { event.preventDefault(); if (text.css('height') == 'auto') { $(this).html(showText); text.css('height', maxheight + 'px'); } else { //$(this).remove(); $(this).html(hideText); text.css('height', 'auto'); } }); var linkDiv = $('&lt;div&gt;&lt;/div&gt;'); linkDiv.append(link); $(this).after(linkDiv); } }); </code></pre> <p>});</p>
javascript jquery
[3, 5]
3,879,242
3,879,243
Can you get (using jQuery if possible) the current scrolled position of an element?
<p>I am using this code on a 'down' button to scroll text in an overflowed div.</p> <pre><code>var textHeight = text.outerHeight(); var pageDown = $('#page-down'); var pageUp = $('#page-up'); pageDown.bind('click', function() { pageUp.fadeIn(500); text.animate({ scrollTop: '+=' + textHeight + 'px'}, 500); }); </code></pre> <p>This is working nicely, but I need a method to determine when the scroll down button should disappear ... i.e. when the last content has appeared inside the div.</p> <p>Is there a property or method to get the scrolled position within that div? Thanks</p>
javascript jquery
[3, 5]
4,432,645
4,432,646
Enter url code javascript player?
<p>When I put url even youtube,vimeo or what ever, then video is playing. Please tell me that player all in one like that. Thanks in advance</p>
javascript jquery
[3, 5]
574,259
574,260
Android action bar items on the left side of the action bar
<p>I am required to create an action bar that has its items split: four of them on the right side and four on the left (it's a tablet-only application). In portrait mode they shouldn't be split. Is it possible to implement without using a custom view for the left side of the action bar, as it seems inconsistent?</p> <p>Note that I want to know how to do it with the <strong>default action items</strong>, not with the custom ones in a custom view, and that <strong>I don't have any influence on the UI decisions</strong>, so please do not suggest to change the concept.</p>
java android
[1, 4]
6,016,546
6,016,547
how to draw the scribling using canvas in android?
<p>I want to draw the scribling using canvas in android. I use three options touchesdown, touchesmove and touchesup. The scribling path is appeared when I remove my hand from mouse button.</p> <pre><code>x = motionEvent.getX(); y = motionEvent.getY(); switch (motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: currentDrawingPath = new DrawingPath(); currentDrawingPath.paint = currentPaint; currentDrawingPath.path = new Path(); currentDrawingPath.path.moveTo(x, y); mX = x; mY = y; break; case MotionEvent.ACTION_MOVE: currentDrawingPath.path.lineTo(mX, mY); float dx = Math.abs(x - mX); float dy = Math.abs(y - mY); isDrawings=true; if (dx &gt;= TOUCH_TOLERANCE || dy &gt;= TOUCH_TOLERANCE) { currentDrawingPath.path.quadTo(mX, mY, (x + mX)/2, (y + mY)/2); mX = x; mY = y; } break; case MotionEvent.ACTION_UP: isDrawings=false; currentDrawingPath.path.lineTo(mX, mY); drawingSurface.addDrawingPath(currentDrawingPath); undoBtn.setEnabled(true); redoBtn.setEnabled(false); break; } </code></pre> <p>I want to draw the scribling like freehand drawing, where I have to move the mouse the line will following, I need this type of scribling without <code>invalidate()</code> option... please help me. Thanks in advance.... </p>
java android
[1, 4]
3,690,850
3,690,851
Search Up DOM from a given element using jquery
<p>In jquery, I'm trying to find a way to search up the dom until it finds the selector. For example.</p> <p>Provided this structure:</p> <pre><code>&lt;span data-type="contact" data-filter="4" id="buyer-lookup" class="uneditable-input contact-lookup" data-original-title="" title=""&gt;Jeff&lt;/span&gt; &lt;div class="popover"&gt; &lt;div class="arrow"&gt;&lt;/div&gt; &lt;h3 class="popover-title"&gt;&lt;strong&gt;Jeff&lt;/strong&gt;&lt;/h3&gt; &lt;div class="popover-content"&gt; &lt;address style="margin:0;"&gt; MO&lt;br&gt;&lt;/address&gt; &lt;a data-id="70" data-type="contact" class="pull-right edit-contact" href="#"&gt;Edit&lt;/a&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>On click of '.edit-contact' I'd like to search up until I find 'span.contact-lookup'. I can use parent a couple of times to get what I want like below, but is there a cleaner way so that you can just specify $(this).searchUpFunction('span.contact-lookup'); so it would start at this and search up until it finds span.contact-lookup? .prev doesn't seem to search up parents.</p> <pre><code>$('.edit-contact').click(function(){ var filter = $(this).parent().parent().prev('span.contact-lookup').data('filter'); alert(filter); }); </code></pre>
javascript jquery
[3, 5]
452,134
452,135
Android - Text on Button
<p>I need to show the <strong>text on button's both left &amp; right side</strong>, whenever I touch the left side that should call an intent , and when I touch the right side that should call a separate intent . Is it possible to do like that? Please anyone suggest me.</p>
java android
[1, 4]
3,565,629
3,565,630
How to revert back to a page if no userInteraction for timeInterval
<p>I have a HomePage and a PayYourBill page, on the PayYourBill page, the user is going to enter critical information, Is it possible to revert back to HomePage if there is no interaction for 'x' periodOfTime, do I have to use <code>session</code>, or is it possible without it?</p>
c# asp.net
[0, 9]
2,778,156
2,778,157
Cross domain and google CDN for jquery
<p>Doesn't using Google CDN for jquery break the rule of not using cross domain requests on the webpage. Do we trust Google enough to do this?</p>
javascript jquery
[3, 5]
2,163,275
2,163,276
what's the best approach for implementing a bilingual website?
<p>I've got an approach for implementing a bilingual website. it divides a table into to tables that contain localized columns and non-localized columns. like this :</p> <h2>Category</h2> <p>CategoryId</p> <h2>Category_Local</h2> <p>ID CategoryId Culture Title</p> <p>I would like to know whether or not it's the best approach? If it is, my question would be how to implement it. I mean how to handle CRUD methods for both two tables. I'm using asp.net 4.5 web form.</p> <p>I would be appreciated for any ideas. Thanks and regards.</p>
c# asp.net
[0, 9]
879,945
879,946
how can i execute large mysql queries fast
<p>I have 4 mysql tables and have a single query with JOIN on multiple tables and I am requesting it via jquery ajax, but it takes much too long, from about 1-3 minutes while I want to execute them on average 2-5 seconds.</p> <p>Is there any special way to execute the queries fast?</p>
php jquery
[2, 5]
4,752,709
4,752,710
JQuery .post() not returning data
<p>I am trying to pass parameters to the <a href="http://www.tinypaste.com/" rel="nofollow">TinyPaste</a> API. I have the following JQuery script in an HTML file,</p> <pre><code>$.post("http://tinypaste.com/api/create.json", { "paste": "This is test paste", "title": "Test", "is_code": 0, "is_private": 1 }, function(data) { console.log(data); } ); </code></pre> <p>As seen in the Firefox's Web Console, I can see that the request is made and is successful (The content length of the response is as expected). But the callback function is not printing anything in the console window.</p> <p>What am I doing wrong here?</p>
javascript jquery
[3, 5]
980,695
980,696
Is it possible to set height and width of image which was assigned to a label dynamically
<p>Hi all i am using the code below to append image to a <code>label</code> text </p> <p><code>lblPopUp.Text = "&lt;img src='Popup(Images)/notfound.png' /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Access Denied,Contact Administrator";</code></p> <p>This results me as follow when loaded</p> <p><img src="http://i.stack.imgur.com/IuNII.jpg" alt="enter image description here"></p> <p>Is it possible to change some what as below so that text and image should look similar</p> <p><img src="http://i.stack.imgur.com/4N7a9.jpg" alt="enter image description here"></p>
c# asp.net
[0, 9]
1,785,671
1,785,672
Echo PHP variable inside jQuery SwitchCase?
<p>I have a jQuery script that I am including on a PHP page that takes mt content and creates facebook/myspace share links. I am having trouble echoing PHP code inside of the swith case statement that builds the share URL's. Here's my code:</p> <p>case 'facebook': this.href += '?t=' + document.title + '&amp;u=http://foobar.com/detail.php?id='; break;</p> <p>The server isn't parsing the PHP code correctly, it's passing the value <code>id=&lt;?php echo "1";?&gt;</code> rather than 1. Can I not insert PHP code into a javascript include? </p>
php javascript jquery
[2, 3, 5]
2,968,852
2,968,853
remove text from string array with javascript/jquery
<p>Using <code>.each()</code> to go through an array, and trying to use <code>replace()</code> to find all the "<code>&lt;br&gt;</code>" and replace with " " (pretty simple) but nothing happens - no errors, it just doesn't replace.</p> <pre><code>//get values of each td in row var values = ''; var tds = $(this).find('td'); $.each(tds, function(index, tditem) { values = values + "td" + ':' + tditem.innerHTML + '\n'; values = values.replace(/&lt;br&gt;/i, " "); }); </code></pre> <p>Acknowledging that it would be better to manipulate a DOM element (and selecting one of those answers as the correct answer) I ended up adding this to my function as it just makes my life easier in the short-term:</p> <pre><code>values = values.replace(/&lt;br&gt;/i, " "); </code></pre> <p>Thanks @all</p>
javascript jquery
[3, 5]
4,303,539
4,303,540
Manipulating database output in Android strings
<p>I'm trying to manipulate the output of an SQLite query so into two parts - KEY_DATE and KEY_ROWID + KEY_TYPE. Here's the code without the KEY_TYPE bit: </p> <pre><code> DataBaseAdapter db = new DataBaseAdapter(this); db.open(); // get last test date int whichItem = 1; int upDown = 1; // use 1 for descending ordering Cursor mCursor = db.getLogType(whichItem, upDown); String[] columns = new String[] {DataBaseAdapter.KEY_DATE, DataBaseAdapter.KEY_ROWID}; startManagingCursor(mCursor); ListAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_expandable_list_item_2, mCursor, columns, new int[] {android.R.id.text1, android.R.id.text2}){ public boolean areAllItemsEnabled(){ return false; } public boolean isEnabled(int position){ return false; } }; setListAdapter(adapter); db.close(); </code></pre> <p>It works fine, but when I replace:</p> <pre><code> String[] columns = new String[] {DataBaseAdapter.KEY_DATE, DataBaseAdapter.KEY_ROWID}; </code></pre> <p>with:</p> <pre><code> String[] columns = new String[] {DataBaseAdapter.KEY_DATE, DataBaseAdapter.KEY_ROWID + DataBaseAdapter.KEY_TYPE}; </code></pre> <p>it doesn't work.</p> <p>All help much appreciated!</p>
java android
[1, 4]
279,983
279,984
Suggestion for learning Javascript and jquery
<p>I want to learn JavaScript. For this recently I had purchased a book named “<em>JavaScript The Good Parts</em>” from OReilly’s. Though this book is pretty old, but I got some good feedback about this book. I want to learn to write plain JavaScript code from scratch and then move to jquery. Is there any suggestion with this vision?</p> <p>I have another question, just for curiosity --- is it possible to use JavaScript or jquery for developing desktop application inside?</p>
javascript jquery
[3, 5]
1,556,274
1,556,275
in mail column in my gridview - how to send mail?
<p>i have gridview in my form that has column that bind to mail field on </p> <p>my database.</p> <p>i see this mail in my gridview, but how to do that in mouse press i'll send mail ?</p> <p>(i try the hyperlink - but still no working)</p> <p>thanks</p>
c# asp.net
[0, 9]
3,097,365
3,097,366
jquery event is not working properly
<p>i have a Invoice form and a jquery function. In Invoice if i enter the quantity greater then the available quantity then i have to alert the user.</p> <p>My problem is: Let the max quantity is 5, if i input data as 7 (single digit>max avail quantity) then my code is working fine. But if i enter two digigist number eg. 17(two digists>max avail quantity) then my alert box is not coming. I mean onkeyup my function is working only with single digit.</p> <p>How can i make it happening? Please help.</p> <pre><code> $('input[name="quantity"]').keyup(function() { //problem is here var $tr = $(this).closest("tr"); var unitprice = $tr.find('input[name^="unitprice"]').val(); var q = $tr.find('input[name^="quantity"]').val(); var cq = $tr.find('input[name^="checkquantity"]').val(); if(q&gt;cq) { alert("Error: Quantity value exceeds then available quantity..Max Quantity is "+cq); //this works fine only if single digit is entered in textbox quantity } //----below are some other stuffs -these are working fine $tr.find('input[name^="sprice"]').val($(this).val() * unitprice); var totalPrice = 0; $('input[name="sprice"]').each(function() { totalPrice += parseFloat(this.value); $('[name=subtotal]').val(totalPrice); }); }); -------------- ------------ // Form containing the above textboxes &lt;input type="submit" id="submitbtnId" value="Save"/&gt;` </code></pre>
javascript jquery
[3, 5]
3,858,380
3,858,381
I want to check if `id` has no content
<p>I want check between id that get in <code>var span</code>, if empty was between it put css for input but it not work. how can fix it?</p> <pre><code>var span = '#'+$('.valid').closest('.auto_box').find('span').attr('id'); if ($(span+':empty').length != 0) { //alert('ok') (this).closest('.auto_box').find('input').css('background-color','#000'); } </code></pre> <p>See here my full code: <a href="http://jsfiddle.net/Pjqv2/2/" rel="nofollow">http://jsfiddle.net/Pjqv2/2/</a></p>
javascript jquery
[3, 5]
1,617,673
1,617,674
javascript onclick function not working
<p>So I adapted this code from another function that does work and is used on the same page. I don't know if that could do anything to it, so I thought I'd mention that, and also that both have id="replace" in them, which I don't know if it could interfere.</p> <p>Anyway, the code to call the function is this:</p> <pre><code> if (mysql_num_rows($LIKE) != 0) { echo " &lt;td id=\"replace\" style=\"text-align:left\"&gt;".$like." Likes -- &lt;a style=\"color:#234904\" onmouseover=\"this.style.color='#6666CC'\" onmouseout=\"this.style.color='#234904'\" id=\"" . $POST-&gt;id . "\" onclick=\"likePost(this.id)\" name=\"like\"&gt;Like This Post&lt;/td&gt; "; } </code></pre> <p>the javascript function is defined as this:</p> <pre><code>var xmlHttp; function likePost(x) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } var pid = document.getElementById(x).id; var url="forum-like.php"; url+="?pid="+pid; url+="&amp;sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } </code></pre> <p>when I click on what should call the function, nothing happens. If I execute the script using the php page called in the js function, that works fine though... I don't know if I missed anything or anything is wrong though... I also know that the $POST->id part does call the right id... hope this is enough info, otherwise let me know and I'll edit in more :D Thanks for any help!</p>
php javascript
[2, 3]
3,586,562
3,586,563
Add custom information to text fields to use with javascript
<p>I´m making a google instant-type of remote suggestion script with ajax on a site I'm making.</p> <p>now I have this:</p> <pre><code>&lt;input type="text" name="spanishtitle" onkeyup="suggest(this, 'title_es');" onblur="fill();" /&gt; </code></pre> <p>and I would like to move that onkeyup script to a jquery call, so I added this</p> <pre><code>$('.suggestable').live('keyup', ( function() { suggest(this); } )); </code></pre> <p>and changed the above to this</p> <pre><code> &lt;input class="suggestable" type="text" name="spanishtitle" onblur="fill();" /&gt; </code></pre> <p>but I'm missing the 'title_es' parameter which tells the ajax handler what am I looking for.</p> <p>So what I want to know, basically, is if there's a way to add this parameter to the object, so I can access it from suggest() somehow.</p>
javascript jquery
[3, 5]
5,345,201
5,345,202
Reversing jQuery code function
<p>I have the following code which when used in a link goes forward to the next link ... so I'm basically using it to do the function of a next button.</p> <p>What I need to do is to create a reverse version so I can use it as a Back button.</p> <p>Here is the code:</p> <pre><code>&lt;script&gt; $("a.mytrigger").click(function(e){ var index = $(this).attr("href").substr(5); $('#navigation li:nth-child('+parseInt(index)+') a').click(); e.preventDefault(); }); &lt;/script&gt; </code></pre> <p>UPDATE:</p> <p>Please see the link below for further details:</p> <p><a href="http://stackoverflow.com/questions/8726871/javascript-jquery-script-click-link-by-code-sliding-form-script/8727481#8727481">Javascript JQuery Script click link by code (Sliding Form Script)</a></p>
javascript jquery
[3, 5]
3,548,414
3,548,415
check for at least 2 char sequence before whitespace in javascript / jQuery
<p>Well like the title says, how can i check it? i have started something like this:</p> <pre><code> for (var i = 0; i &lt; elm.val().length; i++) { if (elmVal.charAt(i) !== '') { //do something } } </code></pre> <p>For example:</p> <p>if the string is: "g g g" OR "gg g " it should be illegal.</p>
javascript jquery
[3, 5]
1,567,173
1,567,174
Problem in event generation of dynamically generated CheckBox
<p>I have a datagrid with dynamically generated checkbox column..I am not able to generate the checkedChanged event for the checkbox..</p> <p>Here is my code:</p> <pre><code>public class ItemTemplate : ITemplate { //Instantiates the checkbox void ITemplate.InstantiateIn(Control container) { CheckBox box = new CheckBox(); box.CheckedChanged += new EventHandler(this.OnCheckChanged); box.AutoPostBack = true; box.EnableViewState = true; box.Text = text; box.ID = id; container.Controls.Add(box); } public event EventHandler CheckedChanged; private void OnCheckChanged(object sender, EventArgs e) { if (CheckedChanged != null) { CheckedChanged(sender, e); } } } </code></pre> <p>and Here is the event</p> <pre><code>private void OnCheckChanged(object sender, EventArgs e) { } </code></pre> <p>Thanks In advance</p>
c# asp.net
[0, 9]
519,772
519,773
Click checkbox by clicking in the surrounding td
<p>I have a table that in one column has a checkbox. I want the user to be able to check (or uncheck) the checkbox by clicking on the checkbox OR the surrounding td. To complicate (possibly) things a little further, the checkbox has an onchange event set on it (i've put doSomething() in here just for clarity). </p> <p>Here's my current html: as you can see i'm using jQuery.</p> <pre><code>&lt;tr&gt; &lt;td onclick="jQuery(this).children('input').click();"&gt; &lt;input id="dvdorders-77_packed" name="dvd_orders[77][packed]" onchange="doSomething()" type="checkbox" value="1"&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>I thought this was working ok but then noticed that when i click on the actual checkbox, this counts as a click on the checkbox AND a click on the td, effectively clicking twice on the checkbox and so setting it and unsetting it again instantly (and triggering doSomething() twice).</p> <p>There must be a nicer way to do this - anyone? thanks, max</p>
javascript jquery
[3, 5]
5,676,679
5,676,680
Get dropdown value selected using Jquery
<p>I have a drop-down which is auto-built by jQuery. It's running fine.</p> <p>When the user selects a value from the drop-down I would like to know what the value is. Currently I'm using:</p> <pre><code>var employee= $('#emplist').find('option:selected').text(); </code></pre> <p>but this seems to always return null.</p> <p>Can someone tell me how to get the drop-down selected text to a variable.</p> <p>My jQuery version is 1.4.1.</p>
javascript jquery
[3, 5]
5,312,942
5,312,943
Change JS alerts to show/hide jQuery alert div?
<p>The title is confusing, so I'll elaborate..</p> <p>I am working on a FaceBook box for my website, and when the comment is successfully posted, it displays an <code>alert()</code>. I am wanting to get rid of the <code>alert()</code> and instead, via jQuery, show and then fade out a div which will say the same thing as the <code>alert()</code> box.</p> <p>Here's my code:</p> <pre><code>}, function (response) { if (response == 0) { alert("Your FaceBook status has not been updated."); } else { alert("Your FaceBook status has been updated."); } showLoader(false); }); </code></pre>
javascript jquery
[3, 5]
5,462,051
5,462,052
Confirm box when link is clicked
<pre><code>&lt;script type="text/javascript"&gt; $("a.route").live('click', function() { // live is better $("#results").load( $(this).attr('href') ); return false; }); &lt;/script&gt; </code></pre> <p>That's the code, how can I incorporate the code you just gave me?</p>
javascript jquery
[3, 5]
2,633,238
2,633,239
Android and C++: Necessary?
<p>Just checking out Android development very superficially, and it seems that most everyone is working in Java. Yet</p> <blockquote> <p>Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework.</p> </blockquote> <p>does this mean that, in Android applications, Java is used and C++ is used:</p> <ul> <li>sometimes?</li> <li>a lot?</li> <li>almost never?</li> <li>Never: you cannot use it for applications?</li> </ul>
java c++ android
[1, 6, 4]
428,029
428,030
Getting the text of all inputs in a form using jquery
<p>I am trying to consolidate all inputs on my form into one string, but my code just overwrites the var on each loop leaving me with only the text from the last input on the form... How can I fix this?</p> <pre><code>$(':input').each(function() { var output = $(this).val(); $('#output').html(output); }); </code></pre>
javascript jquery
[3, 5]
323,363
323,364
progressbar for form
<p>As some will know on here, we are heavily into forms at the moment. So got me thinking, and I do know of various progress bars out there.</p> <p>Such as: <a href="http://t.wits.sg/misc/jQueryProgressBar/demo.php" rel="nofollow">Wits</a></p> <p>and jquery.progressbar itself.</p> <p>What I havent seen as yet, is ...</p> <p>Lets say we have a form, with 5 input fields. Any form will do. Can we attach a score value for each input field, say 20% but that when user clicks into next field, the progreebar is animated, or fills up ( so progresses to 20% etc. )</p> <p>This isnt quite how we want to do it, but is near enough.</p> <p>Anyhoo, I am not after someone to write this, just to explain. How we attach a variable ( value ) to an input element, which then gets parsed to the progressbar.</p> <p>Thats the bit I am stuck on, most of the scripts online are based on SUBMIT. And paginate a form into 5 elements, each element worth x%</p> <p>Anyways Cheers.</p>
javascript jquery
[3, 5]
4,030,494
4,030,495
Catching event with stopped propagation
<p>Is it possible to somehow catch event, if it's propagation was stopped?</p> <p>$('span').click(function(e) { e.stopPropagation(); });</p> <p>Maybe there are some kind of global handler? Like:</p> <p>Event.registerHandler('click', function(e) { alert('thanks'); });</p> <p>There should be no additional code for regular handlers.</p>
javascript jquery
[3, 5]
1,359,137
1,359,138
JQuery callback function flow
<p>i am very new in jquery. so i was searching google for jquery callback function and i got a code but i did not understand the flow of the code. so please anyone help me to understand the coding flow.</p> <p>here is the code</p> <pre><code>function mightyplugin(foo, callback){ // big code block here callback.apply(this, [foo]); } mightyplugin("Bar!", function(param){ alert(param); }); </code></pre> <p>here i am passing <code>"Bar!"</code> as one argument to function <code>mightyplugin</code> and a anonymous function.</p> <ol> <li>what <code>callback.apply</code> does. what <code>this</code> keyword will hold actually.... why it is required.</li> <li>why <code>[foo]</code> is passed as array. </li> <li><p>what would be the syntax if i pass many argument like</p> <pre><code>mightyplugin("Bar!","1stone","2ndone", function(param){ alert(param); }); </code></pre></li> </ol> <p>i know callback function invoke when first function finish but here situation is different... why?</p> <p>please explain...<br> thanks</p>
javascript jquery
[3, 5]
5,774,932
5,774,933
__EVENTTARGET not populating after button click + C#/ASP.NET
<p>I have an asp button that produces this html: </p> <pre><code>&lt;input type="submit" name="ctl00$m$g_a2ba5666_c8e9_4bd7_a44a_f9407dbe2199$ctl00$btnAddWebPart" value="Add Report" id="ctl00_m_g_a2ba5666_c8e9_4bd7_a44a_f9407dbe2199_ctl00_btnAddWebPart" /&gt; </code></pre> <p>When the button is submitted and the page_load method is hit, I am trying to do this: </p> <pre><code>String target = Page.Request.Params.Get("__EVENTTARGET"); </code></pre> <p>but, for some reason 'target' is empty. I checked to see if __EVENTTARGET is getting populated and it is an empty string. Any ideas as to why this is happening? It is something really silly.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
4,178,450
4,178,451
Problem in getting the parseInt(data) return NaN
<p>I am having a peculiar problem with getting an integer from an ajax response. Whenever I call the following code, parseInt(data) returns NaN despite data being a string.</p> <pre><code>function(data) //return information back from jQuery's get request { $('#progress_container').fadeIn(100); //fade in progress bar $('#progress_bar').width(data +"%"); //set width of progress bar based on the $status value (set at the top of this page) $('#progress_completed').html(parseInt(data) +"%"); //display the % completed within the progress bar } </code></pre>
javascript jquery
[3, 5]