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
4,735,097
4,735,098
How to format the time in javascript/jquery
<p>i want to know how to convert the time into "08:14PM 05 Jan 2013" format using javascript/jquery. Thanks in advance.</p>
javascript jquery
[3, 5]
3,875,350
3,875,351
Ideas on how to make multiple selectable resizeable boxes in jQuery?
<p>I am trying to develop a web application that can take an image and draw multiple, resizeable boxes on the image. I have been looking into a lot of cropping plugins, but i cant seem to find what I am looking for. I just need to be able to draw multiple boxes on an image and return coordinates. I am looking for a plugin that would be easily modified for this or if anyone could give me any idea on how I could get started on this. Thanks!</p>
javascript jquery
[3, 5]
2,840,440
2,840,441
reset the form on back button
<p>I have searched on the web but couldn't find any solution. When I click on the 'Submit' button on 'samplepage.php', I redirect the page to the 'newpage.php' page. I would like to reset 'samplepage.php' form values when user clicks on back button of the browser. Right now it keeps all the textbox values, radio button and checkbox selection. Could you please let me know if there are any suggestions? Thanks for your help.</p> <p>Here is my redirect php code.</p> <pre><code>header ("location:newpage.php); </code></pre>
php javascript jquery
[2, 3, 5]
3,539,946
3,539,947
How to access object name for their value using jquery
<p>I have on object and I want to print their name and property name. How can I do that. I can access their properties value. Like I want print object name like 'first' and 'second' and their properties like 'value' and 'text' dont want to print value</p> <pre><code>&lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;script type="text/javascript" src="jquery-1.7.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function (){ var myDate= { 'first':{value:'30',text:'i am the one'}, 'second':{value:'50',text:'i am the second'} } $('a').click(function (){ var t= $(this).text(); if(t=="both"){ $('.text').text(myDate['first'] + '' + myDate['second'] ); } else { $('.text').text(myDate[t]); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="text"&gt;&lt;/div&gt; &lt;a href="#"&gt;first&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="#"&gt;second&lt;/a&gt; &lt;a href="#"&gt;both&lt;/a&gt;​ &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
3,671,003
3,671,004
How to handle touch or press down events in Android?
<p>Alright so i have 4 image views..</p> <p>How can i control what happens when they are pressed down and up</p> <p>So say like:</p> <p>one of the images is press down a textview gets changed to 1 but when they let go of that one the text will change back to 0?</p>
java android
[1, 4]
3,857,251
3,857,252
Update existing notification
<p>Now that the <a href="http://developer.android.com/reference/android/app/Notification.html#describeContents%28%29" rel="nofollow"><code>setLatestEventInfo</code></a> method is deprecated in the latest Android SDK, is there a way that we're supposed to update the content of an existing notification? I am skeptical that they expect us to create a new notification every time we want to update the notification content.</p> <p>The <a href="http://developer.android.com/guide/topics/ui/notifiers/notifications.html" rel="nofollow">Notification Guide</a> doesn't appear to have been updated to make use of the suggested <a href="http://developer.android.com/reference/android/app/Notification.Builder.html" rel="nofollow"><code>Notification.Builder</code></a> class either.</p>
java android
[1, 4]
4,456,540
4,456,541
jquery change color using css not working
<p>Forgive me if this is a bad question. What is wrong with my code ?</p> <pre><code>$(document).ready(function(){ $('#user').css(color:red); }); </code></pre> <p>I am very new to jquery. Thank you in advance!</p>
javascript jquery
[3, 5]
2,161,133
2,161,134
jQuery / Javascript Element height alway returns 0
<p>I'm trying to split some paragraphs into their respective line at each line break. My code seems to break when trying to recover the height of the element, it always returns '0'.</p> <p>My function:</p> <pre><code>function getLines(element){ words = element.text().split(''); width = element.width(); lines = []; hiddenElement = jQuery('&lt;p width ="'+ width +'px", visible ="true"&gt;&lt;/p&gt;'); hiddenElement.text('i'); //add character to get height height = hiddenElement.height(); alert(height); hiddenElement.empty(); jQuery.each(words, function(i, val) { lineText = hiddenElement.text(); hiddenElement.text(lineText + this); if(hiddenElement.height() &gt; height) { lines.push(lineText); hiddenElement.text(this); } }); alert(hiddenElement.height()); alert(lines); jQuery('body').append(hiddenElement); // to see results } </code></pre> <p><a href="http://jsfiddle.net/zQUhV/2/" rel="nofollow">http://jsfiddle.net/zQUhV/2/</a> - function called via <code>up arrow key</code></p> <p>Why does this return 0 rather than the height of the element?</p>
javascript jquery
[3, 5]
5,594,349
5,594,350
jquery not working on server controls in content page
<p>i am having a TextBox txt on a content page. when i try this</p> <pre><code>$(function(){ $("#txt").focus(function(){alert("abcd"); }); }); </code></pre> <p>it doesn't work. It's working if i am using it on simple .aspx page with no master page.</p>
jquery asp.net
[5, 9]
77,619
77,620
JQuery List Events
<p>At the moment I'm building a list using the following code:</p> <pre><code>$('&lt;li id="li' + jJob.Id + '"&gt;&lt;div style="width: 98%; background-color: #9E7BFF; colour: #000000"&gt;&lt;a href="javascript:void(0);"&gt;' + jJob.Type + ' ' + jJob.AddressClean + ' (' + jJob.Status + ')' + '&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;').click(function(e) { ShowStatus('job ' + jJob.Id + ' is available'); UnassignJob(jJob.Id); $(this).remove(); }).bind("contextmenu", function(e) { alert('li' + jJob.Id); return false; }).appendTo('#assignmentList'); </code></pre> <p>This works as previously required. However I need to be able to add another a link which will show another menu allowing various options. The problem is that I've attached the click event to the div. How can I attach it only to the a link?</p> <ul> <li>Create li</li> <li>Create div</li> <li>Create a link with click event</li> <li>Create another a link click event</li> <li>Append li to #assignmentList</li> </ul> <p>Mark</p>
javascript jquery
[3, 5]
3,670,559
3,670,560
How do I fake AJAX start / end events in JQuery?
<p>I'm listening to ajaxStart() and ajaxStop() to show/hide a spinner, and I'm doing some mock AJAX stuff in JS while servers are being written. It just calls a function to generate mock data with a setTimeout(). For now I'm just manually calling hide() and show() on the spinner, but I'd really like to just tell JQuery when I'm starting and stopping my "request", and have the events go through that way, so I don't accidentally hide() the spinner while a <em>real</em> ajax request is still going in the background.</p> <p>Can this be done easily?</p> <p><strong>EDIT:</strong> This is the code I settled on, the trick is maintaining the <code>JQuery.active</code> count:</p> <pre><code>function fakeAJAX(f) { if(jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } setTimeout(function () { f(); if(!(--jQuery.active)) { jQuery.event.trigger("ajaxStop"); } }, Math.round(Math.random() * 3000 + 250)); } </code></pre>
javascript jquery
[3, 5]
3,874,456
3,874,457
Is there an easy way to embed a Javascript interpreter in a C# application?
<blockquote> <p><strong>Possible Duplicate:</strong><br /> <a href="http://stackoverflow.com/questions/172753/embedding-javascript-engine-into-net-c">Embedding JavaScript engine into .NET (C#)</a> </p> </blockquote> <p>Is there an easy way to embed Javascript in a C# application? </p> <p>I want to make my C# application scriptable. </p> <p>I have used Lua for this in the past but would like to use Javascript in this instance. LuaInterface is a nice C# wrapper for the C Lua API and it made it really easy to embed Lua in C# and a lot less painful than writing a Managed C++ wrapper for the Lua API (I have tried that as well). </p> <p>Are there any C# libraries around for embedding Javascript that are as easy to use as LuaInterface?</p>
c# javascript
[0, 3]
3,385,416
3,385,417
Mobile (Smart phone application) architecture
<p>I am into iPhone development, and would like to know more about Smart phone application architectures in general. Is there are any reusuable architectures which would be applicable for both iPhone and Driod platforms?</p> <p>Would appreciate if you can point me to any ebooks or URL.</p> <p>Thanks for your time,</p>
iphone android
[8, 4]
2,893,854
2,893,855
How to preload a div combobox in jquery
<p>I have code as follows:</p> <pre><code>$("#item_select").change(function() { var params = $("#item_select option:selected").val(); $.post('/account/ar_form.php', {idata: params}, function(data){ $("#message_display" ).html(data); }); }); </code></pre> <p>This is a dropdown that uses /account/ar_form.php to display html in the div correctly.</p> <p>But it only displays on the change event. I'd like it to preload the data. When I use a load event, it will display the html, but on change, it displays it twice.</p>
php jquery
[2, 5]
654,435
654,436
Global mouseMove
<p>I have made the following javascript to be used in my jQuery based website. What it does, is to move a slider up/down, and scale the item above higher/smaller.</p> <p>Everything works fine, but since the slider is only a few pixels in height, and the move event is a bit slow (it does not trigger for every pixel) so when I move the mouse fast, the slider can't hold on and the mouse get's out of the slider item. The mouseMove event won't be triggered no more since it is bound to the slider. I guess everything could be fixed by setting the mouseMove global to the whole site, but it won't work, or at least I don't know how to make that work. Should it be bound to document, or body?</p> <p>here is my current code for the slider:</p> <pre><code>$.fn.resize = function (itemToResize) { MinSize = 100; MaxSize = 800; pageYstart = 0; sliderMoveing = false; nuskriverHeight = 0; this.mousedown(function(e) { pageYstart=e.pageY; sliderMoveing = true nuskriverHeight = parseFloat((itemToResize).css('height')); }); this.mouseup(function() { sliderMoveing = false }); this.mousemove(function(e) { if (sliderMoveing) { (itemToResize).css('height', (nuskriverHeight + (e.pageY - pageYstart))); if (parseFloat( (itemToResize).css('height')) &gt; MaxSize) { (itemToResize).css('height', MaxSize) }; if (parseFloat( (itemToResize).css('height')) &lt; MinSize) { (itemToResize).css('height', MinSize) }; }; }); </code></pre> <p>};</p> <p>Thanks for any help, is much appreciated</p>
javascript jquery
[3, 5]
3,806,142
3,806,143
how in singleton instance call interface
<p>This is my class </p> <pre><code>public class MyReceiver implements TolEnabled </code></pre> <p>and here i want to call</p> <pre><code>MyManager.getInstance(context, this, Properties.SDSMT, localText.toString(), Integer.valueOf(repetitions), false); </code></pre> <p>and in <code>MyManager</code> class I have singleton like</p> <pre><code>public static MyManager getInstance(Context context, TolEnabled tolActivitiy, String enginePackage, String text, int repetition) { if (instance == null) { instance = new MyManager (...); } return instance; } </code></pre> <p>but in my <code>MyReceiver</code> receiver when i call singleton i get</p> <blockquote> <p>The method getInstance(Context, TolEnabled, String, String, int) in the type MyReceiver is not applicable for the arguments (Context, MyReceiver , String, String, Integer, boolean)</p> </blockquote> <p>what can i do? <code>MyReceiver</code> implements interface and works if is not singleton. How to use it in singleton?</p>
java android
[1, 4]
2,263,038
2,263,039
Iphone equivalent to Android <include> and <merge> tag?
<p>I'm going to port an Android application over to the iPhone platform. I need header-footer like functionality so I'm looking for Android-style layouts merging for iPhone.</p> <p>Does iPhone support this? If so, how?</p> <p>[EDIT]</p> <p>May be above header-footer description creating confusion.I am trying to describe again.</p> <p>I would like to merge two different .xib file's view in single xib.for an example I have "footer.xib",I just want to include (reuse) same "footer.xib" view in different pages instead of copying same code for each page. I'm very new to Iphone world, so any guidance would be appreciated!</p>
android iphone
[4, 8]
242,483
242,484
How do I write .level+1 as a selector in JQuery or JavaScript?
<p>A quick question. I have a series of DIVs with the following classes <code>.level1</code> <code>.level2</code> <code>.level3</code></p> <p>This is what I want to happen...When I hover over <code>.level1</code> I would like the selector to select <code>.level2</code>. In other words <code>.level</code>+1 whatever I hover over.</p> <p>How do I write this in JavaScript or JQuery ...The <strong>X</strong> in the code is where I need this to go</p> <pre><code>$(".no-submenu").hover(function() { $.data(this, "timer", setTimeout($.proxy(function() { $( X ).hide(); }, this), 700)); }, function() { clearTimeout($.data(this, "timer")); }); </code></pre> <p>Any help is greatly appreciated, Thanks</p>
javascript jquery
[3, 5]
70,297
70,298
link click event not firing button click event on the first try (IE only). Works on second click.
<p>This is driving me mad. I've got a div on my page that opens up in colorbox. When the user clicks one of the links in the div, it fires an event to the code (below) which should in turn populate the hidden field and then click a server button to run some code behind.</p> <p>Problem is, in IE(9) it won't click the server button on the first attempt (yes, it does go onto the client click event). Strangely it seems to work fine in Chrome and FF.</p> <pre><code>$(document).on('click', '.link', function (e) { e.preventDefault(); var thisID = $(this).attr('href').replace('#ca', ''); $("#hiddenField").val(thisID ); $("#button1").submit(); }); </code></pre> <p>It might be worth mentioning that the links in the div that opens in colorbox is dynamically populated. But this should effect it as the click events on the links are working fine.</p> <p>Any help would be appreciated.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
2,015,214
2,015,215
JQuery/Javascript Reordering rows
<p>I have a aspx page that looks something like this:</p> <pre><code>&lt;tr id="Row1"&gt; &lt;td&gt;Some label&lt;/td&gt; &lt;td&gt;Some complex control&lt;/td&gt; &lt;/tr&gt; &lt;tr id="Row2"&gt; &lt;td&gt;Some label&lt;/td&gt; &lt;td&gt;Some complex control&lt;/td&gt; &lt;/tr&gt; &lt;tr id="Row3"&gt; &lt;td&gt;Some label&lt;/td&gt; &lt;td&gt;Some complex control&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database)</p> <p>How would I use JQuery/JS to accomplish this?</p> <p>EDIT:</p> <p>I have run into a performance issue with the appendTo code. It takes 400ms for a table of 10 rows which is really unacceptable. Can anyone help me tweak it for performance?</p> <pre><code>function RearrangeTable(csvOrder, tableId) { var arrCSVOrder = csvOrder.split(','); //No need to rearrange if array length is 1 if (arrCSVOrder.length &gt; 1) { for (var i = 0; i &lt; arrCSVOrder.length; i++) { $('#' + tableId).find('[fieldname = ' + arrCSVOrder[i] + ']').eq(0).parents('tr').eq(0).appendTo('#' + tableId); } } } </code></pre>
javascript jquery
[3, 5]
1,594,258
1,594,259
Making a treeview mimic required field validator functionality
<p>I am in need of validating a TreeView to make sure that users have selected something. What I need is something that mimics a RequiredFieldValidator and stops a page from posting back with any data until something is selected.</p> <p>I am using C# and ASP.NET 3.5</p> <p>I have tried this and it did not work for me:</p> <pre><code>if (TreeView.SelectedNode.Value == null) { lblError.Text = "Required"; lblError.ForeColor = Color.Red; } </code></pre> <p>I am at a loss, and any help would be very appreciated.</p>
c# asp.net
[0, 9]
5,872,902
5,872,903
Android Activities and sub-Activities
<p><br> I am new in Java and Android and now I have a follow problem. I want to pass String[] str variabe from one activity to another and show list of my string.<br> I have read <a href="http://developer.android.com/resources/tutorials/views/hello-listview.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-listview.html</a> tutorial . I have DataTest extends Activity class.</p> <pre><code>Intent myIntent = new Intent(DataTest.this, MyListAdapter.class); myIntent.putExtra("response", str); startActivity(myIntent); </code></pre> <p>When I want to open MyListAdapter extends ListActivity activity,I get an exception. </p> <p>Therefore I create MyListAdapter extends Activity activity class and declare there </p> <pre><code>ListActivity l = new ListActivity(); object. if(extras !=null) { String[] str = extras.getStringArray("response"); } </code></pre> <p>But here I get error. </p> <pre><code>l.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, str)); </code></pre> <p>Where do I mistake ???</p>
java android
[1, 4]
1,101,794
1,101,795
How to show validation errors after a postback
<p>I am having some textboxes and dropdownlist controls but if i select the ddl value the validation errors are disappearing and after the button click they are reappearing but i want to show the errors even after a postback how can i do this?? </p>
c# asp.net
[0, 9]
3,768,941
3,768,942
jQuery, multiple inputs and onBlur
<p>So I have 2 inputs. Both are for an "autocomplete". I also have 2 functions that do pretty much the same thing... Each input calls a different function onBlur. The problem is that the second upon selecting a "suggestion" for the second input, it populates the first. What can I do to make the second one populate the second?</p> <p>There's probably a better way of doing it but my jQuery/Javascript Knowledge is limited and I'm running out of time... Thanks!</p> <p>The code:</p> <pre><code>function fillLocation(thisValue) { $('#location-box').val(thisValue); setTimeout("$('#suggestionsLocation').fadeOut('fast');", 200); } function fillTerms(thisValue) { $('#terms-box').val(thisValue); setTimeout("$('#suggestionsTerms').fadeOut('fast');", 200); } &lt;input type="text" name="search_location" id="location-box" value="" onkeyup="suggestLocation(this.value);" onblur="fillLocation();" autocomplete="off" /&gt; &lt;input type="text" name="search_terms" id="terms-box" value="" onkeyup="suggestTerms(this.value);" onblur="fillTerms();" autocomplete="off" /&gt; </code></pre>
javascript jquery
[3, 5]
260,032
260,033
How to disable click with jQuery/JavaScript?
<p>I have a link that I would like to present with a confirmation. I am using the javascript <code>confirm()</code> method. But the only way for me to get the link to not work when the user clicks 'cancel' is to use <code>return false;</code>. Is that the correct way to do it (cross-browser)?</p> <pre><code>$('a.confirm').click(function() { if(confirm('Are you sure? This cannot be undone.')) { return true; } return false; }); </code></pre>
javascript jquery
[3, 5]
892,060
892,061
How to set the year of a date based on value from drop down
<p>I have a drop down that has the years basically 2011,2010,2009 etc... and there is a date that i need to append the year selected to, basically I want to check todays date</p> <pre><code>DateTime dt = DateTime.Today; </code></pre> <p>and then change the year of dt to the value selected of my drop down</p> <p><code>dt.Year = ddlMyYear.SelectedValue;</code> but this does not work, not sure how to do this..</p> <p>Thank you</p>
c# asp.net
[0, 9]
2,643,279
2,643,280
KeyPress is not calling in jquery
<p>i am capturing an event on enter through a selector. but it is not capturing. </p> <pre><code>var trID; row.click(function() { var tr = $(watchRow).find('tr'); $('tr').not(this).removeClass('highlight'); $(this).toggleClass('highlight'); trID = $(this).attr('id'); alert(trID); }); row.find('trID').keypress( function(event) { if (event.keyCode == 13) { //selfReference.addSymbolToWatch(); alert("You Press Enter!"); } }); </code></pre> <p>i am getting trID but actually what i want to do is when the row is selected then it is able to trigger an enter event on pressing enter.</p>
javascript jquery
[3, 5]
575,717
575,718
jQuery selector
<pre><code>var obj = document.getElementById("&lt;%= tbUpdate.ClientID %&gt;"); var colorid = obj.value; $('.shade[colorId=colorid]').addClass('active'); </code></pre> <p>the problem is with the colorId=colorid. I think jQuery thinks that its string. How can I pass value from var colorid into selector?</p>
jquery asp.net
[5, 9]
297,100
297,101
how to add new product ( hidden list ) forr smartcart jquery pluguin?
<p>i am using smartcart 2 jquery pluguin on my application to handle session cart. the user can create new product and add it to his cart. i use ajax call to save the product in my list .and then i need to refresh the list ( intial hidden products ). the ajax responce is the saved id of the new product. the problem is i can't add it to the cart ?? here is my script :</p> <p>// This function place the new saved product (from user ) to the cart</p> <pre><code> function addInventoryToCart(id) { $.ajax({ url: "{{ path('inventory_add_to_card') }}", type: "POST", data: "id="+id, success: function(html) { $("div.scCartList").append(html); } }); } </code></pre> <p>// This function add a new hidden entry for the new product</p> <pre><code> function refreshList(id) { $.ajax({ url: "{{ path('inventory_refresh_List') }}", type: "POST", data: "id="+id, success: function(html) { if(html != '') { $('.scTabs').before(html); } } }); } </code></pre> <p>and</p> <pre><code> $(document).ready(function(){ $("#weight").forceNumeric(); $("#height").forceNumeric(); $("#depth").forceNumeric(); // Call Smart Cart $('#SmartCart').smartCart(); $("#formNewProduct").submit(function () { $.ajax({ url: "{{ path('inventory_save_temp') }}", type: "POST", data: $(this).serialize(), success: function(html) { refreshList(html); addInventoryToCart(html); $('#SmartCart').populateProducts(); } }); $(".scMessageBar").hide(); return false; }); }); </code></pre>
javascript jquery
[3, 5]
5,175,140
5,175,141
Div onload function and embedding server code c#
<p>I am trying to call c# properties in .aspx page, where myfunc is jquery function. this function take parameters which i am passing through c# public properties. and I want to call this function as soon as div is rendered.previously i have done this on prerender event in ascx control. wha is exact ssyntax for below code and calling jquery function from here is valid?</p> <pre><code> &lt;div class ="v" onload ="Javascript:myfunc('&lt;%= this.articleID %&gt; ' ,'" +&lt;%=this.UserID %&gt;+"','" +&lt;%=this.EncryptedUserID %&gt;" +','" +&lt;%# this.ItemIndex %&gt;)"&gt; </code></pre> <p>thanks</p> <p>Edited</p> <p>Ok If i do like this way</p> <pre><code> &lt;div class ="v" &gt; &lt;script language ="javascript" &gt; JGetTotalVotes(&lt;%= this.articleid %&gt; ,&lt;% this.ThisEncryptedUserID %&gt;,&lt;% this.ItemIndex %&gt;,'aaa'); &lt;/script&gt; </code></pre> <p></p> <p>I do not want server side hidden fields solutions and if i use hiden field ( non server html tag) then i still need to call &lt;%%> to fetch value from server side to hiddent field</p>
c# javascript asp.net
[0, 3, 9]
4,251,637
4,251,638
check alphanumeric characters in string in c#
<p>i have used the following code but it is returning false but it should return true </p> <pre><code>string check,zipcode; zipcode="10001 New York, NY"; check=isalphanumeric(zipcode) public static Boolean isAlphaNumeric(string strToCheck) { Regex rg = new Regex("[^a-zA-Z0-9]"); //if has non AlpahNumeric char, return false, else return true. return rg.IsMatch(strToCheck) == true ? false : true; } </code></pre>
c# asp.net
[0, 9]
3,971,215
3,971,216
relpace textarea in jquery
<p>I'm trying to Replace a %%%VERSION%%% text, the text is coming from an tinyMCE editor. </p> <p>looks like this. </p> <pre><code>$("#description textarea").val($("#description textarea").val().replace(/%%%VERSION%%%/g, STAT_VERSION_INFO)); </code></pre> <p>The value of the textearea is:</p> <pre><code>&lt;textarea rows="20" cols="117" name="description" id="description"&gt;Some code version info: %%%VERSION%%%&lt;/textarea&gt; </code></pre> <p>But i can't make it replace anything. </p> <p>Any idéas how to fix it, or maybe other solutions. </p>
javascript jquery
[3, 5]
5,556,649
5,556,650
Using the cache android
<p>I implemented an application that are fed from an XML stream. The XML feed changes every once daily.</p> <p>I want to know if I can meter the xml file caching for one day for each round has not questioned the service that provided the xml But every day at midnight I want it retrieves the new version of XML</p> <p>cordially</p>
java android
[1, 4]
5,803,451
5,803,452
Loading ASP.NET user control at run time
<p>I have an ASP.NET user control with a button, and I want to add it to the page when the user clicks a button from another user control. I have created an event handler to the first user control to handle it from the page and add the second user control to a page. Everything is working normally, but the button on the second user control doesn't respond to the event.</p> <p>I place the second control on <code>RadAjaxPanel</code> </p> <p>Note: When I add the second user control at design time its working fine.</p>
c# asp.net
[0, 9]
6,001,263
6,001,264
Using a custom image as a form
<p>I've made my own custom log-in form in cs6 and I'd like to use that as my log-in form for my android application. What are some common ways about doing this? I'm fairly new to the Android world, so this is all new to me. </p> <p>I would think to use the image as a ImageView tag and then add a my text field on top of it? Or is there a better way to do this? I'd like to do this instead; In Swing you're allowed to, for example, override a buttons custom image with your own or a label with your own. Is there this kind of functionality in Android development? </p>
java android
[1, 4]
757,753
757,754
Javascript: Interpolating variables inside strings
<p>I have the following jquery code which loads the <code>#content</code> div from <em>another</em> page, into the <code>#result</code> div on the <em>current</em> page:</p> <pre><code>$('a').click(function(event){ $('#result').load('abother_page.html #content'); }); </code></pre> <p>As you can see, I'm hard-coding the name of the requested file, along with the specific div I want to display, into the string that is sent with the load method.</p> <p>I'm trying to make this dynamic, but my code is missing something:</p> <pre><code>// get the href of the link that was clicked var href=$(this).attr('href'); // pass the href with the load method $('#result').load('href #content'); </code></pre> <p>Obviously this doesn't work because the href variable that i've created is not interpolated in the string. How can I do that? </p> <p>I tried the following, all without success:</p> <pre><code>// Ruby-style: $('#result').load('#{href} #content'); // Concatenating-style $('#result').load(href + '#content'); </code></pre>
javascript jquery
[3, 5]
2,911,038
2,911,039
Super simple JQuery Question - refresh static html
<p>I have the following two functions that work great:</p> <pre><code>$(function(){ $('.trash_can a.delete').live('click', function(event) { event.preventDefault(); var link = $(this); $.post(link.attr('data-href'), { promo_id: link.attr('data-promo_id') }, function(data) { $('#page').html(data.html); }); console.log('Clicked Delete'); }); }); $(function(){ $('#add-mod-form').bind('ajax:success', function(evt, data, status, xhr){ data = $.parseJSON(data); // console.log(data.success); if (data.success == true) { $('#page').html(data.html); $('#page box_bc').html() } else { } }); }); </code></pre> <p>As data is received for page, I would also like to reload a static html element, $('#page box_bc') - How do I do this simple task with Jquery? Notice, i've tried it above, and that part does not work as planned.</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,766,797
1,766,798
Jquery replace character and apply classes
<p>I have several string in the following format</p> <pre><code>&lt;span class="label"&gt;20€&lt;/span&gt; </code></pre> <p>And want to convert it all to something like this:</p> <pre><code>&lt;span class="label"&gt;20&lt;small&gt;€&lt;/small&gt;&lt;/span&gt; </code></pre> <p>How could I achieve this in Jquery?</p>
javascript jquery
[3, 5]
5,090,165
5,090,166
foreach through div
<p>I have got some trouble about doing an loop through the following construct:</p> <pre><code>&lt;div id="items"&gt; &lt;p id="test1"&gt; &lt;select name="1" id="1"&gt;&lt;option&gt;A&lt;/option&gt;&lt;option selected&gt;B&lt;/option&gt;&lt;/select&gt; &lt;input type="text" name="to" id="to"&gt; &lt;input type="text" name="away" id="awy"&gt; &lt;/p&gt; &lt;p id="test2"&gt; &lt;select name="2" id="2"&gt;&lt;option&gt;A&lt;/option&gt;&lt;option selected&gt;B&lt;/option&gt;&lt;/select&gt; &lt;input type="text" name="to" id="to"&gt; &lt;input type="text" name="away" id="awy"&gt; &lt;/p&gt; &lt;p id="test3"&gt; &lt;select name="3" id="3"&gt;&lt;option&gt;A&lt;/option&gt;&lt;option selected&gt;B&lt;/option&gt;&lt;/select&gt; &lt;input type="text" name="to" id="to"&gt; &lt;input type="text" name="away" id="awy"&gt; &lt;/p&gt; &lt;/div&gt; </code></pre> <p>I need to run through test1, test2 and test3 and read the selected option and the values of the text-fields (select, to,away). Doing this if i got only one thing in for example test1 is no problem with query: </p> <pre><code>$('#items').children('p').each(function () {...} </code></pre> <p>But if i add the two text-fields and want to do this for each test (1-3) I have no idea...</p> <p>Any idea? Thanks!</p>
javascript jquery
[3, 5]
4,437,269
4,437,270
Asp.Net(C#) Jquery Ajax with WebMethod In Public Method Call
<p><strong>Aspx Page:</strong></p> <pre><code>$(document).ready(function() { $("#btnn").click(function() { $.ajax({ type: "POST", url: "TestPage.aspx/emp", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { } }); }); }); </code></pre> <p><strong>CodeBehind:</strong></p> <pre><code>public void grdload() { GridView1.DataSource = GetEmployee("Select * from Employee"); GridView1.DataBind(); } [WebMethod] public static void emp() { TestPage re = new TestPage(); re.grdload(); } </code></pre> <p>I Can't Gridview Data Load ? How To Make GridView Data Load?</p> <p>Thank You</p>
asp.net jquery
[9, 5]
87,575
87,576
Encode and Decode in c# asp.net?
<p>i am using Encoding and decoding :</p> <p>For Encoding:</p> <pre><code>private string EncodeServerName(string ServerName) { byte[] NameEncodein = new byte[ServerName.Length]; NameEncodein = System.Text.Encoding.UTF8.GetBytes(ServerName); string EcodedName = Convert.ToBase64String(NameEncodein); return EcodedName; } </code></pre> <p>and Decoding:</p> <pre><code> public string DecoAndGetServerName(string Servername) { System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); System.Text.Decoder strDecoder = encoder.GetDecoder(); byte[] to_DecodeByte = Convert.FromBase64String(Servername); int charCount = strDecoder.GetCharCount(to_DecodeByte, 0, to_DecodeByte.Length); char[] decoded_char = new char[charCount]; strDecoder.GetChars(to_DecodeByte, 0, to_DecodeByte.Length, decoded_char,0); string Name = new string(decoded_char); return Name; } </code></pre> <p>I am sending ServerName:<code>DEV-SQL1\SQL2008</code></p> <p>It is encoded:<code>REVWLVNRTDFcU1FMMjAwOA==</code></p> <p>Again i want to decode but getting Exception:in line:</p> <p><code>byte[] to_DecodeByte = Convert.FromBase64String(Servername);</code></p> <p>Exception IS:</p> <p>`The input is not a valid Base-64 string as it contains a non-base 64 character, </p> <p>more than two padding characters, or a non-white space character among the padding characters.`</p> <p>How to solve this issue.</p> <p>Please Help Me</p>
c# asp.net
[0, 9]
2,864,714
2,864,715
jQuery addClass onClick
<p>The setting is easy; I want to be able to add a class to (in this case) a button when onClick-event is fired. My problem is that I haven't found a way to pass the button itself as the parameter to the function. I'd like to do something like:</p> <pre><code>&lt;asp:Button ID="Button" runat="server" onclick="addClassByClick(this)"/&gt; </code></pre> <p>And then a javaScript function something like this:</p> <pre><code>function addClassByClick(button){ button.addClass("active") } </code></pre> <p>I know I've got a lot of errors here, but that's why I'm posting. I've tried different scenarios with jQuery and without jQuery but I always end up with a broken solution (clicks suddenly stop coming through, class not added etc etc) so I decided to ask the pro's.</p> <p>Any suggestion to what I can try? Thanks for reading *<em>edit</em>*and all the help!</p>
javascript asp.net jquery
[3, 9, 5]
2,510,593
2,510,594
Accessing a variable passed by jquery using php
<p>How does php access a variable passed by JQuery?</p> <p>I have the following code:</p> <pre><code>$.post("getLatLong.php", { latitude: 500000}, function(data){ alert("Data Loaded: " + data); }); </code></pre> <p>but I don't understand how to access this value using php.</p> <p>I've tried </p> <pre><code>$userLat=$_GET["latitude"]; </code></pre> <p>and </p> <pre><code>$userLat=$_GET[latitude]; </code></pre> <p>and then I try to print out the value (to check that it worked) using:</p> <p><code>echo $userLat;</code> but it does not return anything. I can't figure out how to access what is being passed to it. </p>
php jquery
[2, 5]
126,169
126,170
How to load javascript function on page load ?
<p>I have used javascript to generate 2D bar-graphs in a HTML page. When i am trying to load this HTML page containing bar-graph in to a div tag of some other HTML page using jQuery <code>.load()</code> function bar-graph (i.e, scripts) are not loading.</p> <p>Please help on this issue.</p> <p>For example i have bar-graph in <code>xyz.html</code>. I am trying to load <code>xyz.html</code> in <code>abc.html</code> div tag using jquery <code>.load()</code> function. Bar-graphs are missing.</p> <p>Hoping for a reply, thanks for help in advance. </p>
javascript jquery
[3, 5]
5,104,952
5,104,953
Better way than setInterval?
<p>I have the current function below, but feel like there is a much better way to write the same thing. I am looking for some insight on the most optimized way to write the same function below and why.</p> <p>Note this is all inside of <code>$(function(){});</code></p> <pre><code>m = function(){ $("#id").animate({marginRight : 0}, 'slow', function(){ $("#id").animate({marginRight : "15px"}, 'slow'); }) } setInterval(m, 700) </code></pre>
javascript jquery
[3, 5]
2,093,211
2,093,212
make radio button selected based on an event
<p>I have several divs of class OuterDiv that contain divs of class InnerDiv that contain radio buttons.</p> <pre><code>&lt;div class="OuterDiv"&gt; &lt;div class="InnerDiv"&gt; &lt;input type="radio" name="TheOptions" /&gt;option 1 &lt;/div&gt; &lt;/div&gt; &lt;div class="OuterDiv"&gt; &lt;div class="InnerDiv"&gt; &lt;input type="radio" name="TheOptions" /&gt;option 2 &lt;/div&gt; &lt;/div&gt; &lt;div class="OuterDiv"&gt; &lt;div class="InnerDiv"&gt; &lt;input type="radio" name="TheOptions" /&gt;option 3 &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I'm looking to catch the event "user clicked on div" to make the corresponding radio button selected.</p> <p>This is what I have so far:</p> <pre><code>$('.OuterDiv .InnerDiv').click(function { $(this).find('radio').... }); </code></pre> <p>I can get to the radio button but I'm stuck on making it selected and making any of the currently selected button unselected (unless selecting one automatically unselects all others).</p> <p>Thanks for your suggestions.</p>
javascript jquery
[3, 5]
903,919
903,920
Simple Redirect Page With Click Button To Continue
<p>I need to create a dynamic redirector page that I can put ads banner and a call button that appears after 5 seconds. When I click the button, it will redirect to any URL after ?</p> <p>For example :</p> <p>1 - user click a link in website : - <a href="http://www.mydomain.com/go.php?http://www.google.com" rel="nofollow">http://www.mydomain.com/go.php?http://www.google.com</a></p> <p>2 - go.php loads a landing page with 5 seconds countdown timer show up</p> <p>3 - after 5 seconds, a button appears...user can click the button to go to actual link</p> <p>I manage to get the simple code..but I don't want it to automatically redirect...</p> <pre><code>&lt;?php $redirect = $_SERVER['QUERY_STRING'].''; ?&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="robots" content="noindex" /&gt; &lt;meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"&gt; &lt;title&gt;Your Page title&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; setTimeout("location.href ='&lt;?php echo $redirect ?&gt;'",500); &lt;/script&gt; &lt;/html&gt; </code></pre> <p>You can refer to oneclickmoviez.com and try to click any download link for my example.. try this : <a href="http://oneclickmoviez.com/dws/TURBOBIT/51776/7" rel="nofollow">http://oneclickmoviez.com/dws/TURBOBIT/51776/7</a></p> <p>I'm not too expert in php coding, so I hope you can show me 100% working codes.</p>
php javascript
[2, 3]
1,960,477
1,960,478
Redirect to the link in parent window
<p>In parent page I'm using:</p> <pre><code>function popitup(url) { newwindow = window.open("child.aspx", 'name', 'height=700,width=800,scrollbars=yes, resizable=no '); if (window.focus) { newwindow.focus() } return false; } </code></pre> <p>Child window has a link:</p> <pre><code>protected void GridView_SelectedIndexChanged(object sender, EventArgs e) { Response.Redirect("Link1.aspx"); } </code></pre> <p>I'm getting redirected in child window. But I want to open "Link1.aspx" in parent window.</p>
javascript asp.net
[3, 9]
3,542,365
3,542,366
How to get SelectedValue of DropdownList without postback or updatepanel
<p>I have a <code>DropDownList</code> which i am binding on page load. i dont have any buttons or anything. as soon as user selects the value in dropdown i need to show that value in label. i am not sure why this is not working. please help.</p> <pre><code>public string SelectedStore { get; set; } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindStoresList(); } } protected void BindStoresList() { storeDDList.AppendDataBoundItems = true; storeDDList.Items.Add(new ListItem("Select store", "-1")); TempCollection stores = TempDataSource.LoadForCriteria("ALL", "Code ASC"); storeDDList.DataSource = stores; storeDDList.DataTextField = "DisplayName"; storeDDList.DataValueField = "Code"; storeDDList.DataBind(); } protected void storeDDList_SelectedIndexChanged(object sender, EventArgs e) { SelectedStore = storeDDList.SelectedValue.ToString(); selectedItem.Text = SelectedStore; } </code></pre> <p>I dont need any kind of jquery stuff as i am going to add gridview which binds depending on the value of dropdown..</p> <pre><code>****** EDITS ******* </code></pre> <p>if i set <code>AutoPostBack=True</code> then on page refresh my DropDownList doesn't bind at all as you can see in Page_Load Method, it will not call <code>BindStoresList()</code> method.</p> <pre><code>***** ANSWER ***** </code></pre> <p>For people who might get stuck with this.. </p> <p>i was setting the <code>EnableViewState</code> to <code>False</code> for the <code>DropDownList</code>, so after page refreshes the <code>SelectedValue</code> was getting lost. after removing the <code>EnableviewState</code> and setting <code>AutoPostBack</code> to <code>Ture</code> working fine...</p>
c# asp.net
[0, 9]
3,064,432
3,064,433
Change "value" of a <input> while clicking on query result, while more than one record
<p>I have a script that would change the value of a input field: </p> <pre class="lang-php prettyprint-override"><code> &lt;script language="javascript"&gt; function klientid() { var getid = document.getElementById("getidfromsearch");//results var klid = document.getElementById("idklienta"); //input field if(getid != "0") { klid.value = getid.textContent; } &lt;/script&gt; </code></pre> <p>a search engine and this is how results are printed:</p> <pre class="lang-php prettyprint-override"><code> &lt;?php while($rowmilion = mysqli_fetch_array($resultmilion)) { ?&gt; &lt;a href="javascript:klientid()"&gt; &lt;table&gt; &lt;tr&gt; &lt;td style="font-weight:bold; width: 160px; text-align:right;"&gt;ID:&lt;/td&gt; &lt;td style="width:200px;" id="getidfromsearch"&gt;&lt;?php echo $rowmilion['id']; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/a&gt; &lt;?php } ?&gt; </code></pre> <p>Now, when as the result there is only one record and I click on the link, it does change the value of a input field fine.</p> <p>When result consists of more than one record, whichever link I would click, it will always get the value from the first record for example:</p> <pre class="lang-php prettyprint-override"><code>ID: 100 ID: 200 ID: 300 </code></pre> <p>So when I click on the third position, it will still change the value of a input field to 100 instead of 300.</p> <p>I quess, this is because all records get the same "ID"... But still, I can't make it work.</p>
php javascript
[2, 3]
528,950
528,951
jQuery not behaving as expected in reference to clicks
<p>I have an element that I grab the content of and swap for an input, I then want to user to be able to click on the input (to enter text as normal), but if they click anywhere else to swap it back to the text.</p> <p>However the click event seems to fire even the very first time the user clicks anywhere on the page. My code is below, have I misunderstood something?</p> <pre><code>$(document).ready(function(){ $("#thingy").css('cursor', 'pointer'); $("#thingy").one("click", function() { var element = $(this); element.css('cursor', 'auto'); element.css('display', 'inline-block'); element.fadeOut(100, function(){element.html('&lt;input type="text" size="25" value="' + element.text() + '" style="width:' + element.width() + 'px;height:' + element.height() + 'px;border:none;padding:0px;margin:0px;"&gt;')}).fadeIn(100); $("#thingy").click(function() { return false; }); $(document).click(function() { alert("You clicked off the text-box"); element.html(element.children('input:text').val()); }); }); }); </code></pre>
javascript jquery
[3, 5]
3,471,793
3,471,794
can jquery and javascript co-exist in a file?
<p>can i use javascript and jquery both in a page?</p> <p>like:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ //some jquery }); function xyz(){ //javascript statements //some jquery statements } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,046,370
1,046,371
how to get 1 hidden field among several within div
<p>i have 3 hidden fields in 1 div. when I have reference to this div, how to get 1 of the hidden fields in this div.</p>
javascript jquery
[3, 5]
920,768
920,769
Menu icons won't appear
<p>I'm trying to add some menu items with icons to a menu. The items appear but without the icon on the left side of them, it's just the text...</p> <p>By the way, I'm using the Holo Light theme...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/menu_market" android:title="View on Play Store" android:icon="@drawable/ic_playstore_colorful"/&gt; &lt;/menu&gt; </code></pre> <p>Thanx upfront!</p>
java android
[1, 4]
5,366,728
5,366,729
fire a function after triggering a click event
<p>How can fix this :</p> <pre><code>function Navigation(sender) { var senderID = sender.id; var answer = confirm("do you want to save your current layout ?"); if (answer) { $("#loadingImg").css("display", "block"); $("#&lt;%=Button1.ClientID %&gt;").click(); //the next line is never fired if (senderID == "AboutClick") { setTimeout('ShowLoadingMsg()', 3000); } } } function ShowLoadingMsg() { window.location="About.aspx"; } &lt;a href="javascript:void(0)" id="AboutClick" class="menu" onclick="Navigation(this);" &gt;Navigate Click&lt;/a&gt; &lt;asp:Button ID="Button1" runat="server" OnClick="btnSaveState_Click" style="display:none;" /&gt; </code></pre> <p>//Server side:</p> <pre><code> protected void btnSaveState_Click(object sender, EventArgs e) { SaveState(); } </code></pre> <p>The main problem is that this line is never fired what am i doing wrong here </p>
javascript jquery
[3, 5]
3,001,667
3,001,668
Javascript comfirmation popup not showing
<p>I am trying to validate some fields in DIV and if theres no validation error, I would show a comfirmation popup, below is my code, apparently the popup doesn't appear, if I remove the Page_ClientValidate(); and the popup will show. Please kindly advice. Thanks. </p> <pre><code>&lt;asp:Button ID="uibtnVoucherIssuance" runat="server" Text="&lt;%$ Resources : Resources, uiIVouchers %&gt;" OnClientClick="if(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); if(Page_IsValid){return confirm('Proceed with voucher issuance?');}" ValidationGroup="Issuance" /&gt; </code></pre>
javascript asp.net
[3, 9]
3,442,462
3,442,463
Any JavaScript or jQuery Method to Load JS files synchronously?
<p>I'm loading user control through jQuery in my asp.net page. </p> <p>User control contains JavaScript files, while loading the user control all my js load at one time which are dependent on each other and they tend to give error while all file load at one time. So I want that my JavaScript file to load synchronously one by one , as one file get completely loaded than next file should start loading . </p> <p>Is there any way to set synchronously mode in JavaScript? or any JavaScript to set this? Any pointer or suggestion would be really helpful.</p>
javascript asp.net jquery
[3, 9, 5]
3,747,617
3,747,618
recursive function calling itself even condition is satisfied
<p>i have a very simple code here which uses recursion to iterate the queue class i need to simple print 6 on screen but it print 1 ,please tell me where i am wrong.</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { q.Enqueue(1); q.Enqueue(2); q.Enqueue(3); q.Enqueue(4); q.Enqueue(5); q.Enqueue(6); long id = getID(Convert.ToInt64(q.Dequeue())); Response.Write(id); } private long getID(long id) { if (id == 6) { return id; } else { id = Convert.ToInt64(q.Dequeue()); if (q.Count != 0) { getID(id); } else { } } return id; } </code></pre> <p>}</p>
c# asp.net
[0, 9]
4,642,730
4,642,731
what is the difference between the below two syntaxes?
<p>1.</p> <pre><code> $(function () { function foo() { return true; } log(bar()); // getting error var bar = function() { return true; }; }); </code></pre> <p>2.</p> <pre><code>$(function () { function foo() { return true; } log(bar()); // working function bar() { return true; }; }); </code></pre> <p>in above snippets <strong>log</strong> is my custom function to log the result.</p>
javascript jquery
[3, 5]
4,657,507
4,657,508
Detect redirect in iFrame
<p>I may be asking the wrong question here so I will provide a small amount of detail about what I am trying to accomplish. </p> <p>I use a third party web app to track support tickets. They provide the code for a form that my users fill out and it submits to their domain. I want to use this form on two different domains, but unfortunately the third party uses a single, hard coded redirect value. This causes one of my sites to switch domains after submission. </p> <p>I was thinking I could embed their form in an iFrame, detect the redirection on successful form submission and instead redirect to one of my own pages. </p> <p>Pseudocode:</p> <pre><code>iframe.detectRedirection if (redirect == 'xyz.html') { //do my own redirection in main window. } </code></pre> <p>So back to my original question - how can I detect the redirection in the iframe?</p>
javascript jquery
[3, 5]
930,451
930,452
Android - Detect app moving to background and foreground
<p>If application is gone to background and come back after 5 minutes, I need to restart the app. We can leave the restart part, how will we detect the app moving to background and to foreground? Please help. </p> <p>If there is a link on details of its official impossibility or possibility, please share.</p>
java android
[1, 4]
3,657,671
3,657,672
hovering of tds
<p>I have a table in my application. I need to start hovering effect on a td when that cell is clicked and then stop hovering till the next click. Also mouseover to the next row of td that (hovering a range of tds). I am new to jquery. Please help.</p> <pre><code>jQuery('td').hover(function(){ jQuery(this).css("background","#000"); }, function(){ jQuery(this).css("background","green"); }); </code></pre>
javascript jquery
[3, 5]
573,789
573,790
JavaScript's strange behavior
<p>If uncomment <code>body.children().each(calc_deep(1));</code> then i get <code>TypeError: Object [object Window] has no method 'attr'</code> on the <code>parseInt(deepest.attr('deep'))</code> string, but without uncomment you can check in console that you can call <code>deepest.attr('deep')</code>. What is that?</p> <pre><code> var deepest; var calc_deep = function(i) { $(this).attr('deep',i); if(i&gt;parseInt(deepest.attr('deep'))) deepest=this; $(this).children().each(calc_deep(i+1)); } var find_deepest = function() { body=$('body').children().eq(0); body.attr('deep',0); deepest=body; //body.children().each(calc_deep(1)); } find_deepest(); </code></pre>
javascript jquery
[3, 5]
3,009,216
3,009,217
jquery error on appending html content to div tag
<p>Here is the code I am having:</p> <pre><code>&lt;div id="removequestions"&gt;&lt;/div&gt; var html += '&lt;input type=radio name=questions /&gt;'; $.('#removequestions').append(html); </code></pre> <p>The javascript error I am getting on executng the above code is:</p> <pre><code>XML filter is applied to non-XML value (function (a, b) {return new c.fn.init(a, b);}) </code></pre> <p>Any idea why this error occurs. I want to add radio button dynamically.</p>
javascript jquery
[3, 5]
5,979,680
5,979,681
Change the color of strings affected by regex on (document).ready
<p>So I what I'm trying to accomplish here, is to change the color of words affected by some regex.</p> <pre><code>$(document).ready(function(){ container = $("#modal_container section").text(); hashtags = /\#\w+/g; var container_hash = container.match(hashtags); $(container_hash).css({'color':'red'}); //We're grabbing the words, but how can I change the color? alert(container_hash); }); </code></pre> <p>Here's a fiddle <a href="http://jsfiddle.net/vuDzC/2/" rel="nofollow">http://jsfiddle.net/vuDzC/2/</a> to make it more clear.</p> <p>Thanks </p>
javascript jquery
[3, 5]
572,044
572,045
JQuery Dropdown Menu <li> Links Do Not Work In Internet Explorer
<p>I recently implemented a jQuery dropdown from this developer's site: <a href="http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/" rel="nofollow">http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/</a>, and it looks and works fine on my site in Chrome and Firefox (my site is: <a href="http://www.ExpeditionerSafaris.com" rel="nofollow">http://www.ExpeditionerSafaris.com</a>).</p> <p>However, in Internet Explorer (of course), the li links do not work.</p> <p>Here is the code:</p> <pre><code>function DropDown(el) { this.dd = el; this.initEvents(); } DropDown.prototype = { initEvents: function () { var obj = this; obj.dd.on('click', function (event) { $(this).toggleClass('active'); event.stopPropagation(); }); } } $(function () { var dd = new DropDown($('#dd')); $(document).click(function () { // all dropdowns $('.wrapper-dropdown-5').removeClass('active'); }); }); </code></pre>
javascript jquery
[3, 5]
113,077
113,078
Best way to refer to javascript in UserControl(ascx)
<p>I usually create usercontrol which is referring javascript file/block. For example, I have a cascading Nation/City selection which is based on AJAX in my Register.ascx(a usercontrol), certainly I need add the javascript file into page. I have 3 ways at present:</p> <p>1.Writing <code>&lt;Script&gt;</code> element in .ascx file directly, but it will bring nonstandard HTML structure due to many <code>&lt;Script&gt;</code> elements would appear in <code>&lt;Body&gt;</code>. </p> <p>2.Writing <code>&lt;Script&gt;</code> element in aspx page which will use the usercontrol, but the father(aspx) rely on child(ascx), it's listening too bad.</p> <p>3.Using <code>ScriptManager</code> or <code>HtmlGenericControl</code> to register file/block in head, but I'm worrying about performance of them, and it's a bit weird that I bring javascript to c# file.</p>
javascript asp.net
[3, 9]
2,829,315
2,829,316
android Service to detect that home screen is on
<p>Can I write an service in android which detects that we are on home screen and Toast a message. I want to detect that control is currently on home screen.</p> <p>Let me know if possible.</p> <p>Thanks, Pravin</p>
java android
[1, 4]
122,062
122,063
Iframes not loading in Firefox
<p>I have a web page with multiple iframes. These ifrmaes trying to load some web forms. My problem is, these forms are not loading in Firefox but working fine in IE8 and chrome.</p> <p>Any idea abut this problem ?</p> <p>Following is the fragment of code. What it does is, creating multiple iframes dynamically.</p> <pre><code> foreach ($references as $key =&gt; $reference) { &lt;iframe scrolling='no' onload='javascript:resizeIframe(this);' id="refForm_&lt;?php echo $reference-&gt;getRecruitmentReferenceFormData()-&gt;getId(); ?&gt;" style="display:block;margin-left:auto;margin-right:auto;" src="&lt;?php echo url_for('recruitment/viewReferenceForm') . '?id=' . $reference-&gt;getRecruitmentReferenceFormData()-&gt;getId(); ?&gt;" id="rightMenu" name="rightMenu" height="1000px" frameborder="0"&gt;&lt;/iframe&gt; &lt;?php } function resizeIframe(obj) { var size = obj.contentWindow.document.body.offsetHeight; size = size + 900; obj.style.height = obj.contentWindow.document.body.offsetHeight + 'px'; obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px'; } </code></pre>
php javascript
[2, 3]
1,535,069
1,535,070
.click doesn't seem to be firing...why?
<p>I am attempting to get a link to fire JQuery's .click() function so that I can call another script behind the scenes. All of the JQuery is generated dynamically by PHP. </p> <p>The code looks correct, but the .click is not firing.</p> <p>This is the code that generates the jquery:</p> <pre><code> $jscript = "$(\"".$server ."Restart\").click(function() { $.get(\"modules/test.php\", {command: \"RESTART\", server: \"$server\"}, function(data){ alert(\"Data Sent: \" + data); } ); }); "; </code></pre> <p>This is the code as it looks after generation (with just an alert right now because I can't get it to do anything):</p> <pre><code>$("critRestart").click(function() { $.get("modules/test.php", {command: "RESTART", server: "crit"}, function(data){ alert("Data Sent: " + data); } ); }); </code></pre> <p>This is the link that is clicked on that should be firing that event: <code>&lt;div id="critRestart"&gt;&lt;a href="#"&gt;RESTART&lt;/a&gt;&lt;/div&gt;</code></p> <p>Can anyone help?</p>
php jquery
[2, 5]
566,122
566,123
Why can't I throw an exception while using the ternary operator
<p>This doesn't compile and gives the following error : <code>Illegal start of expression</code>. Why?</p> <pre><code>public static AppConfig getInstance() { return mConfig != null ? mConfig : (throw new RuntimeException("error")); } </code></pre>
java android
[1, 4]
5,361,421
5,361,422
Determining target TD when TR is clicked
<p>Given some click event for a table row:</p> <pre><code>$("tr.somerow").click(function(){ //do some stuff //can I determine the TD under the cursor at the time of clicking? }) </code></pre> <p>Can I determine which TD (or any child elements) was under the cursor at the time of clicking?</p>
javascript jquery
[3, 5]
4,597,802
4,597,803
Android 1.5/1.6 issue with style and autogenerated R.java file
<p>I'm having strange issue with R.java file and styles defined in my resources.</p> <p>Here's some code:</p> <p>In res/values/strings.xml:</p> <pre><code>&lt;style parent="android:Theme.Dialog" name="PopupWindowStyle"&gt; &lt;item name="android:windowBackground"&gt;@drawable/bg1&lt;/item&gt; &lt;item name="android:textColor"&gt;@android:color/black&lt;/item&gt; &lt;/style&gt; </code></pre> <p>In AndroidManifest.xml:</p> <pre><code>&lt;activity android:name=".RegisterScreen" android:icon="@drawable/ico" android:label="@string/applicationName" android:theme="@style/PopupWindowStyle" android:configChanges="locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale"&gt; &lt;/activity&gt; </code></pre> <p>In autogenerated gen/.../R.java:</p> <pre><code>public static final class style { public static final int PopupWindowStyle=0x7f090000; } </code></pre> <p>After some changes in the project, eclipse changed autogenerated value for <code>PopupWindowStyle</code> from 0x7f080000 to 0x7f090000. After that, on Android 1.5, <code>RegisterScreen</code> activity is displayed without <code>PopupWindowStyle</code> style - there is an error displayed in logcat:</p> <p><code>Skipping entry 0x7f090000 in package table 0 because it is not complex!</code></p> <p>On Android 1.6 however everything works fine - <code>PopupWindowStyle</code> works like it was before it's integer value has changed.</p> <p>I was testing this issue, by reverting the source code to older revisions. I can confirm, that this problem started occurring after src code commit, which changed two files completely unrelated to this part of code - and an autogenerated R.java file.</p> <p>Any idea what could cause that? </p>
java android
[1, 4]
5,501,547
5,501,548
jquery display + delay strategy
<p>The following javascript displays the final result (instead of updating every second). How can I iterate through the result of the getJSON call, display that result, and delay until I display the next element?</p> <pre><code>function display(state) { for (var i=0; i &lt; state.length; i++) { $('#someDiv' + i).text(state[i]); } } $.getJSON('/getdata', function(data) { $.each(data, function(key, val) { setTimeout(function(){display(val)}, 1000); }); } </code></pre>
javascript jquery
[3, 5]
3,550,564
3,550,565
jQuery: Detect element's height when window is resized
<p>I need help with the following issue.</p> <p>I'm creating a responsive site. Its structure is quite basic: header, nav bar, body and footer.</p> <p>In the header I have several elements and all these elements use percentages for their dimensions, so the <em>height</em> of the header is determined by the height of the elements inside of it.</p> <p>For the nav bar I plan to use a "sticky" script, so when you scroll the page, the nav bar 'sticks' to the top of the page, and once you go back all the way up, it 'unsticks' and appears under the header.</p> <p>So far, so good.</p> <p>Thing is that the sticky script depends on the <em>height</em> of the header in order to correctly stick the nav bar under the header. So when I resize my window to test the responsiveness of the layout, the sticky nav bar goes crazy.</p> <p>What I need is a way to detect the <strong><em>height</em></strong> of the header and modify the DOM by creating a style on the <code>&lt;header&gt;</code> ie. (<code>&lt;header style="height:198.3px"&gt;</code>), and assign a dynamic height to it as I resize the browser window.</p> <p>I think this is something that would be accomplished using the <code>height();</code> property, but I'm not a jQuery guru so I'm not sure if that would work.</p> <p>Any help is greatly appreciated.</p> <p>PS. BTW, Stackoverflow.com uses this 'sticky' feature on the boxes on the right column when you're creating/editing a post.</p>
javascript jquery
[3, 5]
5,622,696
5,622,697
make a div with jquery dialog scroll to bottom when loaded
<p>this is the code :</p> <pre><code>$(document).ready(function(){ $("#Dialog").dialog({ title: "dialog", width: 360, height: 365, modal: false, resizable: false, focus: function (event, ui) { $("#ToClientID").val(ToClient); }, open: function (event, ui) { $(this).scrollTop(10000000000000000000000000); } }); }); </code></pre> <p>why the div isn't scrolling to bottom when he is loaded </p>
javascript jquery
[3, 5]
5,667,060
5,667,061
jquery weekcalendar resize/drop variables current div
<p>I am customizing the jquery weekcalendar to use json to read/write data to a mysql database.</p> <p>What works so far, loading the cal from db, creating and storing new events on cal and deleting events on the calendar.</p> <p>I run into problems trying to get the time/date variables when you resize an event on the calendar.</p> <p>Selecting all the values for the events is possible but I don't know how to get the current resized event.</p> <p>So far I have: </p> <pre><code>eventResize : function(calEvent, $event) { var startField = $(".wc-time").text(); alert(startField); }, </code></pre> <p>This selects all the calendar event times but I only need the one that I just resized.</p> <p>Any toughts?</p>
javascript jquery
[3, 5]
4,331,211
4,331,212
How to clear TextBox text and AJAX CalendarExtender value using Javascript?
<p>I have an ASP.NET user control that contains a textbox which has an AJAX CalendarExtender control which allows users to select a date which then populates the textbox.</p> <p>I can clear the textbox value using a submit button and setting the value to null in the code behind, but I need to set the value to "" in the textbox using Javascript.</p> <p>I have tried the following javascript but it didn't work:</p> <pre><code>function ClearTextBox() { document.getElementsByName('TextBox1').Value = ""; } </code></pre> <p>What javascript should I use?</p>
c# javascript asp.net
[0, 3, 9]
4,674,547
4,674,548
Find City,Country from IPaddress
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/372591/how-to-get-city-country-and-country-code-for-a-particular-ip-address-in-asp-net">How to get City, Country, and Country Code for a particular IP Address in ASP.NET?</a> </p> </blockquote> <p>I want to find out the City, country from the Given IP address.</p> <p>Any suggestion will help me lot.</p>
c# asp.net
[0, 9]
3,835,147
3,835,148
How to get list of files from directory FTP?
<p>I have made Android application and I have a problem: I use org.apache ftp client and i have following code:</p> <pre><code> client.connect(InetAddress.getByName(...)); boolean result=client.login(..., ...); client.enterLocalPassiveMode(); for (String s:client.listNames("Power Serve")) { Log.e("name", s); } for (FTPFile f:client.listFiles("Power Serve")) { Log.e("file", f.getName()); } </code></pre> <p>But first circle works and second doesn't work! I have tried to change "Power Serve" directory to "tmp" (this directory exists too), and it works. I try to change "Power Serve" to "/Power Serve", but it doesn't work too. I need it to get list of FTPFile. How can I fix it? </p>
java android
[1, 4]
884,713
884,714
.val() is not working in jquery?
<p>Can we also pass string values to some variable and call through below code</p> <pre><code>$(document).ready(function() { var i = "1, 2, 3"; $('#textvalue').val(i); }); </code></pre> <p>does it work?</p> <p>Its not working don't know how :(</p> <p>There is one more post related to this</p> <p>Link: <a href="http://stackoverflow.com/questions/5327331/jquery-val-not-working-when-setting-a-variable">jQuery .val() not working when setting a variable</a></p> <p>Thanks in advance :)</p>
javascript jquery
[3, 5]
2,886,063
2,886,064
what does jQuery(function) do
<p>I am reading <code>javascript</code> web application and the author is using following code:</p> <pre><code>mod.load = function(func){ $($.proxy(func, this)); }; </code></pre> <p>Can someone help me to understand why returning function from <code>jQuery.proxy</code> is inside <code>jQuery</code> wrapper. </p> <p>Is this the same as:</p> <pre><code>mod.load = function(func){ var temp = $.proxy(func, this); temp(); }; </code></pre>
javascript jquery
[3, 5]
370,082
370,083
JQuery function not found
<pre><code>// also tried function getDeletedDates() var getDeletedDates = function() { var s = new Array(); $(".deleted").each(function(i, e) { s.push($(e).attr("data-day")); }); }; $(function() { $("#delete_send").click(function() { alert("drin"); $.ajax({ url: "delete.php", type: "POST", data: ({deleteDates : getDeletedDates()}), dataType: "json", success: function(msg){ alert(msg); }, beforeSend: function(){ alert("Lösche folgende Urlaubstage: "+ getDeletedDates().join(", ")); }, error: function(x, s, e) { alert("Fehler: " + s); } } ); }); }); </code></pre> <p>But i come into <code>beforeSend</code>() he always says "<code>getDeletedDates</code>() undefined" Why is this, i declared the function in global scope?</p> <p>thanks in advance.</p>
javascript jquery
[3, 5]
130,572
130,573
How to put a \n(new line) inside a list box?
<p>How to put the newline(\n) in list box .selected item? Here I have code it generates the all links but I want to have all those link in listbox, these code is working but the links are not coming in the new line all comes in single line and my code is:</p> <pre><code>var links = TextBox1.Text.Split(new string[] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); foreach (var link in links) { if (!IsLinkWorking(link)) { //Here you can show the error. You don't specify how you want to show it. TextBox2.ForeColor = System.Drawing.Color.Green; TextBox2.Text += string.Format("{0}\nNot working\n\n ", link); //ListBox1.SelectedItem+= string.Format("{0}\nNot working\n\n ", link); } else { // ListBox1.SelectedValue += string.Format("{0}\nNot working\n\n ", link); TextBox2.Text += string.Format("{0}\n working\n\n", link); } string[] values = TextBox2.Text.Split(','); foreach (string value in values) { if (value.Trim() == "") continue; ListBox1.Items.Add(value.Trim()); } } } </code></pre>
c# asp.net
[0, 9]
2,386,360
2,386,361
jQuery Back-to-Top + StickyFloat + Fade-In on Scroll
<p>I'm currently using <a href="https://gist.github.com/728487" rel="nofollow">jQuery Stickyfloat</a> for a "back to top" button on a page that has alot of content. It works perfectly, however, the link is visible at the top when the user goes to the page. I would like it to be hidden on page load and when the user scrolls down (around 400px), it becomes visible and initiates the stickyfloat. When the user scrolls back up to the page, the link goes away.</p> <p>The jQuery:</p> <pre><code>$('a#back-to-top').stickyfloat({duration: 150}); </code></pre> <p>The HTML:</p> <pre><code>&lt;div id="content"&gt; // Content goes here &lt;a href="#top" id="back-to-top"&gt;Top&lt;/a&gt; &lt;/div&gt; </code></pre> <p>The link is absolutely positioned to the main content div. The CSS:</p> <pre><code>#content { position: relative; } a#back-to-top { position: absolute; top:0; right:0; } </code></pre> <p>How would I go about doing this? </p>
javascript jquery
[3, 5]
5,857,716
5,857,717
Why won't my SelectedIndexChanged event fire in Button_Click?
<pre><code>protected void Button1_Click(object sender, EventArgs e) { TableRow tb = new TableRow(); TableCell tc = new TableCell(); DropDownList db = new DropDownList(); db.Items.Add("Bangalore"); db.Items.Add("Mandya"); db.Items.Add( "Hassan"); tc.Controls.Add(db); tb.Controls.Add(tc); Table1.Controls.Add(tb); db.SelectedIndexChanged += db_SelectedIndexChanged; db.AutoPostBack = true; } private void db_SelectedIndexChanged(object sender, EventArgs e) { label.text = "welcome"; } </code></pre> <p>When this code executes in the <code>Button1_Click</code> event, <code>db_SelectedIndexChanged</code> doesn't execute. However, when I place the same <code>Button1_Click</code> code block in the <code>Page_Load</code> event, <code>db_SelectedIndexChanged</code> executes.</p> <p>What may be the reason behind this?</p>
c# asp.net
[0, 9]
5,642,776
5,642,777
How do you convert PHP arrays in ASP.NET?
<p>I have the following code in PHP that uses arrays of arrays. How do I extract the email using ASP.NET? Unfortunately I cannot debug and see what's the caller is sending. Thanks.</p> <pre><code>$data= $POST['data'] $email = $data['email'] </code></pre> <p>Basically I'd need to extract the email from a POST (here's the code in PHP). How do I extract the email?</p> <p>Here's the full reference of the PHP code <a href="http://apidocs.mailchimp.com/webhooks/downloads/webhooks.phps" rel="nofollow">http://apidocs.mailchimp.com/webhooks/downloads/webhooks.phps</a></p>
php asp.net
[2, 9]
5,204,194
5,204,195
Grab two randomly generated divs and wrap within custom div
<p>I am trying to get the two randomly generated div ID's shown below and wrap them within my custom div that I can control. Was searching around on jQuery API for solution but still no ideas.</p> <p>Here's a preview of example: <img src="http://i.stack.imgur.com/4puMl.png" alt="2 Randomly Generated ID's + Custom Class"></p> <p>Okay so as you can see, there are two <code>&lt;div id="random_string"&gt;&lt;/div&gt;</code> and one custom <code>&lt;div class="wrap_awm"&gt;&lt;/div&gt;</code></p> <p>Since I can't target the two ID's from above I have no clues how to tell jQuery, get the two div's from above wrap_awm and put them inside of the ".wrap_awm". Simple as that?</p>
javascript jquery
[3, 5]
3,232,291
3,232,292
Nullable (int?) keep throwing non-nullable exception
<p>This is a first that I've encountered this - of course that does't sais a lot, but never the less I need to consult with the collective as my searches while showed that it can be done, I'm not able to work it out.</p> <p>The issue is that if user leaves the text box empty C# automagically enters zero on the postback and into the database as well. I just want the text box left blank.</p> <p>I have a class there the property is declared:</p> <pre><code>private int? _PageNumber = null; public int? PageNumber { get { return _PageNumber; } set { _PageNumber = value; } } </code></pre> <p>The in my code file I have:</p> <pre><code>if (tbPageNumber.Text != "") ia.PageNumber = Convert.ToInt32(tbPageNumber.Text); else ia.PageNumber = null; </code></pre> <p>and this is where I get the exception:</p> <pre><code>CS0037: Cannot convert null to 'int' because it is a non-nullable value type </code></pre> <p>So I thought if I can't change the type, perhaps I can change the output. So I thought perhaps I can fake it by placing this in the texbox's text property:</p> <pre><code>'&lt;%# Eval("PageNumber") == 0 ? null:Eval("PageNumber") %&gt;' </code></pre> <p>This throws <code>CS0019: Operator '==' cannot be applied to operands of type 'object' and 'int'</code> exception.</p> <p>Why is so damn stubborn???</p>
c# asp.net
[0, 9]
1,419,598
1,419,599
search and suggest with keywords with drop down in java script
<p>I am using php and I have written the code for search and suggest. Like if i enter 're' in text box , it will give all the result start with re in drop down.</p> <p>Now what i want to display all the result with key words math and highlight them in search. Like if i enter 're' then it should display reliance, reliance capital, and so on with key highlight.</p> <p>And if I enter 'capital' word then it should return tata capital, reliace capital with capital highlight (this search is word match search). </p>
php javascript
[2, 3]
1,439,845
1,439,846
Do the same multi task in the same time
<p>I have a problem in Asp.net C#</p> <p>I have the code below : List objectList = new List();</p> <pre><code>foreach(var item in listItem) { object obj = getData (item); objectList.add(obj); } Console.Write("Finish all"); </code></pre> <p>Each time `getData (item);' fires it takes about 1s;</p> <p>I want all items in <code>listItem</code> to run at the same time and then execute after <code>foreach</code> finishes the <code>Console.write("Finish all")</code></p> <p>How can I do that?</p> <p>Any idea will be appreciated!</p>
c# asp.net
[0, 9]
1,094,985
1,094,986
jquery is select selected
<p>Ok, first off this isn't to find a value of a select boxes selected option. But its along the lines there of. I have a function I am working on that will check to see if the value selected matches that of the one being compared to from somewhere else, where if the match is found it does one thing if not it does another. However. Due to a recent requirement. The original function breaks cause there is not the probability that the select wont even be touched prior to the need of function.</p> <p>So Im trying to tell if theres anyway to check to see if the select in question has had anything chosen or not prior to it doing anything else. I'm thinking of the concept of checking for an empty array with length, but I'm not looking to see if the select is empty or not. I need to know if there is a selected value or not so I can act accordingly with that. Hope this makes sense.</p>
javascript jquery
[3, 5]
5,982,164
5,982,165
Load another asp.net page into current page
<p>Using ASP.NET with C#, I would like to load the content of another page into my current page. </p> <p>I have a main div <code>id="maindiv"</code> on one page with a header above it. The header contains clickable links that route to the same url with a get variable like <code>http://www.mainpage.com&amp;page=nextpage</code>. I would like to use the page get variable in a switch case to load from a specified page into maindiv. I can do the switch case bit fine, but how do I load the response from another page?</p>
c# asp.net
[0, 9]
2,314,905
2,314,906
Convert ArrayList<<NameValuePair>> to string android java
<p>How to Convert ArrayList&lt;> to string ...</p> <p>Details:</p> <p>step1: send e-mail address to php mySql database step2: if email address match database content, echoed success step3: retrieved the php echoed value ("success") step4: assign the the response to a string phpEchoedVal step5: compare phpEchoedVal with "success" step6: write email to sd card</p> <p>is this one ok //url = email address</p> <p>ArrayList nameValuePair = new ArrayList(1);</p> <pre><code> nameValuePair.add(new BasicNameValuePair("url", url)); try { //open an httpclient connection HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(strLink); httppost.setEntity(new UrlEncodedFormEntity(data)); //response retrieve "success" echoed from server ResponseHandler&lt;String&gt; handleResponse = new BasicResponseHandler(); //converts server response to string. String phpEchoVal = httpclient.execute(httppost, handleResponse); txtInfo.setText(phpEchoVal); String containEmail = txtInfo.getText().toString(); //compare response from server with local string // if successful write email to sd card if ((containEmail.equals("success"))){ //create a new text file File myFile = new File("/sdcard/moLarouteReg.txt"); myFile.createNewFile(); FileOutputStream fOut = new FileOutputStream(myFile); OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut); myOutWriter.append(containEmail); //close writer myOutWriter.close(); fOut.close(); //Open menu Intent openMenu = new Intent("com.molaroute.mu.Menu"); startActivity(openMenu); finish(); Log.d("test","fileWritten: "+myOutWriter); }else { ... } } </code></pre>
java android
[1, 4]
4,468,174
4,468,175
JavaScript catch event
<p>I have a problem. I have too many events in my DOM. The upper layer is catching the deeper event.</p> <p>Easy Example:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }) $("#second").click(function(){ alert("second."); }); $("#first").click(function(){ alert("first."); }); }); &lt;/script&gt; &lt;style type="text/css"&gt; #first{ width: 200px; height: 200px; background-color: red; } #second{ width: 100px; height: 100px; background-color: green; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="first"&gt; &lt;div id="second"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If someone clicks on the second div, which is enclosed by the first div, both of the divs catch the event. In this situation, how can I catch just the second div's click event, and leave the first div. </p> <p>I learnt about the event bubbling, and tunnelling in C# is that the problem. How is this problem called? How can I solve the problem using JavaScript and jQuery. Is the solution the same?</p>
javascript jquery
[3, 5]
2,289,668
2,289,669
Disable select, copy and paste of the content of HTML pages in Mozilla Firefox
<p>I want to disable select, copy and paste of the content of HTML pages in Mozilla Firefox. I have used jQuery and JavaScript to disable right-click and copy, select, paste of the contents of HTML pages and it's working fine in IE and Chrome, but not working properly in Mozilla Firefox.</p> <p>Can we disable copy, paste option in Mozilla Firefox? Any suggestions?</p>
javascript jquery
[3, 5]
611,543
611,544
I ran out of available quote symbols in javascript!
<p>I can't believe it, but this is really happening. I ran out of available quote symbols using jquery and javascript native functions together. Can somebody help? Maybe there is yet another symbol?</p> <pre><code>var t=setTimeout('$("#popupChange").html('&lt;img src="http://servername/pdf/picture/genericThrobber.gif" /&gt;');',2000); </code></pre> <p><strong>EDIT</strong>: Firebug messages about "missing ) after argument list" error.</p>
javascript jquery
[3, 5]
2,483,112
2,483,113
two small image slider problems
<p>What I want to accomplish is to animate the selected slide from the right just the selected slide and hide the slides in between and the second problem is when the index is zero it animates a slide in from the left does anyone know how to make it animate from the right - when the index is zero it thes the first index in the list and is 330px to the left <a href="http://jsfiddle.net/mdy5R/2/" rel="nofollow">jsFiddle</a></p> <p>Also does anyone know how to reset my timer after you have selected a slide or clicked next and prev after a while of clicking it skips if you check out my fiddle you'll see what I mean if you keep clicking</p> <pre><code>$('.stages li a').on('click', function(e) { var slide = $('#' + $(this).data('slide')); $('.stages li').removeClass('selected'); $(this).parent().addClass('selected'); goto_slide(slide); }); function goto_slide(slide) { var index = $(slide).index(); var count = index; $('.slides ul').animate({'left': '-=' + (item_width * (count - 1))}, 500, function() { $('.slides ul li').slice(0, count - 1).each(function() { $('.slides ul li:last').after($('.slides ul li:first')); $('.slides ul').css('left', '-330px'); }) }); $('#index').text(index); } </code></pre>
javascript jquery
[3, 5]
4,886,046
4,886,047
Detecting an "unselect" event in a text area
<p>jQuery has the <a href="http://api.jquery.com/select/" rel="nofollow"><code>.select()</code></a> method, which lets you execute a function when text is selected in a text area.</p> <p>Unfortunately, there is no corresponding <code>.deselect()</code> method for executing a function when the user removes a selection.</p> <p>How can I detect when the user has unselected the text (for example, by typing, clicking, or defocusing)?</p>
javascript jquery
[3, 5]
347,439
347,440
Is there a better approach to minify html generated from aspx page
<p>I am using the following code to minify html generated from aspx page duuring runtime.</p> <pre><code>protected override void Render(HtmlTextWriter writer) { TextWriter output = new StringWriter(); base.Render(new HtmlTextWriter(output)); String html = output.ToString(); html = Regex.Replace(html, @"\n|\t", " "); html = Regex.Replace(html, @"&gt;\s+&lt;", "&gt;&lt;").Trim(); html = Regex.Replace(html, @"\s{2,}", " "); writer.Write(html); } </code></pre> <p>Is there more better approach to do the same.</p> <p>Thank you so much.</p>
c# asp.net
[0, 9]