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
3,127,247
3,127,248
pass the id of textbox to dropdownliast onchange event in javascript
<p>I have a dropdownlist defined:</p> <pre><code> &lt;asp:DropDownList Width="300px" ID="PlaceHoldersDropDownList" runat="server" AppendDataBoundItems="True" TabIndex="3" onchange="PasteTextInEditor (this.options[this.selectedIndex].value), '&lt;%= SubjectTextBox.ClientID %&gt;'" &gt; </code></pre> <p>So, I pass the selected text and a textbox ID to a javascript function. The text box is defined as:</p> <pre><code> &lt;asp:TextBox Width="660px" ID="SubjectTextBox" Text='&lt;%# Bind( "Subject") %&gt;' runat="server" TabIndex="4" MaxLength="100"&gt; &lt;/asp:TextBox&gt; </code></pre> <p>So, in script function, when i put alert like this :</p> <pre><code> alert(text); //shows selected value alert(editor); // shows undefined </code></pre> <p>So editor value is turning up undefined. So, can you please let me know the mistake I've been doing. I would like to save that value selected from dropdown into textbox.Please help me fixing th eproblem. Thank You</p>
javascript asp.net
[3, 9]
801,498
801,499
Understanding Java syntax of GridView gridview = (GridView) findViewById(R.id.gridview);
<p>In the android tutorials, The <a href="http://developer.android.com/resources/tutorials/views/hello-gridview.html" rel="nofollow">GridView tutorial</a> to be exact, there is a line of code</p> <pre><code>GridView gridview = (GridView) findViewById(R.id.gridview); </code></pre> <p>Which looks to be declaring/instantiating a GridView object named, gridview and assigning from ... (GridView) </p> <p>Now is the (GridView) in parens, the expected return type of findViewById or is it telling where to find <code>findViewById</code> since that doesn't appear to be connected to an object (although, it would appear to be a member function of a GridView object)??</p> <p>I believe that the <a href="http://developer.android.com/reference/android/app/Activity.html#findViewById%28int%29" rel="nofollow">findViewById</a> returns an object of type GridView specified by the resource id of gridview (that we specied in main.xml) and probably now exists after we, earlier, called <code>setContentView(R.layout.main);</code></p> <p>So, what is being specified with the <code>(GridView)</code> part of the syntax and what is specifically meant by the parenthesis?</p>
java android
[1, 4]
2,200,282
2,200,283
How create a synchronized voting service?
<p>I have a project i am working on.</p> <p>What i want to do is have a voting service. That people with the application installed can vote on a article or an item. and it will sync with other's application to see how many times it was voted.</p> <p>or could i implement a like on facebook and it would be easier?</p>
java android
[1, 4]
3,905,973
3,905,974
C# version of Javascript Date.getTime()
<p>What is the best way in c# to get the same result of javascript date.gettime() call?</p> <blockquote> <p>The getTime() method returns the number of milliseconds since midnight of January 1, 1970 and the specified date.</p> </blockquote>
c# javascript
[0, 3]
1,374,185
1,374,186
Simplifiying variables in jQuery
<p>How do I simplify the following code?</p> <p>It is just a static ID.</p> <pre><code>&lt;script&gt; $x('input[id="id1"]').attr('checked', true); $x('input[id="idx4"]').attr('checked', true); $x('input[id="idk5"]').attr('checked', true); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,439,771
3,439,772
Send array in JS to php
<p>I'm trying to do something similar to this <a href="http://stackoverflow.com/questions/2793891/send-selects-values-in-array">question</a>. I want to send to the server the id's of the selected checkboxes. I'm using jquery only because the example. my ajax code is pure JS.</p> <p>This is my code:</p> <p>js:</p> <pre><code>function DeleteTest(ind) { if (confirm('Are you sure you want to delete this test?')) { ​ $(function() { var testdel = $('input[name=deletetest]').serialize(); alert(testdel); window.open('test.php' + "?"+testdel,'_self'); } ​); return true;} else { return false;} } oCell.innerHTML = "&lt;input type='checkbox' name='deletetest' value='"+ ind + "')';&gt;"; // create checkbox for each row in ajax </code></pre> <p>html:</p> <pre><code>&lt;form id="checkboxform" action="test.php" method="post"&gt; &lt;tbody id="auditTblBody"&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;input type="button" value="Submit AJAX Request" onclick="DeleteTest()" /&gt; &lt;/form&gt; </code></pre> <p>With this code i get only one value with GET.<code>testdel</code> is fine. (i.e <code>deletetest=477&amp;deletetest=476</code>) my problem is how to send this information.</p> <p>thank you!</p>
php javascript
[2, 3]
3,948,160
3,948,161
How to fit long text in a button?
<p>My button is fixed size height. I need it to be like the text on the left on my picture below. Now it's like on the right. I've tried every gravity option but no result. Is there a way to accomplish this?</p> <p><a href="http://i.imgur.com/blDVA1D.jpg" rel="nofollow">http://i.imgur.com/blDVA1D.jpg</a></p>
java android
[1, 4]
1,264,608
1,264,609
Check if javascript file was loaded
<p>I am loading the following javascript files from a CDN. Is there any way I can check if these have been loaded correctly and if not, load them from a local folder?</p> <p><a href="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js</a> http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.min.js <a href="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js</a></p> <p>I know I can check the jquery file but not sure about the others. Any tips?</p>
javascript jquery
[3, 5]
5,511,140
5,511,141
How to split the content of a DIV tag to multiple DIVs?
<p>I have a <code>DIV</code>tag with specific Width and height attributes.</p> <pre><code>&lt;div style="width:793px;height:1096px"&gt; A long text and pictures&lt;/div&gt; </code></pre> <p>I want to separate the <code>DIV tag</code> to multiple <code>DIV tags</code> when the lines and pictures are exceeded the first <code>DIV</code> and want to show the remaining text and pictures in next <code>DIV</code> instead of having overflow and scrolling.</p> <p>how to do it?</p>
javascript jquery asp.net
[3, 5, 9]
983,933
983,934
Why should I learn C#?
<p>I want to know why I should learn C#? </p> <p>What features does C# have that Java does not?</p>
c# java
[0, 1]
2,564,411
2,564,412
cannot send email from global.asax
<p>I'd like to simply get notified for site errors, and I've this straight forward code that does work everywhere in the application except in global.asax!!</p> <pre><code>void Application_Error(object sender, EventArgs e) { UIHelper.SendErrorMessage(Server.GetLastError()); } </code></pre> <p>code in another project:</p> <pre><code>public static void SendErrorMessage(Exception ex) { MailMessage errorMessage = new MailMessage(); errorMessage.From = new MailAddress("[email protected]", "Site Errors"); errorMessage.Subject = "Error in sending overseas user"; errorMessage.CC.Add(new MailAddress("[email protected]", "xxxxx")); //test only StringBuilder sb = new StringBuilder(); sb.AppendFormat("Source:{0}\n", ex.Source); sb.AppendFormat("Message:{0}\n", ex.Message); sb.AppendFormat("Stack Trace:{0}\n", ex.StackTrace); sb.AppendFormat("Inner Exception:{0}\n", ex.InnerException == null ? string.Empty : ex.InnerException.Message); errorMessage.Body = sb.ToString(); errorMessage.IsBodyHtml = false; var smtp = new SmtpClient(); try { smtp.Send(errorMessage); } catch { } } </code></pre> <p>Update: I've wrote logic to write the exception to a file in a folder in my website, and I tried that logic in my dev box and it worked, but it never works in the Host!! this is drives me crazy! Email logic works in my box, file logging works in my box but none of them works in production?! this is really strange... any thoughts?</p>
c# asp.net
[0, 9]
435,378
435,379
JavaScript Closures and Memory Leaks
<p>I read in Jquery in Action that memory leaks can result from javascript closures.</p> <p>"Unintended closures can have unintended consequences. For example, circular references can lead to memory leaks. A classic example of this is the creation of DOM elements that refer back to closure variables, preventing those variables from being reclaimed."</p> <p>could somebody give an example of this?</p> <p>thank you!</p>
javascript jquery
[3, 5]
1,816,634
1,816,635
Getting values from dictionary
<p>I have a Dictionary&lt;int, int&gt; in my class. How can I access both values without knowing the key?</p> <p>For instance, I want to be able to do something like this: If the dictionary contains Dictionary&lt;int, int&gt;<br> and the values are &lt;5, 4&gt;<br> I want to be able to get the value of &lt;(this),(this)&gt; like</p> <p>Pseudo code:</p> <pre><code>foreach(Dictionary item or row) { my first int = Dictionary&lt;(this), (not this)&gt; my second int = Dictionary&lt;(not this), (this)&gt; } </code></pre> <p>How can I do this using a dictionary? If this is not doable: Is there another way?</p>
c# asp.net
[0, 9]
15,419
15,420
Field loses value from JS function if I click outside the field with mouse
<pre><code>$(document).ready(function(){ $('#id_laufzeit_bis').datepicker().on('changeDate', recalculate_deadline); $('#id_kuendigungsfrist').change(recalculate_deadline); $('#id_kuendigungsfrist_type').change(recalculate_deadline); $('#id_kuendigung_moeglichbis').change(check_reminder_date); $('#id_erinnerung_am').datepicker().one('hide', check_reminder_date); }); </code></pre> <p>THIS:</p> <pre><code>$('#id_erinnerung_am').datepicker().one('hide', check_reminder_date); </code></pre> <p>loses value from <code>check_reminder_date</code> function and set default value of datepicker - Today's date(after If however I click outside the field with my mouse). How to fix it?</p>
javascript jquery
[3, 5]
1,397,565
1,397,566
jquery exit function in ajax call
<p>I have a javascript function. and in there, I insert a ajax call function using jquery.</p> <p>depends on ajax call result, I want to exit hi function.</p> <p>is there anyway to do this?</p> <pre><code>function hi() { $.ajax({ url: "/shop/haveItem", type: "GET", async:false, success: function(data){ if(data == '1') //exit hi() function } }); //some executable code when data is not '1' ... } </code></pre>
javascript jquery
[3, 5]
5,958,446
5,958,447
How to add native project and use native function in other c++ project
<p>I am working on android project.I have created a native edittext.I want use native jni function in other android c++ project for display the edittext in c++.whenever i add the headerfile of jni and edittext,then compiler does not find.</p> <p>Can you suggest me.how to add native edittext project with my own project and how to use jni function with c++. Your suggestion will helpful.</p>
android c++
[4, 6]
5,926,228
5,926,229
getting columns values using row id jquery
<p>I have a jaquery code like this:</p> <pre><code>var items = $('.trSelected', grid); </code></pre> <p>where items is comma seperated list of rows (tr tags) like this:</p> <pre><code>row25 row30 </code></pre> <p>I want to to get 6th and 8th column ( td) value of these rows. How to do it using jquery.</p> <p>I can iterate through items like this:</p> <pre><code>for (i = 0; i &lt; items.length; i++) { itemList += items[i].id; // gives row id } </code></pre>
javascript jquery
[3, 5]
1,861,166
1,861,167
Calling Java from Python
<p>I have a Java app that takes a long time to be initialized (so I can't use a command-line like interface) and I need to pass text and receive the output of a Java method from Python. Is it possible to load the Java application, have it open all the time the Python script runs and use a method from that app?</p>
java python
[1, 7]
683,222
683,223
How to I rewrite this so that its not a random number search?
<p>Im new to jquery, how would I re-write this string so that it displayed a result of 60 each time?</p> <pre><code>var i = Math.ceil(Math.random()*60) </code></pre> <p>thanks</p>
javascript jquery
[3, 5]
2,290,660
2,290,661
XML Serialization and null value - C#
<p>I have an object that I serialize to XML. If one of the properties in the object is null, then native serialization ignores to add this as the attribute. Is this normal behavior, if so, is there a way I can override it?</p> <p>ex:</p> <pre><code>public class Test { [XmlAttribute] public string value {set; get; } [XmlAttribute] public string key {set; get; } } </code></pre> <p>When value is null, i get</p> <pre><code>&lt;Root&gt; &lt;Test key="blah"&gt; &lt;/Root&gt; </code></pre>
c# asp.net
[0, 9]
246,852
246,853
PHP/ JS File Upload Progress Bar
<p>How do I create a file upload progress bar similar to getdropbox.com using PHP and/or JavaScript?</p> <p>Thanks, -Giles</p>
php javascript
[2, 3]
1,231,687
1,231,688
get Time Zone using latitude and longitude?
<p>I having current latitude and longitude and I want the Time Zone from that latitude and longitude. (I want that this latitude and longitude from which Time Zone)</p> <p>I want output like.</p> <pre><code>Latitude:22.5726460 Longitude:88.3638950 </code></pre> <p>This is latitude longitude of Kolkata,india and when I have this lat long I want Asia/Kolkata(as Output)</p> <p>Please suggest any api or any idea which can solve out my problem </p>
php iphone
[2, 8]
1,808,465
1,808,466
php run javascript code
<p>is it possible to run some javascript expression? for example <code>echo eval("Math.sqrt('25')");</code></p>
php javascript
[2, 3]
2,117,352
2,117,353
Show a clock on jsp
<p>I want to show clock on jsp file, the time is fetched from server and is in <code>05 Jun, 2012 12:48:23 PM</code> format I want the same time to be updated rather than taking client time.</p> <p>i did tried my hands on <code>timer.js</code>, <code>jtimer</code> and some other API's to do the same. I can do it by splitting the things and writing the whole clock logic myself but want to reuse the API that has already been developed.</p>
javascript jquery
[3, 5]
3,591,975
3,591,976
Add a 'loading' gif when an image is loaded
<p>How can l use jQuery to add a loading gif file when an image is loaded, without do it in code behind? For example to this line? Pls help.</p> <pre><code>&lt;asp:HyperLink ID="hprImage" runat="server" NavigateUrl='&lt;%# Eval("WebAddress")%&gt;' ImageUrl='&lt;%# ReturnFilePath((Eval("FileName")).ToString()) %&gt;' Target="_blank"&gt;&lt;/asp:HyperLink&gt; </code></pre>
jquery asp.net
[5, 9]
3,572,409
3,572,410
Cannot allow duplicate enty in textboxes using jquery
<p>i have a text boxes in every row with same name like this</p> <pre><code> &lt;tr&gt; &lt;g:textField name ="point" value = "" class = "destination_points" id ="point_0" /&gt; &lt;input type ="hidden" value ="" name ="pointDistanceMapping.point.id" id ="point_id_0" class="point_id"/&gt; &lt;/tr&gt; &lt;tr&gt; &lt;g:textField name ="point" value = "" class = "destination_points" id ="point_1" /&gt; &lt;input type ="hidden" value ="" name ="pointDistanceMapping.point.id" id ="point_id_1" class="point_id"/&gt; &lt;/tr&gt; &lt;tr&gt; </code></pre> <p>i have to validate that these text boxes should not have same value so how can i do it using jquery...</p>
javascript jquery
[3, 5]
5,579,983
5,579,984
How to get javascript confirm box after validating the form data in asp.net?
<p>I am facing a problem in my asp.net web application that i need to display a java script confirmation box on click of <strong>Update</strong> button and this as per requirements given to me.</p> <p>Currently I am using onclient click</p> <pre><code>&lt;asp:Button ID="btnCustomerUpdate" runat="server" CssClass="applybuttonstyle" Text="Update" onclick="btnCustomerUpdate_Click" OnClientClick="return confirm('Do you really want to update?');"/&gt; </code></pre> <p>It's working fine but the problem is i also applied some validation controls on my form fields so if a user leave any field blank and click update button then it shows javascript confirm box and the validation message below that form field.</p> <p>And it is not desired behavior it should not show the confirmation box until unless all validation are passed.</p> <p>I hope this is due to because i am using this on client click so please tell me a better solution for that.</p> <p>Thanks in advance.</p>
c# javascript asp.net
[0, 3, 9]
3,749,495
3,749,496
Change a javascript function to a jquery
<p>I am using Jquery to load a page into a div. The page the gets loaded is using a javascript. How can i change the javascript shown below into a jquery</p> <pre><code>window.onload = function(){ new JsDatePick({ useMode:2, target:"AdddueBy", dateFormat:"%d-%m-%Y" }); new JsDatePick({ useMode:2, target:"bDob", dateFormat:"%d-%m-%Y" }); new JsDatePick({ useMode:2, target:"gDob", dateFormat:"%d-%m-%Y" }); }; </code></pre>
php javascript jquery
[2, 3, 5]
1,594,115
1,594,116
how to add an OnClick event on DropDownList's ListItem that is added dynamically?
<p>Say I have the following code:</p> <pre><code> DropDownList changesList = new DropDownList(); ListItem item; item = new ListItem(); item.Text = "go to google.com"; changesList.Items.Add(item); </code></pre> <p>How do you dynamically add an OnClick event to <code>item</code> so that google.com will be visited after clicking on the <code>item</code>?</p>
c# asp.net
[0, 9]
5,266,578
5,266,579
Auto Click a button on a web page
<p>I need to auto click a button on a web page. Basically i have a user interface to see the logs of the network printer. This page already has a option 'Save in CSV Format'.When i click this, i get a popup box which asks if you want to run or save that file. </p> <p>The issue is: I am creating another web page where i want that if a user clicks on 'Clickme' button, he automatically gets that popup box, which appears when i click on the 'Save in CSV Format' in that User Interface. Using HTTPFOX, i found out that 'Save in CSV Format' has this detail:</p> <pre><code>&lt;td bgcolor="#333333" height="27" align="right"&gt;&lt;input type="button" value="Save in CSV Format... " onClick="get_loglist()"&gt;&lt;/td&gt; </code></pre> <p>Is there any way i can do this? Thanks in advance. </p>
php javascript
[2, 3]
2,221,717
2,221,718
How do I compare two JQuery objects for identity?
<p>I'm trying to use Jquery to open / close control 'boxes' on a webpage. Unfortunately, it doesn't look very good to close a box just to re-open it if the user happens to click on the already opened box. (Boxes are mutually exclusive).</p> <p>The code I'm using doesn't work, and I'm not sure why. I still get a box closing just to open up anew, which isn't the desired functionality. I created the 'val' variable for debugging purposes; in the debugger, it shows 'val' as having the exact same value as $(this), which should prevent it from getting to the .slideToggle inside the if statement, but doesn't.</p> <pre><code>function openBox(index) { val=$('#box'+index); $('.profilePageContentBox').each(function(){ if($(this).css('display')!='none') { if($(this)!=val) $(this).slideToggle(200); } }); val.slideToggle(200); } </code></pre>
javascript jquery
[3, 5]
580,264
580,265
How to add a class to element in Jquery and then trigger event based on that class
<p>I have some jqeury code that programatically adds a class to an element on document ready. The issue i am having is how to then listen for elements with that class being clicked.</p> <pre><code>&lt;li&gt;&lt;a href="#" id="btnDeleteGroup" class="disabled"&gt;Delete Node&lt;/a&gt;&lt;/li&gt; $(document).ready(function () { $('a.deleteGroup').click(function (e) { alert("deleteGroup"); }); $('#btnDeleteGroup').removeClass("disabled"); $('#btnDeleteGroup').addClass("deleteGroup"); }); </code></pre>
javascript jquery
[3, 5]
1,420,170
1,420,171
How to fetch all the browser names installed on android mobile
<p>I am new to android application development.</p> <p>I want to fetch the list of installed browser names on android mobile through the application. How can I do that?</p>
java android
[1, 4]
902,654
902,655
Call a Java app with a parameter but never wait for the answer
<p>What I want to do is when an user logs in to call a Java app from the PHP server. The app to index some content and process it and save it to a database. But what I want to really do, is to call it and nevermind what it does and never wait for the answer. Like a cronjob on demand. Is this possible?</p> <p>UPDATE:</p> <p>Is shell_exec a solution? $res = shell_exec('java Myprogram'); </p>
java php
[1, 2]
1,936,130
1,936,131
Get Inner HTML of Multiple Elements
<p>I want to get the content of multiple Spans. Here is my code:</p> <p><a href="http://jsfiddle.net/4XumV/" rel="nofollow">http://jsfiddle.net/4XumV/</a></p> <p>It's supposed to give me "111, 222, 333, 444". It gives me "undefined" instead.</p> <p>What's wrong with my code?</p>
javascript jquery
[3, 5]
1,991,512
1,991,513
android: file does not stay written
<p>Here are the relevant bits of my code</p> <pre><code>public void Toast(String text) { Toast toast = Toast.makeText(this,text, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL, 0, 0); toast.show(); } //Within another function File rootPath = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); if(!rootPath.exists()) { if(!rootPath.mkdir()) { Toast("Failed to create directory"); return; } } File file = new File(rootPath,"rtsd.csv"); String p = file.getAbsolutePath(); BufferedWriter f = new BufferedWriter(new FileWriter(file,true)); Toast(data); f.write(data); f.flush(); f.close(); MediaScannerConnection.scanFile(this.getBaseContext(), new String[]{p}, null, null); FileReader fIn = new FileReader(file); CharBuffer buffer = CharBuffer.allocate((int)file.length()); fIn.read(buffer); fIn.close(); Toast("Read Test\n"+buffer.toString()+"\nFrom\n"+p); Toast("Submission Successful"); </code></pre> <p>I was having trouble with another part of this application that relied on this writing correctly, so i decided to see what the writing section had to say about it. One would think that it my it would toast back whatever i just wrote to it. but instead, it just reads back a blank line. Is there any possible reason for this? I have set permissions correctly, and i can even view the file when i plug the device into USB, but the application seems to be unable to read any file it writes. Thanks in advance for any help.</p>
java android
[1, 4]
2,388,913
2,388,914
Image to Binary on Java Android
<p>How to convert image from SDCard to binary and send it to Oracle Database. </p> <p>I can't do a </p> <pre><code>import android.javax.imageio.*; </code></pre> <p>on my Eclipse. </p> <p>Is there a complete source code from which I can learn.</p>
java android
[1, 4]
5,295,197
5,295,198
PyQt4 plugin in c++ application
<p>How is it posible to load python script as plugin in qt based application?</p> <p>The basic idea would be to make a class in c++</p> <p><code> class b { virtual void method1(); virtual void method2(); } </code></p> <p>and 'somehow' inherit it in python like</p> <p><code> class c(b): def method1: #do something def method2: #do something </code></p> <p>I need to be able to modify the gui from python( add buttons to some widgets made in c++ with qt ). Basicaly something similiar to (gedit, blender, etc) plugin architecture with qt</p>
c++ python
[6, 7]
3,219,059
3,219,060
How to execute multiple functions on mutliple objects at the same time in javascript?
<p>Say I have 5 different javascript timers that start ticking when I click "start", each are referenced in variable timer1, timer2, timer3, timer4, timer5.</p> <p>If these timers were each in an array, I would have to do something like this in pseudocode:</p> <pre><code>foreach timer in timerarray { timer.stop; timer.setstoptime(time that it stopped); } </code></pre> <p>The issue here is that if I were to get "getstoptime", due to having to iterate through the array for each timer, all the timers would have different values for the time that they stopped. Is there some way to keep track of all the timers and make it such that when I click on stop, if I were to be able to retrieve their stop time, all of them would be identical?</p> <p>I know this is unlikely to happen with javascript iterating through arrays very fast, but because the array has to iterate, there is a small time gap before each timer stops. </p> <p>I am looking for a way to ensure that all get "stop" executed on them simultaneously. If someone can provide some kind of sample code and some recommendation how to ensure this happens would be great. </p>
javascript jquery
[3, 5]
2,684,488
2,684,489
Why does this work for IE but not for Firefox or Chrome?
<p>I have created a signfield in javascript and php. The User can write in the field with the mouse. Javascript reads out the coordinates and sends them to a php script wich generates an image. a new image is created every time the mouse is moved and it is moved into a div via javascript. The problem is, that this works fine for IE 8, but it doesn't for Firfox or Chrome. Here is the relevant part of my code:</p> <pre><code>.mousemove(function(e) { if(mouseDown) { //alert("debug"); //$("#debug").html($("#debug").html() + e.pageX + ", " + e.pageY + "&lt;br&gt;"); coordhdl.addCords(e.pageX - this.offsetLeft, e.pageY - this.offsetTop); //$('#test').load('showCoordinates.php'); var coordinations = coordhdl.getCords(); $('#signature').remove(); //IMPORTANT LINE: $('#test').prepend('&lt;img id="signature" src="showCoordinates.php?cords=' + coordinations + '" alt="braso"'); } }); </code></pre> <p>I also tried to load an image that is on the filesystem instead using the php script. That doesn't work either. So the problem can't be the communication between the javascript and the php script.</p>
php javascript jquery
[2, 3, 5]
1,068,195
1,068,196
Implicit super constructor LoginActivity() is undefined for default constructor. Must define an explicit constructor
<pre><code>public class Utils extends LoginActivity{ public static String postData(String url, Map&lt;String , String&gt; params, Context context) { String responseString=null; </code></pre> <p>the above one is child class and below one is parent class and i am getting error at</p> <pre><code>public class LoginActivity extends BaseActivity implements OnClickListener, OnKeyListener { private final Activity activity; private final Context context; private final String lisnId; public LoginActivity(Activity activity, Context context, String lisnId){ this.activity=activity; this.context = context; this.lisnId = lisnId; } </code></pre>
java android
[1, 4]
1,927,162
1,927,163
Play audio when user exits my website
<p>I am wondering if there's a way to play audio when user exit my website?</p> <p>for example. "thanks for visiting etc."</p>
javascript jquery
[3, 5]
3,861,175
3,861,176
Something is wrong with my javascript script with arrays
<p>so basically my javascript array script looks like -</p> <pre><code>cars = $('#bike').val(); var priceone = document.documentElement.getAttribute('priceone'); var pricetwo = document.documentElement.getAttribute('pricetwo'); var pricethree = document.documentElement.getAttribute('pricethree'); var pricefour = document.documentElement.getAttribute('pricefour'); var pricefive = document.documentElement.getAttribute('pricefive'); var pricesix = document.documentElement.getAttribute('pricesix'); var priceseven = document.documentElement.getAttribute('priceseven'); var priceeight = document.documentElement.getAttribute('priceeight'); var pricenine = document.documentElement.getAttribute('pricenine'); var priceMatrix = { cars: { 1: { t1: priceone, t2: pricetwo, t3: pricethree }, 2: { t1: pricefour, t2: pricefive, t3: pricesix }, 3: { t1: priceseven, t2: priceeight, t3: pricenine } } }; </code></pre> <p>Maybe anyone have an idea, why the priceMatrix array, doesn't work? How should I insert all the variables into array, so it would work? The cars: is variable cars defined at top of the script and the priceone, pricetwo... pricenine are variables that are defined at top too. Hope you can help. If possible please write, how should I define var cars in javascript mode, so it takes the select fields value too. Here is the script, so you can cehck it - <a href="http://jsfiddle.net/tSsvb/2/" rel="nofollow">http://jsfiddle.net/tSsvb/2/</a> .</p>
javascript jquery
[3, 5]
2,653,906
2,653,907
Putextras not working
<p>I have multiple variables to pass from one activity to another. </p> <p>I have this in the first activity:</p> <pre><code>public void onClick(View v) { switch(v.getId()){ case R.id.bStartGame: Intent i = new Intent(StartScreen.this, GameScreen.class); Bundle extras = new Bundle(); extras.putString("Name 0", sName0); extras.putString("Name 1", sName1); extras.putString("Name 2", sName2); . . . i.putExtras(extras); StartScreen.this.startActivity(i); finish(); break; </code></pre> <p>In the second activity, I have this:</p> <pre><code> Intent i = getIntent(); Bundle extras = i.getExtras(); String name0 = extras.getString("Name 0"); TextView test = (TextView) findViewById(R.id.tvTEST); test.setText(name0); </code></pre> <p>However, the textview shows nothing when I do this. How can I fix this?</p> <p>EDIT: In the first activity I have:</p> <pre><code> name0 = (EditText) findViewById(R.id.etName0); sName0 = name0.getText().toString(); </code></pre> <p>and the same for all the other names with their relevant references.</p> <p>Also, just for clarification, name0 is the edittext, sName0 is the string and "Name 0" is the key.</p>
java android
[1, 4]
2,042,730
2,042,731
JavaScript <%= MyProperty %>
<p>What are the restrictions in using such a construction in JavaScript. In my codeBehind I have property and on the get it has got quite complex logic. It invokes other methods and so on and I get as a result empty string despite that while debugging it is shown to return good value. I wonder what can I do as this type of code run in on render method. </p>
javascript asp.net
[3, 9]
286,911
286,912
Jquery - Pseudo-recursive function with "this" element
<p>I'm trying to apply a cool animation effect on a list with Jquery using a pseudo-recursive function.</p> <p>It works pretty well for the first item, but after the first loop, the <code>this</code> which was selecting <code>#column-left section</code> becomes the <code>li</code> so of course, the function does not find the next <code>li:hidden</code> because it is already inside. Is there a way for me to come back to my original <code>this</code> once the "this" has changed or maybe do something different ?</p> <pre><code>$("#column-left section").mouseenter(function fadeItem(){ console.log(this); $(this).find('ul li:hidden:first').delay(500).fadeIn(fadeItem); }); </code></pre> <p>Thank you very much for your help.</p>
javascript jquery
[3, 5]
716,383
716,384
how can I call a stored procedure in SQL Database from Android?
<p>Can someone please help me to have the code or a simple example how to connect to database and how to call a procedure from my Database. I'm a beginner :S thanks for any help.</p>
java android
[1, 4]
1,685,225
1,685,226
setTimeout delay not functioning - what have I done wrong?
<p>I've put together a piece of code for a drop-down menu, bound to <code>.hover()</code>, however unfortunately the delay on <code>setTimeout()</code> doesn't seem to work and as soon as the mouse is moved from <code>.button</code>, it sets the display property of <code>#sub-nav</code> to <code>none</code>.</p> <p>Dreamweaver CS 5.5 evaluates the syntax as correct :(.</p> <p><strong>Here's my code:</strong></p> <pre><code>function retract(){ $('#sub-nav').css('display', 'none'); } $('#header-restrict &gt; .button').hover( function() { if($(this).html() == "Offers") { $('#sub-nav').css('display', 'block'); $('#sub-nav').html('&lt;a href="#"&gt;Add a New Offer&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="#"&gt;Edit an Offer&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="#"&gt;Get Offer Links&lt;/a&gt;'); } if($(this).html() == "Rotations") { $('#sub-nav').css('display', 'block'); $('#sub-nav').html('&lt;a href="#"&gt;Add a New Rotation&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="#"&gt;Edit a Rotation&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="#"&gt;Get Rotation Links&lt;/a&gt;'); } }, function() { setTimeout(retract(), 4000); }); </code></pre> <p>If anyone could comment on/answer as to why the delay doesn't seem to be working, it would be greatly appreciated!</p>
javascript jquery
[3, 5]
5,704,323
5,704,324
javascript make form dissapear after submitting
<p>I have a form on a html page, with a submit button.</p> <pre><code>&lt;div id="tt"&gt; &lt;form method="post" action="time.php"&gt; &lt;input type="text" name="c"&gt;&lt;br&gt; &lt;INPUT TYPE="submit" VALUE="givetime"&gt;&lt;/FORM&gt; &lt;/div&gt; </code></pre> <p>time.php is just an echo of the current time. </p> <p>I have ajax code which returns:</p> <pre><code>if(ajaxRequest.readyState == 4){ document.myForm.tt.innerHTML= ajaxRequest.responseText; } </code></pre> <p>I don't want to use jquery for this as I want to see if it possible this harder way first...Any idea why this is not working?</p>
php javascript
[2, 3]
4,145,710
4,145,711
Display number of checked checkboxes in jQuery
<p>I am quite new to jQuery, I think this might be quite easy for many of you, but I can't seem to make it work. How can I display the number of checkboxes so that the value increases or decreases. </p> <p>i tried the following but with the number in the span tag remains 0: <a href="http://jsfiddle.net/yunowork/NTwxc/" rel="nofollow">http://jsfiddle.net/yunowork/NTwxc/</a></p> <p>Thanks</p>
javascript jquery
[3, 5]
5,370,401
5,370,402
How to enable and disable back button using JavaScript
<p>I am using VS 2010.</p> <p>I use two links to go back/forward between pages.</p> <p><strong>Code:</strong></p> <pre><code>&lt;a href="#" onclick="history.go(-1);return false"&gt;&lt;img src="Images/back.jpg" /&gt;&lt;/a&gt; &lt;a href="#" onclick="history.go(1);return false"&gt;&lt;img src="Images/forward1.jpg"/&gt;&lt;/a&gt; </code></pre> <p>It works well. Now I want to enable and disable the links based on browser history.</p> <p>How do I do this using JavaScript?</p>
javascript asp.net
[3, 9]
4,590,474
4,590,475
Recognize the backspace and spacebar with jQuery
<p>when a user clicks the spacebar or backspace I need to create a variable that stores the action so I can use it to manipulate an array. I want the backspace to delete a value in an array and the spacebar to create a space. How can I do this?</p>
javascript jquery
[3, 5]
4,038,599
4,038,600
iPhone Jquery run function on confirm = true
<p>I'm using html / jquery to make my phone list, and I want to have a confirm dialog to do the action, but even if I tap cancel, the action is fired...</p> <p>also, is there any chance of using jquery and cycript together?</p> <p>Thanks</p> <pre><code>$(".btns_numeros").click(function() { confirmacao($(this).attr('id')); }); // function confirmacao(numero) { var resposta = confirm ("Ligar para "+numero+" ?"); if (resposta) { var ligar = "&lt;a href='tel:"+numero+"'&gt;&lt;/a&gt;"; window.location.href = ligar; } else { </code></pre> <p>event.preventDefault();</p> <pre><code> return false; } } </code></pre>
jquery iphone
[5, 8]
117,513
117,514
Finding the data inside a word document
<p>In my project which I'm doing, I have to find if my word document consists of any image or table. Is there any way to do that using c# code. I couldn't find any code related to this.</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
1,019,700
1,019,701
Bizarre error with Response.Redirect
<p>I get the following error when trying to use Response.Redirect in one of my ASP.NET pages:</p> <pre><code>[ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: offset] System.Web.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) +8858392 System.Web.HttpResponseStreamFilterSink.Write(Byte[] buffer, Int32 offset, Int32 count) +30 System.Web.HttpWriter.Filter(Boolean finalFiltering) +8754611 System.Web.HttpResponse.FilterOutput() +82 System.Web.ApplicationStepManager.ResumeSteps(Exception error) +501 System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +123 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +379 </code></pre> <p>I've never seen this before. It is happening if I Response.Redirect during the Page Load event.</p> <p>Any Ideas?</p> <p>EDIT: It's not my code, This is happening if I were to just stick Response.Redirect by itself in Page_Load.</p> <p>EDIT #2: Using a 302 FOUND header works fine, but isn't that what response.redirect is supposed to do anyways?</p>
c# asp.net
[0, 9]
2,518,374
2,518,375
jQuery .append() does not work from .js file
<p>I have the following line of code:</p> <pre><code>$('#text').append('&lt;h2 style="color:white"&gt;afdghadfg&lt;/h2&gt;'); </code></pre> <p>If I paste this code inside of a script tag in the html, it works fine. However, when placed inside a .js file it does nothing. </p> <p>Know that the .js file has plenty of other working javascript and jQuery code, it is only this line that won't work.</p>
javascript jquery
[3, 5]
4,428,785
4,428,786
JQuery to show the file path on different input tag
<p>I have a file input and an <code>Apply to all</code> button. If I click on the button, the location in the file field should be shown on a different file field. It should be done using JQuery. Please help.</p> <pre><code>$("input[name='option_image[]']").each( function (){ $(this).val($("#bulk_image").val()); }); </code></pre>
javascript jquery
[3, 5]
4,121,147
4,121,148
Data list binding with some text and validating datalist
<p>I am using this code for datalist validation.</p> <p>I am binding the image in datalist after that i am trying to give the caption to each image suppose there is 3 image is datalist then for the first image i am able to give but for the other one i am unable to.. i think there is some error in conditions help me in this. code is following..</p> <pre><code>if (DataList1.Items.Count == 0) { msgError.Text = "Please add images and captions for each image"; msgError.Focus(); } else AddCaption(); bool IsEmptyCaption = false; Hashtable htble = (Hashtable)ViewState["imgIdCapHtbl"]; List&lt;int&gt; imgIds = (List&lt;int&gt;)ViewState["imgIds"]; if (htble != null &amp;&amp; imgIds != null) { foreach (int id in imgIds) { if (htble[id] == "") { IsEmptyCaption = true; break; } else IsEmptyCaption = false; } } else IsEmptyCaption = true; if (DataList1.Items.Count == 0) { msgError.Text = "Please add images"; msgError.Focus(); } else if (IsEmptyCaption) { msgError.Text = "Please add captions for each image"; msgError.Focus(); } else { Args[0] = "Section1"; Args[1] = ""; Args[2] = FindingId.ToString(); Args[3] = FindingIdIns.ToString(); AnotherHeading = false; //AddCaption(); objGetBaseCase.UpdateImageCaptions((Hashtable)ViewState["imgIdCapHtbl"]); if (AddFindingsViewerDetails != null) AddFindingsViewerDetails(Args, e); ClearImages(); PageContent pg = (PageContent)this.Parent.FindControl("PageContent"); if (pg != null) pg.LoadWorkflowForCase(); if (Display != null) Display(null, EventArgs.Empty); } </code></pre>
c# asp.net
[0, 9]
1,074,966
1,074,967
UserControl pass Value to MasterPage Content
<p>I am coding in a userControl, </p> <p>how can I pass text to a control I placed in one of the contents?</p> <p>It's a literal by the way</p> <p>Thank you</p>
c# asp.net
[0, 9]
5,212,611
5,212,612
dynamically change alternate row colors
<p>I have 5 tr, these are row alternate color. Now how to change tr color dynamically when I delete some row.</p> <p>Assume below is table tr and td</p> <p>this is my row </p> <pre><code>tr class='odd' tr class='even' tr class='odd' tr class='even' tr class='odd' tr class='even' tr class='odd' tr class='odd' tr class='even' if I delete this tr, than tr class='odd' tr class='even' tr class='odd' tr class='even' tr class='odd' tr class='odd' tr class='even' class changed odd to even tr class='odd' class changed even to odd tr class='even' class changed odd to even tr class='odd' class changed even to odd tr class='even' tr class='odd' </code></pre>
javascript jquery
[3, 5]
3,417,061
3,417,062
How to use Global Varabile in Aspx file?
<p>Say I have a global class:</p> <pre><code> static class GlobalOfficeSetting { public static bool PatientRegistation_DialogOnly = true; } </code></pre> <p>Or let's say if I store the global variable in below instead:</p> <pre><code>Application("PatientRegistation_DialogOnly") = true </code></pre> <p>Then how will I able to call them out in aspx? Because I want to use that as a global setting for all users to on/off display some stuff/functionality in aspx page.</p> <p>Thanks in advance, King</p>
c# asp.net
[0, 9]
3,809,787
3,809,788
C++ for the new student?
<p>I'm taking a CS 101 course at my local university, and it looks like every CS class at this school uses C++, and little else. I find my course feeling much more like an intro to C++ than a CS course like I find through the likes of academicearth.com. Also in talking with those in software engineering, I get the advice to stay away from C, C++, and Objective-C because you spend your time not trying to F-things up rather than learn concepts and create. Rather the new student should learn a scripting language initially or perhaps C#. I'm wondering what the greater software engineering community recommends on this topic?</p>
c# javascript c++ python
[0, 3, 6, 7]
5,836,967
5,836,968
Problems with javascript inside echo
<p>I want to echo the following code:</p> <pre><code>&lt;a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;" class="delicious" target="_blank"&gt;Add to Delicious&lt;/a&gt; </code></pre> <p>The problem is that Dreamweaver warns me on syntax errors I can not figure out. Who can spot the syntax errors? The html and script on its own works just fine - the problem comes with the php when it is echoed.</p>
php javascript
[2, 3]
1,258,022
1,258,023
how to clear the fields in the login page while refreshing in asp.net master page
<p>I have one login page that inherits master page. I enter the incorrect username and password then clicking the login button it will shows the error message. I want when I refreshing the page both error message and username field will remove. Can anyone have this experience.. Thank you...</p>
c# asp.net
[0, 9]
4,334,057
4,334,058
asp.net mvc jquery checking size on file upload
<p>Is there any way to check the size of the file when it is about to be uploaded with jquery ?</p>
asp.net jquery
[9, 5]
3,002,149
3,002,150
Asp.net and Jquery return data bug
<p>I have Jquery code behaves weirdly. I am doing a complex task but I am almost done with it. Only problem I have is I am trigering a webmethod in C# which works perfectly. That webmethod returns a string value. I am trying to set a cookie with that returned value but it displays [object Object]. How can I display the returned value properly.</p> <pre><code>$.ajax({ type: "POST", url: "InsertPost.aspx/insert_post_new_category", data: "{'CategoryName':'" + user_cat + "','CategoryDescription':''}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data, status) { if (user_cat.replace(/^\s+|\s+$/g, '') != '') { $("#demo-input-facebook-theme").tokenInput("add", { name: user_cat, id: data }); $.session.set(encodeURIComponent('Kat_' + user_cat + '_x'), data); } } </code></pre> <p>});</p> <p>I am having problem with "data" above. that displays [object Object]. How can I fix this</p>
jquery asp.net
[5, 9]
2,088,085
2,088,086
Form Validation in external JavaScript File using document.getElementById
<p>My document.getElementById function is returning null on a value I know exists. Specifically I try:</p> <pre><code>//in an external .js file var UserName = document.getElementById('&lt;%=_username.ClientID%&gt;'); </code></pre> <p>And test it using some conditions, which never happen due to the element id value being null. I define _username in a user control file here:</p> <pre><code>... &lt;fieldset class="login"&gt; &lt;legend class="login"&gt;Login&lt;/legend&gt; &lt;label for="&lt;%=_username.ClientID%&gt;"&gt; User Name:&lt;/label&gt; &lt;asp:TextBox ID="_username" runat="server" CssClass="login" /&gt; &lt;label for="&lt;%=_password.ClientID%&gt;"&gt; Password:&lt;/label&gt; &lt;asp:TextBox ID="_password" runat="server" CssClass="login" TextMode="Password" /&gt; &lt;br /&gt; &lt;span class="response"&gt; &lt;asp:Literal ID="_response" runat="server" /&gt;&lt;/span&gt; &lt;asp:Button ID="_login" runat="server" Text="Login"/&gt; &lt;/fieldset&gt; </code></pre> <p>I verified my page is listening to the javascript file by testing a simpler function that doesn't require use of getElementById().</p>
javascript asp.net
[3, 9]
5,978,889
5,978,890
find obj type of jQuery result
<p>I have the following code produce ["AM123","DR2","F","99"] from the console.log. Now I want to see what is the type of the result.</p> <p>The code producing the result is : </p> <pre><code>$(".stock_splitdata").each(function() { var $table = $(this); var values = $("td", $table).map(function() { return $(this).text(); }).get(); $table.replaceWith(values.join(" ")); }); </code></pre> <p>My purpose to view the object type is that I want to split the result into four and join them with different padding like ["AM123","DR2","F","99"] become AM123-----DR2-F--99------</p> <p>Update: 19/10/2012:</p> <p>I found the solution as below.But if anyone can optimise the code, please fell free to do so.</p> <pre><code>if(subtableName == 'stock_splitdata'){ $(".stock_splitdata").each(function() { var $table = $(this); var values = $("td", $table).map(function() { return $(this).text(); }).get(); var tmpSKU = padRight(10, values[0], '&amp;nbsp;'); tmpSKU = tmpSKU + padRight(4, values[1], '&amp;nbsp;'); tmpSKU = tmpSKU + padRight(4, values[2], '&amp;nbsp;'); tmpSKU = tmpSKU + padRight(4, values[3], '&amp;nbsp;'); $table.replaceWith(tmpSKU); }); } </code></pre>
javascript jquery
[3, 5]
2,242,258
2,242,259
A Few Python questions
<p>I'm trying to learn Python from a background in javascript. I saw someone make a recursive function to find the least common denominator and wondered why they didn't just use a loop, so, both for the experience and to amuse myself, I wrote a simpler one:</p> <p>I came up with:</p> <pre><code>def LCM(n,d): while(n%d++ != 0 ): continue return d-1 print(LCM(99,12)) </code></pre> <p>Needless to say, for those of you that know Python, ++ isn't a valid operator. I also tried</p> <pre><code>def LCM(n,d): while(n%(d+=1) != 0 ): continue return d-1 print(LCM(99,12)) </code></pre> <p>To make sure it wasn't my thinking that was off, I tried the same thing in javascript:</p> <pre><code>function LCM(b,d){ while(b%d++ != 0){ } return d-1; } </code></pre> <p>So does Python not allow expressions like in javascript? Also, is indentation the only way to define something? I know semicolons aren't required but can be used, is there anything like that in terms of closing a loop or function definition? </p> <p>Finally, are <code>is</code> and <code>is not</code> the Python equality-without-type-coersion operator?</p> <p>P.S. I realize the function isn't practical without checking the input for various things, but that wasn't the point in writing it.</p> <p>P.P.S Also, is there a Python equivalent of the javascript <code>evaluation ? on true : on false</code> if statement abbreviation?</p>
javascript python
[3, 7]
4,927,002
4,927,003
Diff RegisterClientScriptBlock & RegisterStartupScript & responce.write("script")
<p>i need individual explanation and individual advantages regarding <code>RegisterClientScriptBlock</code> &amp; <code>RegisterStartupScript</code> &amp; <code>responce.write("script");</code></p> <p>i got some information like </p> <p><code>RegisterClientScriptBlock()</code> methods will inject the script after the form open tag but before page controls </p> <p><code>RegisterStartupScript()</code> methods will inject the scripts after page controls but before form close tag.</p> <p>we can also simply wrie <code>responce.write("script")</code> it aslo include the script.</p> <p>but i need individual explanation</p> <p>if any link is available regarding this topic also pls reply me.</p>
c# asp.net javascript
[0, 9, 3]
4,464,614
4,464,615
show and hide several random divs using jquery
<p>i am developing a jquery application. I have 10 divs with quotes. I am trying to create a function that takes a number and randomly displays that number of quotes from the 10 divs for 10 seconds and hide the divs. Then repeat the process again. I have not been able to do it please help me out. here is my code:</p> <pre><code>$(document).ready(function(){ var div_number = 4; var used_numbers = new Array(); var todo = setInterval(showQuotes(),3000); function showQuotes(){ used_numbers.splice(0,used_numbers.length); $('.quotes').hide(); for(var inc = 0; inc&lt;div_number; inc++) { var random = get_random_number(); $('.quotes:eq('+random+')').show(); } $('.quotes').fadeOut(3000); } function get_random_number(){ var number = randomFromTo(0,9); if($.inArray(number, used_numbers) != -1) { get_random_number(); } else { used_numbers.push(number); return number; } } function randomFromTo(from, to){ return Math.floor(Math.random() * (to - from + 1) + from); } }); </code></pre>
javascript jquery
[3, 5]
1,215,472
1,215,473
App_Code class not auto completing and cant use it in rest of project
<p>I am creating a site and thought I would do it correctly so I created an <code>App_Code</code> directory and created a class in there.</p> <p>when im editing the class file the auto complete no longer works, which I can live with, however, no matter what I do in my main site I cant access or reference the class file.</p> <p>ive tried putting a using statement at the top of the file, but it just throws an error creating an instance of the class in the code but that throws and error</p> <p>can someone let me know where im going wrong</p> <p>thanks</p>
c# asp.net
[0, 9]
5,725,593
5,725,594
Jquery: Blur function does not work with Div tag
<p>I am trying to create a Jquery Tree plugin for my current project. In the plugin, there are 3 compomnents: a text box containing the result selected from the tree , a div containing the tree and a button to show the div. It works fine, except that i cannot make it auto lose the popup div if the tree lose its focus. </p> <p>Here is the code to create the div </p> <pre><code> createTree = function() { $.getJSON(_options.jsonSrc, function(data) { nDiv = document.createElement("div"); nDiv.id = "divRootAd"; $(nDiv).css('display', 'none'); jsonObj = data["treeJson"]; nUl = document.createElement("ul"); nUl.appendChild(createNode(jsonObj)); nDiv.appendChild(nUl); $("body").append(nDiv); //$(nDiv).focus(); repositionDiv(); }); }; repositionDiv = function() { if ($('#divRootAd').is(':hidden')) { // get the field position var sf_pos = $("#txtAdVal").offset(); var sf_top = sf_pos.top; var sf_left = sf_pos.left; // get the field size var sf_height = $("#txtAdVal").height(); // apply the css styles - optimized for Firefox $("#divRootAd").css("position","absolute"); $("#divRootAd").css("left", sf_left); $("#divRootAd").css("top", sf_top + sf_height + 5); $('#divRootAd').show(); $('#divRootAd').blur(function(event){ alert("lose focus"); clearDiv(); }); } else { clearDiv(); } }; </code></pre> <p>The line alert("lose focus") does not work when i move the mouse outside the div. Can anyone suggest a solution for this ? </p>
javascript jquery
[3, 5]
4,525,217
4,525,218
Display Progress Label while fetching data
<p>Here is how I am trying to do:</p> <pre><code> void Fetch() { //Code To Fetch Data } protected void btn_Click(object sender, EventArgs e) { lblSatus.Text = "Fetching Data..."; Thread t = new Thread(Fetch); t.Start(); t.Join(); lblSatus.Text = "Got Data"; } </code></pre> <p>But on click of button it directly display GotData.</p> <p>Any idea what I am doing wrong here.</p> <p>Thanks</p>
c# asp.net
[0, 9]
1,504,528
1,504,529
how to connect markers in google map api?
<p>How to connect markers in Google map API using just java, i.e., without using asp.net, php or any other language? I am just a beginner. I have multiple markers on my map which are showing the corresponding places in Google android project.</p>
java android
[1, 4]
5,154,429
5,154,430
jquery cookie not working
<p>hey people i'm using a jquery plugin for creating cookies which seems to be working perfect when i run it on localhost but when I tested in the server it's not working as i expected.</p> <p>below is my file testcookie.php</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;link rel="shortcut icon" href="3.ico"&gt; &lt;script type="text/javascript" src="js/iepngfix_tilebg.js"&gt;&lt;/script&gt; &lt;script src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.cookie.js"&gt;&lt;/script&gt; &lt;script&gt; (function($) { $(document).ready(function() { $.cookie("example", "foo"); alert( $.cookie("example") ); });})(jQuery); &lt;/script&gt; &lt;/head&gt; &lt;body&gt;hello there&lt;/body&gt; &lt;/html&gt; </code></pre> <p>result= no alert</p> <p>here's the demo <a href="http://namadda.com/demo/testcookie.php" rel="nofollow">http://namadda.com/demo/testcookie.php</a></p> <p>onething i noticed just now is that click view source and all the script link is working but jquery.cookie.js isn't showing up, instead i'm getting error 406 when i clicked jquery cooke link on view source page. But it's present on server like other plugins.</p>
javascript jquery
[3, 5]
5,590,464
5,590,465
jQuery dropdown menu exclude children from function
<p>I have something like this</p> <pre><code>&lt;div id="dropdown-menu"&gt; &lt;div class="visiblestuff"&gt;&lt;/div&gt; &lt;div class="foldoutstuff"&gt; &lt;form&gt; &lt;some input value/&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want the #dropdown-menu to be clickable but not it's children so I did this:</p> <pre><code>$(function() { var DropdownChildren = $('div#dropdown').children(); $('div#dropdown').not(DropdownChildren).click(function(event) { var $this = $(this); $this.toggleClass('active'); $('.foldoutstuff').toggle(); }); }); </code></pre> <p>This works for the background but not the form nodes... I think the problem is caused by the toggle() on foldoutstuff</p> <p>please advise</p>
javascript jquery
[3, 5]
1,068,739
1,068,740
Incrementing by 4, not 1
<p>My issue is that when I navigate(click) the counter(a) gets incremented by 4 instead of 1(I'm thinking maybe, it's due to body+html selector). So, I'm wonder what will solve this, could I just possibly subtract 3 after the incrementation or will some modulus be of help somewhere?</p> <pre><code>$('body,html').click(function () { $('body,html').animate({ scrollTop: $(test[a]).offset().top }, { duration: 100, queue: false, complete: function () { // updating a bunch of elements here $(somearr[a]).css({ "background-color":"#fff", "border":"5px solid #ff6600", "margin-left":"-5px" }); a++; // CALLED 4 TIMES! console.log(a); if (a === 7) { a = 0; $(filler_six).hide(); $(filler).show(); } clearDiv(); } }); //end of animation }); //end of click function // Clearing The Div's </code></pre>
javascript jquery
[3, 5]
3,203,848
3,203,849
DownloadString timed out
<p>I have a method which returns the content of a webpage:</p> <pre><code> private string FetchHTML(string sUrl, Encoding encoding) { System.Net.WebClient oClient = new System.Net.WebClient(); oClient.Encoding = encoding; return System.Web.HttpUtility.HtmlDecode(oClient.DownloadString(sUrl)); } </code></pre> <p>But when I try to load a link from livejournal (for instance, <a href="http://mos-jkh.livejournal.com/769579.html" rel="nofollow">http://mos-jkh.livejournal.com/769579.html</a>) then I am getting this exception at DownloadString:</p> <blockquote> <p>The request was aborted: The operation has timed out.</p> </blockquote> <p>Is it a known issue? Why doesn't DownloadString work for some webpages and is there a solution for this? Or is there an alternative to DownloadString?</p>
c# asp.net
[0, 9]
2,410,956
2,410,957
grab value of URL segment and update a class accordingly?
<p>I'm building a multi-step form in jQuery which updates the URL according to which segment of the form it's currently showing.</p> <p>eg:</p> <ul> <li>index.php#form=step1 </li> <li>index.php#form=step2 </li> <li>index.php#form=step3</li> </ul> <p>I've also built a breadcrumb menu that links to each of these segments but I need to somehow add an "active" class to the breadcrumb item that is currently being shown. Not sure how I should do this but I figured maybe finding out what the value of #form is and if that value matches the id of the breadcrumb item, then update its class to active?</p> <p>eg:</p> <pre><code>if form = step1 breadcrumbItem addClass "active" if form = step2 breadcrumbItem addClass "active" etc </code></pre>
javascript jquery
[3, 5]
5,309,839
5,309,840
Java executes 'catch' block with no error, and somehow still runs 'try' block
<p>I have a problem with the following code. First, I am a newbie to Java with experience with several other languages.</p> <p>When I run the following on Android, it errors at "in.close();", jumps to the catch block and runs Return ""; The thing is, the function doesn't return an empty string, it successfully returns the correct json data even though the debugger says it isn't running return json, but that it's running return "";</p> <pre><code>public void fetch() { // Get the JSON of the image gallery String json = getJSON(); // json somehow has the actual correct json data and not an empty string! }; private String getJSON() { try { // Create a URL for the desired page URL url = new URL("http://imgur.com/gallery.json"); // Read all the text returned by the server BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8")); String json = in.readLine(); in.close(); return json; // &lt;-- debugger doesn't break here! } catch(Exception e) { Log.e("getJSON", e.getMessage()); return ""; // &lt;-- debugger breaks here! Cat Log shows nothing! } } </code></pre> <p>I copy the exact same code into a Java console so that I can output the error message and watch it in the debugger with break points, and the code executes without error.</p> <pre><code> try { // Create a URL for the desired page URL url = new URL("http://imgur.com/gallery.json"); // Read all the text returned by the server BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String json = in.readLine(); in.close(); System.out.println(json); } catch(Exception e) { System.out.println(e.getMessage()); } </code></pre> <p>What exactly is going on? Why is my code run on Android erroring when it runs in a Java Console just fine? Why when it errors does it not return what the error is supposed to return; and empty string? How can I view the error message in Android?</p>
java android
[1, 4]
439,549
439,550
jquery find text nodes within an element and join and wrap with a tag
<p>I'm a newbie and am having a hard time with some text that has no element, I am trying to wrap text outside of a tag with a list tag :</p> <p><a href="http://jsfiddle.net/danb/7xu6A/" rel="nofollow">http://jsfiddle.net/danb/7xu6A/</a></p> <p><strong>HTML</strong></p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt; text &lt;br&gt;to wrap and combine &lt;li&gt;&lt;a href="#"&gt;item4&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>This was working for me until I came across some instances where the string was broken with a <br> tag - even if i take out the <code>&lt;br&gt;</code> first they are still separate nodes and get wrapped as such.</p> <pre><code>$('ul').contents().remove('br') .filter(function() { return (this.nodeType === 3 &amp;&amp; $.trim(this.data) !== ''); }).wrap('&lt;li class="nav current"&gt;&lt;/li&gt;'); </code></pre> <p>any help is greatly appreciated</p>
javascript jquery
[3, 5]
3,646,683
3,646,684
How to get sorting without removing Row-Created function(Use for changing column of header-text in run-time)
<p>The following code is my Grid View AA from aspx page.</p> <pre><code>&lt;asp:GridView ID="GridView_AA" runat="server" OnSorting = "Gridview_AA_Sorting" OnRowCreated="GridView_AA_RowCreated"&gt; &lt;asp:TemplateField HeaderText="Period Name" SortExpression="PERIOD_NAME"&gt; &lt;EditItemTemplate&gt; &lt;asp:TextBox ID="txtGVPeriodName" runat="server" Text='&lt;%# Bind("PERIOD_NAME") %&gt;'&gt;&lt;/asp:TextBox&gt; &lt;/EditItemTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="lblGVPeriodName" runat="server" Text='&lt;%# Bind("PERIOD_NAME") %&gt;' Visible="False"&gt;&lt;/asp:Label&gt; &lt;asp:LinkButton ID="lborganize" runat="server" OnClick="lborganize_Click" Text='&lt;%# Bind("PERIOD_NAME") %&gt;'&gt;&lt;/asp:LinkButton&gt; &lt;/ItemTemplate&gt; &lt;HeaderStyle HorizontalAlign="Center" Width="400px" /&gt; &lt;ItemStyle HorizontalAlign="Center" Width="400px" /&gt; &lt;/asp:TemplateField&gt; &lt;/asp:GridView&gt; </code></pre> <p>I cannot sort after adding GridView_AA_RowCreated function. Each column of Grid view header-text worked well before I add this Row Created function. If I cut the following code: e.Row.Cells[2].Text = "Period Name"; Sorting works. I want to get sorting without removing this Row Created function. Do you have any brighter solution about my problem?</p> <pre><code> protected void GridView_AA_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[2].Text = "Period Name"; //Change header text in run-time } } </code></pre>
c# asp.net
[0, 9]
1,181,760
1,181,761
Convert java to c# .net
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/896867/tool-to-convert-java-to-c-code">Tool to convert java to c# code</a> </p> </blockquote> <p>I have done a project in java and I want to convert it to C#.Net. I'm using Visual Studio 2008. How can I convert the code from Java to C#? Are there any tools available? </p>
c# java
[0, 1]
3,482,547
3,482,548
How to wrap existing event handler without modifying "this"?
<p>I am using some existing code that has an form submit handler:</p> <pre><code>function AjaxFormSubmit(e) { [...] var form = $(this); [...] } </code></pre> <p>To bind the handler in my view code I have this:</p> <pre><code>$('myForm').submit(AjaxFormSubmit); </code></pre> <p>What I want to do is run some other code before calling AjaxFormSubmit with something like this:</p> <pre><code>$('myForm').submit(function(e) { doSomething(); AjaxFormSubmit(e); }); </code></pre> <p>The problem is that in AjaxFormSubmit, the call to <strong>$(this)</strong> doesn't get the form element. What is the best way to achieve this?</p>
javascript jquery
[3, 5]
265,006
265,007
Using jQuery 1.4.4 This simple method fails for some reason
<pre><code>$.get($(this).attr('rel'), function(response){}, 'script') .error(function(){ alert('this failed')}); </code></pre> <p>I get. <code>.error is not a method</code> . But it was added in version 1.4.3</p> <p><a href="http://api.jquery.com/error/" rel="nofollow">http://api.jquery.com/error/</a></p> <p>Is there some kind of type I have ?</p>
javascript jquery
[3, 5]
5,721,086
5,721,087
Visual Studio 2010 working directory
<p>I'm developing a C# asp.net web application. I'm basically done with it, but I have this little problem. I want to save xml files to the "Users" folder within my project, but if I don't psychically hard code the path "C:......\Users" in my project it wants to save the file in this "C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\Users" folder, this is an annoying problem because I can't use the hard coded directory on our web hosts server. Also, I have a checkbox list that populates from the the "DownloadLibrary" folder in my project, and its suppose to download the files from that fold but its also looking to the "C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\" folder for download even though its populating from the correct folder. I'm very confused by this, its the first time something like this has ever happened to me. Can anyone please help me with this, its the only thing standing in my way to complete this project.</p>
c# asp.net
[0, 9]
4,085,838
4,085,839
How i get value from all dynamic textbox by using Class in php
<p>i have this dynamic textbox, and i want to get value by using class. by php</p> <pre><code>&lt;input id="op1" name="po1" class="key" size="50"&gt; &lt;input id="op2" name="po2" class="key" size="50"&gt; &lt;input id="op3" name="po3" class="key" size="50"&gt; &lt;input id="op4" name="po4" class="max" size="50"&gt; &lt;input id="op5" name="po5" class="key" size="50"&gt; &lt;input id="op6" name="po6" class="lol" size="50"&gt; &lt;input id="op6" name="po6" class="lol" size="50"&gt; </code></pre> <p>in this textbox there are "key", "max" and "lol" class How i get value from this all dynamic textbox by using only Class "Key" in php</p>
php javascript
[2, 3]
586,025
586,026
Closing a child window from it's parent
<p>I currently have the following code to generate a new child window. i also set a timeout for the user to respond , when that time out ends the child window should be closed.</p> <p>Here is what i got so far:</p> <pre><code> var zerominutpopup 'http://www.somewebsite.com/'; zerominutpopup = open(zerominutpopup, '', 'height=300,width=600,left=300,top=300'); setTimeout( function(){ timer_is_at_zero_hold(zerominutpopup); }, 10000); function timer_is_at_zero_hold(windowtoclose){ windowtoclose.closed;// this is how (i thought) closing a window is done but doesnt seem to work. } </code></pre> <p>Thanks in advanced any help would be appreciated.</p>
javascript jquery
[3, 5]
944,983
944,984
loop over the PHP data Returned to jquery AJAX Call
<p>below is my $.ajax call to php</p> <pre><code>$(document).ready(function() { $('ul.sub_menu a').click(function(e) { e.preventDefault(); var txt = $(this).attr('href'); $.ajax({ type: "POST", url: "thegamer.php", data:{send_txt: txt}, success: function(data){ $('#container').fadeOut('8000', function (){ $('#container').html(data); $('#container').fadeIn('8000'); }); } }); }); }); </code></pre> <p>my php code</p> <pre><code> if(mysql_num_rows($result) &gt; 0){ //Fetch rows while($row = mysql_fetch_array($result)){ echo $row['img']; } } </code></pre> <p>I m getting this output </p> <pre><code>images/man/caps/army-black.pngimages/man/caps/army-brown.pngimages/man/caps/army-grey.pngimages/man/caps/army-lthr.pngimages </code></pre> <p>these are basically image paths now how to loop over them in jquery and fit each image in image tag </p> <p>any code will be useful</p> <p>Plz Note I DONT NEED JSON</p> <p>regards sajid</p>
php jquery
[2, 5]
5,843,136
5,843,137
Using a rotation vector in Android
<p>Hey, For an application I'm writing, I need the sort of thing <a href="http://developer.android.com/reference/android/hardware/SensorEvent.html#values" rel="nofollow">Sensor.TYPE_ROTATION_VECTOR</a> offers. However, I assume it is from an old version of Android, as I cannot use this variable in my applications (I get a compilation error). I thought about using the gyroscope instead, but I'm not sure if it's equivalent, if it does - how does one get the vector, and another problem: I want to test it on my G1, and it force closes, even though as far as I understood the G1 does have some sort of a gyroscope.</p> <p>Thank you in advance.</p>
java android
[1, 4]
890,371
890,372
How to remove empty list item with jquery
<p>I have a list which is dynamically built, but there are empty list items which need removing.</p> <pre><code>&lt;ul&gt; &lt;li&gt;www&lt;/li&gt; &lt;li&gt;www&lt;/li&gt; &lt;li&gt;www&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How od i do this with jquery? Thanks</p>
javascript jquery
[3, 5]
5,570,199
5,570,200
Sequential arithmetic operation in javascript
<p>I've a text input and user will write a string for example <code>10+20-10-2*2+4/2</code> and I want to do an arithmetic operation sequentially, which means I want to <code>(10+20)-(10)-(2)*(2)+(4)/(2)</code> and the result should be <code>20</code> according to above example.</p> <p>In other words I want to do the arithmetic operation from the left, sequentially. Can anyone help me on this or may be some idea would be nice too. Thanks.</p> <p><strong>Please ask me if need more information.</strong></p> <pre><code>$('#calculation').on('blur', function(e){ e.preventDefault(); var pattern=/^[-*/+0-9]+$/; value=$(this).val(); if(value.match(pattern)) { $(this).closest('tr').find('span.error').html(''); //$('#total').val(eval(value)); // No idea what to do } else { $(this).closest('tr').find('span.error').html('Invalid character'); } }); </code></pre>
javascript jquery
[3, 5]
2,919,527
2,919,528
how to maintain jquery change preserved on page change?
<p>i am using the below code to slide my navigation menu </p> <pre><code>$(document).ready(function(){ $("#flipnav").click(function(){ $("nav").slideToggle("slow"); }); }); </code></pre> <p>but on browsing to another page or refresh the navigation is back again. but how to preserve this change so that the navigation remains hidden until the user click to show navigation again and remains same(hidden) even when browses to another page ?</p> <p>Further</p> <pre><code>if(sessionStorage["navigationMoved"]== "true"){ $(document).ready(function(){ $("#flipnav").ready(function(){ $("nav").slideToggle("slow"); }); }); $(document).ready(function(){ $('#flipnav').toggle(function(){ $('#content').animate({ top:"0%" }); }, function(){ $('#content').animate({ top:"2%" }); }); }); } </code></pre>
javascript jquery
[3, 5]
2,681,342
2,681,343
Repeter With multiple data source of type class
<p>Hi I have 5 different classes. And using single repeater I want to populate the each class data without writing any data binding code except assigning DataSource and DataBinding. the header values should be populated based upon the class members. I think I can use reflection. But I need clear idea. And if i use reflection, is there a possibility of violating security. </p>
c# asp.net
[0, 9]
1,452,778
1,452,779
DataGrid and formatting data
<p>I'm new to ASP.NET and don't really understand how to display a table with database data. The data is loaded in an object, where I have a list of objects.</p> <p>Now I want to show a table with some columns, an image (path created from two fields in the object), an link (passing one field of the object), a textarea (id from object, value from object), a radiobutton (id from object).</p> <p>How should I do this. I have tried binding a datagrid to the list of objects, and it works. But I don't want to show all data members, and I don't know how to create correct headers and the image and form controls.</p> <pre><code> ImageDataGridView.DataSource = tradeObj.Images; ImageDataGridView.DataBind(); </code></pre>
c# asp.net
[0, 9]
1,703,367
1,703,368
jQuery dual multiple select combo box
<p>i have a function that brings value from 1 combo box to the other.</p> <pre><code>product.bind('click', function() { var t = ($(this).hasClass('prevbtn'))? 0 : 1; if(t) { unsel.find('option').each(function() { if($(this).is(':selected')) { jQuery(this).attr('selected',true); var op = sel.find('option:first-child'); sel.append($(this)); } }); } else { sel.find('option').each(function() { if($(this).is(':selected')) { jQuery(this).attr('selected',false); unsel.append($(this)); } }); } </code></pre> <p>is there any way to pass value from unsel box to sel box without removing from unsel box? what i want to do is people are able to pass as many unsel values into sel box as many as they want to.</p> <p>many thanks!</p>
javascript jquery
[3, 5]
5,042,795
5,042,796
Javascript, or Jquery and posting to php
<p>I want to send a javascript variable to a php file. What I would like to know is could you do it via this method?</p> <p>Jquery:</p> <pre><code>Var UserName; UserName = John; $.post("InsertRunInfo.php", { UserName: UserName } ); </code></pre> <p>Pass to php:</p> <pre><code>&lt;?php $con = mysql_connect("*****","*****",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("runtracker", $con); $sql="INSERT INTO userinfo (UserName) VALUES ('$_POST[UserName]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?&gt; </code></pre>
php javascript jquery
[2, 3, 5]
22,968
22,969
Disabling the viewstate both on page and control does not have effect
<p>I have disabled the viewstate for controls (labels, buttons etc) and the page for test purposes.</p> <p>Now when I change the text of a label on the client side and intercept the button's click event, the label still shows the text that the server sent previously.</p> <p>So what is going on? I need to be able to change data on the client and have it available to the server. </p> <p>How is this done?</p>
c# asp.net
[0, 9]
256,282
256,283
Error: Cannot implicitly convert type 'void' to 'System.Collections.Generic.List'
<p>I am trying to set a property of my .ascx controls from an .aspx using that control. </p> <p>So in one of my <strong>.aspx</strong> which has this control in it, I have the following code trying to set the ItemsList property of my embedded .ascx:</p> <pre><code>Item item = GetItem(itemID); myUsercontrol.ItemList = new List&lt;Item&gt;().Add(item); </code></pre> <p>The property in the .ascx that I'm trying to set looks like this:</p> <pre><code>public List&lt;Item&gt; ItemsList { get { return this.itemsList; } set { this.itemsList = value; } } </code></pre> <p><strong>Error</strong>: Cannot implicitly convert type 'void' to 'System.Collections.Generic.List'</p> <p>So I don't get where it's getting void as part of the property?...weird.</p>
c# asp.net
[0, 9]