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,076,368
4,076,369
Examples of Combo box controls for the Web
<p>I am looking for examples of Combo box controls relying on jquery, or just javascript and CSS. The control would allow the user to slect from a drop down list, or simply type a custom value.</p> <p><a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx" rel="nofollow">http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx</a></p>
javascript jquery
[3, 5]
399,147
399,148
How to check address a page is accessed from?
<p>I was wondering if it is possible to grab the URL from which a page is accessed? For example say if I have a file index.php. It can be accessed from virtually anywhere, depending on where I placed it. For example:</p> <pre><code> - http://folder1/index.php - http://nicefolder1/index.php </code></pre> <p>Is there anyway I can find out where the page was accessed from? I'd like to perhaps parse that URL and if it was from nicefolder1, I'd like to do something like <code>echo "That was a good location to be executed from"</code> :D! Just something I was curious about ...</p>
php javascript
[2, 3]
2,217,838
2,217,839
Javascript or JQuery - How do I change the background color every fixed-time-interval?
<blockquote> <p><strong>Exact Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4836862/how-can-i-execute-javascript-code-every-a-specific-time-interval">how can I execute javascript code every a specific time interval ?</a> </p> </blockquote> <p>Is there an efficient method for causing a javascript (<code>ChangeDivBG()</code>, in my case) function to execute every fixed time interval?</p>
javascript jquery asp.net
[3, 5, 9]
948,098
948,099
How to validate two groups of controls with 1 button and a validation group?
<p>I have one group of 3 asp.net textboxes and one group of 2 asp.net listboxes. There is one asp.net button. The listboxes each have an asp.net required field validator tied to them. The other 3 textboxes in the first group do not have any validation. When the button is clicked, it should display a message if either of the listboxes does not have anything selected, however, if one of the textboxes in the first group has some value, then it should not matter if the listboxes have any value(s) selected. I assigned the ValidationGroup vgFirst to the group of textboxes and the ValidationGroup vgSecond to the two listboxes. I then assigned the ValidationGroup vgSecond to each RequiredFieldValidator and assigned the button a ValidatonGroup of vgSecond. I think I have everything right, but I am not sure how to handle it with just one button. Do I have to disable Validation for the listboxes if the text in the textboxes change? Is this my only option?</p>
c# asp.net
[0, 9]
5,607,973
5,607,974
how to give permission for the user to view private doc using scribed API
<p>I am using scribd java script API to view a pdf file in my website.</p> <p>I have uploaded one pdf file and made the pdf document private.</p> <p>I want it to be viewed via script in my code.</p> <p>I cant call a private document without autentication - so it does not allow me to view.</p> <p>So i need to give something like this </p> <pre><code> scribd_doc.addParam("use_ssl", true); scribd_doc.grantAccess('username','sessionid','password'); </code></pre> <p>I do not understand what is session id here .</p> <p>how should i get it.. pls explain how to given authentication as above using username and password</p> <p>pls refer </p>
java javascript
[1, 3]
531,989
531,990
jquery .html not working
<p>I am trying to replace some div text automatically using the .html command in Jquery but it's not working for me. This is the code I have so far:</p> <pre><code> &lt;div id="test"&gt;123&lt;/div&gt; &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ var refreshId = setInterval(function() { $('#test').html("test"); }, 1000); }); &lt;/script&gt; </code></pre> <p>Could someone tell me what I'm doing wrong please? I have ran tests to make sure Jquery is working and it is, and if I run alert('test'); then that works fine.</p> <p>Thanks for any help</p> <p><strong>Edit: I have ran the script in another file on localhost and it works fine - could it be something within the code I'm using already that's stopping it from working? This is baffling me!</strong></p>
javascript jquery
[3, 5]
3,511,930
3,511,931
What's wrong with this jQuery example?
<p>The following jQuery example should put some text into the div, but it doesn't. I tried Firefox, Google Chrome and Internet Explorer. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" language="javascript"&gt;&lt;/script&gt; &lt;script language="javascript"&gt; $(window).load(function() { $('adiv').html('&lt;p&gt;hello world&lt;/p&gt;'); alert('done'); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="adiv"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Sorry, this might be stupid, but I'm stuck.</p>
javascript jquery
[3, 5]
5,219,313
5,219,314
copy value string directory to my project
<p>I develop android app on my mac; when I finish a project ,for finishing Localization,I copied value file to my project which is in the old project ,such as value-ko-rKR,but it will cause some problem so I can't compile my project ; in the end ,I find out that I must copy the content of string.xml to string.xml in my present value file;I can't copy value file directly from other project; it makes me confused;who can tell me why? is need some hidden file need to configurate or something? thanks a a million. </p>
java android
[1, 4]
493,773
493,774
How to alert(date) with jquery?
<p>I am trying with this, but it is undignified.</p> <p>In html.</p> <pre><code> &lt;BDP:BasicDatePicker ID="DOBpicker" runat="server" CssClass="txtBox" DisplayType="TextBox" ValidationGroup="userRegistration" /&gt; </code></pre> <p>in jquery, I tried with this</p> <pre><code> function btn() { var date = $('#DOBpicker').val(); alert(date); } </code></pre> <p><strong>or</strong> </p> <pre><code>function btn() { var date = document.getElementById('DOBpicker').value; alert(date); } </code></pre> <p>call this function on btn</p> <pre><code>&lt;input id="test" type="button" value="go" onclick="btn()" /&gt; </code></pre> <p>But it undefined. </p>
javascript jquery
[3, 5]
2,070,305
2,070,306
Customizing the Login Control in ASP.NET
<p>I'm making a Library Management System using ASP.NET using C#. I have a problem creating a custom login page in my website. I've tried using the ASP.NET Web Configuration but my boss doesnt allow me to install the Aspnet_regsql.exe in the main database. </p> <p>I have two tables, one table for the username and password and the other one is for the username status (in case the username is deleted or not used anymore). So is there any alternatives or workaround? </p>
c# asp.net
[0, 9]
4,723,610
4,723,611
how do i change contents of a div within a div?
<p>What I am trying to do is change the contents of a div within a div. I can't seem to access it.</p> <p>dialog is the parent while dialogChange is the child.</p> <p>When I do:</p> <blockquote> <p>$("#dialog").text("New Text");</p> </blockquote> <p>It'll replace everything within the parent, dialog. </p> <p>But when I do:</p> <blockquote> <p>$("#dialogChange").text("New Text");</p> </blockquote> <p>Nothing changes. </p> <p>So how can I access the child within a parent?</p>
javascript jquery
[3, 5]
3,431,651
3,431,652
Is there any jquery plugin to capture both image and video from webcam like the one in Facebook wall system?
<p>Is javascript the only way to access any webcam to capture image and video while the scripting language is php?</p> <p>Is there any jquery plugin to capture both image and video from webcam like the one in Facebook wall system? I searched but could not find one to satisfy both needs.</p> <p>The scripting langauge I'll be using is php.</p>
php javascript jquery
[2, 3, 5]
2,382,991
2,382,992
How to prevent ASP:Button from posting back from a jQuery click handler
<p>I have an <code>ASP:Button</code> on a page. It renders as HTML like so:</p> <pre><code>&lt;input type="submit" name="myButton" value="Do something" onclick="javascript:WebForm_DoPostBackWithOptions( new WebForm_PostBackOptions('myButton', '', true, '', '', false, false))" id="myButton" /&gt; </code></pre> <p>Now I am trying to prevent the default behavior of this button (submitting the form) via a jQuery event handler:</p> <pre><code>$('#myButton').click(function () { // do some client-side stuff if (someCondition) { // don't postback! return false; } }); </code></pre> <p>The problem here is that the inline click handler that ASP sticks on the input seems to be executing before the jQuery event handler, every time.</p> <p>The easiest solution here would be to use a plain <code>input type="button"</code> instead of an <code>ASP:Button</code>, unfortunately <strong>this is not a possibilty</strong> as this <code>ASP:Button</code> does many other things that are required in this scenario.</p> <p>What would be the best way to prevent the form submission from happening? I've thought of using string manipulation to prepend my handler on the element's <code>onclick</code> attribute, but this seems really dirty. I'd also like to avoid using the <code>OnClientClick</code> as this would require my handler function to be publicly exposed. Is there a better way?</p>
javascript jquery asp.net
[3, 5, 9]
5,546,723
5,546,724
How to stop an anchor from redirecting using JQuery
<p>How i can stop an anchor to redirecting to another page if the user is not login . i have a function to check if the user is login or not. i want to do it with JQuery or javacript have tried so far but with no results.</p> <pre><code>if (!is_user_logged_in() ) { $id = 'yes'; } else{ $id = 'no'; } &lt;a href="&lt;?php bloginfo('url') ?&gt;/profile/?id=&lt;?php echo $qr-&gt;id ?&gt;&amp;search=yes" id="&lt;?php echo $id; ?&gt;"&gt;Read More &amp;gt;&amp;gt;&lt;/a&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('a').click(function(){ var id = $(this).attr('id'); if(id == 'yes'){ //i want to prevent }else{ //redirect } }); }); &lt;/script&gt; </code></pre> <p>please help</p>
javascript jquery
[3, 5]
3,678,639
3,678,640
jQuery hash attribute
<p>At 4 minutes into the "Scroll Linked Navigation" podcast Posted: Wed, 18 Aug 2010 at <a href="http://feeds.feedburner.com/jqueryfordesigners-podcast" rel="nofollow">jQuery for Designers</a>, Remy uses the hash attribute.</p> <p>Q: Where is the hash attribute documented?</p>
javascript jquery
[3, 5]
903,522
903,523
isSticky button current state Android
<p>I am developing soft keyboard and I added a toggle button similar to the shift button to my keyboard with option isSticky=true on it. How can I control this sticky button from my code? Or actually is it even possible, since my toggle button loses state each time I change the orientation.</p> <pre><code>public class SoftKeyboard extends InputMethodService implements KeyboardView.OnKeyboardActionListener { </code></pre> <p>And I have a function with onKey to specify the key pressed. </p>
java android
[1, 4]
2,535,694
2,535,695
Mobile Data connection is a battery killer if there is no data transfering?
<p>I'm developing an app that use Mobile Data connection (always GPRS) to upload in a loop each 5 minutes 300 kb of data. Between two upload i see that the data connection remains up (gprs logo on status bar) even if there aren't data transferring....</p> <p>In this time (between two upload) the battery is used by the Mobile Data connection? Do you think that i should use this <a href="http://stackoverflow.com/questions/3644144/how-to-disable-mobile-data-on-android">method to disable and enable connection</a> between uploads to save the batterylife or is not helpfull? </p> <p>If is it so...how can i use that code in my Service Class such as a function, without create a new class? THanx from a noob!</p> <p>EDIT</p> <p>The app is for my personal use and the app have the entire control of phone (the phone is alone and it doesn't interact with the user). So i can sto all data connection...but i can't use that code as i want (as a function!) Help me!</p> <p>EDIT 2</p> <p>Anyway i'm able to enable and disable "airplane mode", but the reconnection require minim 13-14 seconds. May be this help to save battery in the "dead time"?</p>
java android
[1, 4]
183,770
183,771
How to remove .aspx from url
<p>How can i remove .aspx from my urls as I used UrlRewritingNet and its giving me page not found error when i host the site to the server but its alright in the IDE browser. </p>
c# asp.net
[0, 9]
4,690,053
4,690,054
How can I get the img's real width and height with jquery?
<p>Is there any method to <strong>get image's real width and height</strong> with Jquery? I need it to re-size the div with css. please can you help me?</p>
javascript jquery
[3, 5]
4,931,454
4,931,455
Java validators?
<p>is there any Java validator libraries i can use to validate text input from an android app?</p> <p>i know that in spring there are validators for various different types such as checking if a value is a int, if a value is a valid email, etc etc.</p> <p>Anything similar in core java or even android?</p> <p>cheers in advance. i dont want to re-invent the wheel if its already been implemented. i could always sue java reg expressions to construct my own ones but was wondering if their was one done specifically for email formats.</p>
java android
[1, 4]
2,587,572
2,587,573
jQuery selector by position on page available?
<p>Is there a selector available in jQuery to select elements which have a specific position of the page, for example all elements that have an offsetTop bigger than, say, 100px?</p> <p>I tried:</p> <pre><code>$('span[offsetTop&gt;100]') </code></pre> <p>because just as we can check if an attribute equals to some value, I thought it might be possible to check if an attribute is larger than some value. This, however, does not work. Is this possible at all?</p>
javascript jquery
[3, 5]
550,511
550,512
Keep ASP .NET code-behind files on server?
<p>I'm inheriting a web application and the previous programmer compiled all his code into a .dll. The .cs files are not present on the server. </p> <p>Working on previous projects, I've always uploaded the .aspx file and the corresponding .cs file. It's never been a problem for me and I always thought it was standard procedure. Am I wrong or just paranoid?</p>
c# asp.net
[0, 9]
5,870,702
5,870,703
What is the proper way to detect the presence of window.console?
<p>I have this bit of code:</p> <pre><code> var has_logger = (window.console &amp;&amp; window.console.log); if (has_logger) { window.console.log(data); } </code></pre> <p><code>has_logger</code>, instead of being a boolean value, is actually initialised to a function object ( <code>function log() { [native code] }</code> )</p> <p>My questions:</p> <ul> <li><p>There is no need to test for the console.log in modern browsers, correct?</p></li> <li><p>What is the proper way to initialize <code>has_logger</code> to a boolean value instead of a function object?</p></li> </ul>
javascript jquery
[3, 5]
738,653
738,654
Android rate button syntax errors
<p>I get the errors Syntax error on token "marketrate", VariableDeclaratorId expected after this token... Uri.parse("https://market.android.com/details?id=com.synamegames.giveaway");</p> <p>and</p> <p>Syntax error on token(s), misplaced construct(s)...startActivity(market);</p> <pre><code> private void makeDialog() { AlertDialog.Builder about = new AlertDialog.Builder(this); about.setMessage("About The Giveaway"); about.setPositiveButton("Rate", new DialogInterface.OnClickListener() { Intent market = new Intent( "android.intent.action.VIEW", startActivity(market); public void onClick(DialogInterface arg0, int arg1) { //action } }); about.setNegativeButton("Close", new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) {} }); about.show(); } } </code></pre>
java android
[1, 4]
682,749
682,750
calling javascript function from .net codebehind with a value
<p>I am trying to call a javascript function from asp.net codebehind using onclientclick for a linkbutton. Code is like this:</p> <pre><code>string x = "redirecttoimagepage"+"("+ y+")";//y has an int value i need and it varies lnkimagepage.OnClientClick = x; </code></pre> <p>i need to use the value y in the javascript function for using. </p> <pre><code> function redirecttoimagepage(variable) { var strURL = "Subpages.aspx?tabID="+variable; window.open(strURL,"_blank"); return true; } </code></pre> <p>Right now, with the code i have shared, it doesnt do anything. After the link is clicked, it stays in the same page. What am i doing wrong? Appreciate all your help guys. Thanks a lot!</p>
c# javascript asp.net
[0, 3, 9]
708,280
708,281
How do I select a span containing a specific text value, using jquery?
<p>How do I find the span containing the text "FIND ME"</p> <pre><code>&lt;div&gt; &lt;span&gt;FIND ME&lt;/span&gt; &lt;span&gt;dont find me&lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,390,813
1,390,814
Array Dynamic Menu Logic?
<p>Ok what I am trying to do is create a dynamic menu based on an array First dimesion elements will be top level and Second dimension levels will be sub items of said parent how will I do this?</p> <pre><code>$(document).ready(function(e) { //var maxLevels = 3;//Max Levels Of The List TO Traverse var nav = new Array(); nav[0] = "Item A"; nav[0][0] = "Item AB"; nav[1] = "Item B"; nav[1][0] = "Item BA"; var menu = ""; nav.forEach(function(e) { menu += "&lt;li&gt;" + e + "&lt;/li&gt;"; }); $('#info').html(menu); }); </code></pre>
javascript jquery
[3, 5]
3,937,557
3,937,558
Jquery add tr to last but one row in a table
<p>Sample Code </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>Now when i click this Add button it should add tr before this row i.e </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>so the next time i click Add button it has to be </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>How is this done?? Please help</p>
javascript jquery
[3, 5]
3,910,738
3,910,739
Displaying the inside of a building on a mobile
<p>I'm not sure where to start or what to search for, but how would i display a map of the inside of one building. The display is to be shown on a mobile phone as an app. I have hand drawn the inside of the building but what software would i use to create it on my mobile?</p>
java android
[1, 4]
2,187,377
2,187,378
Android UI Thread
<p>i am using threads to do few tasks. and after that i want to access the main thread via runOnUiThread(). but how to determine whether that ui thread still running or not?</p>
java android
[1, 4]
5,356,955
5,356,956
using this in javascript function
<p>I have code like this </p> <pre><code>&lt;img onclick="getTitle();" title="myimg" &gt; function getTitle() { alert(jQuery(this).attr("title"); } </code></pre> <p>and its not working. Can somebody explain how to do this right. And what is wrong with this code. </p>
javascript jquery
[3, 5]
4,541,780
4,541,781
Javascript to PHP domain.charCodeAt(i)
<p>I'm trying to convert a javascript snippet into PHP. Javascript is </p> <pre><code>var sum1 = 0, sum2 = 0; for (var i = domain.length - 1; i &gt;= 0; i--) { sum1 += domain.charCodeAt(i) * 13748600747; sum2 += domain.charCodeAt(i) * 40216416130; } var x = ("$" + sum1).substring(0, 8) + ("" + sum2).substring(0, 8); </code></pre> <p>But couldn't understand this part, <code>sum1 += domain.charCodeAt(i) * 13748600747;</code> I mean which PHP function can be used instead of domain.charCodeAt(i).</p> <p><strong>EDIT:</strong></p> <p>My PHP code:</p> <pre><code>$domain = "example.com"; $sum1 = 0; $sum2 = 0; $length = strlen($domain); $i = $length - 1; for ( $i; $i &gt;= 0; $i-- ) { $sum1 += ord($domain[$i]) * 13748600747; $sum2 += ord($domain[$i]) * 40216416130; } $newsum = "$".$sum1; $x = substr($newsum,0,8) + substr($sum2,0,8); echo $x; </code></pre> <p>Output is definitely different. Need Help.</p>
php javascript
[2, 3]
432,836
432,837
Android setContentView with Textview
<p>I'm completely new to Android application programming, and I was reading through Google's tutorial: <a href="http://developer.android.com/training/basics/firstapp/starting-activity.html" rel="nofollow">http://developer.android.com/training/basics/firstapp/starting-activity.html</a>. </p> <p>On this page, under the "Display the Message" section, they create <code>TextView</code> object, and use <code>setContentView</code> with the <code>textView</code> object as the argument, to display some text. I was wondering, if I'm understanding correctly, instead of creating the <code>TextView</code> object within the code, can you define it in XML instead? If you define it in XML, would that require you to create a new XML file besides main_activity.xml? Thanks.</p>
java android
[1, 4]
143,683
143,684
Question about inline aspx tags
<p>I have this div that's got a style attribute..In that I am setting it's background image by calling a function from code behind..</p> <pre><code>&lt;div id="id1" style = "background-image: url(&lt;%=GetImage()%&gt;);"&gt;&lt;/div&gt; </code></pre> <p>now when I add runat="server" attribute in this div..it shows the Image path as method name itself and not <a href="http://localhost/myweb/images/image.jpg" rel="nofollow">http://localhost/myweb/images/image.jpg</a></p> <p>when I remove runat..image path displays alright..Isn't the runat supposed to be there because it's got inline aspx tag ??? I am confused.</p>
c# asp.net
[0, 9]
5,288,286
5,288,287
Please modify the code, it gives error that functionRemainCount() does not exist in current context?
<p>I have taken function "functionRemainCount()" in .js page. I want to call inside the .aspx page . I have used code like this but it gives error that function name does not exit in current context that correct because it is used in .js file. So how to call the function? Please tell me.</p> <p>My code is this:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { txtNote.Attributes.Add("OnKeyDown", functionRemainCount()); txtNote.Attributes.Add("OnKeyUp", functionRemainCount ()); } </code></pre>
c# javascript asp.net
[0, 3, 9]
5,505,927
5,505,928
client program close unexpectedly
<p>I am working on client server application. For this I have created a java project in eclipse for server and an android project as mentioned in <a href="http://lakjeewa.blogspot.in/2012/03/simple-client-server-application-for.html?showComment=1360648588323#c5421919998512375358" rel="nofollow">this</a> tutorial. I have run server program first and it runs. Client program runs but when I clicked on send button it shows "unfortunately stop"</p>
java android
[1, 4]
2,616,545
2,616,546
find the variable which is equal to the value of another variable
<p>I came across a confusing fact during coding a script.</p> <p>How can i find the variable which is equal to the value of another variable. THEN , get the value of that variable.</p> <p>Here's an example:</p> <pre><code>var result; var 1 = "john"; var 2 = "amy"; var 3 = "micheal"; var info = "1"; </code></pre> <p>When var info is set to <code>1</code> , the script will then look for variable 1 which has the value <code>JOHN</code> then get the value <code>john</code> . Then set the result's value to "john".</p> <p>For the same thing ,</p> <p>When var info is set to <code>2</code> , the script will then look for variable 2 which has the value <code>AMY</code> then get the value <code>amy</code> . Then set the result's value to "amy".</p> <p>and so on..</p> <p>My info variable's value is not determined. it could be 1 , 2 or 3 which is set/determined by an user event.</p> <p>P/S i can use if and else , but i want to know how this can be done. :)</p> <p>So how can i do this?</p>
javascript jquery
[3, 5]
3,188,427
3,188,428
How to use Rotating Progress Bar?
<p>Hi i'm using Rotating Progress Bar in my Android Music Plyer Application....I'm not able to stop it. While working with horizontal Progress bar i used handler to stop and start it. But while working with Rotating One, The progress bar goes into Infinite Loop.....</p> <p>Can you please suggest method to stop the indefinite loop. Thanks in advance. </p>
java android
[1, 4]
3,026,153
3,026,154
JQuery - Multiple Timeouts
<p>I have a form where JQuery fires error messages depending on the requirements of the different fields. I want the messages to pop up next to each field as needed, and I want each to fade in, have a 3 second timeout, then fade out.</p> <p>But Im wondering: is there someway to have an object or an array store all the timeouts? Basically, all the errors are currently running off the same reference to the timeout. So if one input fires an error, and another one does 1-second after, then the second message goes away in TWO seconds (rather than 3), because it's all referring to one timeout variable, and the first firing setup the initial timer. </p> <p>This is for an order form, so Product refers to the parent <code>Div 'product'</code> for the input on which the error is being triggered.</p> <p>I have something like this:</p> <pre><code>function error_check_number(input) { var intRegex = /^\d+$/; var product = jQuery(input).closest('div.product'); if (!intRegex.test(input.val()) &amp;&amp; input.val() != '') { input.val('0'); if (jQuery('div.error-message', product).length &lt;= 0) { var error = jQuery("&lt;div class='error-message'&gt;Number Values Only&lt;/div&gt;").hide(); error.appendTo(jQuery(product)).slideDown("fast"); } var thetime = setTimeout(function(){ jQuery("div.error-message", product).slideUp("fast", function () { jQuery("div.error-message").remove(); }); }, 3000); } else { clearTimeout(thetime); jQuery("div.error-message", product).slideUp("fast", function () { jQuery("div.error-message", product).remove(); }); } } </code></pre> <p>I would like each call to the error message, to function independently from one another, as far as the timeouts are concerned.</p>
javascript jquery
[3, 5]
1,256,060
1,256,061
Truncate width function not working when passing integer
<p>I'm trying to create a universal function that I can call from multiple places to truncate long text recursively to fit a predefined pixel width - using jquery.</p> <p>Here is the code...</p> <pre><code>function constrain(text, original, ideal_width){ var ideal = parseInt(ideal_width); $('span.temp_item').remove(); var temp_item = ('&lt;span class="temp_item" style="display:none"&gt;'+ text +'&lt;/span&gt;'); var item_length = text.length; $(temp_item).appendTo('body'); var item_width = $('span.temp_item').width(); if (item_width &gt; ideal) { var smaller_text = text.substr(0, (item_length-1)); return constrain(smaller_text, original); } else if (item_length != original) { return (text + '&amp;hellip;'); } else if (item_length == original) { return text; } } </code></pre> <p>If I run the function like this:</p> <pre><code> $('.service_link span:odd').each(function(){ var item_text = $(this).text(); var original_length = item_text.length; var constrained = constrain(item_text, original_length,'175'); $(this).html(constrained); }); </code></pre> <p>The text doesn't truncate. I also tried the 175 without the quotes.</p> <p>If I define var ideal = 175; inside the function, then it works. Why is passing 175 to the function not working? I did a parseInt on it in case it was a string.</p> <p>Also - this truncate code run a bit slow on older machines - any tips for speeding it up?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,111,783
3,111,784
I need ($("#flip").click slideToggle ) to perform several times on the same page with same <div> ID
<p>I have a FAQs page that reads from XML using XSl code, The div for the question and answer will be repeated as much as the number of records in the XML.</p> <p>This is the XSL code:</p> <pre><code>&lt;xsl:for-each select ="TSPRoot/FAQS/FAQ"&gt; &lt;div id="flip"&gt; &lt;xsl:value-of select ="Question"/&gt; &lt;/div&gt; &lt;div id="panel"&gt; &lt;xsl:value-of select ="Answer" disable-output-escaping ="yes"/&gt; &lt;/div&gt; &lt;/xsl:for-each &gt; </code></pre> <p>And in the head I have this JQuery code:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $("#flip").click(function(event){ event.preventDefault(); $("#panel").slideToggle("slow"); }); }); &lt;/script&gt; </code></pre> <p>The slideToggle works only for the first div, then it do not work.</p> <p>I can't figure out any ideas.</p>
javascript jquery
[3, 5]
5,937,702
5,937,703
Javascript formatting for if condition
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4728144/check-variable-equality-against-a-list-of-values">Check variable equality against a list of values</a><br> <a href="http://stackoverflow.com/questions/13959064/javascript-comparing-single-value-against-multiple-values-with-or-operands">Javascript: Comparing SINGLE Value Against MULTIPLE Values with OR Operands</a> </p> </blockquote> <p>First of all I am new to javascript side. Please let me know is there any simple way of formating the below code.</p> <pre><code>if( fileName== 'doc' || fileName=='docx' || fileName=='xls' || fileName=='xlsx' || fileName=='ppt' || fileName=='pdf' ){ Do something } else{ Do something } </code></pre>
javascript jquery
[3, 5]
211,718
211,719
Generic HttpHandler vs normal aspx Page HttpHandler
<p>Is there any difference in using Generic HttpHandler(ashx) instead of normal aspx Page for returning daynamic Images as stream. Every tutorial that I have read about serving dynamic files uses generic handler but I can't seem to find any comparasion article between those two. Can someone explain why it is good to use Generic handler instead of Page Handler for this task?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
3,838,658
3,838,659
jquery is not getting loaded in my content page?
<p>I have content page , i am putting this inside it </p> <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="contentPanel1" runat="server"&gt; &lt;script type ="text/javascript" src ="JScripts/jquery-1.2.6.js"&gt; &lt;/script&gt; &lt;/asp:Content&gt; </code></pre> <p>The jquery is not loaded , none of the functions of jquery work. </p> <p>i have also tried by putting it in masterpage ScriptManager like below , but still does not work. </p> <pre><code>&lt;asp:ScriptManager ID="masterScriptManager" runat="server" EnablePageMethods="True"&gt; &lt;Scripts&gt; &lt;asp:ScriptReference Path ="~/JScripts/jquery-1.2.6.js" /&gt; &lt;/Scripts&gt; &lt;/asp:ScriptManager&gt; </code></pre> <p>Is there any way to assert whether jquery is loaded or not. Any ideas ? </p>
asp.net jquery
[9, 5]
1,821,173
1,821,174
Shuffle words on hover only once
<p>I'm creating a sort of a animated header for my homepage where I want the words to hover and change their horizontal location randomly.</p> <p><strong>HTML</strong></p> <pre><code>&lt;header&gt; &lt;a href="#"&gt; &lt;span&gt;One&lt;/span&gt; &lt;span&gt;100&lt;/span&gt; &lt;span&gt;Twenty&lt;/span&gt; &lt;span&gt;2000&lt;/span&gt; &lt;/a&gt; &lt;/header&gt; </code></pre> <p><strong>jQuery</strong></p> <pre><code>(function($){ $.fn.shuffle = function() { var allElems = this.get(), getRandom = function(max) { return Math.floor(Math.random() * max); }, shuffled = $.map(allElems, function(){ var random = getRandom(allElems.length), randEl = $(allElems[random]).clone(true)[0]; allElems.splice(random, 1); return randEl; }); this.each(function(i){ $(this).replaceWith($(shuffled[i])); }); return $(shuffled); }; })(jQuery); $("header").mouseenter(function(){ $('span').shuffle(); }); </code></pre> <p>I got this random shuffle code from css-tricks.com ands its a bit quirky. When I hover on the header it goes a little too crazy with the shuffleing and when i want to click on the link it somehow triggers the function again:</p> <p><strong>jsFiddle</strong> <a href="http://jsfiddle.net/5CMCH/1/" rel="nofollow">http://jsfiddle.net/5CMCH/1/</a></p> <p>What I want to achieve is to have only one change when I mouseenter it, click on the link to get to the index, and another one when I mouseenter again etc.</p> <p>Any hints?</p>
javascript jquery
[3, 5]
1,829,115
1,829,116
How to periodically update a date/time value on a page using jQuery?
<p>In this example, I have an input text field that contains a datetime value set with jQuery.</p> <p><strong><a href="http://jsfiddle.net/D4Hu9/" rel="nofollow">http://jsfiddle.net/D4Hu9/</a></strong></p> <p>HTML:</p> <pre><code>&lt;input id="foo" name="foo" type="text" value="" size="55" /&gt; </code></pre> <p>JS:</p> <pre><code>jQuery(document).ready(function() { var now = new Date(); jQuery('#foo').val(now.toString()); }); </code></pre> <p>How can I update this value every 5 seconds from jQuery?</p>
javascript jquery
[3, 5]
5,915,018
5,915,019
how to read hidden div using jquery?
<pre><code>$('.slider').each(function(){ if($('li:last',this).width()+$('li:last',this).offset().left-$('li:first',this).offset().left &lt; $('div',this).width()){ //doing something } }); </code></pre> <p>I have multiple slides and only one is visible. here I'm trying to do some thing after reading each slides. Issue is that I'm not able to read slides if its hidden. is there any way I can read hidden div using jquery.</p>
javascript jquery
[3, 5]
5,051,666
5,051,667
How do you set the "Visible" property of a ASP.NET control from a Javascript function?
<p>Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function. I figured I would just access the control in Javascript using:</p> <pre><code>var theControl = document.getElementById("txtEditBox"); </code></pre> <p>Then just set the control's Visible property to true/false. It doesn't seem to be working, I can't seem to figure out how to set "Visible" to true/false. How can I do that? Also, is that the best way to hide/show a ASP.NET control from a Javascript function?</p> <p>Thanks, Jeff </p>
asp.net javascript
[9, 3]
2,938,350
2,938,351
jQuery .change() returning current value instead of after change takes place
<pre><code>$('#id').change(function () { if ( $('#id option:selected').val() == 'choice1') { // do stuff } else if ( $('#id option:selected').val() == 'choice2' ) { // do different stuff } }); </code></pre> <p>So what's going on here is choice1 is selected by default when the page loads. When I change the dropdown to choice2, nothing happens the first time. When I change it the second time back to choice1, it actually reads the value from the previous selection (choice2). So it's like one step behind with the values, like it is taking the value before the change happens.</p> <p>Any tips would be greatly appreciated!</p> <p>Thanks a lot!</p> <p>UPDATE: Thanks all but there must be something else going on with the rest of the JS on the site that is using this. I had tried .val() before, and it behaves in the exact same way as option:selected - there is a one iteration delay, so it starts working after the first choice but it's behind by one. I have seen this problem before, but I really don't remember how I fixed it. I'll have to answer my own post when I do. Thanks for the responses everyone!</p>
javascript jquery
[3, 5]
3,329,771
3,329,772
Locate HTML Element when it does not have the runat="server" attribute
<p>I have an ASP.NET C# website and I am attempting to retrieve the inner html from a HTML in my page when a button is clicked.</p> <p><strong>My Problem:</strong> I use the function FindControl() but it returns null when it should find the element. Why is this happening, what am I doing wrong?</p> <p>My HTML page:</p> <pre><code>&lt;%@ Page Title="test" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test" %&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ActualContent"&gt; &lt;div class="regMainContainer mainContainer container"&gt; &lt;!-- Attempting to get the below div --&gt; &lt;!-- Knowtice it does not have runat="server", I would prefer not to do that if I dont need to --&gt; &lt;div id="courseDiv" class="courseContainer"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/asp:content&gt; </code></pre> <p>My Code that executes when a button is clicked(inside test.aspx.cs file:</p> <pre><code>HtmlGenericControl d = (HtmlGenericControl)FindControl("courseDiv"); </code></pre>
c# asp.net
[0, 9]
6,002,158
6,002,159
call the same name functions in jquery?
<p>i have 2 file js in my asp website named</p> <pre><code>1-jquery.datepick.js 2-jquery.hijridatepick.js </code></pre> <p>these file have the same name functions but second one apear popup hijricalender i call it by</p> <pre><code> &lt;script type="text/javascript"&gt; $(function () { $('[id$=TextBox1]').datepick({ dateFormat: 'dd/mm/yyyy' }); }); &lt;/script&gt; </code></pre> <p>for <code>textbox2</code> i wanna 2 use datepick function from first file how icall it cause i refrenced the first file as</p> <pre><code> $('[id$=TextBox2]').datepick({ dateFormat: 'dd/mm/yyyy' }); </code></pre> <p>but this call again the function of second file ???</p>
javascript jquery asp.net
[3, 5, 9]
5,601,536
5,601,537
JQuery click of input button not firing
<p>I've looked on the forum and my question is a duplicate of <a href="http://stackoverflow.com/questions/8880389/button-click-event-not-firing-in-jquery">Button click event not firing in jQuery</a>, except my code already matches the given answer.</p> <p>I've stripped this down for you guys anyway, and can confirm that links with a class of disabled do not fire, so this proves the document ready and Jquery library are correct.</p> <p>Javascript</p> <pre><code>$(document).ready(function () { // Prevents links from firing $('a.disabled').click(function (e) { e.preventDefault(); }); // Handles search $("#btnTreeSearch").click(function () { alert("click search fool!"); }); }); </code></pre> <p>Html</p> <pre><code>&lt;input type="submit" value="btnTreeSearch" /&gt; </code></pre> <p>Any clues?</p>
javascript jquery
[3, 5]
4,233,365
4,233,366
Change color on some characters
<p>How can I highlight the minutes (22) when displaying this time using Javascript/jQuery? I want 22 to have a different color than 11 and 33.</p> <p>11:22:33</p> <p>Thank you!</p>
javascript jquery
[3, 5]
5,179,617
5,179,618
form updated by javascript missing post values
<p>I have a form that I ad an element to via JavaScript before it is submitted.</p> <pre><code> parent.document.getElementById('submitcomment' + id).innerHTML = '&lt;img class="image_real" src="/images/site.png" alt="Mostly Dirty," /&gt; &lt;input class="real" name="freshness" type="text" size="5" maxlength="6" /&gt; &lt;a href="#" onClick="submitComment('+[id]+'); return false;"&gt; &lt;img id="submitcommentimg&lt;?php echo $id; ?&gt;" src="images/check.png" alt="Comment!" border="0"&gt;&lt;/a&gt; &lt;div class="submitcommentalert" id="comment_alert_&lt;?php echo $id; ?&gt;" style="display:none"&gt;Comment Posted!&lt;/div&gt;'; </code></pre> <p>When the form is submitted it seems to be missing the <code>'freshness' &lt;input&gt; element</code></p> <p>That is if I try to access <code>$_POST['freshness'];</code> it is empty.</p>
php javascript
[2, 3]
3,458,746
3,458,747
How get namespace on javascript in asp.net web?
<pre><code>%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { debugger; var counter = "test"; WebApplication1.Service1.DoWork(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType); }); function ResultLoadMainGridProductType() { } function ErrorLoadMainGridProductType() { } &lt;/script&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:ScriptManager ID="ScriptManager" runat="server"&gt; &lt;Services&gt; &lt;asp:ServiceReference Path="~/Service1.svc" /&gt; &lt;/Services&gt; &lt;/asp:ScriptManager&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Code fails on <code>WebApplication1.Service1.DoWork(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType);</code> Error: Error of implementation of Microsoft Jscript: "WebApplication1" is not certain. WebApplication1 - the namespace... then I watch it it undefined on javascript code working. How make it be there??</p>
javascript jquery asp.net
[3, 5, 9]
1,674,830
1,674,831
How can I get default Date and Time format pattern
<p>Could somebody tell me how can I get the default date and time format pattern(String) for specified locale(or default locale).</p> <p>What I already found (Could be useful for somebody else):</p> <ol> <li><p>How to get default locale.</p> <pre class="lang-java prettyprint-override"><code>Locale currentLocale= Locale.getDefault(); System.out.print(currentLocale.toString()); Result is "en_US" </code></pre></li> <li><p>How to get decimal separator.</p> <pre class="lang-java prettyprint-override"><code>DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(currentLocale); System.out.print(decimalFormatSymbols.getDecimalSeparator()); Result is "." </code></pre></li> <li><p>How to get the default Date and Time format pattern (String);</p> <pre class="lang-java prettyprint-override"><code>(do something) System.out.print(something); And got at output something like this: "dd/mm/yyyy" or "hh:mm:ss".. or other values for specified locale. </code></pre></li> </ol> <p>Thanks a lot.</p> <p><strong>UPD:</strong> Found solution:</p> <pre class="lang-java prettyprint-override"><code>SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); String dateLocalizedFormatPattern = simpleDateFormat.toLocalizedPattern(); The result of System.out.print(dateLocalizedFormatPattern) on my device is "M/d/yy h:mm a". </code></pre>
java android
[1, 4]
1,587,593
1,587,594
Error with a code
<pre><code>ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = @"c:\windows\system32\rundll32.exe"; startInfo.Arguments = @"C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen C:\Users\Sony\Desktop\c.jpg" </code></pre> <p>I want to specify the image URI <code>(C:\Users\Sony\Desktop\c.jpg)</code> as a string variable.So what changes do I have to make in startInfo.Arguments.</p>
c# asp.net
[0, 9]
5,931,828
5,931,829
What is the fastest way to work with ajax request?
<p>I am a little bit confused about what is the fastest and the friendly way with the server to request POST or GET from server by AJAX, is it jQuery (<code>$.load()</code>, <code>$.get()</code>, <code>$.post()</code>, <code>$.ajax()</code>) or Javascript like XMLHttpRequest? </p> <p>I need to make a function or class to use in my project to call request from server via AJAX, but I don't know what is the faster and more friendly with the server jQuery or Javascript.</p>
javascript jquery
[3, 5]
3,566,333
3,566,334
set javascript array from DataTable in code behind
<p>Im trying to set an array in <code>Javascript</code>, and then give it values from the <code>DataTable</code> in the code behind like that :</p> <pre><code>for (var i = 0; i &lt; '&lt;%=dt_questionVideo.Rows.Count - 1 %&gt;'; i++) { videoQarray[i] = '&lt;%=Convert.ToInt32(dt_questionVideo.Rows['+i+'][0]) %&gt;'; } </code></pre> <p>Im getting an error </p> <blockquote> <p>Too many characters in character literal</p> </blockquote> <p>how can I manuover this one ?</p>
c# javascript asp.net
[0, 3, 9]
3,577,461
3,577,462
Textbox Onclick = clear value , on exit from textbox set the default value?
<p>I have this in the </p> <pre><code>&lt;asp:TextBox ID="svv" OnClick="this.value=''" runat="server"&gt;Hello...&lt;/asp:TextBox&gt; OnClick="this.value=''" // On mouse click in textbox it will deleted the text. </code></pre> <p>How can I set something like </p> <p><code>Unclick"this.defautlvalue"; // something like this.</code></p> <p>So, when I click the control it will clear the value, if I exit from the control (for example, clicking another textbox) it will return the default value of the textbox.</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,723,969
5,723,970
How add click event div runat server
<p>I having difficulty in meeting add an event click on a div tag with runat = "server". This works perfectly on IE but not on chrome, mozilla .. Search error :-)</p> <p>Here is the code I tried</p> <p><strong>JAVASCRIPT:</strong></p> <pre><code>function showAlertAnomalie() { alert("Handler test"); } </code></pre> <p><strong>ASP:</strong></p> <pre><code>&lt;div id="btn_alert_anomalie" class="alertAnomalieClass" runat="server" onclick="showAlertAnomalie" &gt; &lt;asp:Label runat="server" Text="Alert annomaly" Font-Bold="true" Font-Size="12" ForeColor="White" style="cursor:pointer;"&gt;&lt;/asp:Label&gt; &lt;/div&gt; </code></pre> <p><strong>I ave also try this but not work.. :</strong></p> <pre><code>$("#btn_alert_anomalie").click(function () { alert("Handler test"); }); </code></pre>
javascript asp.net
[3, 9]
4,058,573
4,058,574
python receive data from android
<p>how to send stored data in a string format from android to python for example !!</p> <pre><code>String s1=DoubletoString(loc.getLatitude()); String s2=DoubletoString(loc.getLongitude()); </code></pre> <p>i want to send the s1 &amp; s2 data to python how to send it !! any help ???</p>
android python
[4, 7]
946,268
946,269
Android - Get Click Event of Map Overlay Item
<p>I have a MapView with Overlays like this:</p> <pre><code>public class MyMapActivity extends MapActivity { private MapItemizedOverlay itemizedOverlay; @Override public void onCreate(Bundle savedInstanceState) { for(a loop to put all 10 datas into overlay) { OverlayItem overlayitem=new OverlayItem(some params); overlayitem.setMarker(some bitmap); itemizedOverlay.addOverlay(overlayitem); } mapView.getOverlays().add(itemizedOverlay); } } public class MapItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt; { //some code @Override protected boolean onTap(int index) { //Here I know what marker been clicked... } } </code></pre> <p>I know i get what marker has been clicked in the MapItemizedOverlay class. But how do i use this in my MapView? What i want i show a balloon tip when an OverlayItem is clicked like here <a href="http://stackoverflow.com/questions/3707923/show-popup-above-map-marker-in-mapview">Show popup above map marker in MapView</a>.</p> <p>Please guide me, I dont know what to do at all...</p> <p>Thanks a lot.</p>
java android
[1, 4]
5,810,717
5,810,718
how to select a row in a table according to checkbox column
<p>Using Asp.net and <code>jQuery</code> I have a <code>GridView</code> with a <code>CheckBox</code> column. Right now I have code that highlights (green) a row whenever the mouse goes over it (and unhighlights (yellow) on mouse out). I would like to add the ability to highlight it a different color (pink) whenever the checkbox in that row is checked. </p> <p>My problem is that after checking the box and the row highlights pink, when I mouse out, the row returns to the original color (yellow). How can I make the row with the checkbox not react to the mouse out code?</p>
javascript jquery asp.net
[3, 5, 9]
2,654,675
2,654,676
Can't get my head round relative path
<p>This is probably something mind-numbingly obvious, but I'm new to c# so be gentle...</p> <p>I have an application which (in theory) parses a text file into an array. Despite the text file being a peer of the aspx file I can't get the relative path right. Don't know if it makes any difference (I'd assume not) but I'm using code-behind.</p> <p>My folder structure looks like this:</p> <ul> <li>default.aspx</li> <li>default.aspx.cs</li> <li>default.aspx.designer.cs</li> <li>album.cs</li> <li>albums.txt</li> <li>web.config</li> </ul> <p>And this is the code I'm using:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { string[] allLines = File.ReadAllLines(@"Albums.txt"); Album[] Albums = new Album[allLines.Length]; for (int i = 0; i &lt; allLines.Length; i++) { string[] lineSplit = allLines[i].Split(','); Albums[i] = new Album(); Albums[i].ID = Convert.ToInt32(lineSplit[0]); Albums[i].title = lineSplit[1]; Albums[i].keyName = lineSplit[2]; } } </code></pre> <p>However, when I build it I get an error saying albums.txt can not be found, and it fails.</p> <p>Any pointers would be greatly appreciated.</p> <p>Ben</p>
c# asp.net
[0, 9]
5,750,255
5,750,256
Click Event is triggered twice when a click on a link
<p>my click event is triggered whenever i clicks on the link here is my javascript code </p> <pre><code>$('#switchnavigation').click(function(e){ console.log('-&gt;'+i);i++; //var x=$('#switches').html(); if(i&lt;2) { $('#switchnavigation').append('&lt;ul id="navig"&gt;&lt;li class="ui-btn-inner ui-li" style="line-height:20px;padding-left:30px;"&gt;Apps&lt;/li&gt;&lt;li class="ui-btn-inner ui-li" style="line-height:20px;padding-left:30px;"&gt;Videos&lt;/li&gt;&lt;/ul&gt;'); e.stopPropagation();console.log(i); a=setTimeout(rm,3000); } else { $('#navig').remove(); i=0; } function rm() { $('#navig').remove(); i=0; clearTimeout(a); } e.stopPropagation(); }); </code></pre> <p>and respective HTML code</p> <pre><code>&lt;a href="#" data-theme="g" id="switchnavigation" data-role="button" class="revise-menus custom-b ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-e" data-ajax="false" data-icon="back"&gt; &lt;span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true"&gt; &lt;span class="ui-btn-text" id="switches"&gt;Books&lt;/span&gt; &lt;/span&gt; &lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
3,525,799
3,525,800
Image as TabIndicator
<p>using a image as tabIndicator it always appears at the center i want it to take up the whole space available in that tab can I make it something like fill parent ???</p>
java android
[1, 4]
5,577,374
5,577,375
how to save GTFS data into sqlite database
<p>I have downloaded some GTFS data from <a href="http://www.131500.com" rel="nofollow">http://www.131500.com</a>. It is a zip file containing some text files such as <code>stops.txt</code>, <code>trips.txt</code> etc. </p> <p>Now I would like to save that data in an SQLite database but am not sure how to do so. I did download GTFSImporter from <a href="https://github.com/jvashishtha/GTFSImporter/tree/master/GTFSImporter" rel="nofollow">https://github.com/jvashishtha/GTFSImporter/tree/master/GTFSImporter</a> but I am not sure how to run it.</p>
java android python
[1, 4, 7]
1,841,151
1,841,152
create list of tuple (long integer)
<p>Can we create a list of tuple of long integer. I have gone through which says that Python type is variable. Is it Possible in Python.</p> <p>Reason. C++ code has migrated from 32 bit to 64 bit machine and long size become 8 in 64 bit machine but Python is still in 32 bit machine.</p> <p>First I put lot off effort to fix from C++ side but later feel but we increase datatype in Python it may require minimum change.</p> <p>As of now it is defined in following way. Can I upgrade to long<br> temp = [ (0,0), (1,0), (1, 1), (0, 1), (0,0) ]</p> <p>Adding more info for better clarification: Generally we have declare long variable which we assign value from PyInt_AsLong() . which was working fine in 32 bit machine. if I change to int than we have done lot of places long conversion. and the value of int become garbage. But if I use long variable than I am getting error from Python Interface " Python int too large to convert to C long". So I am stuck with problem.Not able to figure out exact solution.</p>
c++ python
[6, 7]
851,728
851,729
Do something after tab is visible in jquery
<p>I'm trying to load a function in javascript (i'm using jquery) after that my tab is it showed. So this it he code that i'm testing:</p> <pre><code>$("#tabsL").html(data).tabs("destroy").tabs({ select:function(event, ui){ var section = $(ui.tab).attr("href"); var foo = section.split("-"); var looking_for = "#slideshow-carousel-"+foo[1]+"-"+foo[2]+" ul li img"; var imgangefd = $(looking_for)[0]; $(imgangefd).click(); } }); </code></pre> <p>but imgangefd need to be visible to get a click. So my question is what can i do something after the tab is clicked and loaded and visible?</p> <p>Thanks for any clue! Roberto</p>
javascript jquery
[3, 5]
4,659,169
4,659,170
Session timeout on server side in asp.net c#
<p>I have problem with session timeout even i added code in web.config as follows but its not working, it expires within 10 mins. </p> <pre><code>&lt;sessionState mode="InProc" timeout="300"&gt;&lt;/sessionState&gt; </code></pre> <p>Server has session timeout of 20 mins.</p> <p>Please help me to solve session timeout issue?</p>
c# asp.net
[0, 9]
4,835,364
4,835,365
BigTable or Similar DB implementation in python
<p>Does anyone have BigTable implementation or subset of this problem implemented in Python? Please give reference</p>
java python
[1, 7]
4,544,918
4,544,919
How can I set dropdownlist default values based on variables?
<p>I have several pages linked together that I want to maintain drop down selections for. I've seen a number of ways to do this with session values, etc, but I want to set the default value while still having the option of selecting other values.</p> <p>Effectively, users will make selections on page 1 and then on page 2 they will use those same selections, but also potentially want to change their selections. My thought was that I could load the selections into a table in SQL in page 1 and then in page 2 call that table and set the values as variables. My question, then, is how I would set the default dropdown value to be a variable as opposed to a set value.</p> <p>I am using VisualStudio2010 with ASP Webforms using C#.</p> <p>Any help or suggestions would be much appreciated!</p>
c# asp.net
[0, 9]
4,295,951
4,295,952
How to make our app resolution free
<p>We have to display many TextView on canvas with proportion to screen resolution.How we can define the textSize and any ImageView size corresponding to Screen resolution so that they can display ratio wise.</p>
java android
[1, 4]
5,055,381
5,055,382
jquery if statement and remove iframe
<p>How do i write an if statement in jquery:</p> <p>IF the user clicks on an image <code>div#ProductImages &gt; img</code> then hide/remove the iframe?</p> <p>This is what i have: (my code will append the youtube video to a div location on the page)</p> <p>I need to remove the iframe once the user starts clicking on the images again. </p> <pre><code>var $video=$('div.icon iframe'); var $productImage=$('.product-image'); var $icon=$('.icon'); $icon.on('click',function() { $('.product-image').append($video); }); </code></pre> <p><strong>EDIT: sorry i meant remove</strong> <a href="http://jsfiddle.net/t7qMF/1/" rel="nofollow">http://jsfiddle.net/t7qMF/1/</a></p>
javascript jquery
[3, 5]
11,508
11,509
ASP.NET: How to extract a specific value from a table html source?
<p>I want to extract the movie name of each row in the IMDb`s Boxoffice table..</p> <p>example html table row:</p> <pre><code> &lt;tr class="chart_even_row"&gt; &lt;td style="text-align: right;"&gt; &lt;b&gt;1&lt;/b&gt; &lt;/td&gt; &lt;td&gt; &lt;img border="0" src="http://ia.media-imdb.com/images/M/MV5BMjA4NDg3NzYxMF5BMl5BanBnXkFtZTcwNTgyNzkyNw@@._V1._SY30_SX23_.jpg" width="20" height="30"&gt; &lt;/td&gt; &lt;td&gt; &lt;a href="/title/tt1392170/" &gt;The Hunger Games&lt;/a&gt; (2012) &lt;/td&gt; &lt;td style="text-align: right; padding-right: 20px;"&gt;$155M &lt;/td&gt; &lt;td style="text-align: right;"&gt; $155M &lt;/td&gt; &lt;td style="text-align: center;"&gt; 1 &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>The value I want to extract is "The Hunger Games"..</p> <p>I need a C# code that would achieve this for me..</p> <p>NOTE: I want to do this via REGEX</p> <p>Thanks in advance, Rashad.</p>
c# asp.net
[0, 9]
2,457,774
2,457,775
jquery files conflicts how to detect?
<p>Q:i have a general problem ,when i wanna to do some thing and i find the jquery file which can do exactly what i wanna to do . after a while i need another case and i find that another jquery file serve me and fix my problem .after i add set of jquery files i find conflicts among those files and some features does not work or work in awkward manner ..and when i try to find which file exactly the source for those problems i find myself in closed circle cannot modify this file or cannot delete this file or cannot find that file itself at all.sometimes the file like this:</p> <p><code>&lt;script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"&gt;&lt;/script&gt;</code></p> <p>cannot modify it.</p> <p>the problem has many faces,and i cannot really know how to handle the whole matter from the beginning.</p> <p>can any one give me instructions ,advices,notes, or explanation to prevent the problem from the beginning and how to fix it if it was happened.</p>
javascript jquery
[3, 5]
3,051,488
3,051,489
How do you call a Javascript function from an ASPX control event?
<p>How do you call a Javascript function from an ASPX control event?</p> <p>Specifically, I want to call the function from the SelectedIndexChanged event of a DropDownList.</p>
asp.net javascript
[9, 3]
1,994,113
1,994,114
in facebook integration I have to access the url of in which access token is given, bt instead of i am getting my published url in asp.net
<p>I am using the following code on Page_Load of facebook_login page in asp.net web application, after redirecting this url i have got the accesstoken in url but when i try to access this current url via HttpContext.Current.Request.Url.AbsoluteUri it gave the url of app where it is published not the url which is currently in window .How can I access this access token or userdetails. Please help me asap its very urgent</p> <pre><code>var uriParams = new Dictionary&lt;string, string&gt;() { {"client_id", facebookAppId}, {"response_type", "token"}, {"scope", "user_about_me, read_stream, email"}, {"redirect_uri", "http://apps.facebook.com/appNameHere/"} }; StringBuilder urlBuilder = new StringBuilder(); foreach (var current in uriParams) { if (urlBuilder.Length &gt; 0) { urlBuilder.Append("&amp;"); } var encoded = HttpUtility.UrlEncode(current.Value); urlBuilder.AppendFormat("{0}={1}", current.Key, encoded); } var loginUrl = "http://www.facebook.com/dialog/oauth?" + urlBuilder.ToString(); Response.Redirect(loginUrl); </code></pre>
c# asp.net
[0, 9]
1,133,317
1,133,318
How to send data to new activity from current activity via intent?
<p>How I can use the intent to send the data to the second class?</p> <p>I am doing this actually</p> <pre><code>Intent connectGetData = new Intent(Main.this, GetData.class); startActivityForResult(connectGetData, REQUEST_GET_DATA); </code></pre> <p>From <code>Main.java</code> activity I am calling the <code>Getdata.java</code> activity and I when come back I again get data using.</p> <pre><code>public void onActivityResult(int mRequestCode, int mResultCode, Intent mDataIntent) </code></pre> <p>Please tell me how I can send data to other activity </p>
java android
[1, 4]
1,253,616
1,253,617
asp.net web application goes to login page after about 15 minutes
<p>I have a web application, and for some reason which I cannot figure out, It goes to the login page every 15 minutes (I believe the session is idle). I have no where web config file that specify a timeout even close to that. Has anyone ever had an issue like this or know where I could look to try and fix the problem? thanks for any help.</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/Login.aspx" timeout="90" defaultUrl="~/" name="" protection="All" /&gt; &lt;/authentication&gt; </code></pre>
c# asp.net
[0, 9]
4,946,600
4,946,601
append data is not showing? HELP!
<p>im trying to append data using jquery, but its only showing the status messages but not the button! although the button deos show on firebug?</p> <pre><code>$("form.follow-form").live('submit', function(e) { /* stop event */ e.preventDefault(); /* "on request" */ $(this).find('i').addClass('active'); /* send ajax request */ $.ajax({ type: "POST", url: "ajax_more.php", data: $(this).serialize(), cache: false, success: function(html) { $("ul.statuses").append(html); $("form.follow-form").remove(); // this is not full code ;) </code></pre> <p>this is ajax_more.php file:</p> <pre><code>$query= mysql_query($result) or die(mysql_error().$result); while($row=mysql_fetch_array($query)) { $dateTime = $row['dt']; //the append shows this echo formatUpdate($row['user_note'],$row['dt']); } ?&gt; // but not this form, it deos show on firebug only &lt;form class="follow-form" method="post" action="ajax_more.php"&gt; &lt;input name="date" value="&lt;?php echo $dateTime ?&gt;" type="hidden"&gt; &lt;button type="submit" value="Actions" class="btn follow" title="123456"&gt; &lt;i&gt;&lt;/i&gt;&lt;span&gt;More&lt;/span&gt; &lt;/button&gt; &lt;/form&gt; </code></pre>
php javascript jquery
[2, 3, 5]
3,291,638
3,291,639
jQuery POST to PHP doesn't get to success function
<p>I have a simple jQuery post function that calls PHP script in order to return value from the database.</p> <p>In Firebug I see that the PHP file is being called with 200 OK status, however the success function in JS is not being called.</p> <p>To test the problem I have changed the PHP to only echo a simple string, but it doesn't work as well.</p> <p>When I view the PHP file directly in the browser I do see the echoed string.</p> <p>Here is the JS code:</p> <pre><code>$.post(PATH + "load.php", { id: _id }, function (data) { console.log("LOADED " + data); }); </code></pre> <p>And here is the simple PHP code:</p> <pre><code>&lt;? echo "bla bla bla" ?&gt; </code></pre> <p>I don't know what the problem is. My HTML+JS file is local and it calls an online PHP file. Maybe this is the reason? Any help will be appreciated.</p>
php javascript jquery
[2, 3, 5]
995,787
995,788
jquery to display images on divs
<p>I am posting here again, I cannot seem to find a solution for this problem. I am using jquery and jstree plugin to build a tree and based on the node_id of the jstree, I am showing some images on divs. The problem I am facing is that some images are not loading eventhough they are there. When I experienced this problem, I verified that the image in question actually not loading by checking the width of the image. Below is the code. How can I make sure to load image before displaying it. Again, any help with this greatly appreciated as I am very new to jquery:</p> <pre><code>(document).ready(function () { $("#div1").jstree({ "xml_data": { "ajax": { "url": "tree.xml" }, "xsl": "nest" }, "plugins": ["themes", "xml_data", "ui", "types"] }).bind("select_node.jstree", function (event, data) { var node_id = data.rslt.obj.attr("id"); if (node_id.indexOf("TEAM") &gt;= 0) var teamA; var teamB; teamA = "image/" + node_id + "-scores.png"; teamB = "image/" + node_id + "-standing.png"; img1 = new Image; img1.src = teamA; img2 = new Image; img2.src = teamB; $("#div2").html(img1); $("#div3").html(img2); }); </code></pre>
javascript jquery
[3, 5]
4,761,109
4,761,110
How to retrieve the image in javascript
<p>I have one url , which returns an image tag.Now i need to call this url using javascript , and embed this return under a div tag. I was trying $.get(), but "data" is returning some text.How to retrieve the image in javascript. note: pls provide sln with javascript/jquery.</p> <p>Edit: data returns GIF40 or soem this kind of arbitary value.. </p>
javascript jquery
[3, 5]
4,674,097
4,674,098
How to select an element by ID using jQuery
<p>I am trying to use the following jQuery code to add a div with class <code>col_box</code> inside the <code>col_left</code> div:</p> <pre><code>$('#col_left').add('div').addClass('col_box'); </code></pre> <p>My DOM tree looks like this:</p> <pre><code>&lt;div id="header"&gt;Header&lt;/div&gt; &lt;div class="col_container"&gt; &lt;div id="col_left"&gt; &lt;div class="col_box"&gt;A&lt;/div&gt; &lt;div class="col_box"&gt;B&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>However the jQuery code isn't working. It adds the class <code>col_box</code> to every element on the page.</p>
javascript jquery
[3, 5]
3,441,465
3,441,466
Jquery prop function is not working as expected
<p>I am trying to enable/disable some hidden fields based on some calculation and using jquery <code>prop</code> function, here is the code</p> <pre><code>function enableSelectedFieldsData(count, mapKey, index) { $("#code_" + mapKey + "_" + index).prop("disabled", false); $("#description_" + mapKey + "_" + index).prop("disabled", false); $("#crossRefrence_" + mapKey + "_" + index).prop("disabled", false); $("#image_" + mapKey + "_" + index).prop("disabled", false); $("#price_" + mapKey + "_" + index).prop("disabled", false); // disable all other fields for (var i = 0; i &lt; count; i++) { if (i != index) { $("#code_" + mapKey + "_" + i).prop("disabled", true); $("#description_" + mapKey + "_" + i).prop("disabled", true); $("#crossRefrence_" + mapKey + "_" + i).prop("disabled", true); $("#image_" + mapKey + "_" + i).prop("disabled", true); $("#price_" + mapKey + "_" + i).prop("disabled", true); } } } </code></pre> <p>Initially i am setting disable=true for all fields and based on the selection i m trying to enable selected fields while disabling other fields, since as per my knowledge disable fields never got submitted to the server on submitting the form, but in my case they are getting submitted.</p> <p>on checking using firebug i saw that the disable field value for non selected item is getting set as <code>""</code> like <code>disable=""</code></p> <p>i am not sure where i am setting things wrong, any help or pointer in this regard will really be helpful.</p> <p><strong>Edit</strong></p> <p>I have taken out the relevant section from my generated HTML and placed it at <a href="http://jsfiddle.net/TDKRV/5/" rel="nofollow">jsfiddle</a> please have a look</p>
javascript jquery
[3, 5]
639,629
639,630
Is there a way to update the status of a login when we go backward in an application
<p>Currently I'm logging into my account. After proceeding some of the pages I have log-out my account. Now if I go back page using <strong>back</strong> button in browser, still I'm in login state. Is there anyway to set this status as logout?</p>
javascript jquery
[3, 5]
3,544,430
3,544,431
Set a variable to true 2 seconds after the last time "G" has been pressed
<p>Title says it all, I know a pretty stupid way to solve this via Javascript but I wonder... if there is a smarter way? There probably is. A user can press "G" as much as he wants and this calls the function <strong>g_pressed();</strong>. Solutions in jquery are also fine.</p> <p>Here's my solution:</p> <pre><code>var allowed = false; var allowed_key = 0; function g_pressed(){ allowed = false; allowed_key++; setTimeout('allowed_check('+allowed_key+');', 2000); } function allowed_check(key){ if(key==allowed_key){ allowed = true; } } </code></pre> <hr> <p>As you can see, it is painfully 12 lines long.</p>
javascript jquery
[3, 5]
2,258,863
2,258,864
Arc & Circle in jsdraw2d
<p>I am facing the following problem in <code>jsdraw2d</code> and please advise if it is a bug or it has to do with my understanding.</p> <ol> <li>I am trying to fill an Arc.</li> <li>Width = 100, Height = 100, Start Angle = 0, Swap Angle = 130</li> <li>I fills the Arc perfectly.</li> <li>As I keep on increasing the Swap Angle till 134, it is OK but</li> <li>As and when I change the Swap Angle to 135, it takes a big jump.</li> </ol> <p>In the code also I have seen that there is a check for 135 degree:</p> <p><code>(if((eaD&lt;=45 &amp;&amp; eaD&gt;=0) || (eaD&gt;=135 &amp;&amp; eaD&lt;=225) || (eaD&gt;=315 &amp;&amp; eaD&lt;=360)))</code></p> <p>Is it intentional? If so then why?</p> <p>Is there a more stable version?</p>
javascript jquery
[3, 5]
3,166,808
3,166,809
Syncronize count down time for all users
<p>I need to synchronize the count down time for all users.So it will display identical remaining time to all in asp.net.</p> <p>Waiting for your valuable thoughts </p> <p>Thanking You </p>
c# asp.net
[0, 9]
4,512,285
4,512,286
How to allow arbitrary 'update' functions to be passed to a requestAnimationFrame loop?
<p>Here is what I have at the moment:</p> <pre><code>function animateLetter(letter, type){ letter.css(type, '50%'); var j = 50; loop(function(){ letter.css(type, (j =- 5) + '%'); return j &lt; 0; }); } function loop(run) { if(run.apply()) requestAnimationFrame(loop(run)); } </code></pre> <p>Why would this not work? I'm new to JS so might be missing something obvious. </p>
javascript jquery
[3, 5]
917,172
917,173
Can you use jQuery( this ) and :after together?
<p>This doesn't work, but it shows you what I want to do:</p> <pre><code>$(this+":after").css('content', 'something'); </code></pre> <p>Basically, I want my function to dynamically add an <code>:after</code> element to various matched elements.</p> <p>Is there a correct way to do this?</p>
javascript jquery
[3, 5]
5,464,255
5,464,256
Reading line from website
<p>I am making a little program thath will read data from website. String in the html file is already managed every info is divided with ; . Now i should read complete line here is example of this line:</p> <pre><code>14:47;24.02.12;18.7°C;18.7°C;285;0.5m/s; 6:48;17:37; Warm ;36;1.8;0.0; </code></pre> <p>So first how should i read them with HTTP Get or is there anything other? And then i would like to save each info, they are seperated with ; into a variable. And how should i cut each info from this line.</p>
java android
[1, 4]
5,880,463
5,880,464
Get content of DOM element without the parent by using jQuery
<p>Here are some simple examples what I am trying to do:</p> <pre><code>$("&lt;li&gt;Foo&lt;/li&gt;") =&gt; "Foo" $("&lt;li&gt;&lt;span&gt;Foo&lt;/span&gt;&lt;/li&gt;") =&gt; &lt;span&gt;Foo&lt;/span&gt; $('&lt;li class="foo"&gt;&lt;div&gt;Foo&lt;/div&gt;&lt;div&gt;Bar&lt;/div&gt;&lt;/li&gt;') =&gt; &lt;div&gt;Foo&lt;/div&gt;&lt;div&gt;Bar&lt;/div&gt; </code></pre> <p>I know of the jQuery <code>get()</code> method, but this just gives me the <code>&lt;li&gt;</code> elments, too. A <code>.children().get()</code> does not work (at least in the first case). Is there a simple way to achieve that (with built in jQuery methods)?</p>
javascript jquery
[3, 5]
2,137,598
2,137,599
Echo Javascript Variable in Php to another page
<p>I have code which passes php variable to another page on my site:</p> <pre><code>echo'&lt;a class="btn btn-danger" style="margin-left:10px;width:120px;float:left;" href="fullsizemarket.php?imageid=',$imageid,'&amp;action=removed"&gt;Remove from Cart&lt;/a&gt;'; </code></pre> <p>I am able to retrieve the php variable $imageid by the following: </p> <pre><code>$imageid = htmlentities($_GET['imageid']); </code></pre> <p>I want to also pass in this code the value of a javascript variable. The variable is set in an earlier part of the code as follows: </p> <pre><code> var rowcount </code></pre> <p>I don't know how to pass var rowcount in the same echo code as I pass $imageid. What is the code to do this?</p>
php javascript
[2, 3]
5,283,971
5,283,972
jQuery Odometer
<p>I would like to implement a jQuery odometer, similar to opower.com's website. So far, I was able to get a bit of the copied code to work, but there is such much extra code around their odometer script, my copied code is bloated and cumbersome, plus has incredible amount of styling that I do not like.</p> <p>What I would like is a text based jQuery count-up odometer that can easily be packaged up in a nice clean folder. </p> <ul> <li>timer</li> <li>css</li> <li>html</li> <li>images</li> </ul> <p>Can anyone help?</p>
php jquery
[2, 5]
5,035,341
5,035,342
Submitting form by hitting enter on keyboard
<p>Currently my team has this <code>(onKeyPress="keyPress(event))</code> defined for each field in a form. So if i have 20 fields then it is defined 20 times. I am wondering if it is possible to define this at the form level rather than field so we only define it one and not 20 times?</p> <p>Using PHP codeignitor.</p>
php javascript
[2, 3]
4,133,214
4,133,215
jquery attr(name,value) method's value parameter
<p>I'm reading Bibeault's jQuery in Action and I'm having troublel understanding the <code>value</code> parameter of the <code>attr()</code> method. The book says that the parameter can be a function whose parameters are <code>index</code> and <code>previousValue</code>. What is the purpose of these parameters? I don't understand the text's explanation. </p> <p>Specifically I want to know:</p> <ol> <li>Are these parameters mandatory?</li> <li>What is an example of how these parameters are used?</li> <li>Can I use other parameters within the function?</li> </ol>
javascript jquery
[3, 5]
5,057,316
5,057,317
getting intellisense to show properties in markup for a custom server control
<p>I have a custom control that inherits from <strong>UserControl</strong>, and I can't get it's properties to show in intellisense. For example, I have a property:</p> <pre><code>public string Title; </code></pre> <p>but if I start typing:</p> <pre><code>ff:myControl Tit... </code></pre> <p>Nothing shows up (like I think it should). I have tried adding attributes like <strong>Browsable</strong>, <strong>EditorBrowsable</strong>, etc, but nothing is seeming to work - what am I forgetting?</p>
c# asp.net
[0, 9]