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,468,793
3,468,794
Detecting the iPhone from jQuery
<p>I know browser-detection is supposed to be taboo, but I'm out of ideas.</p> <p>I have a website that I want to be nice and full-featured when running on a full-sized computer and simple to use when on an iPhone (or other smart phone). What's the right thing to do here?</p>
jquery iphone
[5, 8]
3,928,269
3,928,270
Jquery help creating ajax link rendering
<p>I want to make an ajaxlink, but it is not working:</p> <p>My html: </p> <pre><code>&lt;td class="apris"&gt;&lt;p&gt;&lt;a class="current desc" href="/?direction=asc&amp;amp;sort=pris"&gt;Pris pr. md.&lt;/a&gt;&lt;/p&gt;&lt;/td&gt; </code></pre> <p>My Jquery:</p> <pre><code>$('.apris').live('change', function() { var form=$(this).closest('form'); $.ajax({ type:'post', url:"\/finder\/" + $(this).val(), data:form.serialize(), success:function(msg){ $('#formcontent').html(msg); } }); }); </code></pre>
javascript jquery
[3, 5]
4,767,673
4,767,674
Redirecting Application-Level Error Handler
<pre><code>protected void Application_BeginRequest(object sender, EventArgs e) { const int maxFileSizeKBytes = 10240; //10 MB const int maxRequestSizeKBytes = 305200; //~298 MB if (Request.ContentLength &gt; (maxRequestSizeKBytes * 1024)) { Response.Redirect(".aspx?requestSize=" + Request.ContentLength.ToString()); } for (int i = 0; i &lt; Request.Files.Count; i++) { if (Request.Files[i].ContentLength &gt; (maxFileSizeKBytes * 1024)) { Response.Redirect(".aspx?fileSize=" + Request.Files[i].ContentLength.ToString()); } } } </code></pre> <p>This code is in Global.asax.cs page. I need to redirect to the page that triggered this check. And I need to know the ticketId or projectId parameter. For example I create new ticket at the View Project page <code>/Project/ViewProject.aspx?projectId=1</code> I need to redirect to this page with a meaningful message to the user, because I think that redirecting to another page to display the error message is not a good idea.</p>
c# asp.net
[0, 9]
4,519,091
4,519,092
Android - Generate CSV file from table values
<p>I am having a database containing one table, i want to generate CSV file with values of this table.</p> <p>Actually, I want to email this CSV file as an attachment. I know about sending file as an attachment in Email intent(AcTION_SEND), but i dont know the procedure of creating or the method by which i can create CSV formatted file.</p> <p>Please give me suggestions or ideas.</p>
java android
[1, 4]
882,552
882,553
Testing function that creates a list of DOM components
<p>I have a function which creates an Array of components. Each component is an outer div with a few inner divs.</p> <pre><code>function createDivs(quizQuestions) { var returnElements = new Array(); $.each(quizQuestions.questions, function(i, val){ // create the div. quizDiv = $('&lt;div class="questionContainer radius"&gt;') questionDiv = $('&lt;div class="question"&gt;&lt;b&gt;&lt;span&gt;QuestionText&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;'); quizDiv.append(questionDiv); // Now change the question div text. questionDiv.text = val.question; answerDiv = $('&lt;div class="answers"&gt;'); // ... // ... // Now the answers. questionDiv.append(answerDiv); returnElements[i] = quizDiv; }); return returnElements; </code></pre> <p>I pass JSON such as:</p> <pre><code> {questions:[{"question":"Name the best Rugby team?", "answers":["Leinster", "Munster", "Ulster", "Connaught"], "correct_answer":"Leinster"}, {"question":"Name the best DJ?", "answers":["Warren K", "Pressure", "Digweed", "Sasha"], "correct_answer":"Leinster"}]}; </code></pre> <p>I'd like to write a simpe unit test so that I could test the array of div returned made sense</p> <p>Any tips?</p> <p>Also, are my better to return a DOM component or just text? The latter would be easier to test.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
5,620,539
5,620,540
How to render a web page with android jdk?
<p>I want to show the web page normally,but still keep the user in my app,</p> <p>how to make use of the available web render engines programmatically?</p> <p><strong>UPDATE</strong></p> <p>I'm now using the <code>webview</code> ,but can't render the page,reporting 404 page not found.</p> <p>However,when I pack my project and run in another computer,it works like charm!</p> <p>How to solve this?</p>
java android
[1, 4]
4,912,996
4,912,997
working with dropdownlist in asp.net c#
<p>i have 2 dropdownlist in asp.net c#, one has only two items in it('OK' 'PK') and the other one is bound to a database field and it has 158 items in it.</p> <p>I want remove two Items from the second list when the user selects 'OK' and keep original list when user selects 'PK'.</p> <p>How can i do it?? As i have bound the second list to a database is there any property which can hide some values in the list??</p>
c# asp.net
[0, 9]
5,567,987
5,567,988
Simplest way to animate button
<p>I have to code animated menu buttons for my Android app. It will be look something like this: ![enter image description here][1]</p> <ul> <li>simple mockup of menu: i.stack.imgur.com/vT788.png</li> <li>Animation looks like some kind of cube rotation - one spin of cube, something like that..</li> </ul> <p>I'm looking simplest way to program animation for menu buttons (for example "button1"). By on click it have to do animation first, then show content of submenu. "button1" have to be animated by four *.png file:</p> <ul> <li>button1.png</li> <li>button1_step1.png</li> <li>button1_step2.png</li> <li>button1_step3.png</li> </ul> <p>Anyone know a siple way to code this? Thank's in advance ;-)</p>
java android
[1, 4]
5,163,769
5,163,770
String sequence similarity / difference ratio in javascript and python
<p>Say I had a reference string</p> <p>"abcdabcd"</p> <p>and a target string</p> <p>"abcdabEd"</p> <p>Is there a simple way in javascript and python to get the string sequence similarity ratio?</p> <p>Example:</p> <p>"abcdabcd" differs from "abcdabEd" by the character "E" so the ratio of similarity is high but less than 1.0</p> <p>"bcdabcda" differs from "abcdabEd" greatly because every character at a specific string index is different so the similarity ratio is 0.0</p> <p>note that the similarity ratio is not how many similar characters are in each string but how similar the sequences are from each other</p> <p>therefore code like </p> <pre><code># python - incorrect for this problem difflib.SequenceMatcher(None, "bcdabcda", "abcdabEd").ratio() </code></pre> <p>would be wrong</p>
javascript python
[3, 7]
3,780,356
3,780,357
Function by using Recursion?
<p>I want to make a function which will display numbers starting from 1 to 100 and 100 to 1 I am confused that how i can do this using Recursion?</p> <p>I dont want to do this using any other loop. Please provide me hint and ignore my way of asking because i am new in c++ and c#.</p>
c# c++
[0, 6]
4,258,750
4,258,751
context menu does not appears
<p>have a look at the code below...why isnt my context menu being created ??? what may b the cause of this...?</p> <pre><code>@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflator = getMenuInflater(); inflator.inflate(R.menu.contextmenudisplayer, menu); } @Override public boolean onContextItemSelected(MenuItem item) { switch(item.getItemId()) { case R.id.delete: AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); String s = (String) ((Cursor) getListView().getItemAtPosition(info.position)) .getString(2); Log.v("ID is", s); default: return super.onContextItemSelected(item); } } </code></pre> <p>and here is the code of the xml file from the context menu displayer <code>contextmenudisplayer.xml</code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/delete" android:title="Delete Message"&gt; &lt;/item&gt; &lt;item android:id="@+id/forward" android:title="Forward"&gt; &lt;/item&gt; &lt;/menu&gt; </code></pre>
java android
[1, 4]
367,243
367,244
Jquery plugin for user mappings?
<p>I am building a web application using asp.net, which has three types of user's admin, dealers, and employees (under dealers). The employees can be associated with more than one dealers and which can be done only by the "admin".</p> <p>So what i need is to make a neat employee and dealers mapping page visible to the admin. but am not getting any ideas, in order how to achieve that. The mappings can be in a graphical format (using any jquery plugin) or can be in a simple interactive tabular format.</p> <p>Searched for jquery plugin, but had no luck.</p> <p>Please help me out, need suggestions or demo page views of similar structure or any jquery plugins to be helpful. </p>
jquery asp.net
[5, 9]
1,258,094
1,258,095
jQuery: Get attributes from "live" element
<p>I create a new window when i press a button. This window contains html input elements that i want to manipulate with jquery, but i can't catch the elements. Normally i would use the live function because the html is first added to the dom when the button is pressed, but its not working.</p> <pre><code> jQuery(document).ready(function () { var opretKnap = jQuery("input[value='Open window']"); jQuery(opretKnap).live('click', function () { var inputsDate = jQuery("input[vdfDataType]"); }); }); </code></pre>
javascript jquery
[3, 5]
2,817,271
2,817,272
dynamic tag count on keyup
<p>I have a div that contains many spans and each of those spans contains a single href.</p> <p>Basically it's a tag cloud. I have a textbox with a keyup event that filters the tag cloud div (It actually just hides the tags if not in filter condition).</p> <p>Is there a way to get a count of the tags shown as the keyup event occurs?</p> <p>Thanks, rodchar</p>
javascript jquery
[3, 5]
114,763
114,764
JavaScript graph are not visible in android webview
<p>i want to call this <a href="http://mediasense2.appspot.com/" rel="nofollow">graph</a> in my android web view but i am unable to see it . The random below the graph i can see in webview but cant see the graph . i am taking help from <a href="http://benaskins.github.com/simplegraph/" rel="nofollow">here</a> Thanks</p>
java javascript android
[1, 3, 4]
4,162,597
4,162,598
Change the format of a number to readable in currency format?
<p>In my application, i want to be able to:</p> <p>make this number <strong>300000</strong> appear like this <strong>300,000 USD</strong> ? I don't want it to be necessarily "<strong>USD</strong>" , </p> <p>I want to be able to choose my <strong>own</strong> currency too.</p>
java android
[1, 4]
4,743,543
4,743,544
Implement partial methods across multiple assemblies
<p>In one of the applications I am working on, there are two basic functionalities included: Create and Update.</p> <p>However, there is a need sometimes to add custom code, so I thought of extending the code by allowing 3rd parties to write and embed their own code:</p> <p>OnCreating OnCreated OnUpdating OnUpdated</p> <p>Is there a way to enable the above across multiple assemblies? MEF might help here?</p> <p>Thank you Regards</p>
c# asp.net
[0, 9]
5,792,391
5,792,392
How do I get a simple jQuery code to replace my current Javascript
<p>Goal : When click a link on my navigation will show spinning image until script fully loaded.</p> <pre><code>function ahah(url, target) { document.getElementById(target).innerHTML = '&lt;img src="loading.gif" /&gt;'; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } if (req != undefined) { req.onreadystatechange = function() {ahahDone(url, target);}; req.open("GET", url, true); req.send(""); } } function ahahDone(url, target) { if (req.readyState == 4) { // only if req is "loaded" if (req.status == 200) { // only if "OK" document.getElementById(target).innerHTML = req.responseText; } else { document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText; } } } function load(name, div) { ahah(name,div); return false; } </code></pre> <p>On Link</p> <pre><code>&lt;a href="wrapper.html" onclick="load('file1.html','content');return false;"&gt;File 1&lt;/a&gt; &lt;a href="wrapper.html" onclick="load('file2.html','content');return false;"&gt;File 2&lt;/a&gt; </code></pre> <p>On content wrapper</p> <pre><code>&lt;div id="content"&gt;&lt;/div&gt; </code></pre> <p>Let me know simple way to do this on jquery.</p>
javascript jquery
[3, 5]
1,484,609
1,484,610
how to pass a checkbox value using <a href
<p>example.php ~ when i check the checkbox in example.php webpage.. then i click the print button, the value will be pass on example1.php <pre><code>if($items) { foreach($items as $i) { print"&lt;input name='checkbox[]' type='checkbox' id='checkbox[]' value='$i-&gt;logi_id'&gt;"; } } echo "&lt;a href='example1.php?checkbox=" . $checkbox . "'&gt;&lt;input type='button' name='print' id='delete' value='Print'&gt;&lt;/a&gt;" ?&gt; </code></pre> <hr> <p>example2.php</p> <pre><code>&lt;?php $keyword = $_REQUEST['keyword']; $keycateg = $_REQUEST['keycateg']; $print = $_REQUEST['print']; $checkbox = $_REQUEST['checkbox']; $count = count($_REQUEST['checkbox']); if($print){ for($i=0;$i&lt;$count;$i++){ $del_id = $checkbox[$i]; $sql = "select * FROM sampleDB WHERE logi_id='$del_id'"; $result = mysql_query($sql); } } ?&gt; </code></pre>
php jquery
[2, 5]
3,660,959
3,660,960
Calling a c# function from a Javascript method
<p>I'm trying to call a c# function from a javascript function:</p> <p>In my <strong>default.aspx</strong> I have following code: (javascript)</p> <pre><code>&lt;script type="text/javascript"&gt; function App() { var temp; temp = PageMethods.Connect(); alert(temp); } &lt;/script&gt; </code></pre> <p>(<strong>HTML</strong>)</p> <pre><code>&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;div class="menuContent"&gt; &lt;p&gt;&lt;a href="#" onclick="App();"&gt;blabla!&lt;/a&gt;&lt;/p&gt; &lt;div id="navTreeContainer"&gt; &lt;div id="navtree"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre> <p><strong>Default.aspx.cs</strong></p> <pre><code>[WebMethod] public static string Connect() { string test; test = "test"; return test; } </code></pre> <p>When I try this out nothing happens.</p> <p>I don't know what I do wrong here...</p> <p>Someone that can help me please ? </p> <p>Thanks!</p>
c# javascript
[0, 3]
3,647,407
3,647,408
C# object sender - getting the Method from which it was called
<p>I've got these Methods:</p> <pre><code> private void button_Click(object sender, EventArgs e) { //Changes the Text in the RichBox, EXAMPLE: richtTextBox.Text = "Now Changed and calling Method richTextBox_TextChanged"; } </code></pre> <p>And,</p> <pre><code> private void richTextBox_TextChanged(object sender, EventArgs e) { //Wants something like that if(called from button_click) { //DO SOMETHING } else { //DO SOMETHING } } </code></pre> <p>How can I handle this, to know if it was called from the Button_click? Do I have to use the object sender to get informations? But how?</p> <p>Hope u guys can help me</p>
c# asp.net
[0, 9]
3,048,634
3,048,635
how can i bind image in listbox
<p>I have a listbox on my page where i am checking the driver status if driver status is 1 then i change the font color in red Status 2 then i change color of font in listbox in green . Like that i want that i place a image with item in listbox if status will be 1 then i display a red image with that . How can i do that for you i am placing my aspx and c# code below</p> <pre><code>&lt;asp:ListBox ID="ddlDriver" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="ddlDriver_SelectedIndexChanged" runat="server" BackColor="White" Height="380px"&gt;&lt;/asp:ListBox&gt; </code></pre> <p>C# Code for listbox item font color </p> <pre><code> protected void ColorFillDrvier() { for (int i = 0; i &lt; ddlDriver.Items.Count; i++) { int drvierNo = Convert.ToInt32(ddlDriver.Items[i].Value); Drivers _driv = DataRepository.DriversProvider.GetByDriverNumber(drvierNo); if (_driv.DriverStatus == 1) { ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "red"); } else if (_driv.DriverStatus == 2) { ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "green"); } else if (_driv.DriverStatus == 3) { ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "yellow"); } else if (_driv.DriverStatus == 4) { ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "blue"); } else if (_driv.DriverStatus == 5) { ddlDriver.Items[i].Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, "black"); } } } </code></pre> <p>How can i do that . Thanks in advance for you all </p>
c# asp.net
[0, 9]
1,969,848
1,969,849
Adding class to each li automatically when pressing a button in a carousel
<p>Using JCarousel(circular), i made one list of items, where i want to add a class dynamically for each li after clicking a button,that too the class should be added one li after another. so,for each click, only one li should have that class,so that i can write css for that class. is there any jquery or javascript way to do this ?</p>
javascript jquery
[3, 5]
2,398,349
2,398,350
How do I remove the default Google Search Value from Google Search box?
<p>I am trying to use a little jQuery to "hide" the initial value in a Google Search box when you click in the box and I am missing something.</p> <p>Here is the search box code:</p> <pre><code>&lt;div id="search_box"&gt; &lt;form action="http://mfrp.ehclients.com/search_results" id="cse-search-box"&gt; &lt;div&gt; &lt;input type="hidden" name="cx" value="017425724926122041548:1ccj3d-e1-s" /&gt; &lt;input type="hidden" name="cof" value="FORID:9" /&gt; &lt;input type="hidden" name="ie" value="UTF-8" /&gt; &lt;input type="text" id="q" name="q" value="Search..." size="31" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en"&gt;&lt;/script&gt; &lt;/div&gt; </code></pre> <p>Here is the jQuery:</p> <pre><code>&lt;script type="text/javascript"&gt; $('#q').click(function() { if($(this).val() == 'Search...') $(this).val(''); }); &lt;/script&gt; </code></pre> <p>Only problem is, it doesn't work. Here is the <a href="http://mfrp.ehclients.com/" rel="nofollow">page</a>.</p> <p>I would appreciate some help sorting this out.</p> <p>Thanks,</p> <p>Forrest</p>
javascript jquery
[3, 5]
2,863,696
2,863,697
how to write the condition in jquery?
<p>I have two text input fields like so:</p> <pre><code>&lt;input type="text" id="test1".../&gt; &lt;input type="text" id="test2".../&gt; </code></pre> <p>Now I want the visitor to only be able to fill in only one of those text inputs. For example, if <code>#test1</code> has a value, when the visitor tries to enter a value into <code>#test2</code>, an alert a box should say "Fill in either test1 or test2 but not both".</p>
javascript jquery
[3, 5]
1,564,739
1,564,740
automatic scroll down on search
<p>I have a jsp page in which there are some contents which are hidden.</p> <p><code>onclick</code> of the search button I have displays much content.</p> <p>But I want an automatic scroll down so that user doen't have to take the burden to scroll down.</p> <p>I hope I was</p>
javascript jquery
[3, 5]
2,347,508
2,347,509
Repeater split after X returned results
<p>I have the following code that outputs a number of list items <code>&lt;li&gt;</code> wrapped within a <code>UL</code></p> <pre><code>&lt;asp:Repeater ID="RT_Footer" runat="server"&gt; &lt;HeaderTemplate&gt; &lt;ul class="ftr-links"&gt;&lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;li&gt;&lt;asp:HyperLink ID="HL_NAV" runat="server" NavigateUrl='&lt;%# DataBinder.Eval(Container.DataItem, "PageName") %&gt;' Text='&lt;%# DataBinder.Eval(Container.DataItem, "Title") %&gt;'&gt;&lt;/asp:HyperLink&gt;&lt;/li&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/ul&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>After 7 items are repeated id like to then wrap the next 7 within another UL, is this possible? </p> <p>Im not a .net developer and Ive been left with the website built by an existing developer. </p> <p>Any help would be greatly appreciated, thanks </p>
c# asp.net
[0, 9]
4,450,796
4,450,797
Including Jquery or similar files, should it be conditional?
<p>Simple and fast question:</p> <p>I need the jquery library for a site, so I access it in my header.php file as such:</p> <pre><code>&lt;head&gt; &lt;!-- include jQuery library --&gt; &lt;script type="text/javascript" src="../javascript/jquery.js"&gt;&lt;/script&gt; &lt;/head&gt; </code></pre> <p>Now my question is should I also be putting some other php scripting in there to make sure it is only included when I need it for a given page? My gut tells me I am absolutely right to only load the jquery files when I need them, yet I swear I always see things like this loaded without thought to if they are actually needed for the given situation. So perhaps there is no harm in always having it there.</p> <p>So should it be like this?? Pseudo code:</p> <pre><code>&lt;head&gt; &lt;?php //set jquery variable to true or false in configure.php file based on situation if($jquery){ //include the jquery script!! } else{ //jquery??? we don't need that here } ?&gt; &lt;/head&gt; </code></pre>
php javascript jquery
[2, 3, 5]
4,977,848
4,977,849
String Array doesn't show the expected value
<p>I have a String array initialized globally Like:</p> <pre><code>String[] links={""}; </code></pre> <p>in an onclick listener i m putting some values in it using a for loop</p> <pre><code>links = new String[Link.size()]; String[] news = new String[Catagory.size()]; for (int k = 0; k &lt; Catagory.size(); k++) { news[k] = Catagory.get(k).toString(); if (news[k].contentEquals("Android Apps")) { links[k] = Link.get(k).toString(); Toast.makeText(getApplicationContext(), links[k], Toast.LENGTH_LONG).show(); SHOW.add("Title:" + "\n" + Title.get(k) + "\n" + "Date:" + "\n" + PubDate.get(k).replace("+0000", "") + "\n" + "Content:" + "\n" + Content.get(k).replace("&lt;br/&gt;", "") + "\n"); Log.i("IF ELSE", Catagory.get(k)); } } </code></pre> <p>and its happening correctly. But when I call this array in onitemclick listener method then it shows Blank again:</p> <pre><code>public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { Toast.makeText(getApplicationContext(), links[position], Toast.LENGTH_LONG).show(); } </code></pre> <p>How can i get the array values that i had those in the onclick listener?</p>
java android
[1, 4]
1,682,933
1,682,934
Strange error while doing a multiplication in java?
<pre><code>public static int NUM_FRAMES = 8; public static int FRAME_REPEAT_NO = 2; int height = 24; //bitmap.getWidth() is 168 and bitmap.getHeight() is 91 double w = bitmap.getWidth(); w = w/NUM_FRAMES; w = w*FRAME_REPEAT_NO; w = w*height; w = w/bitmap.getHeight(); </code></pre> <p>I do this and i get the value of <code>w</code> as 11.07 which is correct.</p> <p>But when i do this:</p> <pre><code>double w = FRAME_REPEAT_NO*(bitmap.getWidth()/NUM_FRAMES)*(height/bitmap.getHeight()); </code></pre> <p>value of <code>w</code> is always 0;</p> <p>Can someone explain to me why this is happening?</p> <p>P.S. I'm doing it in an android app... </p>
java android
[1, 4]
2,957,158
2,957,159
How to check if a button is from certain layout?
<p>Let's say I have 2 layouts with two buttons in each. When I click one of them, and then the next one, is there a way I can check if they are from the same layout? And lets say I tagged layout's as android:tag="1" and android:tag="2". I want if they are from the same layout to do nothing, and if they aren't to do some action.</p>
java android
[1, 4]
610,675
610,676
How to write a table content to an xml?
<p>Can somebody tell me how can i write a clientside table control content to an xml on a button click . I'm using a clientside table "selectedTexts" and on save button click i need to save the table content to an xml. Please help.</p> <pre><code> $(document).ready(function() { $('#&lt;%=btnSave.ClientID %&gt;').click(function(event) { var xml = "&lt;schedule&gt;"; $("#selectedColumns").find("tr").each(function() { xml += "&lt;data&gt;"; xml += $(this).find("td").eq(1).html() + "\n"; xml += "&lt;/data&gt;"; }); xml += "&lt;/schedule&gt;"; this.isPrototypeOf( alert(xml); }) }); </code></pre> <p>I managed to get the string in an xml format. How can i pass this string to my codebehind so that i can write it to an xml file. Or is it any other methods available to write it from the clientside itself?</p>
javascript jquery asp.net
[3, 5, 9]
175,943
175,944
When emptying a tag, do the event-attached-buttons inside get garbage collected?
<p>Having a code like this, I'm wondering if I ran this function a second time, which scenario will happen:</p> <ol> <li>When emptying the #deals tag, all <code>btn</code> inside will get wiped as well despite the event on them and life is good.</li> <li>I have to unsubscribe from those <code>btn</code> first, otherwise emptying the <code>#deals</code> tag leads to a memory leak? </li> <li>List item</li> </ol> <p>Code:</p> <pre><code>function test(){ var row = $(this).closest('tr'); $(row).find('#deals').empty(); $(result).find('#tab li a').each(function() { var btn = $('&lt;a/&gt;', {class: 'btn', href: '#'}); $(row).find('#deals').append(btn); btn.click(function(event){ event.preventDefault(); ... }); }); } </code></pre>
javascript jquery
[3, 5]
2,096,461
2,096,462
.load a php page every 3 seconds with jquery
<p>Right now I have this jquery:</p> <pre><code>$(".updatetwo").click(function () { $('div.result').load('permissions.php); }); </code></pre> <p>I wanted to know, how could I .load the php every 3 seconds instead of on click?</p>
php jquery
[2, 5]
2,689,468
2,689,469
Iterate through repeater
<p>There's this repeater...</p> <pre><code> &lt;asp:Repeater ID="myRepeater" OnItemCommand="rpt1_ItemCommand" runat="server" OnItemDataBound="rpt1_OnItemDataBound"&gt; &lt;HeaderTemplate&gt; &lt;table width="99%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tr class="lgrey"&gt; &lt;td&gt;Default&lt;/td&gt; &lt;/tr&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:LinkButton ID="lnk1" Text="Make Default" CommandName="SetDefault" runat="server" Visible="True" CommandArgument='&lt;%#Eval("UserID") %&gt;' CausesValidation="false"&gt;&lt;/asp:LinkButton&gt; &lt;asp:Label ID="label1" Text="Yes" runat="server" Visible="False"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;FooterTemplate&gt; &lt;/table&gt; &lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>What I want is that when user clicks on any of the "lnk1" link button in the lsit that repeater renders, the link should be replaced with the label "label1"..ie when the user clicks on "Make Default" link, it should be replaced with "Yes" label</p> <p>Now when I click 2 link buttons, both get their label "Yes" displayed where as I want only one link button to display Yes ie the one which has been clciked and rest of the items should display "Make Default" link button only.</p> <p>ie Only ONE item should be displaying "Yes" label...now how do I iterate through the repeater items to set only ONE item as default and not multiple ??</p>
c# asp.net
[0, 9]
4,454,657
4,454,658
change VAT price with radio button using jquery and php without reloading
<p>I'm not sure if I am making this more complex then what it is... What I want to do: depending on which button the user presses $price should be calculated and displayed without the page beeing reloaded. The $price variable gets its data from a database. I cannot get this to work so if someone could help me would be fantastic, thanks linda</p> <p>my form</p> <pre><code>&lt;form id="f1" method="POST"&gt; &lt;label for="r1"&gt;Exkl. moms&lt;/label&gt;&lt;input type="radio" name="radio" value="exkl" checked="checked" id="r1"/&gt; &lt;label for="r2"&gt;Inkl. moms&lt;/label&gt;&lt;input type="radio" name="radio" value="inkl" id="r2"/&gt; &lt;/form&gt; &lt;div id="results"&gt;&lt;/div&gt; &lt;?php if(($_SESSION['user_info']['moms'])=="inkl"){ $price*1.25; } ?&gt; </code></pre> <p>jquery</p> <pre><code>function showValues() { var str = $("#f1").serialize(); $.ajax({ type: "POST", url: "momsTest2.php", data: str, success: function(html){ $('#results').html(html); } }); } $(":radio").change(showValues); showValues(); </code></pre> <p>momsTest2.php page</p> <pre><code>session_start(); $_SESSION['user_info']['moms'] = $_POST['radio']; </code></pre>
php jquery
[2, 5]
810,404
810,405
'or' statement in function call
<p>In a file I am looking at, I saw a <code>||</code> statement in a javascript function call what does it mean? </p> <pre><code>createObject(a_variable || b_variable) </code></pre> <p>Does the function take in a true/false value or it take in something else?</p> <p>is the above code equivalent to </p> <pre><code>createanotherObject(a_variable ? a_variable : b_variable) </code></pre> <p>Which I saw right next to it.</p>
javascript jquery
[3, 5]
623,611
623,612
ASP.NET security
<p>I'm currently converting our company database application from VB to ASP.NET. This is pretty much my first ASP.NET application, and I had a question about security. I would like some users to have the ability to add or edit data, while other users can only view and print reports. Now, as I understand it, in ASP.NET, I can use form-based authentication to restrict access to certain pages, but what I really would like to do is use the same web page for not only viewing the data, but also editing it (using a grid view). I don't see how I can do that using forms-based authentication without having separate (but similar) web pages in different folders, each with it's own level of security.</p> <p>I guess I could always use the same web page, then check the users roles to determine if I should enable the 'edit' button or not. Is that a good (and common) programming practice?</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,069,725
4,069,726
Jquery dialog to open multiple windows
<p>I'm trying to make system of multiple dialogs in one page using jquery dialog... </p> <p>Functions looks like... </p> <pre><code> function open_w(id){ $('.opened').dialog('close'); $(id).addClass('opened'); $(id).dialog({position: 'center', modal:true, width: '750px' }); }; function close_w(){ $('.opened').dialog('close'); $('.opened').removeClass('opened'); }; </code></pre> <p>As you see passing the ID opens me that windows, but before open close me old windows.. When i open it fist time everything is good.. But Next time it's doesn't want open</p> <p>Where is mistake?</p>
javascript jquery
[3, 5]
1,710,630
1,710,631
Javascript onKeyPress event not working?
<p>Why does this statement work with OnKeyPress event of Javascript in C#. </p> <pre><code> txtPassword.Attributes.Add("OnKeyUp", "CheckPasswordStrength(\"" + txtPassword.ClientID.ToString() + "\",\""+ lblMessage.ClientID.ToString() +"\")"); </code></pre> <p>this code is working correctly, my problem is that i want to run keypress event not keyup event</p>
c# asp.net javascript
[0, 9, 3]
2,484,043
2,484,044
how can i play vimeo player on image click?
<p>i have a situation i want to add a vimeo player in to my site,and above the player i need to show an image. when image is clicked i want vimeo player to play. till now i have done a little in which i managed to get vimeo player on page on image click.but now i need to mannually play it. any one tell me how i can autoplay it on image click? i have already done some code nd i am pasting it here</p> <pre><code>&lt;script type="text/javascript"&gt; function imgClick() { var video = '&lt;iframe src="http://player.vimeo.com/video/36302746?title=0&amp;amp;byline=0&amp;amp;portrait=0" width="400" height="225" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""&gt; &lt;/iframe&gt;'; document.getElementById("vPlayer").innerHTML = video; } &lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
1,578,070
1,578,071
How do I hide the ScrollView scrollbar faster than the default?
<p>How do I change the delay before the scrollbar on a ScrollView is hidden? I want it to hide instantly after scrolling. I tried android:scrollbarDefaultDelayBeforeFade="0" but it still sticks around and i have to either wait for it to disappear or click twice to click a button inside the ScrollView.</p>
java android
[1, 4]
1,862,174
1,862,175
How to trigger click event only for the clicked-on layer and not its parent too
<p><a href="http://jsfiddle.net/5xvkM/5/" rel="nofollow">Fiddle</a></p> <p>I can of course take the <code>.inner</code> layer out of <code>.main</code> layer and then use absolute position against another wrapper i.e <code>.outer</code> layer to place it in the same position and this will stop it from triggering <code>.main</code> click event. but I was wondering if there's an easier way to avoid having both click events fire if both child element and parent trigger a click event.</p>
javascript jquery
[3, 5]
1,526,446
1,526,447
Can I add my caching lines to global.asax?
<p>Take the following lines of code that would work fine in a c# asp.net file:</p> <pre><code>Response.Cache.SetExpires(DateTime.Now.AddSeconds(300)); Response.Cache.SetCacheability(HttpCacheability.Public); </code></pre> <p>Can I set these in some way in global.asax so that by default my entire application will support 300 second public caching?</p>
c# asp.net
[0, 9]
3,114,805
3,114,806
Android or Java class naming with $ symbol
<p>I'm reviewing a certain project and I see that there are many classes with the same name, but with a dollar ($) symbol at the end + increasing number. For example</p> <pre><code>Class.java Class$1.java Class$2.java Class$n.java OtherClass.java OtherClass$1.java OtherClass$n.java </code></pre> <p>What does it mean?</p>
java android
[1, 4]
3,905,776
3,905,777
display the images in publishing of website in server?
<p>I am using the following code for saving the images.</p> <pre><code> if (RadUploadPageImage.UploadedFiles.Count != 0) { foreach (UploadedFile file in RadUploadPageImage.UploadedFiles) { targetFolder = "/ADDS/"; targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension()); string folderpath = Server.MapPath(@targetFileName); while (File.Exists(folderpath)) { counter++; targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension()); break; } for (int i = 0; i &lt; RadUploadPageImage.AllowedFileExtensions.Length; i++) { if (file.GetExtension().ToString() == AllowedFileExtensions[i]) { file.SaveAs(this.Server.MapPath(targetFileName)); path = targetFileName; break; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "aa", "&lt;script&gt;alert('Image should be in .jpg, .jpeg, .png, .gif,.bmp,.tiff');break;&lt;/script&gt;", false); } } </code></pre> <p>images are not displaying while publishing. How to display the images while publish the site in server. Please tell me </p> <p>While running the code in my system i am able to displaying the uploaded images. In published path i am not able diplaying the uploaded images.</p> <p>Please tell me what is the wrong ?</p>
c# asp.net
[0, 9]
5,936,057
5,936,058
DropDownList Selected Item Incorrect When Using FindControl
<p>I have a number of dropdownlists embedded in a gridview. When I submit the page I loop through all the rows of the gridview and use the findcontrol method to get the dropdownlist e.g:</p> <pre><code>foreach (GridViewRow gvrItem in gvItems.Rows) { DropDownList ddlOption = gvrItem.Cells[2].FindControl("ddlOption") as DropDownList; } </code></pre> <p>This works nicely, however when I try to get the selected item of the dropdownlist e.g:</p> <pre><code>ddlOption .SelectedItem.Text </code></pre> <p>It always returns the first item in the list rather than whats actually selecte din the page. Any ideas what I'm doing wrong?</p>
c# asp.net
[0, 9]
5,248,626
5,248,627
Why does Android Activity move button after changing background?
<p>I have an Activity with the following image button:</p> <pre><code>&lt;ImageButton android:id="@+id/nextPage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/nextPageString" android:alignParentRight="True" android:alignParentBottom="True" android:onClick="NextPage" /&gt; </code></pre> <p>My Button appears in the bottom right corner of the screen as I would expect. </p> <p>When I click the button I change the background with the following code:</p> <pre><code>public void NextPage(View view){ Resources res = this.getResources(); Drawable d = res.getDrawable(R.drawable.nextBackgroundImage); view.setBackground(d); } </code></pre> <p>After I click the button the first time it displays my new background exactly as I want, however, it moves the image button to the center of the screen. Not sure why. I would like it to stay in the bottom right corner.</p>
java android
[1, 4]
3,962,812
3,962,813
How to display details of SQLite query in a ExpandableListView?
<p>I have stored the names and friends in database.</p> <p>For example ,</p> <pre><code>person A,and his friends B,C,D person Z,and his friends K,L,M person Q,and his friends P,O,N </code></pre> <p>How to retrieve values from database and display in a expandable listview.</p> <p>i,e.Person A,Z,Q should be the group names and corresponding friends should be the child Name ....</p> <p>Thanks in advance</p>
java android
[1, 4]
4,853,373
4,853,374
Reducing Output Page Size Perfomance Improvement asp.net
<p>I need to improve the speed of my website and perfomance.</p> <p>I've tried everything under the book from compression handling , whitespace removal , update panels and enable view state false.. but nothing seem to work.</p> <p>The output page size is still 764 kb.. which is quite a lot. So can you guys tell me an out of the box or any other way to approach this to decrease the output page size!</p>
c# asp.net
[0, 9]
2,788,783
2,788,784
How can I calculate the numbers of month between two dates in C#
<p>Now I am working with asp.net and C#<br> I would like to know how to calculate the numbers of Month between two dates.Is there any method to calculate it in C#.</p> <blockquote> <p>Eg1. Date1 = "2011/11/01"<br> Date2 = "2012/02/01"<br> Result. Numbers of Month =3 </p> </blockquote> <pre><code> Eg2. Date1 = "2012/01/31" Date2 = "2012/02/01" Result. Numbers of Month =1 Eg3. Date1 = "2012/01/01" Date2 = "2012/02/28" Result. Numbers of Month =1 </code></pre> <p>The result will strange .It doesn't take the days of the month into account. But I would like to get this result because of system requirement. </p> <p>With regards.</p>
c# asp.net
[0, 9]
971,963
971,964
How could i select folder or file from the asp.net web application?
<p>I have an ASP.NET web application and I need to put data from the web page to the output text file. I would like to give user an ability to select the folder where the file will be saved. For example, when the user clicks on the 'Browse' button the select folder dialog should appear.</p> <p>Is it possible to implement such thing in the asp.net web application?</p> <p>Thanks, </p> <p>Sergey</p>
c# asp.net
[0, 9]
1,053,537
1,053,538
Change value of a button when clicked
<p>I have a list of jokes that I want to display in a box. When the page is loaded I want to display one at random in the box. Then when I click the box I want it to change the value again to another random one from the list.</p> <p>At the moment I just cannot get it to work and can't work out where I am going wrong. I have the HTML as follows:</p> <pre><code>&lt;input class="box" type="button" value"" /&gt; &lt;ul&gt; &lt;li&gt;How much do pirates pay to get their ear pierced? &amp;lt;/br&amp;gt; A buck anear!&lt;/li&gt; &lt;li&gt;How do pirates talk to one another? &amp;lt;/br&amp;gt; Aye to aye!&lt;/li&gt; &lt;li&gt;What did the sea say to the pirate captain? &amp;lt;/br&amp;gt; Nothing, it justwaved!&lt;/li&gt; &lt;li&gt;What is a pirates favourite shop? &amp;lt;/br&amp;gt; Ar-gos!&lt;/li&gt; &lt;li&gt;When is it the best time for a pirate to buy a ship? &amp;lt;/br&amp;gt; Whenit is on sail!&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>The script is:</p> <pre><code> $(document).ready(function () { var list = $("ul li").toArray(); var elemlength = list.length; var randomnum = Math.floor(Math.random() * elemlength); var randomitem = list[randomnum]; $('.box').click(function () { $(this).val(randomitem); }); }); </code></pre> <p>Can someone please show me how to make the button have a value when the page is loaded and then change the value when the button is clicked.</p> <p>Fiddle: <a href="http://jsfiddle.net/uRd6N/98/" rel="nofollow">http://jsfiddle.net/uRd6N/98/</a></p>
javascript jquery
[3, 5]
996,419
996,420
How to check if number is a decimal?
<p>I create android app for dividing numbers.</p> <pre><code>int a,b; int result = a/b; if (result==decimal){ Log.v ("result","your result number is decimal") } else { Log.v ("result","your result number is not decimal") } </code></pre> <p>How can I check if <code>result</code> is a decimal?</p>
java android
[1, 4]
5,863,844
5,863,845
Using HttpModule instead of Global.asax
<p>How do I convert:</p> <pre><code>&lt;%@ Application Language="C#" %&gt; &lt;script runat="server"&gt; void Session_Start(object sender, EventArgs e) { } &lt;/script&gt; </code></pre> <p>To a scheme that uses HttpModule?</p> <p>Also, can I write the Global.asax as pure C# instead of using tags?</p>
c# asp.net
[0, 9]
3,060,040
3,060,041
Create a timer in asp.net Server side
<p>I have a asp.net web application , in that application I will call a function once that function s called , it has to wait for some time interval then execution should take place how to do that.......</p>
c# asp.net
[0, 9]
102,008
102,009
Control multiple-select box using a single select box using javascript
<pre><code>`&lt;select multiple="multiple" name="state[]" id="state"&gt; &lt;option value=""&gt;Select a State&lt;/option&gt; &lt;?php foreach($state_list as $key=&gt;$value){ echo "&lt;option value=\"$key\""; if($html['state']==$key|| $row['state']==$key){ echo ' selected="selected"'; } echo "&gt;$value&lt;/option&gt;\n"; }?&gt; &lt;/select&gt; &lt;/p&gt;` &lt;p&gt;Select A Country &lt;select name="country" id="country"&gt; &lt;option value="0"&gt;Select a Country&lt;/option&gt; &lt;option value="USA"&gt;USA&lt;/option&gt; &lt;option value="UK"&gt;UK&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; </code></pre> <p>I have two select boxes 1)state[] 2) country . What is want is that "If the selected country is not USA, disable the multi-select box which consists all the USA states". Any help is appreciated</p>
php javascript
[2, 3]
1,331,567
1,331,568
how to show popup box in windows mobile application?
<p>I am developing a windows mobile application in which i want to show popup box containing datagrid control of showing particular details when user clicks on a button in a form.</p> <p>i am using ShowDialog() method but it is working.</p> <p>can anyone suggest me how to implement this.</p> <p>thanks in advance.</p>
c# asp.net
[0, 9]
4,484,406
4,484,407
Put element under focus in jquery
<p>I want to put element under <code>focus</code> just after <code>append</code> it, means something similar to :</p> <pre><code>$("id").append($("elementid")).focus(); // not working </code></pre>
javascript jquery
[3, 5]
3,930,215
3,930,216
How to change the color of label depending on certain values in the gridview
<p>I have a sqldatasource and gridview.</p> <p>I have two columns:</p> <pre><code>ID | Status 1 Closed 2 Opened 3 Waiting </code></pre> <p>How to change the color of the label in the view state of the gridview depeding on the value from the <code>'status'</code> column. </p> <p>For example if the value in the cell is "<code>Closed</code>" the label color will be red , if it's <code>opened</code> then it will become green and so on.</p> <p>I've thought about looping through all cells of the <code>status</code> column and if the cell contains a certain value the color will change. ( in row data bound event ) . But I haven't done this because I don't find this idea as a good one because of the looping part.</p>
c# asp.net
[0, 9]
2,850,939
2,850,940
How to get Host IP address in android?
<p>Q:-Now a days I am facing problem in getting IP address of android device using programming. Can any one give ma a code for solving that problem. I have already read lot of thread about it but not getting solid answer from that. Please give me any suggesting about it its appreciated. Thanks in advance. </p>
java android
[1, 4]
4,777,422
4,777,423
How to validate if an HTMLLIElement is hidden with jQuery
<p>I'm iterating through a variable called content, it contains several HTMLLIElement objects. How can i use jQuery's or JavaScript's functions with this object?, what I'm trying to do is the kind of validation written in the commented code.</p> <pre><code> $.each(content, function(index, value){ //if(!value.is(':hidden')){ console.log(index + ' : ' + value); //} }); </code></pre> <p>What I'm getting is </p> <blockquote> <p>Uncaught TypeError: Object # has no method 'is'</p> </blockquote> <p>If I do <code>value.getAttribute('style');</code> I get <code>'display: none;'</code></p>
javascript jquery
[3, 5]
371,155
371,156
asp.net textbox search and replace
<p>In my ASP.NET C# application, within a TextBox control I would like to add search &amp; replace functionality for the content of this control.</p> <p>Functionality like match case, match whole word, replace all matches would be ideal.</p>
c# javascript asp.net
[0, 3, 9]
1,896,136
1,896,137
Showing and hiding in jquery
<p>How can I hide and show a div (and change the width of another div) using the same link,for example I can show A div and change its widht. How can I make it so that if the user clicks again, the width goes back to 600px and the right div is hidden.</p> <pre><code> $("a").click(function(event){ $('#main-content').width(800); $('#right').show('slow').slideDown('slow'); event.preventDefault(); }); </code></pre> <p><strong>EDIT:</strong> From All your replies, I've done this:</p> <pre><code> $(document).ready(function(){ $('#right').hide(); $('#main-content').width(600); $('#show-stats').toggle(function() { $('#main-content').width(800); $(this).text($(this).text() == 'Show' ? 'Hide' : 'Show'); $('#right').show('slow').slideDown('slow').fadeIn('slow'); event.preventDefault(); }, function() { $('#main-content').width(600); $(this).text($(this).text() == 'Hide' ? 'Show' : 'Hide'); $('#right').hide('slow').slideUp('slow').fadeOut('slow'); // change the text event.preventDefault(); }); }); </code></pre> <p>Will this break the internet? Is there a more elegant way or is this fine?</p>
php jquery
[2, 5]
187,669
187,670
First a tag created in a Javascript loop not implemented
<p>I am trying to populate a div (class='thumb") with thumnailpictures. The name of the pictures is gathered from an xml file. Every thumnail picture is encapsulated with an a-tag that points to a function to show the full picture.</p> <p>On some browsers the first thumbnailpicture seems not to have this a-tag...clicking on it gives no action...</p> <pre><code>var rubriek = gup('rubriek'), // rubriek is a parameter in the url of this page pointing a specific photogallery gallerij = rubriek + "gallery.xml", xmlDoc = loadXMLDoc(gallerij), x = xmlDoc.getElementsByTagName("filename"), legebron = x[0].childNodes[0].nodeValue; for (i = 0; i &lt; x.length; i++) { var beeldnummer = x[i].childNodes[0].nodeValue, index = i + 1, kleinbeeld = "/" + rubriek + "images/thumb/" + beeldnummer; $('.thumb').append('&lt;p&gt;&lt;a class="kleintje" onclick="toonDezeFoto(&amp;quot;' + beeldnummer + '&amp;quot;,' + index + ',' + x.length + ');"&gt; &lt;img src="' + kleinbeeld + '" id="' + index + '"&gt; &lt;/a&gt;&lt;/p&gt;'); } </code></pre> <p>See <a href="http://www.karinedaelman.be/foto.php?rubriek=Mensen/" rel="nofollow">http://www.karinedaelman.be/foto.php?rubriek=Mensen/</a> </p> <p>Found the solution: the z-index of the div that keeps the thumbnails was too low. Another div that has the site logo in it had a higher z-index and a width of 100%. Because of that the first thumbnail image was on a layer below the site logo and could not be accessed by the mouseevents....</p>
javascript jquery
[3, 5]
4,213,933
4,213,934
Converting Java date string to JavaScript date
<p>Is there any JavaScript library that takes Java's <code>SimpleDateFormat</code> pattern and parses a date/time string into a <code>Date</code> object?</p> <p>For example, given <code>"2010-12-20"</code> and <code>"yyyy-MM-dd"</code>, the function would parse <code>"2010-12-20"</code> and return a JavaScript <code>Date</code>.</p> <p>I noticed that jQuery UI's Date Picker can format and parse a date string, but it doesn't work with a time string.</p> <p>Thanks.</p>
java javascript
[1, 3]
53,702
53,703
How do I interpret. /glow.min.js?v=5
<p>Please tell me what does /glow.min.js?v=5 means How this is used? i.e How the versioning is done here as file is one.</p>
javascript jquery
[3, 5]
4,938,696
4,938,697
javascript functions doestnt work after using jquery
<p>I am using this jquery to have spell check on the textarea. Spell check works fine but after using jquery for spell check my other javascript functions are not working. Any idea why ? </p> <pre><code>&lt;script type="text/javascript"&gt; $Spelling.SpellCheckAsYouType('txt_comment1'); function showselected() { var input1 = document.getElementById('txt_comment1'); var startPos = input1.selectionStart; var endPos = input1.selectionEnd; var doc = document.selection; if (doc &amp;&amp; doc.createRange().text.length != 0) { alert(doc.createRange().text); } else if (!doc &amp;&amp; input1.value.substring(startPos, endPos).length != 0) { document.getElementById('txt_addwords').value = input1.value.substring(startPos, endPos); //alert(input1.value.substring(startPos, endPos)) } } &lt;/script&gt; &lt;asp:Button ID="cmd_submit_good" runat="server" Height="38px" OnClientClick="showselected();" onclick="cmd_submit_good_Click" Text="Good Word" Font-Bold="False" Font-Names="Arial" Font-Size="X-Small" Width="80px" /&gt; </code></pre>
javascript jquery asp.net
[3, 5, 9]
438,180
438,181
get text node of an element
<pre><code>&lt;div class="title"&gt; I am text node &lt;a class="edit"&gt;Edit&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I wish to get the "Iam text node" do not wish to remove the "edit" tag and need a cross browser solution. it might be something simple, but I can't think of another way of getting to it.</p>
javascript jquery
[3, 5]
5,264,435
5,264,436
How to pass the textbox text to href
<p>I have a simple text box, a button and an <code>a</code> element and I am trying to write a website URL and I need to pass this URL to <code>a</code> element.</p> <p>This is what I've got so far: </p> <pre><code>&lt;a id="weburl" href="http://jquery.com/"&gt;&lt;/a&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button"/&gt; </code></pre> <p>If I click the button I need to take the text from the textbox and I need to pass to the href tag, how can I do this?</p> <p>I am facing a problem still with this as shown below:</p> <p>1.If I mentioned the URL in the href tag And If I give another URL in the textbox and then If I click the button it is showing me the different URL's as shown below:</p> <p><img src="http://i.stack.imgur.com/Dsh7B.png" alt="enter image description here"></p> <p>2.And If I remove the URL and give some other URL in the textbox and clicks the button it is not showing me anything except a blank page.</p> <p>While debuggin I have seen that it is showing me the value of textbox what I gave and the URL I mentioned in the href tag as shown below:</p> <p><img src="http://i.stack.imgur.com/Io6RF.png" alt="enter image description here"></p> <p><img src="http://i.stack.imgur.com/uvPY4.png" alt="enter image description here"></p> <p>And I need both to be equal as I do not want the href to be mentioned in the href tag I want to do it programatically as james said.</p>
javascript jquery asp.net
[3, 5, 9]
2,601,013
2,601,014
Validate Control using javascript
<p>I have asp.net web application where controls are getting loaded dynamically on the web page. Lets say I have a comboBox in my aspx page and on value change event of the ComboBox I am doing Postback. ComboBox is having validator associated with it. Also there are other controls in the web page with validators.</p> <p>I want to validate the comboBox control before I do postback. I am using the following javascript to do so</p> <pre><code> function(s, e) { if (typeof (Page_ClientValidate) == 'function') { Page_ClientValidate(); if (!Page_IsValid) { return; } Callback.PerformCallback();LoadingPanel.SetText(settingCtlPropText); LoadingPanel.Show(); } else { Callback.PerformCallback();LoadingPanel.SetText(settingCtlPropText); LoadingPanel.Show(); } } </code></pre> <p>But this java script is validating the comboBox along with the other controls in the page. I want to validate ONLY comboBox and not other controls when any value chanded in the comboBox , before I do postback.</p> <p>How can I achieve this ??</p>
javascript asp.net
[3, 9]
5,958,394
5,958,395
Converting Decimal To Integer
<pre><code>string retval; retval = Decimal.ToInt32(1899.99M).ToString(); </code></pre> <p>the output is 1899. But i want to if decimal is bigger .5 then output is 1900 else then ouput is 1899. how can i do this? thanks in advance !</p>
c# asp.net
[0, 9]
2,516,584
2,516,585
Deleting file in asp.net using c#?
<p>When I save a document file in my solution explorer, I send that doc file through mail then I am wanting to delete the document file. It is giving an error like this: <code>process being used by another process</code>. </p> <p>Below please find my code:</p> <pre><code>protected void btnsubmit_Click(object sender, EventArgs e) { if (Label1.Text == txtverifytxt.Text) { if (rdoSevice.SelectedItem.Value == "1") { PackageType = ddlindPackages.SelectedItem.Text; } else if (rdoSevice.SelectedItem.Value == "2") { PackageType = ddlCorpPack.SelectedItem.Text; } if (ResumeUpload.PostedFile != null) { HttpPostedFile ulFile = ResumeUpload.PostedFile; string file = ulFile.FileName.ToString(); FileInfo fi = new FileInfo(file); string ext = fi.Extension.ToUpper(); if (ext == ".DOC" || ext == ".DOCX") { int nFileLen = ulFile.ContentLength; if (nFileLen &gt; 0) { strFileName = Path.GetFileName(ResumeUpload.PostedFile.FileName); strFileName = Page.MapPath("") + "\\Attachments\\" + strFileName; ResumeUpload.PostedFile.SaveAs(strFileName); } sendingmail(); FileInfo fi1 = new FileInfo(strFileName); ResumeUpload.FileContent.Dispose(); Label2.Visible = true; Label2.Text = "Request sent sucessfully"; fi1.Delete(); //if (File.Exists(strFileName)) //{ // File.Delete(strFileName); //} ClearAll(tblOrdernow); //Response.Redirect("CheckOut.aspx"); } else { Label2.Visible = true; Label2.Text = "Upload only word documents.."; } } else { Label2.Visible = true; Label2.Text = "Do not upload empty document.."; } } else { Label2.Visible = true; Label2.Text = "Verify Image not Matched"; Label1.Text = ran(); } } </code></pre>
c# asp.net
[0, 9]
2,471,401
2,471,402
How to compare Time in java/android (given input in strings)?
<p>I have two strings which are used to store time in the format <strong>hh:mm</strong>.I want to the compare these two to know which time is greater.Which is the easiest way to go about this?</p>
java android
[1, 4]
1,681,104
1,681,105
Trello staying updated?
<p>How does <a href="http://trello.com" rel="nofollow">trello.com</a> keep all the users screens updated with new information as it comes in?</p> <p>For example, if I change something on my screen, it automatically changes on all the other users screen who are also on that page...Are they just constantly refreshing the page or is their something else going on?</p>
javascript jquery
[3, 5]
2,499,662
2,499,663
ASP.NET and JavaScript dynamic show/hide based on other form fields
<p>I seem to keep running into these complex show/hide scenarios in ASP.NET web forms where the logic goes "if Field A equals blah, and Field B equals blahblah, then Field C is shown/hidden/validated/whatever." Before I run off and start building custom validators and custom controls so I can more easily manage it in markup or backend code, are there any libraries or simpler solutions I'm missing out there in the wild? jQuery makes the job easier, but I get the feeling I could abstract a lot of what I'm wrangling with out into a more elegant solution.</p> <p>All of the controls that are dependent on each other or could trigger events are my own custom controls already, so I get the feeling I could start writing a small framework to handle it like so:</p> <pre><code>&lt;my:DynamicShowHide runat="server"&gt; &lt;PrerequisiteFields&gt; &lt;PrerequisiteField ControlId="FieldA" Value="blah" /&gt; &lt;PrerequisiteField ControlId="FieldB" Value="blahblah" /&gt; &lt;/PrerequisiteFields&gt; &lt;DependentFields&gt; &lt;DependentField ControlId="FieldC" /&gt; &lt;/DependentFields&gt; &lt;/my:DynamicShowHide&gt; </code></pre> <p>...that way if the Prerequisite values were both evaluated as true, the DependentField would show, and hide if not.</p> <p>It seems (and feels) like I'm overengineering but I run into insanely large and complex decision trees like this more and more often. Anyone know of a better way or an existing library that does something along these lines?</p>
asp.net javascript jquery
[9, 3, 5]
3,878,539
3,878,540
Fragments Intercommunication
<p>I have three Tabs implemented by using ActionBar. Fragments are coded programatically. </p> <p>I want to set listener on Fragment2 (Tab2) so that when Fragment1 sends some data by callback (Custom listener), Fragment2 updates its content fields.</p> <p>I couldn't figure out a way to do it, would appreciate help.</p>
java android
[1, 4]
2,111,943
2,111,944
How to intercept opening sms message inbox?
<p>is it possible to intercept user opening sms message inbox. I would like to provide auth mechanism on that event so you can protect your sms inbox from being opened without permission.</p>
java android
[1, 4]
1,990,684
1,990,685
Jquery and IE 7 - selected property not working for multiple select boxes, even when options are selected
<p>I've a dropdown (multiple select). I choose a few values, they are highlighted correctly, but jQuery doesn't recognize them as selected. this works in firefox and chrome, doesn't work in IE. this is the code</p> <pre><code>$("#myBox" +" option").each(function() { if ($(this).attr("selected") == true) { // do something } } </code></pre>
javascript jquery
[3, 5]
3,014,412
3,014,413
search with dropdown filter?
<p>does anyone have an example of a javascript searchbox with a dropdown filter? so for example i'm looking to create a searchbox for my site and allow users to either search: "Current Category" or "Whole Site". I could create a combobox and place it next to the input box but i'm trying to see if there is a fancier js way of doing this.</p> <p><strong>EDIT:</strong> i don't think i explained very well what i'm looking for. So, I have an input box to perform searches on my site. What i'd like is to be able to narrow down this searches and make them more specific by providing a filter. So for example, i want the user to search for "John Doe", but before he must select whether he is going to search in the current category "blog posts" or "whole site".</p> <p><img src="http://i.stack.imgur.com/VNRwq.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
1,017,297
1,017,298
expectation failed in android during photo upload
<p>while uploading images to server, it gives me expectation failed error response code 417.</p> <p>My server side coding is in php, and client is android</p>
java php android
[1, 2, 4]
3,889,938
3,889,939
How to format the output of the javascript function date() ?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3552461/how-to-format-javascript-date">how to format javascript date</a> </p> </blockquote> <p>I have the following bit of code </p> <pre><code> $('#ins_date').attr('value', Date()); </code></pre> <p>What i get is this : Wed Mar 21 2012 17:52:32 GMT+0100 (Romance Standard Time)</p> <p>How could i format this string to get somethingh like this : 2012-03-01</p>
javascript jquery
[3, 5]
4,501,607
4,501,608
jquery.localize doesnt work
<p>i have followed instructions found on <a href="https://github.com/coderifous/jquery-localize" rel="nofollow">https://github.com/coderifous/jquery-localize</a>, and for testing purpose i have created this test file:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt; &lt;title&gt;Test&lt;/title&gt; &lt;script src="jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="jquery.localize.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p rel="localize[greeting]"&gt;some text&lt;/p&gt; &lt;script type="text/javascript" charset="utf-8"&gt; $(function(){ $("[rel*=localize]").localize("test", "en") }) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and test-en.json</p> <pre><code>{ "greeting": "welcome stranger.." } </code></pre> <p>locally it is working with IE8 and Firefox, but with chrome it is not working. what i get is an error in console log: XMLHttpRequest cannot load file:///C:/../test/examples/test-en.json. Origin null is not allowed by Access-Control-Allow-Origin.</p> <p>how can i set it up correctly? are they any incompqtibilites with jquery 1.6.. or web browsers?</p> <p>thanks</p>
javascript jquery
[3, 5]
4,803,870
4,803,871
IndexOutOfBounds with array
<p>Each time I try to run this method</p> <pre><code>private void resetOdds() { mOdds[1] = 0.10; mOdds[2] = 0.25; mOdds[3] = 0.35; mOdds[4] = 0.30; } </code></pre> <p>I get an IndexOutOfBounds error. I don't know why, as I supply enough items in the array to change:</p> <pre><code>private final double[] mOdds = { 0.10, 0.25, 0.30, 0.35 }; </code></pre> <p>Does anyone know why I'm getting this error?</p>
java android
[1, 4]
3,129,297
3,129,298
document.ready inside body tag
<p>I have a web app that has a universal HTML header include, so I'd like to put page-specific scripts in each page instead of having it load for everything. I tried putting <code>document.ready()</code> near the end of the <code>&lt;body&gt;</code> of a page and it seems to be working fine. Are there any potential hazards to putting it there instead of inside the <code>&lt;head&gt;</code>?</p>
javascript jquery
[3, 5]
5,731,752
5,731,753
How to convert the time format in android?
<p>I have the json response like this:</p> <pre><code>{ "Modification": [ { "lastModifiedTime": "1354024211735" } ] } </code></pre> <p>Now I want to convert the <strong>lastModifiedTime</strong> like this <strong>10 Dec 2012 18:41</strong> <em>(DD/MM/Year time)</em>. How I will to achieve this output in Java?</p>
java android
[1, 4]
384,387
384,388
Is it possible to detect a visitor's browsing history using JavaScript or PHP?
<p>I want to check if my site's visitors have visited another particular site before coming to mine.</p> <p>I know how to use JS and PHP to check to see (via referrer info) if the user has just come from that site to mine, but I would like to be able to detect if they have visited this site at any time before (not just immediately before coming to my site). Can this information be detected?</p>
php javascript
[2, 3]
1,871,874
1,871,875
inject jquery into every ASP.Net page
<p>Is there any way to inject JQuery into every page on an ASP.Net site without adding the script tag to every page individually?</p>
asp.net jquery
[9, 5]
787,676
787,677
Android get PID of other applications
<p>I would like to be able to start an activity or service and get the PID of that process as quickly as possible, immediately would be the best case scenario. Do I have any options other than browsing the /proc directory, which then leads to a variable-amount-of-time race condition between the time the activity/service is launched and the time it takes me to find what I want in the proc directory and begin observing?</p>
java android
[1, 4]
555,353
555,354
JQuery: How do I determine if a slideToggle has been toggled?
<p>How do I do the following pseudo code in JQuery?</p> <pre><code>$(document).ready(function(){ $(".btn-slide").click(function(){ $("#divToSlide").slideToggle("fast"); if ($(this).isToggled) { // &lt;---- DOESN'T WORK ------- // do something when toggled } else { // do something different when not toggled } }); }); </code></pre>
javascript jquery
[3, 5]
5,469,218
5,469,219
Disabling asp Controls using .attr does not work in FF & Chrome, Whereas it works with IE
<p>Here is what i am using to disable the controls on click of a button:</p> <pre><code>$('#cmdbtnreleaseOwner').attr('disabled', true); $('#cmdlnkbtnreleaseOwner').attr('disabled', true); </code></pre> <p>This disables the controls with respective ids in IE, but doesn't works with Mozilla FF and Chrome..</p> <p>Edit:</p> <p>Here is my Aspx code:</p> <pre><code>&lt;asp:ImageButton ID="cmdbtnreleaseOwner" ClientIDMode="Static" runat="server" ImageUrl="~/images/add-prospect.png" CommandName="Release" OnClientClick="return OnServiceOrderButtonClick();" /&gt; &lt;asp:LinkButton Text="Release OwnerShip" ClientIDMode="Static" runat="server" ID="cmdlnkbtnreleaseOwner" CommandName="Release" OnClientClick="return OnServiceOrderButtonClick();" /&gt; </code></pre> <p>HTML from Source :</p> <pre><code>&lt;input type="image" name="ctl00$ContentPlaceHolder1$ServiceOrderGridView$ctl00$ctl02$ctl00$cmdbtnreleaseOwner" id="cmdbtnreleaseOwner" src="../images/add-prospect.png" onclick="return OnServiceOrderButtonClick();" /&gt; &lt;p&gt; &lt;a onclick="return OnServiceOrderButtonClick();" id="cmdlnkbtnreleaseOwner" href="javascript:__doPostBack(&amp;#39;ctl00$ContentPlaceHolder1$ServiceOrderGridView$ctl00$ctl02$ctl00$cmdlnkbtnreleaseOwner&amp;#39;,&amp;#39;&amp;#39;)"&gt;Release OwnerShip&lt;/a&gt; &lt;/p&gt; </code></pre>
jquery asp.net
[5, 9]
870,526
870,527
jQuery resource for Win32 programmer
<p>I know programming in general but always been doing either Delphi, VB 6 or C#.net! Now I must do web-dev and must do it fast! I haven't written a hello world in JavaScript yet and must learn jQuery because there are some charts that I must show in my web-app and looks like I must know JavaScript and jQuery to do that.</p> <p>So I am looking for a jQuery resource that during its course or maybe at the first chapter gives us also a jump start on minimum JavaScript knowledge too. Some book or resource that I can hopefully sit and read through it in one day like 12 hours and after then learn enough to be able to use it and embed those darn charts and graphs into my web-app.</p> <p>What do you suggest ? </p>
javascript jquery
[3, 5]
5,581,804
5,581,805
Correct number is not being displayed in the textbox
<p>Problem:</p> <p>In the "Number of Answers" textbox, it should display the number 1, but it doesn't, it displays the number 2 and the reason it is displaying this number is that before the buttons changed, you selected 2 letter buttons, so it displays 2 in the textbox because you previously chose 2 letter buttons.</p> <p>Now this is happening because of this code: </p> <pre><code>$('.answertxt', context).val(context.find('.answerBtnsOn').length &gt; 0 ? context.find('.answerBtnsOn').length : '');, </code></pre> <p>in the <code>$('.gridBtns').on('click', function()</code> but I do need this code. </p> <p>The reason I need this code is because lets say there is 7 letter buttons "A-G" and you turn on all the letter buttons, the textbox would display number "7", but if I change my mind and I want to only display 5 letter buttons "A-E", then the textbox would change from "7" to "5" as now only 5 buttons are turned on. That is why I need this code.</p> <p>So my question is that if the user has clicked on the "Add" button, how can I get the number from the "Number of Answers" column within the row added be displayed in the textbox?</p> <p>Below is the code I have where it is suppose to display the number within the textbox when the "Add" button is clicked on but it is over written because of the <code>"$('#btn'+gridValues).trigger('click');"</code> and in that code is the </p> <pre><code>$('.answertxt', context).val(context.find('.answerBtnsOn').length &gt; 0 ? context.find('.answerBtnsOn').length : '');, </code></pre> <p>in the <code>$('.gridBtns').on('click', function()</code></p> <pre><code>function addwindow(numberAnswer, gridValues, btn) { $('#mainNumberAnswerTxt').val(numberAnswer); $('#btn'+gridValues).trigger('click'); } </code></pre>
javascript jquery
[3, 5]
1,393,211
1,393,212
JQuery checkbox state not working
<p>can anyone tell me why this line isnt working? (i'm trying to access the value property of a checkbox and write it into my variable or otherwise if its not checked an empty string)</p> <pre><code>var ri_ort = $('#ri_ort').attr('checked')?$('#ri_ort').val():''; </code></pre> <p>Thx a lot</p>
javascript jquery
[3, 5]
2,066,553
2,066,554
dynamic button inside dynamic literal control
<p>I want to add dynamic literal control and dynamic button.</p> <p>so I try like this:</p> <pre><code> Literal lit = new Literal(); lit.Text = lit.Text + theRow["CaseExampleDescription"].ToString() + "\n\n"; Button btn = new Button(); btn.ID = "btn1"; lit.Controls.Add(btn); </code></pre> <p>but there is error -System.Web.UI.WebControls.Literal' does not allow child controls.</p> <p>How can I solve this?</p>
c# asp.net
[0, 9]
4,631,161
4,631,162
How do I make my textview support telugu font?
<p>I fetched some data from JSON and added it into my Listview. It's fetching properly. But, in my listview some characters are not supported there? I'm using below code to decode from JSON.</p> <pre><code> BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8); </code></pre> <p>I'm getting the fonts but with wrong pronunciation as below. How do I correct this? <img src="http://i.stack.imgur.com/deUaJ.png" alt="Example"></p>
java android
[1, 4]
1,889,513
1,889,514
How do you get all the post request variables in C#?
<p>I am getting a post from an external vendor. I am not exactly sure what variables they are sending. How do I print out all the Request variables that they are sending in the post? there is no Request.Count or Request.Length so that I could loop and find everything.</p> <p>Thanks in advance for your help.</p>
c# asp.net
[0, 9]
11,868
11,869
How do I set maximum margin-top in jquery animation?
<p>I have the following code in jQuery, that animates a div marginTop. </p> <p>How do I set it so that once the margin top is equal 900px, disable the click event?</p> <pre><code>$("#tmbUp").click(function(){ $("#tmbHolder").animate({"marginTop": "-=100px"}, "slow"); }); $("#tmbDown").click(function(){ $("#tmbHolder").animate({"marginTop": "+=100px"}, "slow"); }); </code></pre>
javascript jquery
[3, 5]
1,757,802
1,757,803
jQuery/PHP - Resize an image with direct proportion
<p>Hi<br /> Suppose I have several image with different width and height, I want all of them to fit in the img tag with 200 width and 200 height and direct proportion(image won't be distortion).</p> <p>How can I do it in PHP or Jquery?</p> <p>Thanks</p>
php jquery
[2, 5]
1,603,567
1,603,568
JQuery / JavsScript mechanism to schedule methods
<p>I want to be able to invoke a specific method at specific times. For example.</p> <ul> <li>after 10 seconds</li> <li>after 20 seconds</li> <li>after 35 seconds</li> <li>after 50 seconds</li> <li>after 60 seconds</li> <li>after 65 seconds</li> </ul> <p>All times from the same starting point. I was looking at the JQuery Timer module but I don't think this will give it to me.</p> <p>What is the a good approach to do this in JavaScript / Jquery? Or any plugin available from a CDN.</p> <p>Thanks.</p>
javascript jquery
[3, 5]