Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,468,030
1,468,031
How to position a custom shape inside a view?
<p>I've defined a custom shape in my res/drawable folder:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"&gt; &lt;stroke android:color="#FF404040" android:width="1dp" android:dashGap="3dp" android:dashWidth="3dp" /&gt; &lt;size android:height="1dp" /&gt; &lt;/shape&gt; </code></pre> <p>I'm using it as a background for one of my views. The shape is positioned vertically centered inside the view, but I want it to appear at the bottom of the view instead, is there a way to do this?</p>
java android
[1, 4]
4,969,821
4,969,822
Download an Excel file
<p>I have read some past posts here on how to download a Excel file from a website. So, I have setup the below code:</p> <pre><code>string path = MapPath(fname); string name = Path.GetFileName(path); string ext = Path.GetExtension(path); string type = "application/vnd.ms-excel"; if (forceDownload) { Response.AppendHeader("content-disposition", "attachment; filename=" + name); } if (type != "") { Response.ContentType = type; Response.WriteFile(path); Response.End(); } </code></pre> <p>However, I get no download dialog box.</p> <p>I try this both in IE 8 and FireFox 10.0.2.<br> The file is there, it's not locked, and it's not set to read only.<br> I'm not sure were I went wrong.</p>
c# asp.net
[0, 9]
1,285,374
1,285,375
How can I center a background image on a web page for different screen resolutions using JavaScript?
<p>I want to determine the screen resolution of the client machine and the set the background image in the center using JavaScript.</p> <p>I have come so far:</p> <pre><code>function centerBackGroundImage() { var browserWidth = document.documentElement.clientWidth; var browserHeight = document.documentElement.clientHeight; $("#background").css({ "z-index": "-10", "margin:left": (browserWidth / 2) - (browserHeight/ 2) }); } </code></pre> <p>I have already added the div tag named <code>background</code> and the <code>&lt;img&gt;</code> tag with the location of the image file.</p> <p>Any help would be appreciated.</p>
javascript jquery
[3, 5]
179,371
179,372
Android Row becomes Unclickable with Button
<p>I have a listView, where each row has a button in the row layout. However, this seems to make the row itself unclickable. How can I make both the button and row clickable? </p> <p>Thanks.</p>
java android
[1, 4]
574,743
574,744
Append Trakt.tv API
<p>I'm trying to query trakt.tv for my latest activity, but I only get a blank screen on proceeding with this script using jquery-1.4.4.js:</p> <pre><code> $(document).ready(function(){ // on document load show_trakt(); }); function show_trakt() { var user = 'INSERT_USERNAME'; var akey = 'INSERT_API_KEY'; var data; var turl = 'http://api.trakt.tv/activity/user.json/'+akey+'/'+user+'/all/?callback=?'; if($('.traktrecent ul').length &lt;= 0) { $('.traktrecent').append('&lt;ul /&gt;'); } $('.traktrecent').hide(); $.getJSON(turl, function(data){ var i=0; $.each(data.activity, function(index, item){ if (i &lt; 11) { var ts = tc(item.timestamp); $('.traktrecent ul').append('&lt;li&gt;&lt;small&gt;'+ts+'&lt;/small&gt;: &lt;a class="lP" href="'+item.episode.url+'" target="_blank"&gt;'+item.show.title+'&lt;/a&gt; - &lt;cite&gt;'+item.episode.title+'&lt;/cite&gt;&lt;/li&gt;'); } i++; }); $('.traktrecent').fadeIn(); }); } function tc(uts){ var a = new Date(uts*1000); var mon = pad(a.getMonth()+1); var d = pad(a.getDate()); var h = pad(a.getHours()); var min = pad(a.getMinutes()); var time = d+'/'+mon+' '+h+':'+min; return time; } function pad(number) { return (number &lt; 10 ? '0' : '') + number } </code></pre> <p>Any help is much appreciated :-)</p>
javascript jquery
[3, 5]
2,983,843
2,983,844
storing a byte array in web.config
<p>I have a developer key </p> <pre><code> byte[] key = new Byte[] { 0x01, 0x42, 0xA0, 0xE1, 0x5E, 0xEE, 0xA7, 0x01, 0x71, 0x9A, 0xCB, 0xAB, 0x58, 0xEB, 0xED, 0x44... </code></pre> <p>that I want to store in my web.config, can I do something like as follows</p> <pre><code>&lt;add key="spotify-devkey" value="0x01, 0x42, 0xA0, 0xE1, 0x5E, 0xEE, 0xA7, 0x01, 0x71, 0x9A, 0xCB, 0xAB, 0x58, 0xEB, 0xED, 0x44,... </code></pre> <p>and if I can do it this easily what code would I need to get the byte array from the stored string?</p>
c# asp.net
[0, 9]
1,697,667
1,697,668
How to find a text using javascript or jquery.
<p>I need to find a text from a paragraph using java script. Is there any code in JavaScript like we do in c# to find a text using "string.Contains("")" method.</p> <p>Pls help...</p> <p>Thanks Guys..</p>
javascript jquery
[3, 5]
1,763,680
1,763,681
how to display a array element one by one with a spacebar in a input field in jquery?
<p>i have a large array with a lot of string i want to display it in a text field one by one with a space bar concatenate to each one automatically </p> <p>my code here</p> <pre><code>&lt;script&gt; x=0 function abc(){ for (i=0;i&lt;words[x].length;i++){ if(x=0) x++; document.getElementById("type").value=words[x]; } &lt;/script&gt; </code></pre> <p>my input field id is <code>type</code> and my array is <code>words</code></p>
javascript jquery
[3, 5]
5,353,156
5,353,157
Disable (most) events on a page?
<p>I have a bunch of buttons with different events.</p> <p>When the app is in 'super' mode I need to disable all of these events, but keep 2-3 of them active. </p> <p>What would the best approach to do something like this? Do I need to unbind every handler or can I super some event that prevents default behavior?</p>
javascript jquery
[3, 5]
4,199,419
4,199,420
jquery mouseover
<p>I have a button on my asp.net page and I am using ajax jquery to create a mouseover effect.I want to show alert on mouse over. How can i do this ?</p>
jquery asp.net
[5, 9]
2,898,952
2,898,953
How to change view-state value dynamically?
<p>I have textbox and button controls in my page. For textbox I have enabled view state, page-load event I am setting text box value “Hello Mr!”. Now I want to change the view state value for text box to “Hello Mr Pradeep!” when post back occurs, how can I do that? And in which all page events I can do that.</p> <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" EnableViewState= "true"/&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; protected void Page_Load(object sender, EventArgs e) { TextBox1.Text = "Hello Mr!"; } </code></pre> <p>Thanks,</p> <p>Pradeep</p>
c# asp.net
[0, 9]
3,461,533
3,461,534
Click event takes two clicks to fire in asp.net
<p>Good afternoon, hopefully someone will be able to assist me in diagnosing an issue that I am having on a web form using Post method to submit data to another domain. within this page I am using asp button control. It is having button_click event.</p> <p>Now the question is, button click event two clicks. (reason is, one click for button click event. and another is for submitting data to another domain). I have written form.action method in Button_click event.</p> <p>Now i want to use one click need to execute button_click event and form should submit to another domain which has given in form.action. </p> <p>Any help would be appreciated.</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
5,766,739
5,766,740
Using the ontextchange event to update the database
<p>I am trying to use the onTextChange event to update the a textbox and then i am using a button to update it in the Database. Every time i try to use is it sets the value as "" i really dont know if i am doing something wrong or if i am doing it right. if someone could please help that would be great. thanks</p> <p>Asp.net code:</p> <pre><code>&lt;asp:TextBox ID="tbPLName" runat="server" OnTextChanged="tbPLName_TextChanged" /&gt; &lt;asp:Button ID="btUpdate" runat="server" Text="Update Name" OnClick="btUpdate_Click" /&gt; </code></pre> <p>C# code:</p> <pre><code>string lastName; protected void btUpdate_Click(object sender, EventArgs e) { tbCheck(); } protected void tbPLName_TextChanged(object sender, EventArgs e) { lastName = tbPLName.Text; } </code></pre> <p>also if there is a better way of doing this please let me know. i really would like to do this the best way posible.</p>
c# asp.net
[0, 9]
2,423,756
2,423,757
Finding element in Javascript object array
<p>I have a javascript object array like</p> <pre><code>var objArr = [Object{key="1", value="a"}, Object{key="2", value="b"}, ...] </code></pre> <p>Do we have any Jquery method find the object and delete it. I know using <code>$.each</code></p> <pre><code>$.each(objArr, function(index, obj) { }) </code></pre> <p>But do we have any easy and efficient solution for this?</p>
javascript jquery
[3, 5]
216,443
216,444
Trigger JQuery function when passed half way down the page
<p>Is there a way to tell if you have scrolled passed the center of the web page or in other words, when you have scrolled passed exactly half of the web page and your scrollbar is situated in the lower half of the browser window? </p> <p>I want to be able to trigger this: $('.pineapple-man').show(); when I have scrolled down passed half of the page?</p> <p>Is this possible at all?</p> <p>Your help would be so kind! </p>
javascript jquery
[3, 5]
4,859,180
4,859,181
Bind ready event on javascript dom element creation
<p>i would like to know if we can bind a loaded or ready event on an item created by a script when the dom is loaded. I heard from live() but it's not something clickable, it's just an item which has to load.</p> <p>Thanks for your help!</p>
javascript jquery
[3, 5]
204,717
204,718
Writing file from PHP page android
<p>In my project a compressed file is displayed on a php in bytes. I am trying to find a way to read the php page, decompress the file using <strong>GZIP</strong>, and write it out to the assets folder. The file that I am reading in has to be placed in the <code>data/data/package/database</code> file. </p> <p>I have a class that reads a file from the assets folder and places the file into <code>data/data/package/database</code>. </p> <p>Is it possible to write to the assets folder during runtime? If not is there a better way to do this?</p>
java php android
[1, 2, 4]
5,383,549
5,383,550
How to get element by point in jQuery/Javascript
<p>I want to get an element by specifying the point values in page.</p> <pre><code>var point = this.svgRenderer.getPoint(serPoint,chart); </code></pre> <p>This will return exact point location of the page. That point contains some SVG element either circle or rectangle or image or other elements. I want to get the element based on the point location. Is this possible?</p> <p>Thanks,</p> <p>Siva</p>
javascript jquery
[3, 5]
3,805,329
3,805,330
How to get the installed application name in a list
<p>I have tried this:</p> <pre><code>final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0); </code></pre> <p>this code gives me the list of the installed app's package name and etc. But I want only the application name's as a string type list. what should I do?</p>
java android
[1, 4]
3,669,636
3,669,637
Get new dropdownlist boxes On button click in asp.net c# with different Ids and assign datasource, along with selection changed functionality
<p>I need to generate 3 DropDownList Boxes in a row Dynamically on ADD Button click event. Once the DDL is generated i should be able to assign Data source to it and also do DDL-selectedEventChanged functionality on them in c# asp.net.<br> Below link was exactly am looking for but i couldn't assign data source or i couldn't do any functionality</p> <p>"<a href="http://stackoverflow.com/questions/11051728/adding-multiple-dropdownlists-with-a-button-click">Adding multiple DropDownLists with a button click</a>"</p> <p>any better Ideas please help</p> <p>if i press Button i need to get 3 DDLs at a time, if i press again it should generate again, so number of clicks= no. of rows with three DDL's in each row</p>
c# asp.net
[0, 9]
5,059,824
5,059,825
On every click text should add in page
<p>I want to add value on every click on my function.</p> <p>for example i click on then value is coming but i want to click again and another value should come without replacing the existing value</p> <pre><code> &lt;script&gt; function dearq(selected){ var value = $(".textvaluenonw").val(); $("#dearname").html(value); } &lt;/script&gt; </code></pre> <p>here is the fiddle </p> <p><a href="http://jsfiddle.net/r7P3w/12/" rel="nofollow">http://jsfiddle.net/r7P3w/12/</a></p>
javascript jquery
[3, 5]
1,149,579
1,149,580
Switching to Java from C++: What are the key points?
<p>I'm an experienced developer, but most of my OO programming experience has been with C++ (and a little Delphi). I'm considering doing some Android work, hence Java.</p> <p>Coming from the C++ background, what areas of Java are most likely to surprise/annoy/delight me?</p> <p>I felt sure this would already have been asked, but my searches haven't turned up a similar question.</p> <p>CW, of course.</p>
java c++
[1, 6]
2,786,954
2,786,955
MapPath vs VirtualPathUtility.ToAbsolute
<p>I am using c#, asp.net and working on a web application. </p> <p>I initially had a relative path as such which I needed to be an absolute path. The below works but need to get the absolute path:</p> <pre><code> return Chart.RenderChartHTML("../../Charts/MSLine.swf"); </code></pre> <p>I tried the following which didn't work (note that it gives me the complete path on my hard drive to .swf):</p> <pre><code> string mslinepath = HttpContext.Current.Server.MapPath("Charts/MSLine.swf"); return Chart.RenderChartHTML(mslinepath); </code></pre> <p>I then tried the following which works:</p> <pre><code> string mslinepath = VirtualPathUtility.ToAbsolute("~/Charts/MSLine.swf"); return Chart.RenderChartHTML(mslinepath); </code></pre> <p>Wondering why VirtualPathUtility.ToAbsolute works while the other one doesn't. </p>
c# asp.net
[0, 9]
1,477,381
1,477,382
why does this jquery image swap not work in chrome and on first load in firefox
<p>I am trying to use jquery to replace an image on rollover (with fade) you can see this on the bottom left here:</p> <p><a href="http://www.anzie.com/index_rollover.php" rel="nofollow">http://www.anzie.com/index_rollover.php</a></p> <p>However in chrome it just fades to near opaque. and in firefox on the first load I get a small blue box on the top left corner (as if it is out of position). but then on refresh it works in firefox. This is working perfectly on my own machine, it only does not work when I try it online. Which leads me to thing it is not loading the images in time perhaps? I am not sure what to do..</p> <p>Here is my php: </p> <pre><code>&lt;a href="&lt;?php echo tep_href_link(FILENAME_EVENTS); ?&gt;"&gt;&lt;img src="images/home_buttons/water_bag.jpg" alt="watch la vie en couleur" border="0" align="left" hoverImg="images/home_buttons/water_bag-hover.jpg" /&gt;&lt;/a&gt; </code></pre> <p>And here is the javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready( function() { $('body').find('*[hoverImg]').each(function(index){ $this = $(this) $this.wrap('&lt;div&gt;') $this.parent().css('width',$this.width()) $this.parent().css('height',$this.height()) $this.parent().css('background-image',"url(" + $this.attr('hoverImg')+")") $this.hover(function() { $(this).stop() $(this).fadeTo('',.01) },function() { $(this).stop() $(this).fadeTo('',1) }) }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,921,112
1,921,113
How to retrieve content passed back from remote server when the server reponds with a System.Net.WebException 422
<p>I am working with an api that also returns a valid xml string containing the error that was encountered on their system.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;error&gt; &lt;request&gt;Request made to server&lt;/request&gt; &lt;message&gt;No user found for account 12345&lt;/message&gt; &lt;/error&gt; </code></pre> <p>Is there any way to get that xml from the remote server out of the System.Net.WebException object? Thanks in advance :)</p>
c# asp.net
[0, 9]
5,100,464
5,100,465
jquery or js code to obtain exact node data for currently selected form item/text/image in a web page
<p>I want to obtain the exact details for the item on a web page that has been clicked on, using jquery.</p> <p>That item can be a form item (like a checkbox, text box, text area etc) or section of text (in a paragraph or div or other) or list or image ...</p> <p>What I figured out is the following--</p> <pre><code>$(function(){ $('*') .bind('click', function(event) { //now obtain details of item that has been clicked on... }); }); </code></pre> <p>Now, I want the exact details- viz the div id/form id/paragraph #, ie all details for that particular item. How do i get this data? I understand that this data is available in the DOM but I just dont know how to get it in this particular case...</p>
javascript jquery
[3, 5]
4,105,878
4,105,879
I'm getting a null pointer exception when I subclass an OnClickListener()
<p>I'm trying to subclass one of my <code>OnClickListener()</code> 's and I'm getting a 'null pointer' exception, but I'm not sure why.. I'm going nuts over this.. any help would be greatly appreciated..</p> <p>Here is the code in my Utilities Class located in com.Tools</p> <pre><code>public class Utilities { public static View.OnClickListener CreateOnClickListener(final Context context,final Class&lt;?&gt; cls) { final Activity act = new Activity(); View.OnClickListener listener = new View.OnClickListener() { public void onClick(View v) { Intent window = new Intent(context, cls); act.startActivity(window); act.finish(); } }; return listener; } } </code></pre> <p>And when I call it from my main class I do this:</p> <pre><code>final Button button1 = (Button) findViewById(R.id.button1); button1.setOnClickListener(Utilities.CreateOnClickListener(MainMenu.this, SettingsMenu.class)); </code></pre> <p>When I debug, the exception occurs on this line:</p> <pre><code>act.startActivity(window); </code></pre> <p>Any ideas??? Thank you very much in advance!!!</p>
java android
[1, 4]
372,760
372,761
Does Rhino have a future?
<p>I'm looking to add serious scripting into my Java app and JavaScript would be a great language choice. My concern though is the Rhino project and its future.</p> <p>While Groovy/Jruby etc have seen constant updates, and engines like V8 and SpiderMonkey make continuous and significant performance boosts; Rhino languishes with its last release in March '09.</p> <p>I've seen some work on hacking Rhino:</p> <ul> <li><a href="http://cr.openjdk.java.net/~jrose/pres/201009-ThunderingRhinos/pres.html">Great Thundering Rhinos!</a> presentation from Oracle</li> <li><a href="http://www.google-melange.com/gsoc/project/google/gsoc2011/rohit_mullangi/37001">Explore and implement JDK7 InvokeDynamic</a> Google Summer of Code project</li> </ul> <p>But nothing solid about actually merging this code into the project and getting an active committer community around it.</p> <p>What is the Rhino road map? For example, is there any plan to bring <code>invokedynamic</code> to the Rhino world?</p>
java javascript
[1, 3]
5,999,976
5,999,977
add "readonly" to <input > (jQuery)
<p>How can i add "readonly" to a specific <code>&lt;input &gt;</code>? .attr('readonly') does not work.</p>
javascript jquery
[3, 5]
2,118,262
2,118,263
jQuery .nextUntil() equivalent
<p>I need an alternative for jQuery's <code>.nextUntil()</code>. I'm currently using <code>jQuery 1.3.1</code> and updating it is out of the question :(</p> <p>I have this HTML:</p> <pre><code>&lt;h4&gt;...&lt;/h4&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; &lt;h4&gt;...&lt;/h4&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; </code></pre> <p>and I have this jQuery code:</p> <pre><code>$('h4').click(function(){ $(this).nextUntil('h4').toggle(); }); </code></pre> <p>but <code>.nextUntil()</code> is added in <code>1.4.0</code> So do you have an idea how to do that in <code>1.3.1</code> ?</p>
javascript jquery
[3, 5]
3,334,426
3,334,427
Adjusting height of scrolling div Javascript
<p>I am combining two scripts together a scroller and a content fader. When I swap the content (fading), div's with alot of content make the scrolling div super long. I was reading on the plugin demo for content scrolling: <a href="http://manos.malihu.gr/jquery-custom-content-scroller" rel="nofollow">http://manos.malihu.gr/jquery-custom-content-scroller</a> that you can use $(selector).mCustomScrollbar("update"); when loading different content to make the div adjust accordingly.</p> <p>Well that is where I am stumped. I know that code needs to go in my fading script somewhere but where is the question? Here is the fading script where would it go?</p> <pre><code>&lt;script type='text/javascript'&gt;//&lt;![CDATA[ $(window).load(function(){ (function($) { $.fn.Fader = function() { this.each(function() { $('.clickme').bind('click', function(e) { e.preventDefault(); $( "#mediaswap div" ).fadeOut(); $( "#mediaswap div" + $(this).attr('name') ).fadeIn(); }) }); } })(jQuery); $(function() { $('#mediaswap').Fader(); }); });//]]&gt; &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
956,662
956,663
Comparing two input fields - What am I doing wrong?
<p>Forgive me but I'm just starting to learn Javascript. I'm trying to get the sum of two input fields, and I'd like to update the result "live" so to speak, on every keyup event.</p> <p>At the moment the result field just disappears when values are entered into the input fields.</p> <p>What am I doing wrong?</p> <p>Thank you so much,</p> <p>Peter</p> <p>edit: how stupid of me, I forgot to post the code</p> <p><a href="http://jsfiddle.net/u7VwP/" rel="nofollow">http://jsfiddle.net/u7VwP/</a></p> <pre><code>var inputFirst = $('#first'), inputSecond = $('#second'), inputFirstVal = inputFirst.val(), inputSecondVal = inputSecond.val(); function getResult(first, second) { var result = first + second; $('p#result').text(result); }; inputFirst.on('keyup', function() { getResult(inputFirstVal, inputSecondVal); }); inputSecond.on('keyup', function() { getResult(inputFirstVal, inputSecondVal); });​ </code></pre>
javascript jquery
[3, 5]
4,135,705
4,135,706
How to Read a webpage and extract certain links using jQuery?
<p>Its on the same domain.. both my Jquery code and the url to read.</p> <p>What i want to do is first read the webpage using Jquery and then parse certain links which has "ProductDetails.php" and extract "ProductCode" from the webpage into array.</p> <p>The html page may have many instances of a href="ProductDetails.php which looks like below.</p> <pre><code>&lt;a href="ProductDetails.php?ProductCode=SMS%2D15%2DXLG%2DA7&amp;CartID=1" class="carttext colors_productname cart-item-name"&gt;item 1 &lt;a&gt; &lt;a href="ProductDetails.php?ProductCode=SMS%dfdfde&amp;CartID=2" class="carttext colors_productname cart-item-name"&gt;test me item &lt;a&gt; </code></pre> <p>I dont know if this is really possible</p>
javascript jquery
[3, 5]
2,692,292
2,692,293
Simulating shell command in JAVA
<p>If I run the command <code>adb shell cat /dev/input/event0</code> at command prompt, it shows some raw data corresponding to user actions on Android emulator.</p> <p>I want to simulate this command programmatically with Java to record user actions.</p> <p>How can I achieve this?</p>
java android
[1, 4]
547,757
547,758
Create a link on the fly when a user enters a code in a form box
<p>I have a form....</p> <pre><code>&lt;form id="orderform" method="post" orderform="" name=""&gt; &lt;table width="533" cellspacing="0" cellpadding="2" border="0" id="ordertable"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Product Code&lt;/td&gt; &lt;td&gt;Meterage&lt;/td&gt; &lt;td&gt;Sample Img&lt;/td&gt; &lt;/tr&gt; &lt;tr class="item"&gt; &lt;td class="prodcode"&gt;&lt;input type="text" id="prodcode" name="prodcode"&gt;&lt;/td&gt; &lt;td class="meterage"&gt;&lt;input type="text" id="meterage" name="meterage"&gt;&lt;/td&gt; &lt;td class="imgsample"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>What i would like is when a user clicks out of the box on the prodcode it searches a folder for the image reference...creates a link on under the imgsample header for that particular item using the prodCode they entered...</p> <p><a href="http://www.mylink.com/images/folder/sub-folder/imageref.jpg" rel="nofollow">http://www.mylink.com/images/folder/sub-folder/imageref.jpg</a></p> <p>Is this an impossible task, any ideas?</p>
php jquery
[2, 5]
2,168,827
2,168,828
JQuery not returning value
<p>I'm using <a href="http://valums.com/ajax-upload/" rel="nofollow">Valum's AJAX file uploader</a>. I am trying to send a parameter with the GET request made by the jQuery plugin. This code used to work a few hours ago. But it isn't now!</p> <p>Can't see any error in Firebug either.</p> <p>Help!</p> <pre><code>$(document).ready(function(){ $("#newProject").colorbox({width:"38%",inline:true, href:"#project-new"}); var uploader = new qq.FileUploader({ element: document.getElementById('projectCsv'), action: 'new-project.php', params: { name: $('#projectName').val() }, onSubmit: function(){ if($('#projectName').val().length &lt; 4) { alert('Project name should be at least 4 characters long.'); return false; } }, onComplete: function(id, fileName, responseJSON){ var result = responseJSON.success; if(result==true) location.reload(); else return true; } }); }); </code></pre>
php javascript jquery
[2, 3, 5]
544,460
544,461
jquery how to get the index of a click event when after doing an ajax call
<p>In the following code how would I use <code>$(this).parents('#friendRequest').remove();</code> in my ajax success callback function, and use <code>$(this)</code> to get selector of the click event in the first line?</p> <pre><code>jQuery(".notyAcceptFriendRequest").on('click', function() { notyId = jQuery(this).attr("notyIdOne"); // pull in the id of the current selected notification userProfilesUserId = $('#requestAlert').attr('userProfilesUserId'); // pull in the id of the current selected user profile id if (notyId == userProfilesUserId) { // if notification id is the same as the user profiles id, do the following $("#requestAlert").replaceWith('&lt;span class="font1"&gt;You two are now friends&lt;/span&gt;'); // the user profile friend requester will be replaced with the text $(this).parents('#friendRequest').remove(); // find the '#friendRequest' id from the parent elements and fade it out } else if (notyId != userProfilesUserId) { /* the below will execute when the user * clicks the 'Add' button and he/she is * not on the targeted users page */ $.ajax({ type: "POST", dataType: "JSON", url: "&lt;?=base_url()?&gt;index.php/reguserDash/acceptFriendNoty", data: {notyId: notyId}, json: {friendshipCaneled: true}, success: function(data) { if(data.acceptNotyFriendSuccess == true) { $(this).parents('#friendRequest').remove(); } } }) } }); </code></pre>
javascript jquery
[3, 5]
4,355,378
4,355,379
How to reliably detect an Internet connection at Android phone wake up
<p>I have an App that relies on Internet connection at startup, and I am able to detect that ok with the code below.</p> <p>However when the phone has been idle for some time and I unlock it and start my app it does not find the connection immediately and I have to re-start the app again to get success.</p> <p>I have tried waiting in a thread and retrying the code below again with no success too.</p> <p>Any ideas would be appreciated, thank you. </p> <p><strong>Code</strong> </p> <pre><code> // check Network/Internet connection public boolean isOnline() { try { ConnectivityManager cm = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE); boolean haveConnectedWifi = false; boolean haveConnectedMobile = false; cm = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo[] netInfo = cm.getAllNetworkInfo(); for (NetworkInfo ni : netInfo) { if (ni.getTypeName().equalsIgnoreCase("WIFI")) { if (ni.isConnected()) { haveConnectedWifi = true; } } if (ni.getTypeName().equalsIgnoreCase("MOBILE")) { if (ni.isConnected()) { haveConnectedMobile = true; } } } return haveConnectedWifi || haveConnectedMobile; } catch (Exception e) { Log.e(TAG, e.toString()); } return false; } </code></pre>
java android
[1, 4]
5,474,718
5,474,719
Disable upload button after uploading image http://valums.com/ajax-upload/
<p>I am using this, valums ajax fileupload: <a href="http://valums.com/ajax-upload/" rel="nofollow">http://valums.com/ajax-upload/</a> , It is working fine for me. I want to disable the upload button as I upload an image and want add 2 more buttons beside it "Delete" and "View". How would I do this using existing JS file.</p>
javascript jquery
[3, 5]
3,855,235
3,855,236
Set default time in trentrichardson timepicker
<p>How can i set default time in <code>trentrichardson timepicker</code>. I checked <em>trentrichardson.com</em> for the documentation, but the site is down. Any suggestions will be appreciable. Thanks.</p>
javascript jquery
[3, 5]
3,523,253
3,523,254
check two timestamps are same day
<p>I am getting some data from SQL which has <strong>timestamp</strong> and i Wanna check whether they are same day or not....</p> <p>In a loop i am trying to check the previous loop timestamp is same as the current loop timestamp...... I am trying something like this.....</p> <pre><code>$.each(data, function(key, value) { if( new Date([value.startTime] * 1000) === previousdate){ console.log("*** Same day ***"); } previousdate = new Date([value.startTime] * 1000); } </code></pre> <p>But though they are same day but they differ in time ...... I just want to check they both are same day or not..... I can trim them before comparing them so that way it works fine.... but is there any other effective way to do this.....</p> <p>Cheers...</p>
javascript jquery
[3, 5]
3,780,771
3,780,772
Javascript multiply function failed when together
<p>Javascript function does not work when </p> <pre><code>function loadcontents(obj) { var params = $(obj).attr('href').split('?'); $.getJSON(IVIDPLAY_BASE_DIR+'content/load2.php?'+params[1], function(json) { if (json.returnval == 1) { $('#contents').fadeOut('fast', function() { $(this).html('json.contents').fadeIn('slow'); }); } } </code></pre> <p>is trigger to replace this div:</p> <pre><code>&lt;div class="content"&gt; &lt;a href="{$content2.url}" onclick="return loadContent2(this, 'page', '2')"&gt;Click Here &lt;/a&gt; &lt;/div&gt; </code></pre> <p>in another word, there is a function being refresh by the first function and it does not work, when the second one does work.</p> <p>However! when </p> <pre><code>loadContent2(this, 'page', '2') </code></pre> <p>is replace or remove</p> <pre><code>loadContent2(this, "page", "2") </code></pre> <p>like so, the first function work, but not the second!</p> <p>is there a way to by pass the quote issue? if it's a quote issue?</p> <p>any help highly appreciated!</p> <p>EDIT:</p> <p>fire bug show no error, but it's clearly not working as logically should.</p>
php javascript
[2, 3]
5,767,700
5,767,701
Complete CONNECTIVITY_SERVICE test
<p>My application connects to the internet onCreate, it does this in an AsyncTaks class and all works fine. I have some error checking in place to make sure there is internet available and works great if I say put my phone on Flight Mode.</p> <p>My problem is when I’m on WIFI, where I live the WWW drops out from time to time but the phone still thinks it’s connected. E.g.. the phone is still connected to the WIFI dongle but the WIFI dongle is not connected to the WWW, so when the application opens and tries to connect it gets an error and I get a force close.</p> <p>How can I do a complete internet connection check onCreate that will cover all bases???</p> <p>Cheers,</p> <p>Mike.</p>
java android
[1, 4]
1,100,283
1,100,284
An array is undefined in javascript
<p>I am actually trying to retrieve something for a sqlite database and store the results in an array. So I create an array and pass it as an argument to the function. Then after the function returns, the array remains undefined. What is the problem with that?</p> <pre><code>function initGraphView() { var resultsArray=new Array(12); getGraphData(defaultQueryString,resultsArray); alert(resultsArray[0]); //undefined } </code></pre> <pre> getGraphData=function(queryString,resultsArray) { dbConnection.transaction(function(tx){ tx.executeSql(queryString, [], function(SQLTransaction, data) { for(var i=0;i</pre>
javascript jquery
[3, 5]
2,780,041
2,780,042
C#: Base64 encoding
<p>Can anyone please let me know where I made a mistake in this code? This code is written in C#.NET. I need to write an algorithm for encoding a string using base64 format using C#.NET, and then decoded with base64_decode() using PHP. Please see the snippit below:</p> <pre><code>System.Security.Cryptography.RijndaelManaged rijndaelCipher = new System.Security.Cryptography.RijndaelManaged(); rijndaelCipher.Mode = System.Security.Cryptography.CipherMode.CBC; rijndaelCipher.Padding = System.Security.Cryptography.PaddingMode.Zeros; rijndaelCipher.KeySize = 256; rijndaelCipher.BlockSize = 128; byte[] pwdBytes = System.Text.Encoding.UTF8.GetBytes(_key); byte[] keyBytes = new byte[16]; int len = pwdBytes.Length; if (len &gt; keyBytes.Length) len = keyBytes.Length; System.Array.Copy(pwdBytes, keyBytes, len); rijndaelCipher.Key = keyBytes; rijndaelCipher.IV = keyBytes; System.Security.Cryptography.ICryptoTransform transform = rijndaelCipher.CreateEncryptor(); byte[] plainText = Encoding.UTF8.GetBytes(unencryptedString); byte[] cipherBytes = transform.TransformFinalBlock(plainText, 0, plainText.Length); return Convert.ToBase64String(cipherBytes); </code></pre>
c# php
[0, 2]
1,476,772
1,476,773
Javascript remove event
<p>Guys i have a little problem , huge for me , so that is why i have to ask you ... Anyway problem is , i want to copy table row from one table and add it to another table , but before i add it to another table i need to remove all of its events , i used google allot but its not helping me </p> <pre><code>var $UserRow = $(Final).closest('tr'); $('td', $UserRow).each(function () { $(this).onclick = null; }); $UserRow.clone().appendTo($('#UserTicket')); </code></pre> <p>This is code so far , i got UserRow and all 'td's inside of it just how to remove all of its events?</p>
javascript jquery
[3, 5]
1,464,843
1,464,844
how to write javascript in asp.net in code behind using C#
<p>Greetings, how can I write JavaScript code in asp.net in code behind using C#. For example, I have click button event when I click the button I want to invoke this java script code:</p> <pre><code>alert("You pressed Me!"); </code></pre> <p>I want to know how to use java script from code behind.</p> <p>Thank you;</p>
c# asp.net javascript
[0, 9, 3]
3,530,134
3,530,135
Multiple concurrent $.post causing blocking
<p>I have an app where multiple concurrent ajax requests are sent out to my nodeJS backend server. The calls are sent out in rapid succession and immediately sent out again after data is received.</p> <p>I don't mean all of JS is being blocked, please view the screenshot (bottom right corner) to see what I'm referring to.</p> <p><img src="http://i.stack.imgur.com/d7dyG.png" alt="enter image description here"></p> <p>Can someone please explain to me what this blocking is and if there is anyway around it?</p>
javascript jquery
[3, 5]
195,764
195,765
Equivalent to PHP function number_format in jquery/javascript
<p>PHP Function:</p> <pre><code>function formatNumberForDisplay($number, $decimal=0, $decimalSeperator='.', $numberSeperator=',') { return number_format($number, $decimal, $decimalSeperator, $numberSeperator); } </code></pre> <p>My need: Can any body suggest me the equivalent functionality in jquery/javascript. </p> <p>Thanks in advance.</p>
php javascript jquery
[2, 3, 5]
1,396,183
1,396,184
Getting a PHP variable in jQuery
<p>So I have this:</p> <pre><code>&lt;?php echo ' &lt;script&gt; $(function(){ $("a#yeah").click(function(){ $.ajax({ url: "ajax.php?action=yeah&amp;id='.$id.'", success: function(html){ $("a#yeah").html("your cool") } }) }) })&lt;/script&gt;'; ?&gt; </code></pre> <p>basically I am using the PHP variable $id wich can be find in the document, how could i get this same variable but without echoing the jQuery(so i could keep my editor syntax highlight in the Javascript part)?</p>
php jquery
[2, 5]
1,501,919
1,501,920
send data to android set
<p>how to send data from a php page that is open in browser to a particular person who has android set with him.The person is connected to the Internet and me also.i know the person IMEI number.kindly tell me all the possible solutions.please i am new to android</p>
php android
[2, 4]
3,599,917
3,599,918
jquery: How to know if a page is not in focus?
<p>For example, if user is doing other things but not viewing this page, jquery/javascript can know?</p> <p>I don't need to be very accurate, just roughly.</p>
javascript jquery
[3, 5]
4,152,655
4,152,656
Selecting a random image from a flickr set and appending it to a div
<p>I've run into a bit of a problem and was hoping to get a little help. I am trying to select a random image from a flickr set and append it to a div to use as a background image. Here is the function:</p> <pre><code>$.getJSON("http://***", function (data){ var htmlString = ""; $.each(data.photoset.photo, function(i, item){ var bkg = data.photoset.photo[i]; var randomBkg = Math.floor(Math.random() * bkg.length); htmlString += '&lt;img src='+ randomBkg.url_o +' /&gt;'; return i &lt; 0; }); $('#bg').append(htmlString); }); </code></pre> <p>If i replace randomBkg.url_o with bkg.url_o it just returns the first image in the set. using it as i have above appends an image tag with "undefined" as the img src. Any help about where i am misguided would be super appreciated. </p>
javascript jquery
[3, 5]
2,105,517
2,105,518
Conflicting javascript
<p>I've got a bunch of jquery/javascript running on a new site I'm building, and of course I've run into a conflict. I can't figure out where it's coming from as I'm not that great with js. There is a sticky relocate function that's supposed to show a navigation bar when you start scrolling the page but since I've added in a category filter function, the navigation bar no longer shows.</p> <p>Site: <a href="http://www.audreylynn.net/demo" rel="nofollow">audreylynn</a></p>
javascript jquery
[3, 5]
3,330,012
3,330,013
Injected javascript does not execute
<p>I'm trying to write a piece of javascript that integrates a webpage with an external system. Currently, what I have is a very small amount of code that dynamically inserts a script element into the page.</p> <pre><code>$(document).ready(function() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://example.com/example.php?arg1=1&amp;arg2=2"; document.body.appendChild(script); }); </code></pre> <p>The JS returned by the external system is a large one-line document.write call which writes a table to the page.</p> <pre><code>document.write('&lt;table&gt;&lt;tr&gt;&lt;td&gt;blah&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'); </code></pre> <p>When I inject this script element into the page, I can see it using a DOM inspector, but the script does not appear to execute. If I put the script element into the HTML manually, the javascript executes just fine (so it's not a same origin policy or malformed html error...), but I'd like it to be dynamic.</p> <p>Any ideas why the javascript isn't executing?</p>
javascript jquery
[3, 5]
2,493,938
2,493,939
USING windows control library in ASP.net
<p>I created a control library by adding refrence to office interop excel to do some excel automation in client.The control works fine in windows forms Now i need to add the control in asp.net can somebody tell how to do that.</p>
c# asp.net
[0, 9]
2,699,300
2,699,301
Select text on click for multiple textbox with random IDs
<p>I have multiple textboxes on my page, their ID starts with 'Text' and followed by a random string like this 'Textc0816e05-d7c0-4acc-b233-bef152781cac', How can I have the textbox' value selected when user click on it?</p>
javascript jquery
[3, 5]
2,598,354
2,598,355
Is there a way to capture the alert ok button click event?
<p>Is there a way to capture the alert ok button click event? In jQuery? </p>
javascript jquery
[3, 5]
1,430,947
1,430,948
jquery hide problem
<p>I use this to toggle my div elements, and hide all them when the DOM is ready...</p> <pre><code> $('div[class*="showhide"]').hide(); $('input:image').click( function() { var nr = $(this).attr('id').substr(7,2); $('div.showhide' + nr).toggle(400); }); </code></pre> <p>I have dynamically created div elements with class <code>showhide0;showhide1;showhide2</code>...etc... Inside the DIV tags I have search boxes. </p> <ul> <li>First when page is loaded all DIV tags hide.</li> <li>I toggle one of them to show.</li> <li>Start a search, so the page is reloaded with the result of the query.</li> </ul> <p>Of course all DIV is hide again, because the page is reloaded. Unfortunately...</p> <p>Is it possible to not hide again after I searched for something? It would be nice when I open the page, all the <code>div</code>s are hidden, but after then just when I toggle it...</p>
php jquery
[2, 5]
560,787
560,788
how i trigger javascript function in jquery hover
<p>I have one javascript function. Which i want to call on hover of li</p> <pre><code> var Divhtml='&lt;div&gt;hover&lt;/div&gt;'; $('li a').hover(function(){ $(this).html(Divhtml); //here i want to fire hovercall(); which will work on "Divhtml" i.e. innerHtml,this contains visual effects,depending on Class }); function hovercall() { } </code></pre> <p>please guide</p>
javascript jquery
[3, 5]
4,693,939
4,693,940
How to seperate path from a filename
<p>I have a path to a file like:</p> <blockquote> <p>C:\NewFolder\Test\file1.doc</p> </blockquote> <p>How do I remove the filename from the path .I require only </p> <blockquote> <p>C:\NewFolder\Test\</p> </blockquote>
c# asp.net
[0, 9]
1,374,571
1,374,572
why value change in jquery ajax
<p>in this blow code, after printing $tarikh_sal i can see <code>2012-10-27</code> correctly, but in <code>$.post</code> that changed to <code>1975</code>, i do not change that. why?</p> <p><strong>php code</strong></p> <pre><code>echo $tarikh_sal; //-&gt;2012-10-27 if ( $khoms &gt; 0) {?&gt; &lt;script&gt; $.post("actions.php",{ kh:&lt;?php echo $kh;?&gt; , tarikh_sal:&lt;?php echo $tarikh_sal;?&gt; , postaction:'sabte_kh'}, function(data){ alert(data.message); },'json'); &lt;/script&gt; &lt;?} </code></pre> <p><strong>FIREBUG:</strong></p> <pre><code>kh=2397897533&amp;tarikh_sal=1975&amp;postaction=sabte_kh </code></pre>
php jquery
[2, 5]
3,273,421
3,273,422
How to specifically validate a certain form field using Jquery Validation plugin
<p>I'm using the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow">Jquery Validation plugin</a> to validate my form on the client before submitting.</p> <p>There is a specific field in my form that I want to validate using ajax to the server, once the user has filled out that field (onblur). (Basically it's the username field, I want to check on the server if the username is available and show a message accordingly)</p> <p>Here is the code I'm using to validate my form:</p> <pre><code>$(document).ready(function() { $("#signupForm").validate({ submitHandler: ajaxSubmitForm}); }); </code></pre> <p>(ajaxSubmitForm is just the js code that submits the form)</p> <p>How can I use the Jquery Validation plugin to have the username field send its value to the server (using ajax) when it has changed and have the server return a result that somehow marks that field as valid on the client so the rest of the validation works?</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,369,609
2,369,610
Performing a Process on an Uploaded File .NET
<p>I'm programming in ASP.NET 3.5.</p> <p>I need to process a file that has to be uploaded by a user. The file is in a specific format. Basically, I need to take the information in the file, parse it, and insert it into a SQL db. I have no problem doing that, but I was wondering how to do this from a web site. </p> <p>I think I want to create a share that the user will have access to, have the user upload the file onto the share, and upon upload, save a record into the DB with the full UNC path. In the site, process the file with that UNC path, then move the file to some "processed" folder.</p> <p>Has anyone done something like this? Is there any "standard" way of doing things similar to this?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
5,484,296
5,484,297
JavaScript: Highlight/select word under mouse pointer
<p>How do I highlight (css: background-color) a word with JavaScript when the mouse pointer is hovering over it? It should be possible to select it by clicking on it then and saving it in a variable.</p>
javascript jquery
[3, 5]
4,547,670
4,547,671
how to replace a button text in jQuery mobile
<p>Below is my app code</p> <pre><code>&lt;li class="ui-block-e"&gt; &lt;a href="#login" data-transition="slide" data-role="button" data-theme="b" data-mini="true" id="UserLoginButtonP5" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" class="ui-btn ui-btn-inline ui-mini ui-btn-up-b" data-inline="true"&gt; &lt;span class="ui-btn-inner"&gt; &lt;span class="ui-btn-text"&gt;Login&lt;/span&gt; &lt;/span&gt; &lt;/a&gt; &lt;/li&gt; </code></pre> <p>jQuery replace code</p> <pre><code>$("#UserLoginButtonP1").html("&lt;span class='ui-btn-inner'&gt;&lt;span class='ui-btn-text'&gt;Logout&lt;/span&gt;&lt;/span&gt;"); </code></pre> <p>How do I replace Login to Logout text?</p>
javascript jquery
[3, 5]
760,983
760,984
Inserting 1 or 0 in Bit field in sqlDatabase based on Checkbox checked in GridView
<p>I have a gridview which has a Checkbox Template Field, I am using C# code and basically when the user checks all the Checkboxes in the datagrid view I want to add a 1 or 0 into an SQL database with a datatype field Bit based on the checkbox being checked or not. Here is my code so far;</p> <pre><code>protected void SaveRegisterButton_Click(object sender, EventArgs e) { SqlConnection connection; SqlCommand command; int numRowsAdded; int id; //Boolean AttendanceChecked; foreach (GridViewRow row in GridView2.Rows) { if (((CheckBox)row.FindControl("AttendanceCheckBox")).Checked) { try { // Connecting to the database using the connection string in the web.config file connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["RegisterConnectionString"].ConnectionString); // Create an INSERT Sql statement // To prevent an Sql injection attack, we add parameters with names starting with an @ symbol command = new SqlCommand("INSERT INTO Attendance(Present, StudentID, LessonID) VALUES(@AttendanceChecked, @StudentID, @LessonID)", // Replace the parameters with the actual values read from the form //command.Parameters.AddWithValue("@AttendanceChecked", SqlDbType.Bit).Value = AttendanceChecked; //command.Parameters.AddWithValue("@AttendanceChecked", CheckBox("Attend //com.Parameters.Add("@Approved", SqlDbType.Bit).Value = status; </code></pre> <p>I am struggling to implement this part of my project and any help would be much appreciated! Thanks in advance...</p>
c# asp.net
[0, 9]
3,138,204
3,138,205
adding classes to element
<p>In the code below,do after method generate new jquery object .If not ,why addClass method is addind class 'foo' on both the <em>div</em> as well as <em>p</em> element</p> <pre><code>$('&lt;div/&gt;').after('&lt;p&gt;&lt;/p&gt;').addClass('foo') .filter('p').attr('id', 'bar').html('hello') .end() .appendTo('body'); </code></pre>
javascript jquery
[3, 5]
4,829,587
4,829,588
Is it possible to display a message in php on javascript is disabled?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5334329/display-enable-javascript-message-only-when-javascript-is-disabled">Display “Enable JavaScript” message only when JavaScript is disabled</a> </p> </blockquote> <p>I have a php document which contains both php and jquery coding. My question though is that is there a way in php where if the brower's javascript is disabled, that it displays a message stating "In order to use this application without any problems, you must have javascript enabled"?</p> <p>Can the message appear straight away when the user has disabled javascript?</p> <p>Thanks</p>
php javascript
[2, 3]
1,641,322
1,641,323
Unable to ping host from app but can otherwise
<p>Here's my code:</p> <pre><code>InetAddress address = InetAddress.getByName("www.whyoceans.com"); if (!address.isReachable(3000)) { Toast.makeText(this, "Unable to ping host", Toast.LENGTH_SHORT).show(); } </code></pre> <p>The isReachable always fails, yet I can open a shell and ping it just fine (from both my PC and my phone):</p> <pre><code>ping www.whyoceans.com PING www.whyoceans.com (69.163.249.123) 56(84) bytes of data. 64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123): icmp_seq=1 ttl=55 time=38.3 ms 64 bytes from apache2-fritz.harmony.dreamhost.com (69.163.249.123): icmp_seq=2 ttl=55 time=40.9 ms ^C --- www.whyoceans.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 38.319/39.654/40.989/1.335 ms </code></pre> <p>Why? </p>
java android
[1, 4]
3,935,024
3,935,025
Android save state of listview with multipleChoice
<p>I have a listview that contains some values with the multipleChoice enabled in my xml file. I want to be able to save what has been checked by the user when the app is exited, then re-check what they have selected upon opening again. My code works for a radio group, but I can't seem to get it to work for this.</p> <p><strong>EDIT:</strong> Got this working by using some for loop trickery at the end. </p>
java android
[1, 4]
1,706,969
1,706,970
Reliable way to get the "ancestor" of an object with a specific classname, using jQuery
<p>I've got a javascript function that gets called on change event of a select form element. So, the "this" variable in js refers to the select element.</p> <p>This select element is in a td tag, in a tr tag. The tr tag has a classname of "FilterDetailsRow".</p> <p>Now, I've tested, and if I use this syntax:</p> <pre><code>var filterRow = $(this).parent().parent(); </code></pre> <p>it gets me what I want. However, is there a better way to tell jQuery, "starting with "this" can you please go up my tree of parents until you find one with a classname of "FilterDetailsRow"?</p> <p>Here's what I came up with, but I want to make sure I"m not reinventing the wheel.</p> <pre><code>function GetFilterDetailsRowOfObject(o) { if (o) { if (o.parent()[0].className.indexOf("FilterDetailsRow") != -1) return o; else return GetFilterDetailsRowOfObject(o.parent()); } else { return null; } } </code></pre> <p>Thanks for any advice.</p>
javascript jquery
[3, 5]
1,317,740
1,317,741
International Character Issue
<p>I have a string with value:</p> <p><code>'Reserva de Usos M\xfaltiples de la Cuenca del Lago de Atitl\xe1n-RUMCLA (Atitl\xe1n Watershed Multiple Use Reserve)'</code></p> <p>How do I get the <code>\xfa</code> and <code>\xe1</code> to show up as characters?</p> <p>Thanks Eric</p>
java android
[1, 4]
3,540,866
3,540,867
Iterate through and delete empty HTML table rows with jQuery
<p>I am attempting to iterate through a HTML table using jQuery and delete empty rows. The page is driven by ASP.NET and with certain permission, items in the table will be hidden. Therefore, I wanted to create this script to remove the empty rows and get rid of the space between the other items that are still displayed. I cannot seem to get what I currently have to run and I am unsure as to why. Here is the code:</p> <pre><code>&lt;script src="http://code.jquery.com/jquery-1.5.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('tr').each(function () { $(this).find('td').each(function () { if ($(this).text().trim() == "") { $(this).closest("tr").remove(); }; }); }); }); &lt;/script&gt; </code></pre> <p>Any guidance would be greatly appreciated. Thanks!</p>
javascript jquery
[3, 5]
1,614,538
1,614,539
How to display hidden placeholder without refreshing the page?
<p>I have two placeholders in one page and basically my requirement is that I want to show other placeholder on click of button which is in first placeholder without refreshing the page.</p> <p>But when I m clicking on the button in 1st placeholder it is refreshing the page and then showing me second placeholder.I m open to hear any other suggestions also if it is not possible through placeholder.</p> <p>Can anyone tell me how to achieve this?</p> <p>Thanks,</p>
c# asp.net
[0, 9]
845,963
845,964
JavaScript: how to control progress speed?
<p>Is there any option to increase and decrease the speed of the progress? Sometimes progress takes time and sometime very very slowly to finish: </p> <pre><code>var value = 0, interval = setInterval(function(){ value = ((+value) + .1).toFixed(1); if(value == 80.5) clearInterval(interval); $('p').html(value+'%'); },2); </code></pre> <p><a href="http://jsfiddle.net/sweetmaanu/zjdBh/13/" rel="nofollow">http://jsfiddle.net/sweetmaanu/zjdBh/13/</a></p>
javascript jquery
[3, 5]
2,529,421
2,529,422
How to Read the value in a hiddenField from javascript
<p>I want to read a value in the hidden field in javascript/Jquery.How can i acheive this ??</p>
c# javascript asp.net
[0, 3, 9]
1,793,850
1,793,851
Why doesn't .on() work for links that weren't preloaded on the page?
<p>After trying hashchange and finding out it simply doesn't work in Internet Explorer, I decided to try a click() approach instead. What below is supposed to do is when a link is clicked, check to see if the url contains the page, then change the link_content's html to a div content with an id equal to the hash. </p> <p>It works for all links that are preloaded with the page, but the current links in the link_content div do not trigger. Why isn't this working?</p> <pre><code>$(document).ready(function() { $('a').on("click", function(event){ if (location.pathname.search("boh.html")){ hash=this.hash; if(hash=='#more'){ $('#link_content').html($('#hiddenlist').html()); } else if(hash){ $('#link_content').html($(hash).html()); } } }); }); </code></pre>
javascript jquery
[3, 5]
787,463
787,464
How can I call a method that are in my code-behind via Javascript or Jquery
<p>I have the follow line in my Javascript code </p> <pre><code>credenciadausuario = '&lt;%= getCredenciada() %&gt;'; </code></pre> <p>In my code-behind I have this method </p> <pre><code>public string getCredenciada() { Utilidade.QuebraToken tk = new Utilidade.QuebraToken(); string credenciada = tk.CarregaToken(1, Request.Cookies["token"].Value); return credenciada; } </code></pre> <p>but when I put the debugger in my javascript code, the credenciadausuario variable, receives the string "&lt;%= getCredenciada() %>" and not the return of my method. How can I call my method that are in my code-behind via javascript or jquery ?</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
726,065
726,066
bottom left & bottom right of HTML element
<p>How could I get bottom left x-y &amp; bottom right x-y of any HTML element? I wanted to assign it to another <code>&lt;div&gt;&lt;/div&gt;</code></p>
jquery asp.net
[5, 9]
4,387,292
4,387,293
Creating dynamic objects with Javascript
<p>I'm trying to create a new Javascript object from attributes pulled from the DOM using jQuery. The info I'm trying to pull is the data-* from this:</p> <pre><code> &lt;button type='button' class='pickup' data-name="apple" data-weight='1' data-color='red'&gt;food&lt;/button&gt; </code></pre> <p>So I want to get data-name and data-weight and put them into a new (or existing if I have to) object. Here's where I'm having problems. I want the object to look like this:</p> <pre><code> MyObject = { food: { weight: 1, color: 'red' } } </code></pre> <p>I've been trying to create a new object like this through a "for(var i in MyObject)" loop, but when it comes down to adding the attributes and values to MyObject{} I can't figure out how to make it work.</p> <p>Any ideas or suggestions?</p> <hr> <p>The answers below worked perfectly! Thank you! How if I wanted to dynamically create:</p> <pre><code> MyObject.food = {} </code></pre> <p>from a variable, like this:</p> <pre><code> var Name = "meal"; MyObject.Name = {} // creates MyObject.meal = {}; </code></pre> <p>How would I do that? I thought MyObject[Name] = {} would work but it didnt seem to for me. Maybe I typed it wrong? :S</p>
javascript jquery
[3, 5]
214,384
214,385
How to bind two document objects to single jquery function
<p>I have a custom jquery function that I need to bind to two iframe document objects. </p> <p>Currently it will work with just one doing something like:</p> <pre><code>$(window.frames["iframeName"].document).bind('textselect', function(e) { }); </code></pre> <p>what I'm looking to do is something like:</p> <pre><code>$(window.frames["iframeName"].document,window.frames["iframeName2"].document).bind('textselect', function(e) { }); </code></pre>
javascript jquery
[3, 5]
2,307,835
2,307,836
Beginner To Programming
<p>I am in my second semester at my local college. My major is computer science and this is the second part of the Java course. The thing is, even though I passed with a C,(highest grade in the class) I want to do better and get where I need to be. Just like most people it was a up hill battle to learn because it was an online class and the teacher took an average of about a week to respond to anything. I am asking for techniques and tools that helped you be successful. We are learning JAVA and it's hard learning it on your own because there is no one to really look at your code. At the same time I am trying to learn C and C++ with what I've read from at Joel on Software. Any help is nice.</p> <p>Thanks,</p> <p>Orlando</p>
java c++
[1, 6]
3,032,540
3,032,541
Paging implementation in C# using Stored Procedure (SQL 2000)
<p>Anyone with a link to a sample code with paging that can be changed to work within a (10000+ records) table? I want to display the records on my asp.net page.</p> <p>Cheers</p>
c# asp.net
[0, 9]
2,768,282
2,768,283
jquery text area length count?
<p><br/> I have a text area field where i need to provide information about the word count when the user enters some text in the field. Length of the field is supposed to be 500 Characters. Initialy it must show </p> <blockquote> <p>min characters:100 | 0 of 500 // 0 of 500 must be in red color</p> </blockquote> <p>and once the user enters come character need to update the count as well. Once the user reaches the count say the min character 100, i need to display </p> <blockquote> <p>min characters:100 | 100 of 500 // 100 of 500 must be in green color.</p> </blockquote> <p>How can i do this?? is there any plugin for the same??? let me know your thoughts on this.</p>
javascript jquery
[3, 5]
773,049
773,050
Jquery How to use history plugin?
<p>In my web application I am using ajax and now I'd like the back and forward browser buttons to work. So I went looking for a jquery history plugin and found this one: <a href="http://stilbuero.de/jquery/history/" rel="nofollow">http://stilbuero.de/jquery/history</a></p> <p>In my code I use a function to load a page:</p> <pre><code>function loadDocument(id, doc) { $("#DocumentContent").show(); // Clear dynamic menu items $("#DynamicMenuContent").html(""); $("#PageContent").html(""); // Load document in frame $("#iframeDocument").attr("src", 'ViewDoc.aspx?id=' + id + '&amp;doc=' + doc + ''); // Load menu items $("#DynamicMenuContent").load("ShowButtons.aspx"); } </code></pre> <p>As you can see I want my pages to load within an Iframe. Can someone tell me how I can use a history plugin so that the brwoser buttons will work? I don't really care which plugin it is, as long as the browser buttons work. I prefer an easy to use plugin.</p>
javascript jquery
[3, 5]
1,563,372
1,563,373
Jquery, adding input element
<p>i have successfully added input element into div, which looks like this :</p> <pre><code>$(document).ready(function() { $('#jumlah').change(function() { var jum = $('#jumlah').val(); for(i=1;i&lt;=jum; i++){ $('#jawaban').append('&lt;label&gt;Jawaban Soal ' + i + ' : &lt;/label&gt;&lt;input type="text" name="jawab'+i+'" id="jawab[]" size="2" maxlength="1" /&gt;&lt;br&gt;'); } }); }); </code></pre> <p>and some my HTML codes are :</p> <pre><code>&lt;select name="jumlah" id="jumlah" class="test"&gt; &lt;option value="0" selected="selected"&gt;choose value&lt;/option&gt; &lt;?php for($i=1;$i&lt;=20;$i++) echo("&lt;option value=\"$i\"&gt;$i&lt;/option&gt;"); ?&gt; &lt;/select&gt; &lt;div id="jawaban"&gt;&lt;/div&gt; </code></pre> <p>but when i choose different value, it appends more input elements under the first ones, for example, if i choose option 2 and then option 3 it will look like :</p> <pre><code>Jawaban Soal 1 : &lt;input /&gt; Jawaban Soal 2 : &lt;input /&gt; Jawaban Soal 1 : &lt;input /&gt; Jawaban Soal 2 : &lt;input /&gt; Jawaban Soal 3 : &lt;input /&gt; </code></pre> <p>Please help, i'm still junior in Jquery. I'm looking forward to your respond.</p>
php jquery
[2, 5]
2,814,263
2,814,264
Debug on the Samsung Galaxy I7500 Android Phone
<p>I am having Samsung Galaxy phone and i am trying it to connect to my Vista ,I have installed the Samsung PC suite . When i start the USB debugging on it asks for new driver , i give the path for sdk but still it never worked . The firmware version of phone is 1.5 .I am having sdk 1.6. I have done some changes in inf file but still no luck What wrong i am doing ?</p> <p>Thanks in advance.</p>
java android
[1, 4]
5,764,414
5,764,415
Jquery popup with single enabled datetimepicker
<p>I have a dialog with a few controls and datetimepicker. When I disable all component, except datetimepicker a datetimepicker select dialog appears. He get focus and select date triggers. How can I fix this problem? I want just to show text box with date. </p> <p><img src="http://i.stack.imgur.com/9Om7u.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
1,879,851
1,879,852
selection index change is not working of drop down list
<p>i have only one element in drop downlist so selection index change is not working... the datasource is given to run time... if it was on designing time i can give the select one list item... but at run time what should i do????????</p>
c# asp.net
[0, 9]
5,705,608
5,705,609
Fading colors with jquery?
<p>I have a regular color change using jquery, but I'd like to have it so it has a smooth color change. At the moment, the code changes the color of a link on hover and then removes it when the mouse is removes. I have seen one tutorial but it doesn't explain it and it does not look like my current code. This is what it looks like at the moment:</p> <pre><code>$(document).ready(function() { $("#link1,#link2,#link3").hover(function() { $(this).addClass("red"); },function(){ $(this).removeClass("red"); }); }); </code></pre> <p>Thanks in advance</p>
javascript jquery
[3, 5]
2,956,381
2,956,382
Adding and changing checkbox names + labels on change
<p>This is what I am working with:</p> <p><a href="http://jsfiddle.net/VkYnQ/" rel="nofollow">http://jsfiddle.net/VkYnQ/</a></p> <p>The goal is to select as many times you want, and then select what time, and then it should add and show the times under the <code>'Copy to more dates?'</code> .</p> <p>Currently it has the 1 static checkbox, just to demonstrate how it should work.</p> <p>So when there's 1 static checkbox 0800 out from each weekdays, it means that you have selected 1 time and that one time is currently at 08:00.</p> <p>And if you change this time to 16:00, the checkbox name and label should change to 1600.</p> <p>If select 2 times, and select the second to 20:00, it should add a checkbox at each weekdays next to the other checkboxes, with label "2000"</p> <p>This is what I have tried, for making the changing work, so the checkbox follow if you change from e.g 08:00 to 16:00 like mentioned above: <a href="http://jsfiddle.net/epCbv/1/" rel="nofollow">http://jsfiddle.net/epCbv/1/</a> </p> <p>Which is working, but I cant figure out a way to make it work with my code.</p> <p>Hope anyone out there can help me out, I'll reward with an +300 reputation/bounty, when it's possible (2 days).</p>
javascript jquery
[3, 5]
3,452,287
3,452,288
How to prevent the user to change page with jQuery
<p>I have a page with a form that is submittes via ajaxSubmit() (so, without changing the page).</p> <p>My goal is that, when the user try to change page (or even to close the browser), i ask him if really want to exit the page without sending the form (exactly as gmail does).</p> <p>Gmail for example do this with a window.confirm-like popup, but if it is possible, i'll like to handle it with custom messages and options.</p> <p>jQuery have the unload event:</p> <pre><code>$(window).unload( function () { alert("Bye now!"); } ); </code></pre> <p>but it permits me just to do something before exit the page; i need to 'block' the page exit, if the user click the relative button.</p> <p>So, how to handle (and cancel) the page-exit event?</p>
javascript jquery
[3, 5]
1,849,794
1,849,795
How to select first child with jquery
<p>How do I select the first div in these divs (the one with <code>id=div1</code>) using first child selectors? </p> <pre><code>&lt;div class="alldivs"&gt; &lt;div class="onediv" id="div1"&gt; &lt;/div&gt; &lt;div class="onediv" id="div2"&gt; &lt;/div&gt; &lt;div class="onediv" id="div3"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,278,324
4,278,325
How do i Turn ON/OFF the Caps lock key
<p>We can able to detect the Caps lock key is ON/OFF using Jquery. My question is </p> <p>"can we possible to Turn ON/OFF the Caps lock key using Jquery or Javascript in Keypress event".</p> <p>And also using C#, How to achieve this?</p> <p>Thanks in advance !!!</p>
c# javascript jquery
[0, 3, 5]
4,842,865
4,842,866
Convert String to jQuery Object for HTML Parsing
<p>I have a simple string e.g.</p> <pre><code>var s = "&lt;p&gt;Hello World!&lt;/p&gt;&lt;p&gt;By Mars&lt;/p&gt;"; </code></pre> <p>How do I convert <code>s</code> to a jQuery object? My objective is to remove the <code>&lt;p&gt;</code>s and <code>&lt;/p&gt;</code>s. I could have done this using regex, but that's rather <a href="http://stackoverflow.com/q/7886634/583539">not recommended</a>.</p>
javascript jquery
[3, 5]
4,942,687
4,942,688
jQuery.inArray() function
<p>if we have an array like the following one</p> <pre><code>var x = [[1326844545000,89.59143829345703],[1326844545000,89.59143829345703], [1326844550000,89.4941635131836]] </code></pre> <p>how can we use jQuery.inArray() function ?? and also how can we know the location of that item</p> <p>Thanks </p>
javascript jquery
[3, 5]
2,850,204
2,850,205
How to get correct table format ? Jquery ques
<p>This code prints output as given below... <strong>code</strong>:</p> <pre><code>$('#calendar').append('&lt;table&gt;&lt;thead&gt;&lt;tr&gt;'); var i; for(i=0;i&lt;=6;i++) { $('#calendar').append('&lt;td&gt;'+week[i]+'&lt;/td&gt;'); } $('#calendar').append('&lt;/tr&gt;&lt;/thead&gt;'); $('#calendar').append('&lt;/table&gt;'); </code></pre> <p><strong>output</strong>:</p> <pre><code>&lt;section id="calendar"&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;/table&gt;&lt;td&gt;Sunday&lt;/td&gt;&lt;td&gt;Monday&lt;/td&gt;&lt;td&gt;Tuesday&lt;/td&gt;&lt;td&gt;Wednesday&lt;/td&gt;&lt;td&gt;Thursday&lt;/td&gt;&lt;td&gt;Friday&lt;/td&gt;&lt;td&gt;Saturday&lt;/td&gt;&lt;/section&gt; </code></pre> <p>But i expect something in this structure..</p> <pre><code>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;/table&gt; </code></pre>
jquery javascript
[5, 3]
2,645,120
2,645,121
pass javascript value to asp.net function
<p>the question says it all : i have a linkbutton to which i pass through CommandArgument a value and i need that value to be a javascript value. Thanks!</p> <p>Edit : </p> <p>here is my linkbutton tag :</p> <blockquote> <p>&lt; asp:linkbutton id="prevBut" runat="server" OnCommand="load_com" CommandArgument=to_place_javascript_string Text="previous" /></p> </blockquote> <p>and the function :</p> <blockquote> <p>public void load_com(object sender, CommandEventArgs e)</p> <pre><code>{ //get the string from e and search through the database for something } </code></pre> </blockquote> <p>i want to pass the name of a photo that is stored in a variable $.galleria.current.</p>
javascript asp.net
[3, 9]
138,885
138,886
Call jQuery function from JavaScript
<p>I have some jQuery code:</p> <pre><code>$(function(){ function someFunc(){ /*do something*/ }; ............. }); </code></pre> <p>And now I want call someFunc from JavaScript like below:</p> <pre><code>function test(){ $.fn.someFunc(); } </code></pre> <p>But it doesn't work! I've seen an article <a href="http://stackoverflow.com/questions/8533439/how-to-call-function-in-jquery-from-javascript">how to call function in jquery from javascript</a>. Is it possible? </p>
javascript jquery
[3, 5]