Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
3,878,220
3,878,221
countdown bar android example
<p>any help to display this simple countdown on progress bar?</p> <pre><code>new CountDownTimer(30000, 1000) { public void onTick(long millisUntilFinished) { mTextField.setText("seconds remaining: " + millisUntilFinished / 1000); } public void onFinish() { mTextField.setText("done!"); } }.start(); </code></pre> <p><a href="http://developer.android.com/reference/android/os/CountDownTimer.html" rel="nofollow">http://developer.android.com/reference/android/os/CountDownTimer.html</a></p>
java android
[1, 4]
1,792,859
1,792,860
Convert localized string into decimal
<p>I have a string, that could look like "123,34", "123123,09", "1234", "123.34", "123123.09"</p> <p>(Stringrepresentation of 10,2 decimal that will be stored into a MySql DB)</p> <p>Due to the culture of the ASP.net thread may differ, because my application supports localization, I need to find a safe way to convert the most likely user input into a decimal.</p> <p>How is that possible?</p> <p>I tried various Decimal.Parse attemps, that all failed so far.</p> <p><strong>Solution</strong>:<br> My final solution was a mixed one. I used string replace to ensure my date is formatted into the specified CultureInfo I used for parsing</p>
c# asp.net
[0, 9]
4,969,866
4,969,867
Get client machine's operating system name for both - tablet devices and PC
<p>I have a website created in asp.net 3.5, c# 2008 - hosted on IIS 7. I want to check from which operating system the client is accessing the site, whether from browser of computer or from browser of tablet devices like ipad, dell streak, samsung galaxy etc or from the smart phone. Is it possible to know. I have tried out </p> <pre><code>Page.Request.Browser.Platform.ToString(); </code></pre> <p>but accessing from android device browser I am getting it undefined.</p> <p>I also have tried </p> <pre><code>Request.Browser.Capabilities["OS"].ToString(); </code></pre> <p>but for android I am getting the OS name Linux !! </p> <p>I want the exact name whether it is windows, Symbian, Android, iOS, MAC or Linux. </p>
c# asp.net
[0, 9]
2,352,953
2,352,954
Run .exe on client system from server-side c# code
<p>I want to run an exe on client system from my c# asp.net website. When I use <code>Process.Start()</code> it throws an error:</p> <blockquote> <p>The requested operation requires elevation.</p> </blockquote> <p>How do I set permissions to run that exe?</p>
c# asp.net
[0, 9]
1,278,198
1,278,199
Unable to Print the full content of Page when horizontal scroll bar appears
<p>I need to print the current page in the asp.net application for that I am using <code>javascript:window.print()</code>.</p> <p>It's working fine when the page content is within the bounds. However, if the horizontal scrollbar appears as a result of overflow, am able to print only the visible content while the overflown contents couldn't be printed. </p> <p>Is there any workaround to get this working? Is there any other alternative apart from javascript to achieve this functionality?</p>
javascript jquery asp.net
[3, 5, 9]
1,767,344
1,767,345
C# Passing a part of an array as an argument of a function by reference
<p>Is the C# code below the equivalent way of trying to achieve the same as the C++ code? Is there any way to avoid the copy (while not sending the whole array to the function)?</p> <p>C++</p> <pre><code>static void somefunction(double* v, int nb) { //something that will update v[0],v[1], ... v[nb-1] } double * myarray=new double[100]; somefunction(&amp;myarray[10],5); //... delete [] myarray; </code></pre> <p>C#</p> <pre><code>static void somefunction(double[] v, int nb) { //something that will update v[0],v[1], ... v[nb-1] } double[] myarray=new double[100]; double[] temp_array=new double[5]; somefunction(temp_array,5); temp_array.CopyTo(myarray,10); </code></pre>
c# c++
[0, 6]
1,511,597
1,511,598
What do I have to do to allow my web application run on mobile phones?
<p>let's say I have a webaplication with server programmed in Java and Javascript on client. What do I need to do in order to make this application run on common mobile devices, let's say with android OS or iPhones? </p> <p>Do I even have to do anything? I know I will have to adjust Javascript UI for mobile phones and touch screens, but anything else? I have no experience with android or iPhone programming.</p> <p>Thanks for help.</p>
java android
[1, 4]
5,431,246
5,431,247
JavaScript if/elsif statment bug
<p>I have some sort of elsif statment bug I can't find:</p> <p>My JSfiddle:</p> <p><a href="http://jsfiddle.net/z3xV3/64/" rel="nofollow">http://jsfiddle.net/z3xV3/64/</a></p> <p>Jquery:</p> <pre><code>$('#slider1, #slider2, #slider3, #slider4, #slider5').bind('slide', function (event, ui) { var num = this.id.replace('slider',''); if(parseInt(num) == 1) { $label = $('#boksTimer' + num).html( (ui.value / 31 * 60).toFixed(0) + ' GODT' ); } elseif(parseInt(num) == 2) { $label = $('#boksTimer' + num).html( (ui.value / 31 * 60).toFixed(0) + ' SUPER' ); } else { $label = $('#boksTimer' + num).html( (ui.value / 31 * 60).toFixed(0) + ' min pr. dag' ); } $thumb = $(this).children('.ui-slider-handle'); $label.css({ top: $label.outerHeight(true), left :$thumb.position().left - ( $label.width() - $thumb.width() ) / 2 }); }); </code></pre>
javascript jquery
[3, 5]
3,830,620
3,830,621
Using a get variable while staying on the same page?
<p>I was wondering if there is a way to use a GET variable while staying on the same page. </p> <p>I have some php/mysql script that I would like to execute if a particular link is clicked, using a GET variable. However, once the link is clicked, I don't want anything on the page to change, I just want to the script to run behind the scenes.</p> <p>Right now, when A user is on the search page and adds an item to their favorites all search results disappear, and b/c I am resubmitting </p> <p>NOTE: The add to favorites link below, links to same page that the user will be on when clicking it.</p> <pre><code>if(isset($_SESSION['username'])){ echo '&lt;div id="favbutton"&gt;&lt;a href="search.php?id='.$id.'"&gt;&lt;img src="./image/staricon.png"/&gt;Add to favorites&lt;/a&gt;&lt;/div&gt;'; } </code></pre> <p>thank you</p>
php jquery
[2, 5]
3,331,451
3,331,452
JQuery function Adding progress animation
<p>I would like to add a progress animation to a function so that it displays at the begining of the function and then disappears at the end of it.</p> <p>Something like:</p> <pre><code>&lt;script type="text/javascript"&gt; function myfunction() { //Display progress animation here $('input[type=submit]#submit').click(); etc... //Hide the progress animation here } ?&gt; </code></pre> <p>UPDATE:</p> <p>Here is my current Ajax code:</p> <pre><code>&lt;script type="text/javascript"&gt; function myfunction() { $("#ajax-form").submit(function(){ $.post("submit.php", $("#ajax-form").serialize(), function(data){ mysubmitForm(); } ); return false; }); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,470,584
3,470,585
Synchronised timely refresh of multiple divs
<p>I have written a code to refresh two divs at regular intervals of time. Here it is</p> <pre><code> &lt;script language="javascript"&gt; $(document).ready(function() { $("#autorefresh_1").load("content1.php"); var refreshId = setInterval(function() { $("#autorefresh_1").load("content1.php"); }, 9000); $("#autorefresh_2").load("content2.php"); var refreshId = setInterval(function() { $("#autorefresh_2").load("content2.php"); }, 9000); }); &lt;/script&gt; </code></pre> <p>Is there some other best way of writing this code? prehaps merging the two? Sorry for the simple question, I am new to jQuery.</p>
php jquery
[2, 5]
1,787,084
1,787,085
Can I use a C++ class in python class as superclass
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/602580/how-can-i-use-c-class-in-python">How can I use C++ class in Python?</a> </p> </blockquote> <p>I am designing a software in python but I am experiencing some memory problems while implementing it with python so I am planning to extend my software with C++. So I was thinking <strong>can I use C++ defined class and use it in python as Superclass and override some of its methods?</strong></p>
c++ python
[6, 7]
3,312,393
3,312,394
Passing a variable from created in function a to function b when function b is inside function a
<p>I have a function for the class .myclassA, inside this function I capture the id of the particular element chose and I put it inside a variable inputid. This function also brings another function for another class(.myclassB), which is inside the first function. Do you guys have any idea how I can pass the variable inputid from the first function to the function inside it? Thanks for all your help</p> <pre><code>$('.myclassA').click(function(){ var inputid = $(this).attr('id'); $('.myclassB').click(function(inputid){ var thisid = $(this).attr('id'); $(inputid).val(thisid); }); //$('seqa').click(); }); //$('#empcriddi').focus(); </code></pre>
javascript jquery
[3, 5]
2,563,349
2,563,350
Is it possible to automate the work in a solid .exe process?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/120359/tools-for-automated-gui-testing-on-windows">Tools for automated GUI testing (on Windows)?</a> </p> </blockquote> <p>I'm interested in following thing. Let's say there is a program that is already pre-written and pre-compiled. It's a solid .exe piece, that has some .dll files in Program Files folder, etc. Like Firefox, or MS Word for example.</p> <p>And let's say this process is running. Is there a way I can automate the work in this software? Like "click that button", "enter this text in that textbox" etc.</p> <p>Imagine that this software does not support plugins. So all handling has to be made "from outside".</p> <p>I'm familiar with scripting languages (like PHP, Python, etc), familiar with C#. So just want to know at least in which direction to look.</p>
c# python
[0, 7]
4,231,151
4,231,152
Could Not Write File on FTP server using FTPClient in Java
<p>I am reading files on a FTP server and writing that data into another file. But after properly reading the data I couldn't write the file on to the FTP server.</p> <p>I can retrieve files using "retrieve file", but can not store file using the <code>storefile</code> function.</p> <p>My code is:</p> <pre><code>import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; public class FtpDemo { public static void main(String args[]){ FTPClient client=new FTPClient(); try { if(client.isConnected()){ client.disconnect(); Boolean isLog=client.logout(); System.out.println(isLog); } client.connect("server"); Boolean isLogin=client.login("user","password"); if(isLogin){ System.out.println("Login has been successfully"); FTPFile[] files=client.listFiles(); System.out.println("Login has been successfully"+files.length); for(int i=0;i&lt;files.length;i++){ if(files[i].getName().equals("rajesh.txt")){ System.out.println("match has been successfully"); InputStream is=client.retrieveFileStream("/rajesh.txt"); BufferedReader br=new BufferedReader(new InputStreamReader(is)); String str; String content=""; str=br.readLine(); while(str!=null){ content+=str; str=br.readLine(); } System.out.println(content); Boolean isStore=client.storeFile("/rajesh.txt",is); System.out.println(isStore); } } } } catch(Exception e){ System.out.println(e.getMessage()); } } } </code></pre>
java android
[1, 4]
5,888,891
5,888,892
Create another div and variable onChange using jQuery
<p>below is a code that gets the value of the selected option and shows the php file in the div. How can I add another file and another div (secondfile) to be displayed ?</p> <pre><code>$('#firstresult').empty().addClass("loading") .load(val + '.php', { value: val }, function(){ $("#firstresult").removeClass("loading"); })); $('#secondresult').empty().addClass("loading") .load(val + 'b.php', { value: val }, function(){ $("#secondresult").removeClass("loading"); </code></pre>
php javascript jquery
[2, 3, 5]
2,938,384
2,938,385
Loading ASPX markup from database
<p>Let say I have one default.aspx page in local development but in production we have different mark up according to client requirement might be we will not use up-comming.ascx user control on client page but we using on local or using for other client. in short how can load aspx markup from database not .cs code since it is already compiled only change aspx.</p>
c# asp.net
[0, 9]
3,910,185
3,910,186
Writing a quiz application
<p>im making a quiz application in asp.net using c#. The following code is my start page where on clicking on start i'm redirected to my questions page. The only reason I've added a start.aspx page ... so I could initialize the values in the Session. Here in the page_load event the- request.QueryString["testid"] always resulting to null? i.e my if condition is never true and everytime i'm redirected to my "default.aspx" page. what is the reason?</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections; namespace TESTPROJ2 { public partial class START : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ArrayList a1 = new ArrayList(); Session.Add("answerlist", a1); Session.Add("quizid", 1); if (Request.QueryString["testid"] != null) { int testID = int.Parse(Request.QueryString["testid"]); Session.Add("quizid", testID); } else { Response.Redirect("DEFAULT.aspx"); } } protected void startB_Click(object sender, EventArgs e) { Response.Redirect("QUEST.aspx"); } } } </code></pre>
c# asp.net
[0, 9]
1,280,119
1,280,120
javascript replace not workings
<p>I've got a problem with replace not working.</p> <pre><code>alert($('input#membership_edc').next("label").html().replace(/£/g, "")); </code></pre> <p>The value of the label after the input would be £24.00, but I want to do a math on that value then put it back with the new value. It's not removing the pound sign.</p> <p>What's wrong? Thanks.</p>
javascript jquery
[3, 5]
400,417
400,418
How to display loading image or text while processing
<p>in my project i am checking links whether its working or not ,when i click on create link button i want to display please wait for while but when and when if their some text in text box1if textbox1.text == null then it should not be display and when its not null then when i will click create button it should show please wait,my code is working but i want to check if their is some value in text box and user click the create button it should show please wait a while .if their no value in textbox1 then if user click on create button then please wait should not be displayed</p> <p>here is my code</p> <pre><code>&lt;script type="text/javascript"&gt; function ShowProgressBar() { if (Textbox1.Text == " ") { document.getElementById('dvProgressBar').style.visibility = "hidden"; } else { document.getElementById('dvProgressBar').style.visibility = "visible"; } } &lt;/script&gt; &lt;asp:Button ID="Button1" runat="server" Text="Create link" OnClick="btn_createlink_Click" OnClientClick="javascript:ShowProgressBar()" /&gt; &lt;br /&gt; &lt;div ID="dvProgressBar" style="visibility: hidden;"&gt; &lt;div id="content" style="text-align: left; " &gt; Please wait for while... &lt;/div&gt; &lt;/div&gt; &lt;asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="373px" Width="410px" ViewStateMode="Enabled"&gt;&lt;/asp:TextBox&gt; </code></pre>
c# asp.net
[0, 9]
395,004
395,005
Android: Pass an integer from NumberPicker to another activity
<p>I am using the built in NumberPicker to have the user choose a number. Then the user will hit the "OK" button to confirm and the resulting action will open up another activity. I want the number that the user chooses to be passed through to the other activity when the user hits the "OK" button. I have done buttons that result in opening up a new activity and I know that the NumberPicker has a getValue() and you can pass stuff through with putExtra(), but I am not sure how to combine those with the onClick method. How do I go about doing this?</p> <pre><code>public class Source1 extends Activity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_1); ...(NumberPicker code) } @Override public void onClick(View v) { int x = ((NumberPicker) v).getValue(); Intent intent = new Intent(this, Destination.class); intent.putExtra("VarName", x); startActivity(intent); } } </code></pre> <p>This is the xml for my button:</p> <pre><code>&lt;Button android:id="@+id/Id_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/numberPicker1" android:layout_centerHorizontal="true" android:onClick="methodName" android:text="@string/Ok" /&gt; </code></pre> <p>That was my attempt. Is this right/what needs to change? Do I even need the onClick in the button code since I am using the onClick method in the class?</p>
java android
[1, 4]
4,031,833
4,031,834
Is it bad practice to assign a css class for the sole purpose of finding it with jQuery?
<p>I'm using ASP.NET, not the newest one with that clientIdMode stuff. So, the control ids are generated and funky.</p> <p>There are lots of ways of passing ids around, but lately I've been assigning a 'fake' css class to the control I'm interested in. Then in a js file I use jQuery to find the control.</p> <p>Is this bad practice? It seems a lot like the ajaxControlToolkit's behaviorId to me... Is the behaviorId bad practice as well?</p>
asp.net jquery
[9, 5]
5,622,018
5,622,019
Getting value of Radio buttons with Master Pages
<p>I have an aspx page that uses a master page. On this page I have a group of radio buttons. I need to get at the checked property for each of the elements in the radio button group in javascript. Before the page was converted to use a master page, the following javascript code worked just fine:</p> <pre><code>if((!f.rblRegUseVehicles[0].checked) &amp;&amp; (!f.rblRegUseVehicles[1].checked)) { isValid = "false"; } </code></pre> <p>f is the reference to the form. This worked just fine.</p> <p>When the page was chanded to use a Master Page, I changed the javascript to the following:</p> <pre><code>if((!f.&lt;%=rblRegUseVehicles.ClientID%&gt;[0].checked) &amp;&amp; (!f.&lt;%=rblRegUseVehicles.ClientID%&gt;[1].checked)) { isValid = "false"; } </code></pre> <p>Now, the javascript is failing because it can't find the element. In the "View Source" I have elements with the name:</p> <pre><code>&lt;input id="ctl00_cphContent_rblRegUseVehicles_0" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="Yes" /&gt; &lt;input id="ctl00_cphContent_rblRegUseVehicles_1" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="No" /&gt; </code></pre> <p>The only code that works is</p> <pre><code>document.&lt;%=Form.ClientID%&gt;.&lt;%=rblRegUseVehicles.ClientID%&gt;_0.checked </code></pre> <p>I want the javascript to reference the array like before the page was converted to use a Master Page. How can I do that?</p>
asp.net javascript
[9, 3]
2,055,895
2,055,896
JQuery: If a custom class contains a number greater than 'x' add CSS code
<p>I would like to add css to a assigned span class if it contains a number higher than 55, also this must on a page load and not a button trigger. </p> <p>Thanks any help would be great. </p> <p>Example below: (currently not working) </p> <pre><code>&lt;span class="subTotalPrice"&gt;10&lt;/span&gt; &lt;span class="subTotalPrice"&gt;5&lt;/span&gt; &lt;span class="subTotalPrice"&gt;125&lt;/span&gt; &lt;span class="subTotalPrice"&gt;55&lt;/span&gt; &lt;script&gt; $(".subTotalPrice:contains(&gt; 55)").css({'color':'red', 'text-decoration':'underline'}); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,956,011
2,956,012
Retain information after update android App
<p>I am creating an application using a connection to a database with JDBC in an activity (ip, port, database name, username and password). Everything works fine, but when I do some change (update of version) I have to reenter the data (ip, port, database name, username and password) to get a connection. Any help or idea...!!!!</p> <p>TY</p>
java android
[1, 4]
684,375
684,376
Javascript stops as I lock iphone, can it still run?
<p>Is there a way to tell a javascript function to continue running even as a phone is locked?</p> <p>Pretty much I have a timer that I need to continue to run even as the phone is set to idle.</p>
javascript iphone
[3, 8]
3,124,903
3,124,904
Refresh js and css every session
<p>i want that a user make the login, the js and css are force to refresh themself</p> <p>How can i do?</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,761,658
3,761,659
Make a path for create a file in Java (Android)
<p>Given a File object how can I create the path for saving it?</p> <p>I tried file.mkdirs() but for example if the file's path is:</p> <pre><code>/mnt/sdcard/downloads/myapp/temp/song.mp3 </code></pre> <p>it also creates a folder named "song.mp3" inside temp.</p> <p>How can I do it correctly?</p>
java android
[1, 4]
1,114,296
1,114,297
jQuery - If screen is less that specified width and responsive
<p>How can I make an alert popup if the width of the page is less that 1200px, but also made responsive?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
868,847
868,848
Determining text width
<p>I want to find correct approach for calculating text width for specified font in C#. I have following approach in Java and it seems it works:</p> <pre><code>public static float textWidth(String text, Font font) { // define context used for determining glyph metrics. BufferedImage bufImage = new BufferedImage(2 /* dummy */, 2 /* dummy */, BufferedImage.TYPE_4BYTE_ABGR_PRE); Graphics2D g2d = (Graphics2D) bufImage.createGraphics(); FontRenderContext fontRenderContext = g2d.getFontRenderContext(); // determine width Rectangle2D bounds = font.createGlyphVector(fontRenderContext, text).getLogicalBounds(); return (float) bounds.getWidth(); } </code></pre> <p>But watch my code in C#:</p> <pre><code>public static float TextWidth(string text, Font f) { // define context used for determining glyph metrics. Bitmap bitmap = new Bitmap(1, 1); Graphics grfx = Graphics.FromImage(bitmap); // determine width SizeF bounds = grfx.MeasureString(text, f); return bounds.Width; } </code></pre> <p>I have different values for above two functions for the same font. Why? And what is correct approach in my case?</p> <p><strong>UPDATE</strong>: The <strong>TextRenderer.MeasureText</strong> approach gives only <strong>integer</strong> measurements. I need more precuse result.</p>
c# java
[0, 1]
436,680
436,681
Accessing,filling and submitting a form using the URL it resides on from another form using javascript or jquery
<p>I have a blog (Blogger). I want to make a contact form. I made it using google forms. However the theme is not matching with my blog. Also I cannot customize that form. so what i thought is to build my own form. So when a user fills and submits the form i shall fill the google form (that has got a url) with the same and submit.</p> <p>So my question is: Is it possible to access, fill and submit one form through its URL from another form using javascript or jquery. I know that we can fill a form or access elements of a form using javascript and also submit it FROM THE SAME FORM. But here the requirement is like Form A will be filled and submitted that will trigger a javascript function which using the URL, of say Form B, fill that form and hit the submit button of that form.</p> <p>Kindly provide the solution. Thanks and Regards. Daniel</p>
javascript jquery
[3, 5]
2,119,478
2,119,479
ASP.NET CheckBox disabling postback with javascript
<p>I'm trying to wire up a CheckBox to handle an event when check/unchecked. If the user has JavaScript enabled, use that, otherwise use a postback.</p> <p>Here is my code:</p> <pre><code>&lt;asp:CheckBox ID="ApplicationInProcessCheckBox" runat="server" Text="Application In Process" AutoPostBack="true" oncheckedchanged="ApplicationInProcessCheckBox_CheckedChanged" onclick="return false;" /&gt; </code></pre> <p>The return false in the javascript onclick event is disabling the postback. However, it also won't let the box check or uncheck. (I have more code to add to the javascript event... I just want to get the concept working first).</p> <p>What am I doing wrong?</p>
asp.net javascript
[9, 3]
346,534
346,535
Global javascript function
<p>I have a method which detects broken links with a .imageclass class like so:</p> <pre><code>$('.imageclass').one('error', function() { alert('broke'); }); </code></pre> <p>That I want to be used in several files.<br> How would I go about doing this?<br> I've tried using a separate js file with:</p> <pre><code>function checkErrors(){ $('.imageclass').one('error', function() { alert('broke'); }); } </code></pre> <p>and then calling this on each of the files:</p> <pre><code>$(document).ready(function() { checkErrors(); }); </code></pre> <p>But it doesn't seem to work. <br> The method is called however there is no alert when it spots a broken link. <br> If I use:</p> <pre><code>$(document).ready(function() { $('.imageclass').one('error', function() { alert('broke'); }); }); </code></pre> <p>The alert occurs.</p>
javascript jquery
[3, 5]
5,509,912
5,509,913
Get HREF property
<pre><code>&lt;a class="some" id="1" href="/s/1/2"&gt;link 1&lt;/a&gt; &lt;a class="some" id="2" href="/s/2/3"&gt;link 1&lt;/a&gt; &lt;script&gt; $(document).ready(function() { $('.some').click(function() { var id = this.id; var link = $(this).css('href'); alert(id); alert(link); return false; }); }); &lt;/script&gt; </code></pre> <p>When I click on the link I get correct id, but "undefined" link. What is the problem and how can I fix it?</p>
javascript jquery
[3, 5]
3,722,316
3,722,317
how to target certain time using jquery Countdown - http://keith-wood.name/countdown.html
<p>I am using these jQuery countdown - <a href="http://keith-wood.name/countdown.html" rel="nofollow">http://keith-wood.name/countdown.html</a>.</p> <p>I'm trying to get it to countdown to 17:00 (5:00 PM) everyday but I cannot seem to set the time.</p> <p>Any help welcomed.</p> <p>The code I have is :-</p> <pre><code>$(function() { var now = new Date() var since = new Date(now.getFullYear(), now.getMonth(), now.getDay(), 17, 00); $('#noDays').countdown({until: since, format: 'HMS'}); }); </code></pre> <p>timer is stuck at 0 with this.</p>
javascript jquery
[3, 5]
3,595,348
3,595,349
Retrieve value from webservice called from javascript?
<p>Is it possible to retrieve value or date from calling a webmethode from javascript, here is a sample code:</p> <pre><code>//This method is in a webservice.asmx file. [WebMethod] public List&lt;tbl_City&gt; GetAllCitiesByCountry(int countryID) { return Cities.GetAllCitiesByCountry(CountryID: countryID); } &lt;script language="javascript" type="text/javascript"&gt; function fillCities() { var dropDownList = document.getElementById('&lt;%=DropDownList_Country.ClientID %&gt;'); var selectedIndex = dropDownList.selectedIndex; var value = dropDownList[selectedIndex].value; WebService.GetAllCitiesByCountry(parseInt(value.toString()), onSuccess, null, ""); } function onSuccess(result){ alert(result[0].(PropertyName)); } </code></pre> <p></p> <p>The variable x doesn't retrieve anything and I guess that it produce an error. I have tried to define an array but still it didn't work. Any idea ?</p> <p><strong>Edit:</strong></p> <p>The above code have been altered and is now an answer to my question along with the answer below which used JQuery.</p>
c# javascript asp.net
[0, 3, 9]
4,692,700
4,692,701
How to Fix the width attribute in cross browser environment
<p>Please see the JS link here </p> <p><a href="http://trac.openwebanalytics.com/browser/trunk/modules/base/js/includes/jquery/jquery.ui.selectmenu.js?rev=1436" rel="nofollow">http://trac.openwebanalytics.com/browser/trunk/modules/base/js/includes/jquery/jquery.ui.selectmenu.js?rev=1436</a></p> <pre><code>(function($) { $.widget("ui.selectmenu", { getter: "value", version: "1.8", eventPrefix: "selectmenu", options: { transferClasses: true, typeAhead: "sequential", style: 'dropdown', positionOptions: { my: "left top", at: "left bottom", offset: null }, width: null, menuWidth: null, handleWidth: 26, maxHeight: null, icons: null, format: null, bgImage: function() {}, wrapperElement: "" }, </code></pre> <p>This width attribute defined below is being browser specific . For instance this width value is being browser specific , for example for Crome it is 97px , IE 8 it is 67px So as a result it is not looking good inside IE . Please tell me how can we fix it ??</p>
javascript jquery
[3, 5]
3,159,413
3,159,414
Android: Specifying a onClick() member method in XML?
<p>I have a layout in XML as follows: </p> <pre><code>&lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:onClick="myButton.performClick" /&gt; </code></pre> <p>myButton is a member of this activity, is it possible use a class member method here?</p>
java android
[1, 4]
2,942,063
2,942,064
Need suggestion for accessing remote machine in asp.net
<p>I want to access some places on a remote machine.The folder i want to access have full control to EVERYONE. The code given below is used to access network path.</p> <pre><code> System.IO.DirectoryInfo locationInfo = new System.IO.DirectoryInfo(BackupLocationTxt.Text); if (locationInfo.Exists) { // do some operations } </code></pre> <p>The application run fine if both the host computer and the remote computer to be accessed having os windows xp .The application also run fine if the application is running inside visual studio .</p> <p>Then my problems is ,any one of the machine( server and remote machine)having an os newer then windows xp( like windows 7, server 2008) locationInfo.Exists always false.</p> <p>But if the application is running inside in visual studio, then it work fine independent of os</p> <p>I searched a lot in net. But didnt find an exact solution yet. Someone suggests impersonation. But i dont know exactly how to do it. Is impersonations is the solution for my problem ?? Or is there any better ideas??</p> <p>Any help will be greatly appreciated</p>
c# asp.net
[0, 9]
1,151,947
1,151,948
Attach sounds to every list item
<p>If I have a list of words...</p> <pre><code>var wordList = ["jim", "tim", "sam", "bob", "pam"] </code></pre> <p>and I want to attach a different sound to each one so when they where randomly selected it would play their sound. Can someone please help?</p> <pre><code>var wordList = ["jim", "tim", "sam", "bob", "pam"] var shuffledWords = wordList.slice(0).sort(function() { return 0.5 - Math.random(); }).slice(0, 1); </code></pre>
javascript jquery
[3, 5]
660,943
660,944
append a select box with same option but different name
<p>How can I append a select box with same option and different name. I have a loop, where my php reads a sql table, and for each row, it creates a option tag</p> <p>this is the function to append:</p> <pre><code>$(function(){ $('#add').click(function(){ var select = $('span[id=combo]').html(); $('#allCombo').append('&lt;br/&gt;&lt;span id="combo"&gt;'+select+'&lt;/span&gt;'); }); }); </code></pre> <p>this is the select box:</p> <pre><code>&lt;span id="allCombo"&gt; &lt;span id="combo" name="combo"&gt; &lt;select name="item"&gt; &lt;?php foreach ($items as $item) { ?&gt; &lt;option value="&lt;?php echo $item-&gt;item_id; ?&gt;"&gt; &lt;?php echo $item-&gt;item_name; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;/span&gt; &lt;/span&gt; </code></pre> <p>Can anyone help me. thanks before.</p>
javascript jquery
[3, 5]
5,357,359
5,357,360
hosting a webserver inside iphone and android phones
<p>i am planning to do some servlet for my app to work offline on both android and iphone devices. for this i need to have the stubbed responses on a server.i saw there is one such server for android (<a href="http://code.google.com/p/i-jetty/" rel="nofollow">http://code.google.com/p/i-jetty/</a>). is there is similar server for iPhone ? so that i can develop a single solution to solve both the platforms.</p> <p>or else you can also get me an alternate idea of using a php kind of server which could work on iPhone and android. </p>
php android iphone
[2, 4, 8]
4,230,405
4,230,406
Using JQuery to get string value of an onclick() event
<p>Wondered if there was good way to do this, thought I would post to the SO community...</p> <p>There is a 3rd party web page that I have no control over how it renders, but they allow me to add JQuery.</p> <p>Using the JQuery, I am creating a nav menu on the side of the page, it will be a list of links. The onclick event of these links I get from existing onclick events already on the page, but when I do a:</p> <pre><code>var linkLoc = $('#theLink').attr("onclick"); </code></pre> <p>linkLoc returns:</p> <pre><code>function onclick(event) { handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", "smartform"); } </code></pre> <p>instead of what I would expect:</p> <pre><code>handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", smartform"); </code></pre> <p>I think JQuery is trying to get the event for binding, but I need the <em>actual Javascript markup</em> since I'm creating the HTML dynamically. I guess I could substring the "function onclick(event) {" out, but seems kind of hacky.</p> <p>Any ideas of an elegant way I could get the onclick markup?</p>
javascript jquery
[3, 5]
3,953,385
3,953,386
Asp.net web app shows me as the logged in user on someone elses pc
<p>OK, I really don't know what to search for this, so hopefully someone can help me.</p> <p>I've just published an asp.net web application, and after much messing about finally got it to load in my browser.</p> <p>The issue however is that when I got my mate who is sitting next to me to open the site in his browser, the page showed me as the logged in user.</p> <p>In the default.aspx I run some code that grabs the users windows identity</p> <pre><code>LDAPDetails LDAPUser = new LDAPDetails(WindowsIdentity.GetCurrent().Token); </code></pre> <p>LDAPDetails then does this.</p> <pre><code>_UserName = windowsId.Name.Substring(windowsId.Name.IndexOf('\\') + 1); _DomainName = windowsId.Name.ToString().Remove(windowsId.Name.IndexOf('\\')); //Get users information from active directory DirectorySearcher search = new DirectorySearcher("LDAP://DCHS"); search.Filter = String.Format("(SAMAccountName={0})", _UserName); SearchResult result = search.FindOne(); if (result != null) { _FullName = result.Properties["givenName"][0].ToString() + ' ' + result.Properties["sn"][0].ToString(); _Email = result.Properties["mail"][0].ToString(); _FirstName = result.Properties["givenName"][0].ToString(); _SSID = windowsId.User.ToString(); _errMsg = ""; } </code></pre> <p>These values are then put into session variables. </p> <p>It seems that WindowsIdentity.GetCurrent().Token is still using my details even though its on a machine that i'm not logged into.</p> <p>Thoughts?</p>
c# asp.net
[0, 9]
3,886,020
3,886,021
How to Delete a file using asp.net?
<p>to all i write the code in asp.net using c# to delete the file in my computer, but it is not deleting please help me thank u. this is my code, i write in button click event</p> <pre><code> string path = "E:\\sasi\\delt.doc"; FileInfo myfileinf = new FileInfo(path); myfileinf.Delete(); </code></pre>
c# asp.net
[0, 9]
4,479,741
4,479,742
jQuery Uppercase word locator
<p>I need to locate words for more than 4 characters that are written between <code>&lt;p&gt; &lt;/p&gt;</code> in uppercase and add them a style (ex. italic).</p> <p>I know about the function <code>isUpperCase()</code> but don't know how to apply it to check if the string is more than 4 characters.</p> <pre><code>function isUpperCase( string ) { (?) } </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
5,518,228
5,518,229
How to update "complex" data stored with jQuery's .data()?
<p>It seems to me that jQuery's <code>.data()</code> function is more of a write-once store than true read-write-storage.</p> <p>There does not seem to be a comfortable way of updating complex values.</p> <p>Let's suppose one wants to use some elements in a double-linked list (not my use case, illustrative purpose only).</p> <p>It would be easy if I would do:</p> <pre><code>$elem.data('prev', $prev); $elem.data('next', $next); </code></pre> <p>But I feel it is bad practice to pollute the "global" <code>.data()</code> namespace of an element.</p> <p>So I would rather do:</p> <pre><code>$elem.data('list', {prev: $prev, next: $next}); </code></pre> <p>But how do I now update <code>prev</code>?</p> <p>In the first example, I would just do:</p> <pre><code>$elem.data('prev', $newPrev); </code></pre> <p>But in the in my opinion "nicer" way of doing things the only thing I can think of is something like this:</p> <pre><code>$elem.data('list', {prev: $newPrev, next: $elem.data('list').next}); </code></pre> <p>This seems a lot more cumbersome to me and I suspect there is a better way, but so far I was unable to find anything.</p> <p>How should I go about this?</p>
javascript jquery
[3, 5]
4,048,421
4,048,422
jQuery .click event runs on page load
<p>I have this jQuery script in an external file. Im using it to update a database. I've been practicing around with it and cannot get it right. I would like for the .ajax call to be ran when my button (labeled with ID "add") is clicked, however the database is updated everytime the page is refreshed and NOT when the button is clicked! Can someone explain why? Thanks in advance</p> <pre><code>$('#add').click( $.ajax({ url: 'test.php', success: function() { alert("added"); } }) ); </code></pre> <p><strong>UPDATE</strong>: Thanks to @flo I was able to get this working perfectly. Here's the final product:</p> <pre><code>$(document).on('click','#add',function() { $.ajax({ url: 'test.php', success: function() { alert("added"); } }) }); </code></pre>
javascript jquery
[3, 5]
5,946,288
5,946,289
Arithmetic + and Bitwise OR
<p>Is there any difference between Arithmetic + and bitwise OR. In what way this is differing.</p> <pre><code>uint a = 10; uint b = 20; uint arithmeticresult = a + b; uint bitwiseOR = a | b; </code></pre> <p>Both the results are 30.</p> <p>Edit : Small changes to hide my stupidity.</p>
c# java
[0, 1]
714,958
714,959
jQuery - .on('click', ...) event fires two times in Firefox
<p>i have a search field in which the user enters a letter and the ajax script in the background performs a search. The results are displayed live in a ul-li list. The user can click on the li which class is 'search_list_item'. After the click the username/id is copied into another div (the msg-receiver div).</p> <p>I have a strange behaviour because in Safari everything works fine. In firefox the click-event seems to be fired two times, because i see the username two times in the #msg_receiver-div. </p> <p>The code looks like this:</p> <pre><code>$(document).ready(function(){ $('#searchresult').on('click', 'li.search_list_item', function(){ var msg_receiver_content = $('#msg_receiver').html(); $('#msg_receiver').html(msg_receiver_content + ' &lt;li class="single_receiver" id="single_receiver_'+$(this).attr('id')+'"&gt;'+$(this).find('span').html()+'&lt;/li&gt;'); $('#single_receiver_'+$(this).attr('id')).hide().fadeIn(500); }); }); </code></pre> <p>Does anybody know why the code is called two times in FF and one time in Safari - i only click one time on the li in the search result.</p> <p>Edit: In the initial state the #msg_receiver-div is empty, but it seems like the statement <code>$('#msg_receiver').html(</code> is performed before the variable <code>msg_receiver_content</code> has some content and then the variable has the content which should be added afterwards...</p>
javascript jquery
[3, 5]
2,591,105
2,591,106
will $("#someelementid").html('') still preserve space in DOM?
<p>I have an div with id <code>someelementid</code> that contains lot of tags or you can say long form in it. if i use jquery's method <code>$("#someelementid").html('')</code> will it free the memory of that form in the ram?</p>
javascript jquery
[3, 5]
866,774
866,775
make div float up
<p>I am trying to make a chat option for users however I only want the chat to show for a certain amount of time, I could do this via PHP and timestamp but I would also like to visually hide it by making the div containing the message to float up until it becomes hidden as an overflow..</p> <p>I seen a script on the following page: <a href="http://rainbow.arch.scriptmania.com/scripts/bg/float_up.html" rel="nofollow">http://rainbow.arch.scriptmania.com/scripts/bg/float_up.html</a> It uses images but I'd like to do the same idea with submitted messages (floating chat)</p> <p>Any help would be appreciated</p>
javascript jquery
[3, 5]
2,892,294
2,892,295
when i invoke gmail to send some advice the bluetooth come out, too
<p>this is my code to invoke gmail.</p> <pre><code>private void sendMail() { // Device model String PhoneModel = android.os.Build.MODEL; // Android version String AndroidVersion = android.os.Build.VERSION.RELEASE; final Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND); emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "****@gmail.com"}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "'some feedbace..."); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "—— phoneModel:" + PhoneModel + ";ROM:" + AndroidVersion); startActivity(Intent.createChooser(emailIntent, "Sending mail...")); } </code></pre> <p>when i click the menu to invoke the gmail to send feedback,the bluetooth come out too,with the gmail,and waiting for me to select one.but i just want to invoke the gmail app.what's wrong with my code .anybody help please!</p>
java android
[1, 4]
5,037,310
5,037,311
AJAX web applications with no hand-written JavaScript
<p>I'm looking for solutions that make it possible to create AJAX-enabled web applications without need to write JavaScript code manually. The requirements are:</p> <ol> <li>Performance doesn't matter. It can be slow, JavaScript may be unoptimized, amount of code it generates may be large.</li> <li>Platform doesn't matter as long as I can work with it on either Linux or Windows.</li> <li>Language doesn't matter as long as it's Python, Java or C#.</li> <li>I want to be able to create composite 'widgets' that can be updated dynamically using AJAX. For instance, I want to be able to load data dynamically and replace existing controls with the other ones when user clicks the button on that page.</li> <li>As long as this solution provides concepts like 'Panel' (composite widget), 'EditBox' and 'Label', I don't care if it's hard to create my own controls.</li> </ol> <p>What do you think?</p>
c# java javascript python
[0, 1, 3, 7]
1,513,462
1,513,463
jQuery/JS - Count elements within element
<p>In jQuery or JS I need to count the amount of DIV elements inside my parent DIV called <code>cont</code>? I've seen similar questions here on StackOverflow and have tried the following.</p> <pre><code>&lt;div class="b-load" id="cont"&gt; &lt;div&gt; &lt;img src="page2.jpg" alt=""/&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="page3.jpg" alt="" /&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="page4.jpg" alt="" /&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="page5.jpg" alt="" /&gt; &lt;/div&gt; &lt;/div&gt; function countPages() { var maindiv = document.getElementById('cont'); var count = maindiv.getElementsByTagName('div').length; alert(count); } </code></pre> <p>The child DIV's are dynamically produced, so I need to count them after the page has finished loading. The problem I have is the function I wrote counts 13 DIV's and in this example, there should only 4!! Any help gratefully received..</p>
javascript jquery
[3, 5]
497,028
497,029
jquery disable a button for a specific time
<p>i want to disable a button for a specific time. how can i do that?</p>
asp.net jquery
[9, 5]
136,488
136,489
Getting the response of a webpage that contains javascript
<p>In my C# app i got the following code:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { string uri = urlTextBox.Text; Uri myURL; if (!Uri.TryCreate(uri, UriKind.Absolute, out myURL)) return; WebRequest request = WebRequest.Create(myURL); request.Method = "GET"; using (WebResponse response = request.GetResponse()) { using (Stream stream = response.GetResponseStream()) { using(StreamReader sr = new StreamReader(stream)) { responseTextBox.Text = sr.ReadToEnd(); } } } </code></pre> <p>}</p> <p>But when I click the button it returns me the following text:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;title&gt;Login Timed Out&lt;/title&gt; &lt;link rel=stylesheet type="text/css" href="../../shared/css/ilearn_base.css"&gt; &lt;script&gt; function redirectToTop(reloginLoc) { if (opener != null &amp;&amp; opener != self) { opener.top.location = reloginLoc; window.close(); } else if (top != self) { top.location = reloginLoc; } else { location = reloginLoc; } } &lt;/script&gt; &lt;noscript&gt; Your browser does not support JavaScript. Please turn on JavaScript to use the features of this web page. &lt;/noscript&gt; &lt;/head&gt; &lt;body onLoad="redirectToTop('../../learner/jsp/relogin_site.jsp')"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>What I can't understand is why it says: "<code>Your browser does not support JavaScript. Please turn on JavaScript to use the features of this web page.</code>", because I activated JavaScript in both my current browser and in IE.</p> <p>In my Internet Browsers the page looks different, having the scripts executed, and I want to find out how can I activate javascript in C# browser to get the full response.</p>
c# javascript
[0, 3]
5,262,315
5,262,316
Jquery: How can I place triggers on images already cached?
<p>Please see: <a href="http://flx.me/h/0504/" rel="nofollow">http://flx.me/h/0504/</a></p> <p>Source: <a href="http://pastebin.com/bDh5k3Qd" rel="nofollow">http://pastebin.com/bDh5k3Qd</a></p> <p>jquery.preload-min.js: <a href="http://jquery.com/plugins/project/Preload" rel="nofollow">http://jquery.com/plugins/project/Preload</a></p> <p>jquery.jplayer.min.js: <a href="http://www.happyworm.com/jquery/jplayer/0.2.4/developer-guide.htm" rel="nofollow">http://www.happyworm.com/jquery/jplayer/0.2.4/developer-guide.htm</a></p> <p>I'm using jquery.preload-min.js to preload images and to send a play trigger to jquery.jplayer.min.js to start playing a mp3 file.</p> <p>This works great when viewing the page for the first time (or force reloading all content). However, when the image has already been cached, it doesn't use the preloading script and thus does not send the play trigger to jplayer.</p> <p>How can I make it send a play trigger even when the image is cached?</p> <p>Thank you in advance,</p> <p>Dennis</p>
javascript jquery
[3, 5]
1,792,065
1,792,066
ltrim with jQuery?
<p>I am using jQuery to capture an encoded URL. </p> <p>I looks something like: #?var=asdasdasdasdasd</p> <p>I need to strip "#?" at the beginning of the string. In PHP I'd use ltrim. How can I do this with jQuery or plain JS?</p> <pre><code> $("#myLink").click(function(){ var myUrl = $(this).attr("href"); var cleanUrl = .... } </code></pre>
javascript jquery
[3, 5]
2,886,139
2,886,140
Copy text to other input field onblur
<p>I'm using jQuery to copy the value of one input field to another on blur. Here's my code:</p> <pre><code>$( "input[id$=token-input-search_field]" ).blur( function() { $(this).val() = $('input[id$=search_field]').val; }); </code></pre> <p>But it doesn't seem to work. What am I doing wrong?</p>
javascript jquery
[3, 5]
237,716
237,717
Need help in changing layout at run time using Repeater control
<p>I am new to .Net. Currently working on creating a bus layout for a online bus reservation system. is there any solution possible with below code</p> <p><strong>1. Booking.aspx file</strong></p> <pre><code> &lt;asp:Repeater ID="SeatLayout" runat="server"&gt; &lt;HeaderTemplate&gt;&lt;table class="seatList"&gt;&lt;tr&gt;&lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;td&gt; &lt;input type="image" src="../Images/available_seat_img.png" &gt;&lt;%# Eval("NumberSeat")%&gt;&lt;/input&gt; &lt;/td&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p><strong>2. Databinding in codebehind file.</strong></p> <pre><code>SeatLayout.DataSource = _seatBUS.GetAllSeatByBusRouter(_listBus); SeatLayout.DataBind(); </code></pre> <p><strong>3. Data source involves "Seat" table which has columns like</strong></p> <pre><code>SeatID NumberSeat Status ListBusId </code></pre>
c# asp.net
[0, 9]
4,059,530
4,059,531
replace cookie value to space character using jquey or javacript
<p>I have stored some textbox values in cookies.</p> <p>But if textbox is blank then cookie value will be "null".</p> <p>I am assigning that cookie value to another textbox. But as the cookie value is null it shows "null" in textbox.</p> <p>I want to replace this "null" to a blank space.</p> <p>How to do it?</p> <p>Please help</p>
javascript jquery
[3, 5]
5,665,225
5,665,226
How can I print only one specific panel ID
<p>I have an aspx page (c# using visual studio 2010) in which I have a terms of service. I would like to allow the users to print the terms of service without having to print the rest of the page. (The rest of the page is various other information) </p> <p>Therefore I would like a way to specify a panel ID and when the "Print TOS" button is pushed it will only print the information which is in the specific panel specified. </p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
2,052,989
2,052,990
How to call a function automatically on document ready event in jQuery
<p>I m having following Code in which this code executes when i click a anchor tag named msgup</p> <pre><code> $("#msgup").bar({ color : '#1E90FF', background_color : '#FFFFFF', removebutton : false, message : 'Your profile customization has been saved!', time: 4000 }); </code></pre> <p>But I want to do this thing automatically when page loads , so what is required to achieve such workflow?</p> <p>Actually i m using jBar plugin to show stackoverflow type notifications at top of the page.</p>
javascript jquery
[3, 5]
999,171
999,172
jQuery replace all single character
<p>I want to replace all characters in the textarea by a click using jQuery.</p> <p>For example:</p> <p>ə = e, ı = i, ...</p> <p><em>Thıs ıs əxamplə</em></p> <p>By clicking it should be:</p> <p><em>This is example</em></p>
javascript jquery
[3, 5]
3,651,125
3,651,126
JavaScript code not working IE8
<p>I am trying to make work links which we click to change the language of website using JavaScript. Here is the HTML code:</p> <pre><code>'&lt;form action="" method="post" name="currlang"&gt;'. '&lt;input type="hidden" name="languageval" value="'.$session-&gt;value("language").'"/&gt;'. '&lt;a onclick="langa(this, \'en\');" class="langs'.($session-&gt;value("language")=='en'?" active":"").'" id="en"&gt;&lt;/a&gt;'. '&lt;a onclick="langa(this, \'it\');" class="langs'.($session-&gt;value("language")=='it'?" active":"").'" id="it"&gt;&lt;/a&gt;'. '&lt;a onclick="langa(this, \'pl\');" class="langs'.($session-&gt;value("language")=='pl'?" active":"").'" id="pl"&gt;&lt;/a&gt;'. '&lt;/form&gt;'. </code></pre> <p>and here the javascript:</p> <pre><code>function langa(obj, valu) { document.getElementsByName("languageval")[1].value=valu; document.getElementsByName('currlang')[1].submit(); } </code></pre> <p>The script works fine on new browsers (Firefoxe, Opera, Chrome, IE9) but when testing it on IE8 it gives an error "'document.getElementsByName(...).1' is null or not an object". After some research I found out that getElementsByName() is not supported by IE8 and above and maybe the solution would be to use jQuery and this is where I need help. How can I make this work with jQuery or without it?</p> <p>Thank you so much for your help.</p>
javascript jquery
[3, 5]
1,991,801
1,991,802
Are there comment system/user loggin type modules through PHP API/Python API outside of CMS?
<p>I'm primarily using Drupal and am considering moving away from CMS. If I were to build my own platform could I integrate modules like commenting systems, user login, etc. through a PHP/Python API? What would be the proper steps/good places to look/good tutorial on this? Would I have to build all of my own tables manually to suit the needs of such custom modules? I'm wondering if this would even be possible with out having to hard code all of this by hand? Thank you.</p>
php python
[2, 7]
3,573,577
3,573,578
Reload when setTimeout function finishes
<p>I want to reload window after a this custom function finishes:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ setTimeout(function () { $('#order_form').dolPopupHide({}); }, 3000); //window.location.reload(); }); &lt;/script&gt; </code></pre> <p>Is there a way I can add the reload to the setTimeout function so it doesn't run until the timeout is over?</p>
javascript jquery
[3, 5]
2,638,416
2,638,417
Jquery dynamically create link
<p>I have a piece of JQuery that creates a row in a table and in one of the cells there is an X that is surrounded by a class. When it is dynamically created and then clicked on the click listener does not fire. Here is the code.</p> <pre><code>$('#add').click(function() { $( '#table' ).append('&lt;td class="x"&gt;X&lt;/td&gt;&lt;/tr&gt;'); }); $('.x').click(function() { alert('Fired'); }); </code></pre>
javascript jquery
[3, 5]
725,134
725,135
How to get asp:textbox value on code behind file?
<p>The error I get is :The name agentName does not exist in the current context"</p> <p>On default.aspx I have <code>&lt;asp:TextBox ID="agentName" runat="server" /&gt;</code></p> <p>On code behind file I have <code>agentName.Text</code></p> <p>But is says the above error message.</p> <p>when I pass hard coded value like "John", it works. I need a way to recognize the textbox on code-behind.</p> <p>Thanks</p> <p>Following is my code:</p> <p>Default.aspx:</p> <pre><code>//code behind on @page directive &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="WebApplication2.WebForm1"%&gt; // Getting the value from XML Agentname.Text = root.SelectSingleNode("name").ChildNodes[0].Value; // Assigned a textbox asp:TextBox ID="Agentname" runat="server" disabled="true" MaxLength="57" / (removed angel bracket as SO is ignoring this line, don't know why) //Code behind using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication2 { public partial class WebForm1 : System.Web.UI.Page { public void SaveXml(object sender, EventArgs e) { XDocument xmlDoc = XDocument.Load(Server.MapPath("Agent.xml")); Console.WriteLine("read XML"); var person = xmlDoc.Descendants("agent"); person.ElementAt(0).Value = ""; xmlDoc.Element("agent").Add(new XElement("name", Agentname.Text)); xmlDoc.Save(Server.MapPath("Agent.xml")); } } } </code></pre>
c# asp.net
[0, 9]
1,187,755
1,187,756
How to replace a codebehind method with an aspx method using ternary operator
<p>I have an asp:hyperlink control as part of a gridview template. The code in the aspx page is given below:</p> <pre><code>asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='&lt;%# GetUrl(Eval("ID").ToString(), Eval("CategoryID").ToString()) %&gt;' ImageUrl="~/Images/Edit.gif" </code></pre> <p>The NavigateUrl value is obtained from the codebehind method GetUrl(string, string). The code works fine and is as follows:</p> <pre><code>protected string GetUrl(string id, string categoryID) { var CategoryID = string.Empty; if (!String.IsNullOrEmpty(Request.QueryString["CatID"])) { CategoryID = Request.QueryString["CatID"].ToString(); } else if (!String.IsNullOrEmpty(categoryID)) { CategoryID = categoryID; } return "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + id + "&amp;CatID=" + CategoryID; } </code></pre> <p>I want to replace the code behind method by using a ternary operator within the aspx page. I tried something like below, but didn't work:</p> <pre><code>asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='&lt;%# "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + Eval("ID") + "&amp;CatID=" + Eval(this.Request.QueryString["CatID"].ToString()) != ""? this.Request.QueryString["CatID"] : Eval("CategoryID")) %&gt;' ImageUrl="~/Images/Edit.gif" </code></pre>
c# asp.net
[0, 9]
3,005,625
3,005,626
It doesnt seem that jQuery clones events, but just the html/xml?
<p>I have a test script i writing up as a demo, and I am building a template, but when i clone it, it doesnt seem to fire the event.</p> <pre><code>var $shifter = $("&lt;a class='shifter'&gt;^&lt;/a&gt;"); $shifter.click(function(){ alert("ping"); }); </code></pre> <p>You can view my whole template at: <a href="http://jsfiddle.net/fallenreaper/drdCp/2/" rel="nofollow">http://jsfiddle.net/fallenreaper/drdCp/2/</a> Everything is done in Javascript, so the HTML contains just the sample form PRE-COMPONENTS.</p>
javascript jquery
[3, 5]
453,767
453,768
jQuery select img with src
<p>I want to select an image (with jQuery) by the src attribute. The Image is inside an ul and a collection of div's. The id of the ul is "sortable".</p> <p>Here is my HTML:</p> <pre><code>&lt;ul id="sortable"&gt; &lt;li id="pic_0"&gt; &lt;div class="sortEleWrapper"&gt; &lt;div class="imgWrapper"&gt; &lt;img src="/test1.jpg"&gt; &lt;/div&gt; &lt;input type="text" name="picText" id="picText" value="""" style="width:105px;color:#aaa" class="sortInput"&gt; &lt;/div&gt; &lt;input type="hidden" id="picSrc" name="picSrc" value="/test1.jpg"&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>etc.</p> <p>and here is my js:</p> <pre><code>if($('#sortable').find('img[src="/test1.jpg"]').length &gt; 0){ alert('img exists'); }else{ alert('img dosnt exists'); } </code></pre> <p>My problem is, that they don't find any image. But if I write the js like this:</p> <pre><code>if($('img[src="/test1.jpg"]').length &gt; 0){ alert('img exists'); }else{ alert('img dosnt exists'); } </code></pre> <p>so they find the image. Can anybody help me plz.</p> <p>PS: sorry for my poor english, but I'm german =)</p>
javascript jquery
[3, 5]
4,472,632
4,472,633
Get script to wait for file dialogue to return
<p>I have a web page where I want to prompt the user for a file to upload, but I don't want to display the <code>&lt;input type="file"/&gt;</code> element.</p> <p>I have a button that triggers the file dialogue to display, but the code doesn't wait for the dialogue to return.</p> <p>Is there an event I can hook into that is raised when the file dialogue returns? Is there some other thing I've not thought of?</p> <p>This is what I have at the moment, it uses an alert to block the code. I want something less hacky.</p> <pre><code>function importValues(e) { var f = document.getElementById('file'); f.click(); alert('loading'); //hack to make the code wait for the user to choose a file before making the ajax call var formdata = new FormData(jQuery('#frmImport')[0]); jQuery.ajax({ url: 'importFile', type: 'POST', data: formdata, chache: false, contentType: false, processData: false, }); } </code></pre>
javascript jquery
[3, 5]
2,438,821
2,438,822
When the submit button is clicked, I want to get the value of a dropdownlist
<p>How do I get the option's value that was selected in a dropdown list when a button is clicked?</p> <pre><code>&lt;select id="d1"&gt;&lt;option value="1"&gt;One&lt;/option&gt;...&lt;/select&gt; </code></pre>
javascript jquery
[3, 5]
4,706,485
4,706,486
javascript date + 1
<p>How do I take today's date and add 1 day to it?</p> <p>If possible, inline please?</p>
javascript jquery
[3, 5]
2,106,813
2,106,814
is it possible to make duble include in javascript and php?
<p>I am using the following code to check if the user liked my facebook page or not ?</p> <pre><code> &lt;style&gt;xxxxxxxxxxxxxxxxx&lt;/style&gt; &lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;&lt;script&gt;google.load("jquery", "1");&lt;/script&gt; &lt;script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; Username="gagsallday", Title="Join Our Facebook!", Skin="01", Time="30", Wait="0", Lang="en" &lt;/script&gt; &lt;script type="text/javascript" src="likeboxfbfanpro.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;$(document).ready(function(){$().popupbox({ closeable: false });});&lt;/script&gt; &lt;? echo'&lt;Center&gt;&lt;Font Face="Tahoma"&gt;&lt;Font size="10"&gt;Your Content Here!'; </code></pre> <p>the last piece of code is where I should have my page contents on which is this one :</p> <pre><code> &lt;? echo'&lt;Center&gt;&lt;Font Face="Tahoma"&gt;&lt;Font size="10"&gt;Your Content Here!'; </code></pre> <p>my question is how can add this code to my page ? just like this ? it did not work because I can not include a file whiat already has include function inside it ? what I want is something like this, but how can I do it ?</p> <pre><code>&lt;?php include('the-ablve-code-goes-here.php');?&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; stuff goes here... &lt;/body&gt; &lt;/html&gt; </code></pre>
php javascript
[2, 3]
5,764,346
5,764,347
Jquery droppable live disabling/enabling
<p>I have a some draggables in a list of droppables (1 draggable per droppable li). </p> <p>When I move a draggable from one droppable to another free droppable, I want to diable the receiving droppable, and enable the droppable it is leaving from. </p> <p>In firebug the droppable class gets removed – but the functionality of the droppable remains. I have a feeling I need to use live() somehow, but could use a leg-up.</p> <pre><code>$(function() { $(".user").draggable({ revert : true, revertDuration : 200 }); $("li.droppable").droppable({ accept : ".user", hoverClass : "drophover", drop: function(event, ui) { var position = this.getAttribute("id").replace("position_", ""), user_id = ui.draggable.attr("id").replace("user_", ""); droppable = this parent = ui.draggable.parent() $.ajax({ url : "users/"+user_id+"", type : "POST", dataType: "JSON", data : ({ "position" : position, "_method" : "PUT" }), success : function() { $(ui.draggable).parent().addClass("droppable"); $(ui.draggable).appendTo(droppable); $(parent).removeClass("droppable"); } }); } }); }); </code></pre>
javascript jquery
[3, 5]
1,686,469
1,686,470
How to display selected GridView row in DetailsView
<p>I have a aspx page that has a GridView with a datasource of an array of the Client class. I would like to include a DetailsView below the GridView that shows the information of the selected GridView row and allows the user to edite that row. When they are done editing the row, I plan to call the web service to update the row.</p> <p>Is there an easy way to link the selected GridView row to the DetailsView?</p>
c# asp.net
[0, 9]
4,938,577
4,938,578
Why I am not able to control Media volume when the alert dialog is shown in Android?
<p>I am controlling media volume programmatically from my app. I am setting alert dialog when the media volume is below certain range. When this alert is displayed at this point if I try to adjust the volume controller buttons the ringer volume will get adjusted not media volume. Why is this happening?</p> <p>I am using these lines to control media volume..</p> <pre><code>case KeyEvent.KEYCODE_VOLUME_DOWN: audio.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_VOLUME_UP: audio.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); return true; </code></pre> <p>Once the alert dialog is dismissed I am able to control the media volume. I am facing this issue only in phone not in tablet.</p>
java android
[1, 4]
3,752,033
3,752,034
asp.net C# how to check wether whereparameters of a entitydatasource returns 0 rows
<p>I have a entitiydatasource: </p> <pre><code>&lt;asp:EntityDataSource ID="EntityDataSourcePersoneel" runat="server" ConnectionString="name=HotelTestDatabaseEntities" DefaultContainerName="HotelTestDatabaseEntities" EntitySetName="Personeels" Include="Afdeling"&gt; &lt;/asp:EntityDataSource&gt; </code></pre> <p>where i dynamically put these whereparameters:</p> <pre><code>EntityDataSourcePersoneel.WhereParameters.Clear(); EntityDataSourcePersoneel.AutoGenerateWhereClause = true; EntityDataSourcePersoneel.WhereParameters.Add("personeelID", TypeCode.Int32 personeelId.ToString()); </code></pre> <p>How can i Check if the whereparemeters returns 0 rows(nothing)..</p> <p>Oh yeah if my code is wrong please help and advice me.. Thanks!</p>
c# asp.net
[0, 9]
3,009,322
3,009,323
The method apply() is undefined for the type SharedPreferences.Editor
<p>code: <a href="http://pastebin.com/sh5TKhVv" rel="nofollow">http://pastebin.com/sh5TKhVv</a> I have coppied this code from book and I did not change anything but it have this error in lines 96 and 192.</p> <pre><code>preferencesEditor.apply(); --&gt; The method apply() is undefined for the type SharedPreferences.Editor </code></pre>
java android
[1, 4]
5,648,769
5,648,770
Double execution on a single click jquery
<p>i am having a problem when i click on an input(button) (click event captured using jquery) it is executed two times but the click event is single... i used <strong>"e.stopPropagation();"</strong> - but it didn't work...</p> <pre><code>jQuery("#ok").click(function(e){ alert("Alert"); e.stopPropagation(); }); </code></pre> <p>i need the reason and the solution...</p> <p>take care..</p>
javascript jquery
[3, 5]
4,155,675
4,155,676
How to convert a urlcode in array in php?
<p>I hope you can help me;</p> <p>How to convert a urlcode in array in php?</p> <p>example:</p> <pre><code>$Urlcode = 'name=luiz&amp;country=Brazil&amp;city=patrociniomg'; </code></pre> <p>I need to transform this $Urlcode in array, in PHP, anyone know?</p> <p>Thanks to everyone now</p>
php jquery
[2, 5]
3,019,109
3,019,110
iTextSharp StyleSheet how to set label style
<p>I am using iTextSharper and i am reneding a labelabout.text as a pdf , but the the control i render that are displayed in the pdf file does not have nice format so i am trying to style it.</p> <p>I should on some way use "Styles to set it on my labelabout as a div on some way the labelabout that u se here right down"</p> <pre><code>LabelAbout.RenderControl(hTextWriter); var styles = new iTextSharp.text.html.simpleparser.StyleSheet(); var hw = new iTextSharp.text.html.simpleparser.HTMLWorker(document); hw.Parse(new StringReader(strHtml1)); </code></pre>
c# asp.net
[0, 9]
5,197,370
5,197,371
Get content of iframe from jquery
<p>everyone. I created my page and inserted inside another page using IFrame. Now I'm trying to get whole text of that inserted page using pure javascript or jquery. Here's what I have now, but it doesn't work... </p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;script type="text/javascript" src="jquery-1.5.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function getFrameContents(){ return $("#myframe").contents().find('body'); } &lt;/script&gt; &lt;/head&gt; &lt;form&gt; &lt;input type="button" value="CodingForums" onClick="window.alert(getFrameContents())" /&gt; &lt;/form&gt; &lt;iframe id='myframe' src="http://www.fxstreet.com/rates-charts/currency-rates/" width="100%" height="300"&gt; &lt;p&gt;Your browser does not support iframes.&lt;/p&gt; &lt;/iframe&gt; &lt;/html&gt; </code></pre> <p>I've read also that there is some policy about accessing pages from different server. How can I do it properly?</p>
javascript jquery
[3, 5]
3,348,488
3,348,489
Return the fields that do not pass validation in PHP to jQuery
<p>I'm using jQuery with PHP for form validation. I want to return the fields that do not validate so i can highlight them using javascript</p> <p>this is my attempt using PHP(validate.php):</p> <pre><code>&lt;?php ... $a_invalidInput = array(); $from = $_POST['from']; $to = $_POST['to']; $email_to = $_POST['email_to']; if( empty($from) ){ $a_invalidInput[] = 'from'; } if( empty($to) ){ $a_invalidInput[] = 'to'; } //validate the email_to address if( empty($email_to) ){ $a_invalidInput[] = 'email_to'; } else{ //do more validation for email } ... ?&gt; </code></pre> <p>This is my jquery code:</p> <pre><code>... var data = "from="+ from + "&amp;to=" + to + "&amp;email_to=" + email_to; $.ajax({ url: "includes/validate.php", type: "POST", data: data, success: function(){ //highlight fields that do not pass validation } }); ... </code></pre> <p>I'm not sure if i'm on the right path or not AND how to return the input fields that do not pass validation so i can add a class to highlight the fields that do not pass validation.</p> <p>I could do this using javascript but i prefer using a php file for validation</p> <p>Thanks Marco</p>
php jquery
[2, 5]
1,894,836
1,894,837
How do I stop an effect in jQuery
<p>I have a page that uses </p> <pre><code>$(id).show("highlight", {}, 2000); </code></pre> <p>to highlight an element when I start a ajax request, that might fail so that I want to use something like</p> <pre><code>$(id).show("highlight", {color: "#FF0000"}, 2000); </code></pre> <p>in the error handler. The problem is that if the first highlight haven't finished, the second is placed in a queue and wont run until the first is ready. Hence the question: Can I somehow stop the first effect?</p>
javascript jquery
[3, 5]
2,925,814
2,925,815
how to send sms to mobile from web application using asp.net and c#?
<p>How do you send an sms message to a mobile phone from a web application using asp.net and c#?</p>
c# asp.net
[0, 9]
4,399,316
4,399,317
Javascript function that returns a DOM when input is html content
<p>I want a Javascript function that returns a correct DOM when input is HTML content. I have used the follwing function for the same. Here input is HTML content and output is DOM.</p> <pre><code>function htmltoelement(elementHTML) { var temDiv = document.createElement('div'); temDiv.innerHTML = elementHTML; return temDiv; } </code></pre> <p>This function works well for Firefox, but not for IE or Chrome, when the HTML is broken.</p> <p>I need a suggestion for a function that works fine on all the browsers even when HTML is broken. </p>
javascript jquery
[3, 5]
4,595,876
4,595,877
Help needed to pass javascript result to serverside on page load
<p>I've got a Master page, which loads my Default.aspx</p> <p>I need to get the browser version using </p> <pre><code>function loadHiddenField() { document.getElementById("HiddenField1").value = document.documentMode; } </code></pre> <p>The result of this needs to be passed to my Default.aspx page so that I can use it in a Linq query used to populate the page. This all happens when my site first loads.</p> <p>So: <br> 1) Type in my site URL <br> 2) Page loads, displaying the correct information in the default.aspx page depending on what browser version you are using.</p> <p>I originally tried to call the method using the client side body onload, but I realise that this won't work.. So I need to know what does work.. </p> <p>Please don't tell me to use HttpBrowserCapabilities, because that won't work.. What I have in the JavaScript above is what I need.</p> <p>I'm stuck and really need help here.. I've asked this question previously, but the only person that tried to help deleted his post. </p>
c# javascript asp.net
[0, 3, 9]
3,427,975
3,427,976
Execute python from php
<p>Say you have a class like this:</p> <pre><code>class MyClass: def __init__(self, var1): self.var = var1 .... </code></pre> <p>This class, in python, works only when you assign a value:</p> <pre><code>x = MyClass("Hi") </code></pre> <p>So basically, my question is whether I can send a variable from php to execute a python class, and return its output (it's string) and continue to execute my php code?</p> <p>Any suggestions?</p> <p><strong>SOLUTION</strong></p> <p>in php:</p> <pre><code>$var = "something"; $result = exec("python fileName.py .$var") </code></pre> <p>in python:</p> <pre><code>import sys sys.argv[0] # this is the file name sys.argv[1] # this is the variable passed from php </code></pre>
php python
[2, 7]
5,665,492
5,665,493
run jquery on php page open
<p>I have a jquery notification bar script that im using. I don't know the first thing about jquery and javascript, but anyway, heres the code:</p> <pre><code>&lt;script src="jquery.bar.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $("#msgup").bar({ color : '#FFFFFF', background_color : '#8F0000', removebutton : false, message : 'hello', time : 4000 }); </code></pre> <p>how do i run this using php echo when the page opens? To run it with a link i use this</p> <pre><code>&lt;a id=bar&gt;click here&lt;/a&gt; </code></pre> <p>this code would run in a section of the page that refreshes every 10 sections using jquery, so yeah, must check on 'page load'</p>
php jquery
[2, 5]
5,560,279
5,560,280
Is there a way to call [ScriptableMember] in Asp.Net via jQuery
<p>I know there's a way to call [WebMethod] via jQuery <code>($.ajax(...))</code> I was wondering if it's possible to call [ScriptableMember] via jQuery.</p>
asp.net javascript jquery
[9, 3, 5]
357,355
357,356
Setting div scroll bar as active when main window scroll is at bottom
<p>In a page I have div with vertical scroll bar. Main page has it's normal browser scroll bar. When main window scroll bar is at bottom and user continues to scroll down div vertical scroll bar should continue scrolling.</p> <p>Is there some jquery event to catch scroll or some other easy way to accomplish this?</p>
javascript jquery
[3, 5]
4,523,342
4,523,343
Error while implemening single sign on in my asp.net application
<p>I am using single sign on method to redirect from on e website to another.I am using forms authentication in both sites and gave the <strong>validationkey</strong> in machine key tag in both webconfig.While i am redirecting i get this error " <strong>Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects</strong>"</p>
c# asp.net
[0, 9]
3,976,263
3,976,264
Expanding compressed div
<p><a href="http://jsfiddle.net/Y8MUF/" rel="nofollow">http://jsfiddle.net/Y8MUF/</a></p> <p>It can expand the div when i click on it. How do i make it look nicer by adding a "See More" link then hide it when the div exapands and adjust the row height relative to the See More link?</p> <pre><code>$(document).ready(function(){ var rowsshown = 2; var rowheight = 1.2; // line height in 'em' var ht = (rowsshown * rowheight) - .5; // subtracting the .5 prevents the top of the next line from showing $('.info') .css({'overflow':'hidden','line-height' : rowheight + 'em','height': ht + 'em' }) .click(function(){ if ( $(this).css('height') == 'auto') { $(this).css('height', ht + 'em'); } else { $(this).css('height','auto'); } }); }) </code></pre>
javascript jquery
[3, 5]
2,341,910
2,341,911
Good javascript-graph library
<p>I need do create a pretty complicated graph in Javascript. It's a line-graph with dots that are click-able. I've looked at the google-api, and it just won't do. Also, it needs to be able to rendre several graphs in one window.</p> <p>Would be really nice if it was powered by jQuery, since the rest of the project is running on that platform.</p> <p>Does anyone know about any good libraries? I have not gotten across any suitable yet.</p> <p>Thomas</p>
javascript jquery
[3, 5]
2,837,230
2,837,231
javascript countdown timer new date
<p>I am using javascript for a count down timer</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { var newYear = $(".HF").val(); alert('hehe' + newYear); $('#countdown').countdown({ until:newYear, format: 'DHMS', layout: '&lt;div id="timer"&gt;' + '&lt;hr /&gt;' + '&lt;div id="timer_days" class="timer_numbers"&gt;{dnn}&lt;/div&gt;' + '&lt;div id="timer_hours" class="timer_numbers"&gt;{hnn}&lt;/div&gt;' + '&lt;div id="timer_mins" class="timer_numbers"&gt;{mnn}&lt;/div&gt;' + '&lt;div id="timer_seconds" class="timer_numbers"&gt;{snn}&lt;/div&gt;' + '&lt;div id="timer_labels"&gt;' + '&lt;div id="timer_days_label" class="timer_labels"&gt;days&lt;/div&gt;' + '&lt;div id="timer_hours_label" class="timer_labels"&gt;hours&lt;/div&gt;' + '&lt;div id="timer_mins_label" class="timer_labels"&gt;mins&lt;/div&gt;' + '&lt;div id="timer_seconds_label" class="timer_labels"&gt;secs&lt;/div&gt;' + '&lt;/div&gt;' + '&lt;/div&gt;' }); }); &lt;/script&gt; </code></pre> <p>it gets its until value from a hidden field <code>HF</code>.The value of the hidden field is a string 10/22/2011...but the timer shows only 34 mins left while it must show 2 days and some hours and some mins left..why??</p>
javascript asp.net
[3, 9]
3,222,587
3,222,588
Adding a <br /> after a label only if label is visible. C#
<p>I have a chunk of code that on page load with populates some of or all of the following labels. It should have two labels per line ( needs a line break after each xData label). The problem I am having is that since the number of labels with data and set to visable on page load changes, the <code>br /</code> tags cause spacing issues when not all labels are visible.</p> <pre><code>&lt;div id="Status"&gt; &lt;asp:Label ID="1" runat="server" Text="1:" Width="125px" Visible="false" /&gt; &lt;asp:Label ID="1Data" runat="server" Text="" Visible="false" /&gt; &lt;asp:Label ID="2" runat="server" Text="2:" Width="125px" Visible="false" /&gt; &lt;asp:Label ID="2Data" runat="server" Text="" Visible="false" /&gt; &lt;asp:Label ID="3" runat="server" Text="3:" Width="125px" Visible="false" /&gt; &lt;asp:Label ID="3Data" runat="server" Text="" Visible="false" /&gt; &lt;/div&gt; </code></pre> <p>I would like to be able to add the line breaks after each "xData" label in the code behind when the labels are filled and set to visible.</p> <p>I have tried adding <code>"\n"</code> to the label text and\or <code>Environment.NewLine</code> with no luck.</p> <p>Thanks for any help</p>
c# asp.net
[0, 9]