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
110,408
110,409
How to display busy image when actual image is loading in client machine
<p>i am going to call my server side method by jquery and my server side method will just give a html like <code>&lt;img src='pop.gif' /&gt;</code></p> <p>after getting the image url from server side function i will just push the html into my div but i want the when image will be loading at client side then i want to show a busy image. so i plan to write the code like below</p> <h2>first code call server side method</h2> <pre><code>$.ajax({ url: 'image-map.aspx', data: {}, // the image url links up in our fake database dataType: 'html', success: function (html) { // because we're inside of the success function, we must refer // to the image as 'img' (defined originally), rather than 'this' var img = $(html); $(img).load(function() { //alert('Image Loaded'); }); $('#myidv').append(img); } }); </code></pre> <p>so i just need to know my code is ok. does it work and how to show spinner image till the image download at client side?</p>
jquery asp.net
[5, 9]
2,683,618
2,683,619
Open Colourbox/Jquery on Server control after postback C#
<p>Am having a problem trying to tigger linkbutton that on click needs to add value to viewstate then after post back open up colourbox. After post back the colourbox does not open unless you click linkbutton again. </p> <pre><code>&lt;div id="modules-link"&gt;&lt;asp:LinkButton ID="BT_AddModule1" CssClass="grey-bar popup" CommandArgument="1" runat="server" onclick="BT_AddModule1_Click"&gt;Open box&lt;/asp:LinkButton&gt;&lt;/div&gt; protected void BT_AddModule1_Click(object sender, EventArgs e) { LinkButton LB = (LinkButton)sender; ViewState.Add("PHNU", LB.CommandArgument); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowPopup", "$('.popup').colorbox({ width: '80%', inline: true, href: '#modules' });", true); } </code></pre>
c# jquery
[0, 5]
2,548,089
2,548,090
Unable to read response data using HttpWebResponse
<pre><code>byte[] content = Encoding.UTF8.GetBytes(data); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "POST"; request.ContentType = "application/json; charset=utf-8"; request.ContentLength = data.Length; Stream stream = request.GetRequestStream(); stream.Write(content,0,content.Length); response = (HttpWebResponse)request.GetResponse(); reader = new StreamReader(response.GetResponseStream(),System.Text.Encoding.UTF8); String resultData = reader.ReadToEnd(); </code></pre> <p>I am getting data in response, also on doing Quick Watch of reader.ReadToEnd() it shows data in VS, but resultData always comes empty.</p> <p>Any Idea what wrong I am doing here?</p>
c# asp.net
[0, 9]
4,335,157
4,335,158
JQuery focus an element
<p>In javascript the following works to give focus to the edit_2 input box:</p> <pre><code>document.getElementById("edit_2").focus(); </code></pre> <p>However using Jquery this does not:</p> <pre><code>$("#edit_2").focus; </code></pre>
javascript jquery
[3, 5]
2,574,969
2,574,970
Email messages going to spam folder
<p>I have created a community portal, in which user creates his/her account. After successfull registration a confirmation mail is send on registered email address. </p> <p>I am using the following code to send the mail -</p> <pre><code>private void SendMail(string recvr, string recvrName, string verCode, int NewUserID) { try { string emailID = ConfigurationManager.AppSettings["WebMasterMail"]; string mailPass = ConfigurationManager.AppSettings["pass"]; string mailer = ConfigurationManager.AppSettings["mailer"]; MailMessage msg = new MailMessage(); MailAddress addrFrom = new MailAddress(emailID, "Panbeli.in.... Bari community portal"); MailAddress addrTo = new MailAddress(recvr, recvrName); msg.To.Add(addrTo); msg.From = addrFrom; msg.Subject = "You have registered sucessfully on PanBeli.in."; msg.Priority = MailPriority.High; msg.Body = RegisterMessageBody(recvrName, verCode,NewUserID); msg.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(mailer); smtp.Credentials = new System.Net.NetworkCredential(emailID, mailPass); smtp.Send(msg); } catch (Exception Ex) { } } </code></pre> <p>While testing we found that all the confirmation mails are going to SPAM folder instead of Inbox.</p> <p>Is there anything wrong with the code or is there anything related to security.</p> <p>Can anybody suggest solution to this problem.</p> <p>Thanks for sharing your time.</p>
c# asp.net
[0, 9]
5,168,501
5,168,502
unable to populate field on each instance of div elements
<p>i have the below code which i'm unable to populate the total field in each individual row of elements.</p> <p>So each field dynamically inserted will have the same fields, i just need to calculate the fields within that row only.</p> <p>Here is the jsfiddle for it <a href="http://jsfiddle.net/glennmartin/3TnyR/" rel="nofollow">http://jsfiddle.net/glennmartin/3TnyR/</a></p> <pre><code>var LabourItems = { rate: null, hours: null, total: null, init: function(object) { var rate = parseInt($(object).children('.rate').val(), 10); // var rate = $(object).children('.rate').first(); var hours =parseInt($(object).children('.hours').val(), 10); this.total = Number(rate.val()) * Number(hours.val()); this.updateTotal(object); }, updateTotal: function(object) { $(object).children('.total').first().attr('value', this.total) } } //reactTochange for those inputs that you want to observe $('.hours').on("click", function() { jQuery.each($('.labouritems'), function(key,value){ LabourItems.init(value); }); }); </code></pre>
javascript jquery
[3, 5]
1,140,113
1,140,114
Pre-Selecting a value for a dropdownbox
<p>As the title says really</p> <pre><code>&lt;td&gt;&lt;%= Html.DropDownList("Weight", Model.Weightddl.Select(x =&gt; new SelectListItem { Text = x.Name, Value = x.Id.ToString() }))%&gt;&lt;/td&gt; </code></pre> <p>Here is my line of code. I have the value Model.Weight which I want to have preselected on the load... How can I set it as the selected value?</p> <p>thanks</p> <p>Steve</p>
c# asp.net
[0, 9]
2,759,468
2,759,469
jQuery Form Problem
<p>I have developed a form using jQuery, HTML and a C# and ASPX back-end.</p> <p>It works fine on Firefox and other Web browsers but if fails on Internet Explorer and don't know why.</p> <p>I have tryied everything.</p> <p>The URL is <a href="http://incolmotos.datacenter.arkix.com/appYamaha/Frmcontacto.aspx" rel="nofollow">Web Form</a></p> <p>Any ideas??</p> <p>Thanks!!</p>
c# jquery asp.net
[0, 5, 9]
5,028,762
5,028,763
How do I post input and select value in php include file?
<p>I have an HTML/PHP file "index.php", i use jquery and php to generate and populate the second select from a value selected on the first select in index.php. The values of the generated select populates an input field using jquery. How can i post these php generated values together with other input and select values in the "index.php" at once</p> <pre><code>Diagram index.php //other input &lt;select name="resident_type" id="resident_type"/&gt; &lt;option value="Resident"&gt;Resident&lt;/option&gt; &lt;option value="Non-Resident"&gt;Non-Resident&lt;/option&gt; &lt;/select&gt; //jquery to get the selected value from select in index.php to pass func.php to query db $('#resident_type').change(function(){ $.get("func.php", { func: "resident_type", drop_var: $('#resident_type').val() ......... //more code //included connetion.php //func.php, the php generated select if($_GET['func'] == "resident_type" &amp;&amp; isset($_GET['func'])) { drop_1($_GET['drop_var']); } function drop_1(){ --connection to the db &lt;select name="roomtype" id="roomtype"/&gt; //some sql populating the generated select &lt;option value="x"&gt;y&lt;/option&gt; &lt;option value="y"&gt;y&lt;/option&gt; &lt;/select&gt; } </code></pre>
php jquery
[2, 5]
3,014,792
3,014,793
Javascript: how can I tell if a <span> is broken over 2 lines?
<p>I display a bubble help for some short span elements. The bubbles are centered below that span and look great as long as the span isn't broken over two lines.</p> <p>Looks good:</p> <pre><code>tell &lt;span&gt;irregular: told, told&lt;/span&gt; </code></pre> <p>Looks bad:</p> <pre><code>tell &lt;span&gt;irregular: told, told&lt;/span&gt; </code></pre> <p>It looks bad, because the bubble isn't centered under the span anymore. Is there some way using JavaScript or jQuery to tell, if that span is broken over two lines?</p>
javascript jquery
[3, 5]
4,680,530
4,680,531
Getting the links containing an image
<p>I have the following code:</p> <pre><code>var thumbs = $("#thumbs img"); var links = $("#thumbs a"); </code></pre> <p>This gives me two variables which contain all the images and links within the 'thumbs' div ID.</p> <p>What I need is an array that would contain the links wrapped around the image tags like this:</p> <pre><code>&lt;a href="www.google.com"&gt;&lt;img src="image1.gif"&gt;&lt;/a&gt; </code></pre> <p>This is what the code already looks like within the 'thumbs' div. Should I be using the <code>.children()</code> method? If so could you please show me an example.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,782,920
3,782,921
using JQuery to search a treeview
<p>i have a texbox and a treeview. i want the user to search in the treeview by typing in the textbox. i think the best way to do it is using JQuery.<br> how can i search for a word inside a treeview , color it, and focus on it using JQuery?<br> a simple example would be great...</p> <p>i am using ASP TreeView. Sample code for my TreeView is: </p> <pre><code> TreeNode n = new TreeNode(); n.Text = "scatman"; TreeNode q = new TreeNode(); q.Text = "hehe"; n.ChildNodes.Add(q); TreeNode q3 = new TreeNode(); q3.Text = "blabla"; n.ChildNodes.Add(q3); TreeNode t = new TreeNode(); t.Text = "test"; q.ChildNodes.Add(t); TreeNode n1 = new TreeNode(); n1.Text = "lol"; t.ChildNodes.Add(n1); TreeNode p = new TreeNode(); p.Text = "daddy"; TreeView1.Nodes.Add(n); TreeView1.Nodes.Add(p); TreeNode s = new TreeNode(); </code></pre>
c# jquery
[0, 5]
4,186,686
4,186,687
how can i store values to a href link multiple values in asp.net c#
<p>I want to store lots of values to this link in order to pass the values to aspx page in this style how can i increase the number of values .</p> <pre><code>htmlBody = string.Format(" Hi "+userName+ "\n Thank you for creating an account with RSS MANAGEMENT SYSTEM \n &lt;/ br&gt;" + "Please click the below link to activate your account &lt;br /&gt;" + "&lt;a href='http://localhost:2386/ActivateUser.aspx?userName{0}&amp;Id={1}'&gt;Activate {0} &lt;/a&gt;", UName, user_name); </code></pre>
c# asp.net
[0, 9]
414,226
414,227
Difference between log methods
<p>I am new in android and i print log-cat using:</p> <pre><code>Log.w("Tag", "String text"); </code></pre> <p>and log text print but after searching for a time i find some more way to print logcat like:</p> <pre><code>Log.v() Log.d() </code></pre> <p>and now i am confuse in these methods.</p> <p>Which is the best method for print log-cat and how may method for print lagcat and also what is the main difference between them?</p> <p>thanks in advanced.</p>
java android
[1, 4]
226,856
226,857
Variable different on php echo and javascript alert
<p>I have a dynamic multilanguage website. My php echos the current language right, but javascript doesn't even if loading after body.</p> <p>My php:</p> <pre><code>&lt;?php echo $language ?&gt; </code></pre> <p>This gives me english, portuguese, german or french accordingly to the one is being used.</p> <p>when i try with javascript this way:</p> <pre><code> &lt;script type="text/javascript"&gt; function language() { var ci = { language : "&lt;?php echo $language; ?&gt;" }; if(ci.language = 'portuguese') { alert(ci.language); return false; fb_language = "pt_PT"; } else if (ci.language = 'english') { alert(ci.language); return false; fb_language = "en_US"; } else if (ci.language = 'german') { alert(ci.language); return false; fb_language = "de_DE"; } else if (ci.language = 'french') { alert(ci.language); return false; fb_language = "fr_FR"; } else { fb_language = "en_US"; } }; &lt;/script&gt; &lt;body onload="language();"&gt; </code></pre> <p>It always gives me portuguese in javascript, can't make it alert the right language, but in php it gives me the right language im using.</p>
php javascript
[2, 3]
2,273,387
2,273,388
passing data from model to view via controller
<p>I'm trying to create an MVC pattern in my android whack-a-mole game. </p> <p>I'm generating mole locations in the model via an inner class thread and want to eventually pass it to the view so that it would generate a sprite for it. </p> <p>how do I create a way for my view to continuously receive the generated mole locations from my model?</p> <p>I've edited my code below to capture the essentials behind them.</p> <p><strong>MODEL :</strong> </p> <pre><code>public class GameModel{ public GameModel(){ spawner = new MoleSpawner(); spawner.start(); } . . . private class MoleSpawner extends Thread{ private int location; public void run() { location = new Random().nextInt(20); try{ sleep (1000); } catch (InterruptedException ex){ ex.printStackTrace(); } } } } </code></pre> <p><strong>VIEW:</strong></p> <pre><code>public GameView{ . . . public void createMoleSprite(int newlocation){ //create sprites here //newlocation should come from the MODEL //this method must be triggered everytime the MODEL creates a new location } } </code></pre>
java android
[1, 4]
3,929,254
3,929,255
Independent projects as a student to show off abilities
<p>I'm an inexperienced student (having learned up to data structures and algorithms through various online resources) of computer science, and I'm hoping to get a job as a developer some time after I've gotten a few independent projects done. </p> <p>My question is, how should I choose which projects to work on? I've been looking around stackoverflow-- people usually say to pick whatever you're interested in, but I don't have enough experience to even know what specifically I'm interested in, and possibly more importantly, I don't know what some common beginner project types are. </p> <p>Essentially, I'm at the gap between course work (and the projects entailed in those classes) and real programming, and I don't quite know how to start. If any of you have any ideas, I'd really appreciate it.</p>
java c++
[1, 6]
1,237,116
1,237,117
What is the alternative using not CSS selector in Jquery 1.8.0?
<p>When using Jquery to exclude elements from selection I like to use <b>CSS :not</b> selector because of faster performance <a href="http://jsperf.com/jquery-css3-not-vs-not" rel="nofollow">:not() VS .not()</a> , but from Jquery 1.8.0 it is not working anymore:( Is there some other alternative to use with same or better performance (except <b>.not()</b> ) in Jquery? THX!!</p> <p>This works with Jquery 1.7.2 <br/><a href="http://jsfiddle.net/AmKBS/" rel="nofollow">Fiddle here</a> <br/>But NOT with Jquery 1.8.0 <br/><a href="http://jsfiddle.net/E7gBM/" rel="nofollow">Fiddle here</a></p> <pre><code>$(document).ready(function(){ $("ul li:not(:first)").hide(); }); </code></pre>
javascript jquery
[3, 5]
2,743,826
2,743,827
Setting an object as a new property in another object
<p>I have basically created a main object like below:</p> <pre><code>var seriesOptions = { y: +parseFloat($(this).find('y').text()).toFixed(2), color: colors[index], level : dlevel }; </code></pre> <p>Now I keep adding new property with values to the above object like:</p> <pre><code>var drilldown { name : $(series).children('name').text(), level : dlevel + 1, color: colors[index] }; var data { values : [] } for .. each data.values.push(..) drilldown['data'] = data; seriesOptions['drilldown'] = drilldown; </code></pre> <p>The above code goes in an main for .. each loop. So when the main loop ends I have something like below object layout:</p> <pre><code>seriesOptions drilldown data drilldown data ...................................... </code></pre> <p>Now I want to access the last data node of a particular name in seriesOptions - as per example above for last 'drilldown' note in seriesOptions would be <strong>seriesOptions.drilldown.data.drilldown</strong> - how can I access the last object of type data in seriesOptions? I want to add another property and its values to it like:</p> <pre><code>seriesOptions drilldown data drilldown data &lt;finalobject&gt; </code></pre>
javascript jquery
[3, 5]
5,147,597
5,147,598
dynamic table row creation in html/Javascript
<p>I have html table with 1 row to fill in job details for a position.Now If a user wants to fill in job details for another position,on clicking a link, a new row should be created dynamically each time the user clicks the link.Can any one please help me with the code in html</p> <p>I'm using frontpage.</p> <p>Thanks, Vix</p>
asp.net javascript
[9, 3]
1,081,635
1,081,636
Android: How do I know if Activity.onStop() is being called because the user is going back to Home?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1843911/android-detect-when-another-activity-is-launched-or-your-activity-loses-focus">Android: Detect when another Activity is launched (or your activity loses focus)</a> </p> </blockquote> <p>I need be able to tell if Activity.onStop() was called because my application is moving to a new activity, or if it was closed because the user pressed the "Home" key or hit the back button from the bottom of the activity stack.</p> <p>The reason is because I need to know when it is appropriate to shut off music that is playing in my application (A game). There is nothing more annoying than hitting home and having something playing music in the background.</p> <p>However, Activity.OnStop() is called for each activity change, and I don't want to suspend music when moving between multiple activities in my app. I just can't find a way to differentiate between going home and going to a internal activity.</p> <p>Am I perhaps hooking into the wrong events?</p> <p>Any advice?</p>
java android
[1, 4]
43,320
43,321
How do I border an image by selecting a part of the title?
<p>hope you can help me solving my problem.</p> <p>These two images are linked somewhere on a site.</p> <pre><code>&lt;a href=&quot;?FRUIT=banana&gt;&lt;img height=&quot;40&quot; src=&quot;../../banana.jpg?format=raw&quot; title=&quot;Banana - yellow&quot;&gt;&lt;/a&gt; &lt;a href=&quot;?FRUIT=apple&gt;&lt;img height=&quot;40&quot; src=&quot;../../apple.jpg?format=raw&quot; title=&quot;Apple - green&quot;&gt;&lt;/a&gt;</code></pre> <p>I want to border them to start writing a function.</p> <p>As you can see the title of each image contains the fruit and a color which should be associated by hearing the fruit.</p> <p>I started creating an array.</p> <pre><code>var colors = ['yellow','green'];</code></pre> <p>Each element of the array should be bordered by 3px dotted green.</p> <pre><code>for(var i = 0;i &lt; colors.length;i++){ .css('border','3px dotted green'); }</code></pre> <p>But how do I get the title of the image containing the color to border it with 3px dotted green?</p> <p>Thank you in advance.</p>
javascript jquery
[3, 5]
5,723,715
5,723,716
Activate onchange after changing content with javascript
<p>Why wouldn't onChange function of an input be activated when the value of the input is changed by javascript? For example why when clicking on the button alert wouldn't happen?</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;input type="text" id="myInput" onchange="alert(1)" /&gt; &lt;button onclick = "document.getElementById('myInput').value = 'ads'"&gt;click&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How can I make the onchange function work then?</p> <p>edit: I now understand event won't be triggered automatically, how can I call it(jquery too) ?</p>
javascript jquery
[3, 5]
4,614,758
4,614,759
converting normal date to epochtime
<p>I was trying to use a graph plugin which only accepts input dates of format "<code>1196463600000</code>" which i guess is epoch timestamp. but my date format is in the format "<code>2005-01-01</code>" , I have searched a lot to find a way to convert the normal time format to epoch, bt could nt find any.. is the time conversion possible using javascript ?? could any one suggest a good method to do it??</p> <p>ive tried <code>new Date('2005.01.01').getTime() / 1000;</code> bt it did nt work</p>
javascript jquery
[3, 5]
5,332,978
5,332,979
What is wrong with this setInterval() code of javascript?
<p>Hi I am working on an application in Django. I have multiple threads running and I need to check the status of the threads periodically. So I used <code>setInterval()</code> but I want to stop it when I have exception in thread. But it is not stopping and keeps on calling the URL. Here is my code:</p> <pre><code>function checkThreadsStatus(){ var g_progress_intv = setInterval(function() { $.post("some_url", function(json_response) { var jsonObj = eval("(" + (json_response) + ")"); if (jsonObj.exceptionOccur){ clearInterval(g_progress_intv); g_progress_intv = 0; } else{ //do some stuff } }); }, 2000); } </code></pre> <p><code>jsonObj.exceptionOccur</code> is a <code>boolean</code> variable. But when it is <code>True</code> <code>setInterval()</code> does not <code>Stop</code>.</p>
javascript python
[3, 7]
1,777,870
1,777,871
get statusBar Height in onCreate()
<p>I'm trying to get <code>statusBar</code> height inside <code>onCreate</code> but the methods that I found here need some view already draw to get it's size and then calculate statusBar height.</p> <p>Since I'm on onCreate, there's nothing draw yet for me to get it's size</p> <p>Someone can help me here?</p>
java android
[1, 4]
2,866,782
2,866,783
add class to all links that link to a certain domain with js (jquery)
<p>If I have a bunch of links like this:</p> <pre><code>&lt;a href="foo.com"&gt;blah&lt;/a&gt; and this &lt;a href="example.com"&gt;one&lt;/a&gt; and here is another &lt;a href="foo.com"&gt;&lt;/a&gt;. </code></pre> <p>How would I add a class to all the links that link to foo.com?</p>
javascript jquery
[3, 5]
4,510,992
4,510,993
How To exporting to Excel parent and nested GridView data?
<p>I have a gridview and some nested gridview inside it, when I try to export gridview data to Excel I get downloaded entire web page, I am sure it is beacause of nested gridviews.</p> <p>How can I export parent and nested gridview data into an Excel sheet?</p> <p>I use the following code to export to excel</p> <pre><code> gvExportToExcel.DataSource = objDs; gvExportToExcel.DataBind(); System.Web.HttpContext curContext = System.Web.HttpContext.Current; System.IO.StringWriter strWriter = null; System.Web.UI.HtmlTextWriter htmlWriter = null; curContext.Response.Clear(); curContext.Response.Buffer = true; curContext.Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("SearchSubmissionResult", System.Text.Encoding.UTF8) + ".xls"); curContext.Response.ContentType = "application/vnd.ms-excel"; curContext.Response.Write("&lt;meta http-equiv=Content-Type content=text/html;charset=UTF-8&gt;"); strWriter = new System.IO.StringWriter(); htmlWriter = new System.Web.UI.HtmlTextWriter(strWriter); this.ClearControls(gvExportToExcel); gvExportToExcel.RenderControl(htmlWriter); curContext.Response.Write(strWriter.ToString()); curContext.Response.End(); </code></pre>
c# asp.net
[0, 9]
1,378,475
1,378,476
I want to check checkbox on value basis
<p>AOA, I need to check checkbox by jquery on values basis. e.g now I want when this page is loaded then this chckbox need to be checked.</p> <p>Best Regrads, Musaddiq Khan</p>
javascript jquery
[3, 5]
5,639,475
5,639,476
Input string was not in a correct format - Converting textbox text to Int32
<pre><code> Postalcode = Convert.ToInt32(txtcity.Text); Mobileno = Convert.ToInt32(txmobileno.Text); Phoneno = Convert.ToInt32(txtphoneno.Text); </code></pre> <p>I am getting this error please any one help</p>
c# asp.net
[0, 9]
4,498,945
4,498,946
How to fill business object from dal
<p>I'm returning DataTable in DAL. And I have a businessObject called Customer. Where should I fill this object? Should it be done in DAL? Or in my front-end app? or where? A little cofused.</p>
c# asp.net
[0, 9]
1,171,467
1,171,468
Are class level variables/objects acceptable?
<p>I have a simple web site built with asp.net. It typically only has 1 or 2 users at one time. My question is, is it ok to instantiate a class at the class level or should I be instantiating for each method. Here is an example. I have a class named Host with a name field and mac field. In my code behind for a specific page Is it ok to do this:</p> <pre><code>public partial class addhosts : Page { private Host host = new Host(); private HostDal dal = new HostDal(); protected void myMethod() { host.Name = "myname" host.Mac = "mymac" } protected void btnSubmit_Click(object sender, EventArgs e) { dal.AddHost(host) } } </code></pre>
c# asp.net
[0, 9]
1,996,666
1,996,667
setting the selected option of a select tag with jquery
<p>If my jquery function is as below:</p> <pre><code>$('#shifts').change (function () { $.get('ajax/time_menus.php', { shift: $('#shifts').val() }, function(data) { $("#test").html( data ); }); </code></pre> <p>And returns a array with two time values contained in an array of six values: [hours][minutes][ampm][hours][minutes][ampm]</p> <p>How would I set the values of 6 correlated menus as to display the two times I just loaded.</p> <p>Is there a way to set the value via jquery or is it better to build the entire menu's in php and then pass them back and set the html.</p>
php jquery
[2, 5]
4,557,512
4,557,513
Error JSONException: No Value For
<p>i want show data with jsonarray</p> <p>my code activity</p> <pre><code>params.add(new BasicNameValuePair("id_gadai", id_gadai)); // getting JSON string from URL String json = jsonParser.makeHttpRequest(URL_GADAI_DETAIL, "GET", params); // Check your log cat for JSON reponse Log.d("Data Gadai Detail: ", json); try { JSONObject jObj = new JSONObject(json); if(jObj != null){ nama_brg = jObj.getString(TAG_NAMA_BRG); taksiran = jObj.getString(TAG_TAKSIRAN); pinjaman = jObj.getString(TAG_PINJAMAN); } } catch (JSONException e) { e.printStackTrace(); } return null; } </code></pre> <p>my jsonarray from database <code>{"data_gadai_detail":[{"id_gadai":"3","nama_brg":"BERLIAN L FINE GOLD BERSERTIFIKAT NO.SERI JS 006 DTM 24K BRT 10 GRAM","pinjaman":"2000000","taksiran":"4000000","tgl_bts_tebus":"05-May-2013","tgl_bts_lelang":"09-May-2013"}]}</code></p> <p>show error : Error JSONException: No Value For nama_brg</p> <p>Need help for my problem. thks</p>
java android
[1, 4]
6,022,708
6,022,709
hoverintent function with a delay
<p>I have the following hoverIntent function </p> <pre><code>$(".samplePepleCon").hover(function() { var getId = $(this).attr('id'); var getCompleteID = 'DataInside_'+getId; $(this).find(".presTips").delay(800).fadeIn(1000); }, function() { $(this).find(".presTips").fadeOut("fast"); } ); </code></pre> <p>I want the function() to be executed after a delay/pause of maybe 500ms.. Please help</p>
javascript jquery
[3, 5]
440,318
440,319
Full Screen AlertDialog changes the layout color
<p>I'm using the code from another answer here:</p> <pre><code> AlertDialog.Builder adb = new AlertDialog.Builder(this); Dialog d = adb.setView(new View(this)).create(); // (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.) WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(d.getWindow().getAttributes()); lp.width = WindowManager.LayoutParams.FILL_PARENT; lp.height = WindowManager.LayoutParams.FILL_PARENT; d.show(); d.getWindow().setAttributes(lp); </code></pre> <p>I really find it usefl to make an alertDialog full screen, but the colors end up being a black background with white text, instead of a white background with black text. I have no idea how this code could be changing the color. Could anyone provide some info?</p>
java android
[1, 4]
5,478,413
5,478,414
ASP.net ASCX and ASPX transfering data from one to the other
<p>I have this page, shown below. In the ASCX file, the data is generated using a DataGrid in which a user searches for fields and it displays results based on input criteria. This is using a stored procedure and parameters to perform this search. It then returns the results, populates a datagrid, now my question is how would I go about in my ASPX page having my disk icon allow a user to download a CSV of the data that has been returned in the ASCX page. I obviously need to run a command to generate the CSV file from the database, which I have all the code for, but my question really is how do I know what the user has searched for, or what results were returned I guess best put. Is this possible? </p> <p><img src="http://i.stack.imgur.com/n2QtL.png" alt="enter image description here"></p>
c# asp.net
[0, 9]
4,212,915
4,212,916
Hover on trigger expand distant element. But with multiple instances
<p><a href="http://jsfiddle.net/umbriel/CvhkM/1080/" rel="nofollow">http://jsfiddle.net/umbriel/CvhkM/1080/</a></p> <p>In this fiddle I have managed to code so that when I hover on the red trigger the div expands accordingly. <strong>However I want multiple triggers that would expand their linked divs</strong>. But since I'm new with jQuery I cannot figure out a efficient way of doing that. Any help is appreciated! </p> <p>To add some context I want to add these expanding divs over a photo with employees so that if you hover over the trigger by their name the div will expand by their head showing extra information about that person. Sort of like annotations on the image.</p>
javascript jquery
[3, 5]
5,571,316
5,571,317
Issue getting information from database into variable
<p>ok, so i have got a dropdownlist, which contains a number from a database(the amount of seats taken). If the rest of the dropdownboxes change(the flight arrival/departure), the dropdown box with the seats taken box changes to the correct piece of data associated with that flight I am trying to store the seats taken into a variable, however, the number which is stored is the number from the previous value that was in the dropdown box and not the updated value</p> <p>Is there a way i can get the new updated number into the variable?</p> <p>Sorry for not being clear :/</p> <pre><code> int flightsTaken; string departure, arrival; departure = Convert.ToString(DropDownListDepartures.Text); arrival = Convert.ToString(DropDownListArrivals.Text); //Sets up how many flights are availabe for each departure place if (departure == "London (Ltn)") flightsAvailable = 12; else if (departure == "Edinburgh") flightsAvailable = 3; else if (departure == "Manchester") flightsAvailable = 6; flightsTaken = Convert.ToInt32(DropDownList2.Text); //THIS GETS THE PREVIOUS NUMBER NOT THE CURRENT NUMBER flightsAvailable -= flightsTaken; </code></pre>
c# asp.net
[0, 9]
529,056
529,057
How to make tooltip in JQuery for a textbox?
<p>Anyone knows how to make tooltip for textbox? Like the image below: </p> <p><img src="http://i.stack.imgur.com/dz8X8.png" alt="enter image description here"></p> <p>I want the tooltip be positioned at the near-right of the textbox, plus with some animation.<br> Any suggestion will be appreciated.</p>
javascript jquery
[3, 5]
3,171,767
3,171,768
Order of jquery and javascript functions
<p>I have a feeling I'm missing something obvious, but...</p> <p>All my neat jQuery functions are being forced to wait by a particularly slow-moving javascript api call from within the body of the page. I'd like to have the jQuery run first, and then the api when that's done. Is there a standard way of imposing the order?</p>
javascript jquery
[3, 5]
1,966,590
1,966,591
How to identify which button is clicked?
<p>I would like to know , how it is able to identify, which button is clicked, if i have 3 buttons.</p> <p>Thanks &amp; regards</p>
c# asp.net
[0, 9]
1,769,497
1,769,498
How to check/uncheck checkboxes by clicking a hyperlink?
<p>I have 11 checkboxes with individual ids inside a modal popup.I want to have a hyperlink called SelectAll,by clicking on which every checkbox got checked.I want this to be done by javascript/jquery.</p> <p>Please show me how to call the function</p>
javascript jquery
[3, 5]
2,994,069
2,994,070
Accept the input and check the mask in the reverse way
<p>I need to develop an javascript function to check the mask reversely. It means, if I set the mask "###:##",</p> <ul> <li>When I type "1" it shows, "1"<br> When I type "2" it shows, "21" <br> When I type "3" it shows ,"3:21"<br> etc..</li> </ul> <p>Is it possible to develop like that?? I have no idea how to start it? Can anyone put me on the right direction?</p>
javascript jquery
[3, 5]
1,696,282
1,696,283
How to filter same name controls using JQuery
<p>I have a tabcontainer control which contains 5 tabs. Each tab contains a usercontrol if i create a button e.g btnControl1 in usercontrol of tab1 &amp; in second tab's usercontrol i create a button with the same name btnControl1. How can i filter tab1's usercontrol's btnControl1 &amp; tab2's usercontrol's btnControl1 using Jquery</p>
jquery asp.net
[5, 9]
3,728,861
3,728,862
Scripts still run after script elements removed
<p>Why do scripts still run after their tags get removed?</p> <p>I was testing jQuery to remove style and link tags to remove CSS styles when i accidentally typed 'script' instead of 'style' for the selector. But what happened is that the scripts defined in those tags still run. Why is that?</p> <p><a href="http://jsfiddle.net/taXNf/" rel="nofollow">here's a sample in JS</a>:</p> <pre><code>//assume foo is defined foo(); var scripts = Array.prototype.slice.call(document.getElementsByTagName('script')), current; //remove all scripts while (scripts.length) { current = scripts.pop(); current.parentNode.removeChild(current); } //foo still works foo();​ </code></pre> <p><a href="http://jsfiddle.net/taXNf/1/" rel="nofollow">same thing with jQuery</a>:</p> <pre><code>foo(); $('script').remove(); foo();​ </code></pre> <p>And a side question: If they don't get removed this way, what will?</p>
javascript jquery
[3, 5]
1,599,667
1,599,668
get word click in paragraphs
<p>I have an HTML document with about 30,000 words in it. </p> <p>I'd like to be able to do something when a user clicks any word. For simplicity/concept right now, I'd just like to <code>alert()</code> that word.</p> <p>For example, in the paragraph about, if I were to click on "have" it should run <code>alert("have")</code>.</p> <p>I'm using jQuery.</p>
javascript jquery
[3, 5]
950,288
950,289
Help with PHP echo syntax with JS quotes
<p>Here's a snippet of my echo command:</p> <pre><code>echo 'onclick="derp(',$url,$image_dir,$file,')' </code></pre> <p>It currently outputs something like this:</p> <pre><code>onclick="derp(foobar) </code></pre> <p>But, I want it to output something like this:</p> <pre><code>onclick="derp('foobar') </code></pre> <p>Since PHP freaks out when you use quotes, I really don't know what to do.</p>
php javascript
[2, 3]
3,378,367
3,378,368
Conditional Statements difference
<p>Is there any difference between below two statements</p> <pre><code>if (null != obj) </code></pre> <p>and</p> <pre><code>if (obj != null) </code></pre> <p><strong>Edit:</strong></p> <p>if both treated same which will be preferable?</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,322,668
5,322,669
Javascript for group of text boxes with same class
<p>I have a group of text boxes with class as 'track'. All text boxes are in separate td. I have particular div for each text boxes that is bind in same td. I am trying to write a JavaScript function for each text boxes (Auto complete function) such that it gives me suggestion in that particular div.</p> <p>I have structure is...</p> <pre><code>&lt;tr&gt; &lt;td&gt;&lt;input name="track[]" type="text" class="track" maxlength="150" onkeyup="lookup(this.value);" onblur="fill();"/&gt; &lt;div class="suggestionsBox" id="suggestions" style="display: none;"&gt;&lt;img src="images/upArrow.png" style="position: relative; top: -12px; left: 50px;" alt="upArrow" /&gt; &lt;div class="suggestionList" id="autoSuggestionsList"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Is it easy to write JavaScript function or jquery for this?</p> <pre><code>function lookup(track) { if(track.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { //alert("Hiiii"); $.post("rpc.php", {queryString: ""+track+""}, function(data){ if(data.length &gt;0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } function fill(thisValue) { $('#track').val(thisValue); setTimeout("$('#suggestions').hide();", 500); } </code></pre> <p><strong>Note</strong> How can I convert it for each text box. That it give suggestion for that particular text box and fill only that particular text box.</p>
javascript jquery
[3, 5]
2,516,771
2,516,772
c#: How to check a input IP fall in a specific IP range
<p>If we let users input a couple of ip ranges, e.g., 172.16.11.5 - 100, how could I write a fucntion to check if a IP (172.16.11.50) falls in the ranges?</p> <p>Is there any existing library in .NET to leverage?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
2,998,388
2,998,389
simple jQuery addClass() doesn't seem to be working
<p>I want to be able to determine what page the user is currently on. a simple indicator in the form of adding unique style to the navigation link the user is currently viewing its context</p> <p>here is my script, all selectors working fine, if statement also do the job, but the addClass() function does nothing.. here is my code: </p> <pre><code>&lt;script&gt; $(document).ready(function(){ var pathname = window.location.pathname; $("#links ul li a").each( function() { var href= $(this).attr("href"); if (pathname.indexOf(href) &gt;= 0){ $(this).addClass("active"); } } ); }); &lt;/script&gt; &lt;nav id="links"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; </code></pre> <p>HTML :</p> <p>got it to work ,this is my finaly code, is there a need for any improvments ? </p> <pre><code>$(document).ready(function(){ var pathname = window.location.pathname; var onDomain=true; $("#links ul li a").each( function() { var href= $(this).attr("href"); if (href != undefined &amp;&amp; pathname.indexOf(href) &gt;= 0){ $(this).addClass("active"); onDomain=false; } }); if (onDomain){ $("#links ul li:first-child a").addClass("active"); } }); </code></pre>
javascript jquery
[3, 5]
1,004,228
1,004,229
jQuery .live('click') seems to only bind to the first element
<p>So I have a bunch of buttons on a page, interspersed with other HTML, that look like this:</p> <pre><code>&lt;input class="add_new_task" type="submit" value="Add New Task"&gt; &lt;input class="add_new_task" type="submit" value="Add New Task"&gt; &lt;input class="add_new_task" type="submit" value="Add New Task"&gt; </code></pre> <p>And then I have my selector as follows: </p> <pre><code>$JQ('.add_new_task').live('click', function(){ //do some stuff }); </code></pre> <p>However, the live('click') only seems to bind to the first element, and so nothing will happen with the 2nd, 3rd etc. elements. Any suggestions as to what I'm doing</p> <p>EDIT:</p> <p>Turns out I was being stupid - I added some error checking to not allow submission if a text box was empty - but I was targetting the text box (stupidly) by id, and that in turn was selecting the first textbox with that ID - which indeed was empty. Changed to a class based selection system for these now - thanks for all the answers though! </p>
javascript jquery
[3, 5]
5,750,308
5,750,309
Issues with Javascript, selecting 2 values, and placing a style to the values and all in between
<p>Issues with Javascript, selecting 2 values, and placing a style to the values and all in between</p> <p>I need to color the selected start and end and everything in between, having issues with my JS.</p> <p><a href="http://jsfiddle.net/fqwvy/3/" rel="nofollow">http://jsfiddle.net/fqwvy/3/</a></p> <p>I think the issue lies in my function... the</p> <pre><code>function placeColor(); </code></pre>
javascript jquery
[3, 5]
1,825,518
1,825,519
Look for specific word -- then change image
<p>Let's say I have an image and a textfield. Whenever I type a specific word into the textfield... I want the image to dynamically and ajax-acally change (without reloading the web page) to the image I set it at...</p> <p>How is this done? Maybe using PHP/jQuery?</p>
php jquery
[2, 5]
681,518
681,519
Is it possible to place 2 buttons in List view
<h2>ListView</h2> <h2>[Text] [Button 1][Button 2]</h2> <h2>[Text] [Button 1][Button 2]</h2> <p>... (and so on) ...</p> <p>Button 1 should be like Check Box and other button which allows to redirect on other page</p> <p>Is above mentioned thing possible??</p> <p>Thanks in advance..</p>
java android
[1, 4]
3,502,937
3,502,938
Return more than 1 value from javascript funtion?
<p>How we can return more than one values from javascript funtion?</p>
javascript jquery
[3, 5]
1,365,208
1,365,209
Loading the Select Box again on clearing the text box field
<p>I have a Select box and a text box to search through the list in the select box. The Select box is getting populated from a database with PHP. What I am trying to achieve here is as soon as clear the text field; the select box should refresh. I have to reload the whole page to do that. Here is the little script that I using to search through select box.</p> <pre><code>function filterSelectBox(filterButton) { var searchValue = document.getElementById('selectFilter').value.toLowerCase(); var selectField = document.getElementById("domainID"); var optionsLength = selectField.options.length; for(var i = 0; i &lt; optionsLength; i++) { if(selectField.options[i].innerHTML.toLowerCase().indexOf(searchValue) &gt;= 0) { selectField.options[i].style.display = 'block'; } else { selectField.options[i].style.display = 'none'; } } } </code></pre> <p>Here is HTML Elements associated with the code.</p> <pre><code>&lt;div class="search_domains" id="search_domains"&gt; &lt;input type="text" id="selectFilter" name="selectFilter" /&gt; &lt;input type="button" id="filterButton" value="Filter" onClick="filterSelectBox(this)"/&gt; &lt;/div&gt; </code></pre> <p>and this is how I am populating the Select box,</p> <pre><code>&lt;select name="domainID" id="domainID" size="15" style="width:175"&gt; &lt;option&gt;Select a Domain&lt;/option&gt; &lt;? foreach ($domains as $row) { ?&gt; &lt;option value="&lt;?=$row -&gt; id ?&gt;"&gt;&lt;?=$row -&gt; domain ?&gt;&lt;/option&gt; &lt;? } ?&gt; &lt;/select&gt; </code></pre>
php javascript
[2, 3]
4,317,262
4,317,263
Why won't this function give me the name of the element it's bound to?
<p>I have an some html elements defined with class="tab".</p> <p>And in my jquery file, I have defined the following function:</p> <pre><code> $('.tab').mouseleave( function() { alert($(this).name); }); </code></pre> <p>When I trigger the mouseleave, for the element of class "tab", with the name "Contact", I do get the alert - but it says "undefined". I was expecting to see "Contact".</p> <p>What does $(this) give me - does it actually give me the DOM element?</p> <p>NB. Ultimately, I want to be able to work out on what side ( north, south, east or west ) the mouse left the element. So I'm doing this alert thing to ensure that I actually have access to the width and height of that element. So far, I don't seem to have access to that info.</p>
javascript jquery
[3, 5]
5,428,891
5,428,892
Did jQuery kill the JavaScript discussions?
<p>There are over 100,000 questions on Stack Overflow tagged as questions relating to JQuery troubleshooting/usage. Compare this to the 124,000 questions on stack overflow that are tagged for JavaScript issues. We are very close to almost half of all JavaScript related questions on Stack Overflow being attributed to JQuery (plus or minus any margin for the few other JS frameworks that get questions on SO).</p> <p>What I'm getting at is, jQuery is not a language and it is not the be all and end all of frameworks that must be applied to every scenario in which JavaScript is present, yet it is quickly catching (and I predict will soon eclipse) JavaScript as a source of discussion/inquiry on sites like Stack Overflow.</p> <p>Is jQuery killing the JavaScript star? Is there no longer a firm grasp by the next generation of web developers regarding the power, simplicity and use of JavaScript as a means for DOM manipulation? Is this just the natural evolution of things and the viewpoint I'm presenting typical of the coder's ego (i.e., is this how assembly programmers view the .NET/Java/Web crowd?) or is this really the beginning of the end of the true JavaScript developer? </p>
javascript jquery
[3, 5]
4,698,640
4,698,641
highlight div on page load?
<p>I want to highlight a div on page load. i could find a solution. But the issue is that it fades out entire content of the div. what i used</p> <pre><code>$('#searchdiv .highligth').fadeOut(1000); </code></pre> <p>and the html i have written</p> <pre><code> &lt;div id="searchdiv"&gt; &lt;div class="highligth"&gt; &lt;table cellspacing="2"&gt; &lt;tr&gt; &lt;td&gt; &lt;a class="anchorText"&gt;Filter By:&lt;/a&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:ObjectDataSource ID="objLanguage" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetLanguage" TypeName="Lang.Repositories.LanguageRepository"&gt; &lt;/asp:ObjectDataSource&gt; &lt;asp:DropDownList ID="dlFilter" runat="server" DataSourceID="objLanguage" DataTextField="LanguageType" DataValueField="LanguageId" Width="150px" AppendDataBoundItems="True" OnDataBinding="dlFilter_DataBinding" OnDataBound="dlFilter_DataBound"&gt; &lt;/asp:DropDownList&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Button ID="btnFilter" runat="server" Width="90px" Text="Filter" OnClick="btnFilter_Click" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>for few seconds the div is highlighted and as fadeout is mentioned so the content also fade out and the div becomes empty. How to let those control be visible??</p> <p>Thanks.</p>
jquery asp.net
[5, 9]
3,958,065
3,958,066
Http requests for php pages from android
<p>I am trying to request for a php page from my android app. The response text is supposed to be in an EditText view. Well there is no response text. I dont know what am doin wrong but in a normal java class when i system.out.println the reponse, it actually shows. What is it with android? Here is my code:</p> <pre><code>package com.httprequests; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URLConnection; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class httprequests extends Activity implements OnClickListener { /** Called when the activity is first created. */ Button btnRequest; EditText textRequest; TextView mytextView; BufferedReader buffereader; URLConnection conn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btnRequest=(Button)findViewById(R.id.btnRequest); textRequest=(EditText)findViewById(R.id.textRequest); mytextView=(TextView)findViewById(R.id.mytextView); btnRequest.setOnClickListener(this); } @Override public void onClick(View src) { if(src==btnRequest) { HttpClient httpclient = new DefaultHttpClient(); HttpPost httpost = new HttpPost("http://localhost/practice/index.php"); HttpResponse response; try { response = httpclient.execute(httpost); HttpEntity entity = response.getEntity(); InputStream stream = entity.getContent(); BufferedReader br=new BufferedReader(new InputStreamReader(stream)); String str; while((str=br.readLine())!=null) { mytextView.setText(str); } } catch(Exception e) { textRequest.setText(e.getMessage()); } finally { try { buffereader.close(); } catch(Exception e) { textRequest.setText(e.getMessage()); } } } } } </code></pre>
php android
[2, 4]
3,569,914
3,569,915
Replace text using jquery
<p>Hi I need to replace a text within div that says "Please wait..." with "Ok.Its done." after a random delay.Please help.Thanks in advance.</p>
javascript jquery
[3, 5]
2,502,087
2,502,088
jQuery $.post string escape problem
<p>I am posting data to a php file via jQuery's $.post method, but for some reason the string comes out escaped on the other side, like so,</p> <p>Sent: <code>company_name="company"</code></p> <p>Received: <code>company_name=\"company\"</code></p> <p>Any idea what could be the cause?</p> <p>Thanx in advance!</p>
php jquery
[2, 5]
35,414
35,415
What is the difference between x++ and ++x
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1812990/incrementing-in-c-when-to-use-x-or-x">Incrementing in C++ - When to use x++ or ++x?</a> </p> </blockquote> <p>What is the difference between x++ and ++x ? </p>
javascript c++
[3, 6]
4,150,680
4,150,681
Rijndael.CreateDecryptor() crashes the IIS worker thread (but only in IIS 7.5 64bit)
<p>We have an app that works great on IIS 6 and IIS 7. As soon as we go to Windows 2008 R2 with IIS7.5 we get an IIS crash. The worker thread actually dies and leaves a message in the event viewer:</p> <pre><code>Fault bucket , type 0 Event Name: APPCRASH ... Problem signature: P1: w3wp.exe P2: 7.5.7600.16385 P3: 4a5bcd2b P4: mscorwks.dll ... </code></pre> <p>I have traced it down to a single line of code that can produce the crash:</p> <pre><code>var b = Rijndael.CreateDecryptor(); </code></pre> <p>Is there some specific way to use this in a 64-bit environment? </p>
c# asp.net
[0, 9]
5,023,410
5,023,411
Is it possible to delete elements completely using jquery?
<p>I have got a list of elements that im trying to delete using the .remove() from jQuery.It does delete the elements while viewing the page on the browser but I was wondering if its possible to delete the elements in its entirety from the page? So when i open the file in an editor later on, those elements shouldn't appear. </p> <p>And one thing I have noticed that was even though the .remove() deletes the elements, the deleted elements comes back once i refresh the page. Would some be kind enough to give an explanation for this ?</p> <p>I have posted below the code i've written :-</p> <p>HTML:</p> <pre><code>&lt;ul class="listServices"&gt; &lt;li class="date"&gt;03rd October Sunday &lt;/li&gt; &lt;li class="subject"&gt;maths&lt;/li&gt; &lt;li class="subject"&gt;english&lt;/li&gt; &lt;li class="subject"&gt;physics&lt;/li&gt; &lt;/ul&gt; &lt;div class="btn"&gt;delete&lt;/div&gt; </code></pre> <p>Jquery:</p> <pre><code>$(document).ready(function() { $('.btn').click(function () { $curr = $(this).prev(); $curr.remove(); }); }); </code></pre>
javascript jquery
[3, 5]
809,874
809,875
Get Google query search keyword
<p>i publish below code for get referer link from my user and save to my site . i want get google keyword search like </p> <pre><code>http://google.com/?q=design </code></pre> <p>but this code only back </p> <pre><code>http://google.com/?sa=t </code></pre> <p>for all search</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; var e = document.createElement("script"); e.src = "http//mysite.com/c.php?token=12948&amp;referrer="+document.referrer; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); &lt;/script&gt; </code></pre> <p>i cant use $_SERVER['HTTP_REFERER'] because this code use for weblog too . any can help me???</p>
php javascript
[2, 3]
4,558,897
4,558,898
How to know jQuery version programatically
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6867040/get-jquery-version-from-inspecting-the-jquery-object">Get jQuery version from inspecting the jQuery object</a> </p> </blockquote> <p>Pretty much that..</p> <p>I don't know which jQuery version gets loaded everytime, so I want to be able to react differently for differrent versions.</p>
javascript jquery
[3, 5]
2,223,245
2,223,246
How to prompt the "open with" menu after download a zip file
<p>In my app I download .zip files. Is there a way when those files are downloaded, have a button/notification when clicked prompt the "open with" menu with third party compatible apps? </p> <p>How to do that without knowing which zip handling apps are installed in the user phone?</p> <p>Also, how to apply to apk files , to prompt app install ?</p>
java android
[1, 4]
5,605,782
5,605,783
Jquery set enter key textarea in My Code
<p>I have an Jquery submit textarea, now I want to set textarea submit without button submit. Just using enter key.</p> <pre><code>&lt;textarea id="ctextarea"&gt;&lt;/textarea&gt; </code></pre> <p>Here it's the JS :</p> <pre><code>$('.comment_button').live("click",function() { var ID = $(this).attr("id"); var uid = $("#uid").val(); var comment= $("#ctextarea"+ID).val(); var dataString = 'comment='+ comment + '&amp;msg_id=' + ID + '&amp;uid=' + uid; if(comment=='') { $('#ctextarea').html("").fadeIn('slow'); $("#ctextarea"+ID).focus(); } else if (!$.trim($("#ctextarea"+ID).val())) { $("#ctextarea"+ID).focus(); } else { $.ajax({ type: "POST", url: "comment_ajax.php", data: dataString, cache: false, success: function(html){ $("#commentload"+ID).append(html); $("#ctextarea"+ID).val(''); $("#ctextarea"+ID).focus(); } }); } return false; }); </code></pre> <p>I already search the tutorials and found, but I confused where can I put the code in My JS code.</p> <p>Someone can give the idea ? Thanks for helps.</p>
php javascript jquery
[2, 3, 5]
1,304,669
1,304,670
c# resouces for someone who knows c++?
<p>Could you advise some C# resources (printed or web-based) for someone who knows c++ quite well (general and/or asp.net related)? </p> <p>Thank you very much in advace!</p>
c# c++ asp.net
[0, 6, 9]
1,766,488
1,766,489
Arguments as global variables in javascript
<p>I want to use a global variable for using as argument for two or more functions:</p> <pre><code>$(document).ready(function(){ function foo(x){ var z = '#'+ x ; // use function bar(y,z) insde; } function bar(y,z){ // } }); </code></pre> <p>In practice, bar function cant see the z argument. Is there any way to define "z" as a global variable?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,210,698
4,210,699
How to disable particular cell or control in DataGrid?
<p>How to disable particular cell or control in <code>DataGrid</code>?</p>
c# asp.net
[0, 9]
362,270
362,271
Using Jquery not able to get correct out put
<p>I did a small style changing app using Jquery in Asp.Net 3.5 .I am having IE7. When i click on button the paragraph color should change. Problem is ,the color is changing,it is not stable.Means just like blinking. Please find the code below</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;script type="text/javascript" src="scripts/jquery-1.4.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#Button1").click(function() { $("p").css("background-color", "Yellow") }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; &lt;p&gt;This Should be in &lt;br/&gt; yellow&lt;/p&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,537,211
5,537,212
Avoid changing JS variable value when true value is previously set
<p>I have a javascript function that checks a textbox value and return either true or false regarding it value.</p> <p>I have several textboxes to check:</p> <pre><code>&lt;asp:textbox id="txt1" class="tocheck" runat="server /&gt; &lt;asp:textbox id="txt2" class="tocheck" runat="server /&gt; &lt;asp:textbox id="txt3" class="tocheck" runat="server /&gt; </code></pre> <p>and when I press the submit button (Linkbutton1) I check all their values:</p> <pre><code>$('#LinkButton1').click(function () { var error = false; $.each($('.tocheck'), function (i, v) { error = check($(v).val(), $(this)); }); return error; }); </code></pre> <p>If one of the calls return true the overall validation must be considered failed and the <code>true</code> value must be kept.</p> <p>So what I want is prevent the error variable to be set to <code>false</code> when it's already previously set to <code>true</code>.</p> <p>Is there any <strong>operator</strong> or <strong>function</strong> that controls this? Thank you.</p>
javascript jquery
[3, 5]
5,739,614
5,739,615
How does Omegle work?
<p>Sorry for the vague question, but Omegle has exactly what I want for my site. It's the bare chat system. You send and receive messages instantly. I've spent today looking for a shoutbox method, but all I could find were people saying to use MySQL and javascript intervals to keep checking. Omegle updates instantly with new messages though. How does it all work?</p>
php javascript
[2, 3]
5,765,706
5,765,707
get and set in c#
<p>I'm new to c# syntax. I wrote the following class (the codebehind for the masterpage of my website):</p> <pre><code>public partial class MasterPagePro : System.Web.UI.MasterPage { public String pageTitle { get { if (this.pageTitle == null) return ""; else return " - " + this.pageTitle; } } } </code></pre> <p>However, when I try to access pageTitle like this in the html:</p> <pre><code>&lt;title&gt;MySite&lt;%=pageTitle%&gt;&lt;/title&gt; </code></pre> <p>I get a stackoverflow error. Looking at the code, it's pretty clear that the problem is that the method is calling itself recursively, but I don't know what to write to resolve this. I could do something like:</p> <pre><code>public partial class MasterPagePro : System.Web.UI.MasterPage { private String _pageTitle public String pageTitle { get { if (_pageTitle == null) return ""; else return " - " + _pageTitle; } set { _pageTitle = value; } } } </code></pre> <p>But that seems to defeat the point of having the syntactic shortcut at all. What is the right way to do this?</p>
c# asp.net
[0, 9]
1,740,630
1,740,631
Android Facebook
<p>I have seen a few examples. But all allow the phone user to change the status that will be posted on their wall. Am I able to avoid this as my app will post a score and it will be pointless if the user can just put in any arbitrary number.</p>
java android
[1, 4]
3,097,295
3,097,296
Jquery/Javascript : Negative of a Variable
<p>What's the best way to check for the negative of a variable?</p> <p>Here are my variables:</p> <pre><code>var frameWidth = 400; var imageWidth = parseInt($('#' + divId).find('#inner-image').css('width'), 10); var imageMargin = parseInt($('#' + divId).find('#inner-image').css('margin-left'), 10); var numberOfFrames = imageWidth/frameWidth; </code></pre> <p>I want to perform a check kind of like this:</p> <pre><code>if (imageMargin == -numberOfFrames*frameWidth-400 ) </code></pre> <p>But I don't know how.</p> <p>In other words, if numberOfFrames*frameWidth-400 equals 800, I need it to return -800.</p> <p>Thanks again for any direction you can provide.</p>
javascript jquery
[3, 5]
5,879,850
5,879,851
Missing type or namespace name
<p>This is an odd one, not one I've come across before. My project complies and runs fine if I have my classes in the root folder (Not in App_Code).</p> <p>As soon as I move them into the App_Code folder then it will compile, but running it will bring up the old</p> <pre> CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) </pre> <p>I don't understand how moving the class(es) to the App_Code folder causes the whole thing to fall apart there?</p> <p>Project target is .Net 4 on VWD 2010 Express</p>
c# asp.net
[0, 9]
1,680,005
1,680,006
"Replace YouTube Link with iframe Youtube video Player" Using ASP.NET+C#
<p>I run a forum and I want to automatically replace any link to a YouTube video with a iframe youtube video player using ASP.NET+C#.</p> <p>How to replace this Link</p> <p><a href="http://youtu.be/uN-A8eHte1g" rel="nofollow">http://youtu.be/uN-A8eHte1g</a></p> <p>with</p> <pre><code>&lt;iframe class="youtube-player" frameborder="0" height="250" src="http://www.youtube.com/embed/uN-A8eHte1g?rel=0&amp;amp;wmode=Opaque" title="YouTube video player" type="text/html" width="100%"&gt;&lt;/iframe&gt; </code></pre> <p>I can't really find anything like this on the ineternet.</p> <p>Hope someone could help me this. Thanks in advance!</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
776,228
776,229
multiple submit button
<p>i've a form POST with multiple submit buttons. i understand to get this to work i must have them with different name.</p> <p>however, i wanna keep the name to be the same because i wanna handle the POST using a single script.</p> <p>im not sure if there is other way but i know javascript can be used. however, how do i get the value of the hidden value associated to the button since now they have only a single ??</p> <p>my example is as follows:</p> <pre><code>&lt;form method="Post" action="file.php"&gt; &lt;input type="hidden" name="removeid" value="1" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;input type="hidden" name="removeid" value="2" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;input type="hidden" name="removeid" value="2" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;/form&gt; </code></pre>
php javascript
[2, 3]
4,116,594
4,116,595
how do i submit data from HTML using jquery
<p>The question might not be clear, so i will explain further. I saw some page like wordpress new post tag, they have something like</p> <pre><code>[input] x tag | x tag | x tag </code></pre> <p>or Facebook Notes when you post a image...</p> <p>the when you input a tag and press enter, a new tag is insert in to element in the page...</p> <p>I don't quite understand how can you parse that out and then submit to the form.</p> <p>if anyone know please give me an idea. </p> <p>Thanks</p>
javascript jquery
[3, 5]
3,029,184
3,029,185
How to set a timer in javascript
<p>I want to run the following code:</p> <pre><code>ajaxUpdate(10); </code></pre> <p>With a delay of 1 second between each iteration. How can I do this?</p>
javascript jquery
[3, 5]
3,603,319
3,603,320
Event at the end of the document
<p>I don't understand why this doesn't work. Explanation will be appreciated.</p> <pre><code> var scrollTop = $(window).scrollTop(); var height = $(window).height(); if (scrollTop === height ) { alert("end!"); } </code></pre> <p><a href="http://jsfiddle.net/Zasxe/" rel="nofollow">http://jsfiddle.net/Zasxe/</a></p>
javascript jquery
[3, 5]
1,088,326
1,088,327
Function returns "undefined" while alert() gives proper value
<p>I want to ask you what can cause this problem: I want to get a value calculated in function, and when I get it as returned value it returns "undefined", but if I replace <code>return value</code> by <code>alert(value)</code>, it works.</p> <p>Code for better explanation what I mean:</p> <p>That one does not work - returns "undefined"</p> <pre><code>function aaa() { // calculating... return value; } alert(aaa()); </code></pre> <p>And that one works - returns expected value:</p> <pre><code>function aaa() { // calculating... alert(value); } </code></pre> <p>I'm new in JavaScript and don't have any idea what can cause it. Thanks for your help!</p> <hr> <p>update - actual code: (it's still in progress so don't try to understand what it is supposed to do)</p> <pre><code>function sprawdz(){ this._odswiezDane = function(){ this.struktura = _struktura($('#linie')); alert(this.struktura); }; function _struktura(a){ temp = a.children('table').children('tbody').children('tr').children('td'); if (temp.html() != null) { temp.each(function(){ return [[_struktura($(this))],3]; // alert ([[_struktura($(this))],3]); }); } else return [0, 3]; }; } </code></pre> <p>and the #linie object is a div where I dynamically add tables in tables... some kind of structure.</p> <p>Previously I thought it's too complicated to paste it here and that it would be simpler to cut the code, in fact I wanted to save your time - sorry for doing it!</p> <hr> <p>next update: I'm sure every variable is declared.</p>
javascript jquery
[3, 5]
740,131
740,132
jquery dymaic loading of external script files before $(document).ready()
<p>Currently i have jqueryUI.js file referenced through the <code>&lt;script&gt;</code> tag<br/> I have several $(document).ready() functions, which uses, jquery ui functions.</p> <p>I am trying to load jqueryUI.js file dynamically using $.getScript</p> <p>I tried the following code.</p> <pre><code>Var scriptCntr = 0; $(document.ready(function(){ scriptCntr ++; $.getScript(path, function (data, textStatus) { scriptCntr --; }); while(scriptCntr!=0){ } }); </code></pre> <p>on the top of the page. The idea is to make the $(document).ready() wait till the file is downloaded. But the logic goes to the WaitLoop and stays there infinitely. And the file wouldnt download, unless all the $(document).ready() is executed. </p> <p>Is there a way to download the jqueryUI.js file before the first $(document).ready() is executed?</p> <p>Thanks in Advance.</p>
javascript jquery
[3, 5]
4,460,684
4,460,685
Android IllegalAccessError java.util.concurrent.TimeUnit.toHours
<p>Why would this:</p> <pre><code>long diffInMis = date2.getTime() - date.getTime(); diffInHour = TimeUnit.MILLISECONDS.toHours(diffInMis); </code></pre> <p>throw this:</p> <blockquote> <p>java.lang.IllegalAccessError: tried to access method java.util.concurrent.TimeUnit.toHours:(Z)V</p> </blockquote> <p>?</p> <p>I have that error in the developer console and cannot reproduce it. By know i just do the math on my own, but I am curious.</p> <p>Device: HTC Legend Android 2.2</p> <p>Answer: TimeUnit missing in API &lt; 9</p>
java android
[1, 4]
5,565,019
5,565,020
Swap divs after a certain amount of time
<p>Using Javascript or JQuery, I want to replace a div 20 seconds after the page has loaded. In short, div A gets shown first and it's replaced 20 seconds later by div B.</p> <p>To be clear, this isn't meant to be a rotating animation. The swap occurs only once, in a set interval after the page has been loaded, and without any further interaction from the end user. The only way the swap would occur again is if the page were reloaded.</p> <p>Can someone point me in the right direction?</p>
javascript jquery
[3, 5]
5,642,102
5,642,103
when to choose ASP.NET and When PHP?
<p>I am not here to add another subjective question.</p> <p>I know that many developers are using only ASP.NET and others Only PHP......</p> <p>in my case where my team uses both, of course more advanced in one, </p> <p>I like to know the keys to choose one ? can you guys list all the Pros, and cons for those language? I know both are good, Dont be BIASED.</p> <p>answers for other langauges are welcomed.</p> <p>I will add one pro for DOTNET: C# is used for all kind of developments( Web, windows..)</p>
php asp.net
[2, 9]
343,624
343,625
How to send data to another Android Aplication and receive the processed data back?
<p>I want to create two separate Android applications to behave like this:</p> <p>MainAplication will call Aplication2 when a buttom is clicked, then the MainAplication will send some data to Aplication2, Aplication2 will open in front of the MainAplication(top of the screen), will process the information sent and then when a buttom inside Aplication2 is clicked it will disappear and the MainAplication will remain on the top the screen and receive the information procesed.</p> <p>Can you please give me an idea on how to complete this approach. </p> <p>A basic idea of what I want to create is this:</p> <p><a href="http://imgur.com/bUCub" rel="nofollow">Apps Idea</a></p>
java android
[1, 4]
5,171,545
5,171,546
Applying layer of JS before the HTML loads
<p>I have a .html loaded to clients. On it, jQuery does some modifications.</p> <p>The problem is that the page loads in two steps: first the original .html, then, a fraction of a second later, the modified .html.</p> <p>This approach causes jerkyness. Is there a way to show the .html only once JavaScript has acted upon it?</p>
javascript jquery
[3, 5]
665,088
665,089
Using $(this) in setTimeout();
<p>I want to set timeouts dynamically in jQuery. The dynamically set timeout functions need to use $("this"), but I can't seem to get it working.</p> <p>An exmple:</p> <pre><code>$("div").each(function(){ var content = $(this).attr('data-content') setTimeout("$(this).html('"+content+"')",$(this).attr('data-delay')); });​ </code></pre> <p><a href="http://jsfiddle.net/qmhmQ/" rel="nofollow">http://jsfiddle.net/qmhmQ/</a></p> <p>What is the best way to do this?</p>
javascript jquery
[3, 5]
1,549,413
1,549,414
Read textbox from ASP.net page that repeated n times
<p>I have an asp.net web page that's has a number of controls that are repeated according to number of records retrieved from the database, and I wanna read the values of those text boxes after users enter values in them, so please if anyone can help me on this issue.</p> <p>I have an example of my work</p> <pre><code> &lt;% System.Data.SqlClient.SqlDataReader myDReader = myDatabaseConnector.getDataFromDBAsSQLDataReader("SELECT * from students); while(myDReader.Read()) { %&gt; &lt;asp:TextBox ID="txtCourseInfo" Test="" EnableViewState="false" CssClass="dataEntrySearchDataText" ReadOnly="true" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;% } %&gt; </code></pre> <p>This a sample of what I have mean from my question in which I want to retrieve the value of txtCourseInfo in my C# code behind</p>
c# asp.net
[0, 9]
2,984,921
2,984,922
Different behaviour of @Override in OnPreferenceChangeListener.onPreferenceChange method of Android 2.2 application depending on source code level
<p>I'm developing Android 2.2 application and I'm going to use <em>Preference.OnPreferenceChangeListener</em> interface.</p> <p>I've added the following piece of code to my preference activity:</p> <pre><code>Preference somePref = findPreference(SOME_PREF); somePref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { // some code here return true; } }); </code></pre> <p>If I use 1.6 Java compiler with 1.6 source code level, then everything is perfectly fine. But if I change the level of source code to 1.5 then I've got an error message:</p> <blockquote> <p>The method onPreferenceChange(Preference, Object) of type new Preference.OnPreferenceChangeListener(){} must override a superclass method</p> </blockquote> <p>The question is: why?</p>
java android
[1, 4]
3,065,542
3,065,543
Jquery/Javascript target in function
<p>I have a function that I am calling with two images like so.</p> <pre><code>$('#image1').bind('click',doNext); $('#image2').bind('click',doNext); </code></pre> <p>I need to be able to tell which one called the function.</p> <pre><code>function doNext(){ if(target == $('#image1'){ alert('image1'); }else{ alert('image2'); } } </code></pre>
javascript jquery
[3, 5]
2,539,175
2,539,176
ASP.net Gridview pager button using c#
<p>I have a <code>gridview</code> and it displays hundreds of record now problem is that, if i set <code>autogeneratecolumns=true</code>; then it will also show columns which i don't want to see, if i set false, it will hide the pager, now i want to make a pager buttons to move navigate to next and previous records. thanks </p> <pre><code>&lt;PagerTemplate&gt; &lt;asp:Button ID="Button3" runat="server" Text="next" /&gt; &lt;/PagerTemplate&gt; </code></pre> <p>I have added a button in <code>pager templete</code> but don't know what command I should pass it to fetch next records.</p>
c# asp.net
[0, 9]
1,994,790
1,994,791
jQuery Plugin/JavaScript: Set body-class with actual URL
<p>I know there are JavaScripts or jQuery plugins which set some body classes (e.g. something like that <code>&lt;body class="ff3.5 ff win gecko some-awesome-icons-article-with-100-icons"&gt;</code>) I don't know how that is called...? Do you know what I mean and have you a link/name of it? The path to the article set as css-body-class is more important for me than for example the browser or OS.</p>
javascript jquery
[3, 5]
2,566,411
2,566,412
TryParse inside of a for loop throws an error
<p>I am trying to set some boolean values at the start of a for loop but it is throwing an 'Object reference not set to an instance of an object' error on my ASP.NET page.</p> <p>Here is the code:</p> <pre><code>for (int i = 0; i &lt; length ; i++) { bool res = int.TryParse(Array[i],out num1); bool res2 = Array[i].StartsWith("AA"); //The rest of the code } </code></pre> <p>So I can't seem to figure out why I am getting this error. I have commented out both res and res2 and they both throw the error. I thought that TryParse would only return a True/False value as well as StartsWith.</p> <p>Any Thoughts?</p>
c# asp.net
[0, 9]