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,418,726
3,418,727
place the text when we click the more button
<p>i write the following ,for displaying the text,when i click the more link,it has to show the remaining paragraph .i already tried,but i dont know why its not working,can any help to get of this .</p> <p>this is my following code</p> <pre><code> &lt;style&gt; p span { display:none; } &lt;/style&gt; &lt;script type="javascript"&gt; $('a').click(function() { $(this).next().show(); return false; }); &lt;/script&gt; &lt;table cellpadding:0px;cellspacing:0px;border=0px; width="100%"&gt; &lt;tr&gt; &lt;td style="width:20%"&gt;&lt;a&gt;&lt;button class="choosesub_but comingsoon"&gt; list&lt;/button&gt;&lt;/a&gt;&lt;/td&gt; &lt;td style="width:47%;"&gt;&lt;p style="font:13px verdana;"&gt;A written work—be it an essay or a story—is about an idea or concept. An essay explains it; a story narrates it.&lt;a href="#" style="text-decoration:underline;"&gt;More...&lt;/a&gt; &lt;span&gt;all to entertain the reader. All paragraphs support each other, leading the reader from the first idea to the final resolution of the written piece of work.&lt;/span&gt;&lt;/p&gt; &lt;/td&gt; &lt;td style="width:30%;"&gt;&lt;ul class="choosesub_ul"&gt;&lt;li&gt;&lt;a href="#"&gt;Community event&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>when i click the more link,it has to display the output as</p> <p>A written work—be it an essay or a story—is about an idea or concept. An essay explains it; a story narrates it.More...all to entertain the reader. All paragraphs support each other, leading the reader from the first idea to the final resolution of the written piece of work..</p>
javascript jquery
[3, 5]
1,736,158
1,736,159
When I clean my solution then dll missing error comes in my asp.net app
<p>I am developing an app in asp.net in which I have added a .dll file. When I clean the project and then build the project the .dll is missing in the reference. What is the solution?</p>
c# asp.net
[0, 9]
4,353,085
4,353,086
change background color of div with jquery that has an !important tag
<p>Using a plugin that calls a .jsp that uses its own stylesheet hosted externally (it's a yelp embed - trying to manipulate the look of it). The one element I'm trying to change has an !important tag on it, and I can't seem to change it...</p> <p>I tried</p> <pre><code>&lt;script type="text/javascript"&gt; $('.elementToChange').css({'background-color':'black'});​ &lt;/script&gt; </code></pre> <p>to no avail. Ideas?</p>
javascript jquery
[3, 5]
4,952,158
4,952,159
using c# variable in javascript
<p>I want to know how can I use a C# variable in javascript?</p>
c# javascript
[0, 3]
3,388,837
3,388,838
How to know when an input has changed its class
<p>I have function which is removing and adding class into input tag, i want to when we add or remove class then one function should alert that you have made changes.</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript"&gt; $(function() { $('a').click(function() { $('input').removeClass() var cl = $(this).attr('class') $('input').addClass(cl) }) }) function activitydone() { alert('class change') } &lt;/script&gt; &lt;style&gt; .first { border:solid 1px #F00 } .second { border:solid 1px #0F0 } .third { border:solid 1px #00F } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" onchange="activitydone()" /&gt; &lt;a href="#" class="first"&gt;first&lt;/a&gt; &lt;a href="#" class="second"&gt;second&lt;/a&gt; &lt;a href="#" class="third"&gt;third&lt;/a&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
1,740,178
1,740,179
JQuery missing : after property ID
<p>So I am working with some jquery code to do a simple hide of a p and a show of a p. I am simple adding a class called showp and showing it while making sure the others are not shown by hiding them first. But I keep getting an error missing : after property ID. Any help would be greatly appreciated.</p> <pre><code> $(document).ready({ $("#phone").click(function(){ $(".hide2").addClass(".hide2").hide("slow"); $(".hide3").addClass(".hide3").hide("slow"); $(".hide1").addClass("showp").show("slow"); }); }); </code></pre>
javascript jquery
[3, 5]
5,472,110
5,472,111
How to get the ID of a div when using bind() in jQuery?
<p>Let's say I have the following <code>div</code>.</p> <pre><code>&lt;div id="123" class="abc"&gt;Foobar&lt;/div&gt; </code></pre> <p>I know I can do this to trigger a function when this <code>div</code> is moused-over:</p> <pre><code>$(".abc").bind({ mouseenter : SomeFunction(id) }); </code></pre> <p>With this, before <code>SomeFunction</code> runs, I want to be able to extract out the id of this <code>div</code>, which is "123", and pass it though as a parameter to <code>SomeFunction</code> for it to handle. Could I do that?</p>
javascript jquery
[3, 5]
505,979
505,980
how to split image into multiple pices and join them as requested by user
<p>I am trying to load a large image <strong>( size > 80 MB)</strong> into web page. User doesn't really need to see the whole image at once and only need to see the requested portion. </p> <p>The dimensions of the image are approx <strong>10k x 10k</strong>.</p> <p>I looked around a little bit but couldn't found a reasonable solution to the problem.</p> <p>I would like to split the image into some amount of pieces as needed (for ex 9 pieces, 3k x 3k each) and load them into the page as user request or moves into next section of the image (ex. if user crosses <strong>3k x 3k</strong> boundary, server will send side or bottom piece as needed). </p> <p>I did found ways how to split image but couldn't find a way to do that dynamically and sew them together dynamically.</p> <p><strong>UPDATE</strong></p> <p>I tried using <strong>Microsoft Deep Zoom Composer</strong> but it didn't work. I think it does not support such large image size. I came to that conclusion as I tried the same image in <strong>Microsoft PhotoSynth</strong> and got an error message that it only supports files up to <strong>32MB</strong>. <strong>Deep Zoom Composer</strong> and <strong>Photo Synth</strong> use same file format so I think they might have same file size constraints.</p> <p>Deep zoom Composer didn't produced meaningful error message as the error message was, <strong>file format is not right</strong>, but file is in right format (i.e. jpg). Thanks</p>
c# asp.net
[0, 9]
607,896
607,897
which file is the js error in and how to correct it?
<p><img src="http://i.stack.imgur.com/nR9et.jpg" alt="enter image description here"></p> <pre><code>http://www.idcspy.com/asp-hosting.html </code></pre> <p>when loads over the page , at the bottom of the IE broswer window. it shows an alert(the page has an error), it's an javascript error.but i don't know which js file has the error in and how to correct it. thank you, </p>
javascript jquery
[3, 5]
1,152,447
1,152,448
String equality returning false when strings are equal
<p>I have an anchor element :</p> <pre><code>&lt;a id="buyBtn" href="#" alt="Purchase" title="Buy now" data-enabled="true"&gt; </code></pre> <p>When it is clicked, I'm doing this:</p> <pre><code>enabled = $(this).data('enabled') == "true"; console.log(enabled); </code></pre> <p>However, the console shows <code>false</code>. I was initially using <code>===</code> but that was giving false, so I moved to <code>==</code>. </p>
javascript jquery
[3, 5]
5,932,176
5,932,177
Is it possible to have the menu link color change on the table hover for an asp.net menu control?
<p>I'm using an ASP.net menu and when i hover inside my menu item's table, i change the background color on the table column, but unless i hover over the link text itself, the link text color will not change.</p> <p>Is it possible to have the link text color changed on the table hover?</p> <p>Example below shows what happens.</p> <p><img src="http://i.stack.imgur.com/r5AoI.jpg" alt="example of issue"></p> <p>Excuse the ugly CSS:</p> <pre><code>.TopStaticSelectedStyle { cursor: pointer; font-size: 11px; font-family: Verdana; } .TopStaticMenuStyle a, .TopStaticMenuStyle a:visited, .TopStaticMenuStyle a:active { color: #ffffff; text-decoration: none; font-weight: bold; font-family: Verdana; } .TopStaticMenuStyle a:hover { color: #000000; text-decoration: none; font-size: 11px; font-weight: bold; font-family: Verdana; } .TopStaticMenuItemStyle td { padding: 0px 12px 0px 12px; text-align: center; background-color: #6c85b0; height: 18px; border-top: solid 1px #012754; border-bottom: solid 1px #012754; border-left: solid 1px #012754; border-collapse:collapse; } .TopStaticHoverStyle { font-weight: normal; font-family: Verdana; } .TopStaticHoverStyle td { padding: 0px 12px 0px 12px; text-align: center; background-color: #ffffff; height: 18px; border-top: solid 1px #012754; border-bottom: solid 1px #012754; border-left: solid 1px #012754; border-collapse:collapse; color: #000000; } </code></pre>
c# asp.net
[0, 9]
3,542,609
3,542,610
How to bind function on different butons?
<p>I tried to bind alert on my buttons:</p> <pre><code>for(var i=1; i&lt;=3; i++){ $('#' + i).live('click', function(){ alert(i); }); }; </code></pre> <p>It is my html code:</p> <pre><code>&lt;input id="1" type="button" value="one"&gt; &lt;input id="2" type="button" value="two"&gt; &lt;input id="3" type="button" value="three"&gt; </code></pre> <p>But I get 4 on all buttons. How to fix it to get correctly alert values? (1, 2, 3 and etc..)</p> <p><a href="http://jsfiddle.net/sergey1986/UFjsM/" rel="nofollow">http://jsfiddle.net/sergey1986/UFjsM/</a></p>
javascript jquery
[3, 5]
2,848,003
2,848,004
Why does Repeater.ItemDataBound - Event not trigger anything?
<p>I do register a method for the <code>ItemDataBound</code> - Event like this:</p> <pre><code>protected void Page_Init(object sender, System.EventArgs e) { MyRepeater.ItemDataBound += MyRepeater_ItemDataBound; // ... } protected void MyRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { // ... } </code></pre> <p>Like this, nothing is triggered, the method is never executed. When I register the method in code-before like</p> <pre><code>&lt;asp:Repeater ID="MyRepeater" runat="server" OnItemDataBound="MyRepeater_ItemDataBound"&gt; </code></pre> <p>it does work. Why doesn't the former version work?</p> <p>Thx for any tipps sl3dg3</p>
c# asp.net
[0, 9]
1,762,381
1,762,382
What is the easiest way to display a table of data?
<p>Coming from PHP background. What would be the easiest (best?) way to display a table of data populated in C#? The format of the data could be modified as required, right now, I am thinking 2D list to store the data.</p> <p>Gridview is nice and all but I haven't found a way to use a C# List as it's data source.</p> <p>No real feature is required. I can implement my own editor / inserter, etc.</p>
c# asp.net
[0, 9]
4,411,136
4,411,137
User login to information on query string
<p>I have a list of clubs that when a user clicks on one of the clubs it loads a query string. This then pulls the data relating to that club.</p> <p>I need to set up a users so they can login and edit the information under that account. At the moment i am unsure of how i would set this up for a user.</p> <p>The url that i have created looks like the following clubpage.aspx?CategoryID=6</p> <p>So a user that added under category id6 could log on to catergory 6 and edit the information.</p>
c# asp.net
[0, 9]
4,795,141
4,795,142
Access gridview as property from usercontrol
<p>I have gridview bind in user control and want to access that gridview from user control in page and use export to excel.</p> <p>I created property in usercontrol to access but I am not able to access it.</p> <p>How can I access gridview from usercontrol in my page?</p>
c# asp.net
[0, 9]
4,828,733
4,828,734
Output markup & controls dependent on result of Javascript function
<p>I have an ASP.NET page which includes markup and 3rd party controls (in this particular case Telerik controls) e.g. </p> <pre><code>&lt;h1&gt;Hello&lt;/h1&gt; &lt;telerik:RadToolBar ID="toolbarCAD" runat="server" Skin="Web20" Height="30px" Width="300px" OnClientButtonClicked="OnClientButtonClicked"&gt; &lt;Items&gt; &lt;telerik:RadToolBarButton runat="server" Text="Zoom In" ImageUrl="~/images/zoom_in.png" Value="cadZoomIn"&gt; &lt;/telerik:RadToolBarButton&gt; &lt;/Items&gt; &lt;/telerik:RadToolBar&gt; </code></pre> <p>I only want to display this if an ActiveX control is installed. From another question I have a Javascript function (ActiveXOrNull) which successfully detects this so now I have replaced the above in my markup with:</p> <pre><code>&lt;script type="text/javascript"&gt; var obj = ActiveXOrNull('CADViewX'); if (obj == null) { WHAT DO I DO HERE } &lt;/script&gt; </code></pre> <p>How do I include the original markup in the Javascript function? Can I "include" another page or is there another method available?</p>
javascript asp.net
[3, 9]
225,001
225,002
How to synchronize jQuery dialog box to act like alert() of Javascript
<p>I am currently working on developing custom dialog box to be used with my application using jQuery. The problem is that the call to create dialog is asynchronous i.e. the line of code after it is executed before it is displayed. Here is what I have done, I have created a function DisplayConfirm() which when called creates a modal dialog. I want to use it like the following:</p> <pre><code>if(DisplayConfirm()){ //do this else // do that </code></pre> <p>But I cannot because the line of code written after DisplayConfirm() is executed before the dialog is even created. How can I synchronize this operation so that I don't have to use callback functions?</p>
javascript jquery
[3, 5]
520,492
520,493
Is it considered Bad Idea to Edit the orginal JQuery File?
<p>We have Tabs-Menu controls which rely on jQuery library and the dev-manager insist that i should get the functions that controls are using into a separate java-script file so we don't have to reference/rely on the whole jQuery, so it made me wonder.. is it a bad idea to edit the jQuery files ?</p>
javascript jquery
[3, 5]
64,796
64,797
How to use more than one Operator in an If Statement using C#
<p>I want to use multiple operators like =, >, &amp;&amp; in my if statement. I only want to send the email when this condition is true if (strAuthReqDate == null &amp;&amp; strDate &lt; strExpectedSubDate). So i think my "less than operator" is wrong pls let me know what i am doing wrong here. thanks</p> <p>Here is my code:</p> <pre><code>foreach (GridViewRow gr in GridView1.Rows) { CheckBox cb = (CheckBox)gr.FindControl("chkItem"); if (cb.Checked) { // string strID = gr.Cells[0].Text; string strExpectedSubDate = gr.Cells[3].Text; string strAuthReqDate = gr.Cells[8].Text; string strDate = Convert.ToString(System.DateTime.Now); if (strAuthReqDate == null &amp;&amp; strDate &lt; strExpectedSubDate) { send email(); } } } </code></pre>
c# asp.net
[0, 9]
3,983,768
3,983,769
Find grid control inside grid without its rowbound event
<p>I have a grid of list of companies &amp; below its branches(subgrid within company grid). I have checkbox for each binding with their id's(Companyid &amp; branchid).I have one button to add those selcted values from either company or branch &amp; show all selected record in another grid.Add button is outside of gridview so on click of add button i have to find branch gridview here i can find its parent grid.I wrote following code to find control inside onclick event of add button but its not finding that control:</p> <blockquote> <p><code>GridView gvbranch= (GridView)gvcompany.FindControl("gvbranch");</code></p> </blockquote> <p>So please help me how i can find that child control in add click event? Thanks</p>
c# asp.net
[0, 9]
4,004,866
4,004,867
clear all ASP label fields
<p>I am trying to clear all the fields in my .aspx page using javascript (<em>Should be cross-browser</em>). The below code is working fine for <code>TextBox</code> fields but not for <code>Label</code> fields.</p> <pre><code>var elements = document.getElementsByTagName("input"); for (var i = 0; i &lt; elements.length; i++) { if (elements[i].type == "text") { elements[i].value = ""; } else if (elements[i].type == "label") { elements[i].value = ""; } } </code></pre> <p>Later I saw that HTML is rendering asp.net Labels as <code>span</code> so I also tried:</p> <pre><code>else if (elements[i].type == "span") { elements[i].innerHTML = ""; } </code></pre> <p>Still the Labels are not being cleared. Am I doing something wrong here?</p> <p>And the other problem is, whenever I refresh the page, the cleared <code>TextBox</code> fields are again being populated with the old values.. (really frustrating)</p> <p>I am trying the above code by referring <strong><a href="http://stackoverflow.com/q/569357/1577396">this</a></strong></p> <p>Please help.</p>
javascript asp.net
[3, 9]
2,054,096
2,054,097
jquery, c# and server side data validation
<p>Ive been using jquery to post data and was wondering how best to perform serverside validation on the data. I check the values clientside but know its good practice to also check serverside. Ive seached online but cant really find any examples.</p> <p>Thanks in advance</p>
c# asp.net jquery
[0, 9, 5]
878,554
878,555
About binding record to gridview from 2 tables in asp.net c#
<p>I have one gridview. I have one table(source) that contains fields like sourceid, name and another table(target) that contains fields like targetid, from, to,date. In that target table from &amp; to fields are ids refer to source table's sourceid's. So i have to bind record of target table i.e to bind fields : from - here name should come respect to that source id from source table to - here name should come respect to that source id from source table date should come from target table.</p> <p>How i can do this? Asp.net c#</p> <p>Thank you.</p>
c# asp.net
[0, 9]
1,332,968
1,332,969
Android out of memory after first application run?
<p>I have an application that will run fine the first time it is ran. Now if I leave the application and force stop it in manage applications and come back in it will crash with OutOfMemory. Why would it work the first time and run out of memory on subsequent calls?</p>
java android
[1, 4]
1,452,901
1,452,902
Fails to read InputStream
<p>I'm using the following code to read <code>InputStream</code> from <code>Runtime.Exec()</code>.</p> <p><strong>CODE :</strong></p> <pre><code>private String inputstreamReader(String[] shellinput) { InputStream inputstream = null; String isrval = null; System.out.println("Entering inputstreamReader"); try { inputstream = Runtime.getRuntime().exec(shellinput) .getInputStream(); System.out.println("Tried getRuntime().exec :: "+inputstream.read()); } catch (IOException e) { System.out.println("Failed getRuntime().exec"); e.printStackTrace(); } InputStreamReader inputstreamreader = new InputStreamReader(inputstream); try { isrval = new BufferedReader(inputstreamreader).readLine(); } catch (IOException e1) { e1.printStackTrace(); } System.out.println("TEMPfile is "+isrval); return isrval; } </code></pre> <p>But it returns :</p> <p><strong>STACKTRACE :</strong></p> <pre><code>02-28 19:34:20.663: I/System.out(20892): Entering inputstreamReader 02-28 19:34:20.694: I/System.out(20892): Tried getRuntime().exec :: -1 02-28 19:34:20.694: I/System.out(20892): TEMPfile is null </code></pre> <p>Any idea why this happens?</p>
java android
[1, 4]
3,917,479
3,917,480
C# equivalent to Java resource
<p>Is there an online resource or database that allows looking up the C# equivalent to a Java class and vice versa?</p> <p>I have been porting code and have been Googling individual classes one at a time; it gets a little tedious. 8^j</p> <p>Cheers</p>
c# java
[0, 1]
2,537,746
2,537,747
Ajax loads new button, do I need to load a new selector?
<p>Let's say that I'm coding a message system for example. Users can add messages (via AJAX) and next to their messages they've got some buttons. (Edit, Remove, ...)</p> <p>By loading the page, a few messages are loaded.</p> <pre><code>&lt;div class="message"&gt; &lt;p&gt;blaat&lt;/p&gt; &lt;a href="#" class="btnRemove"&gt;Remove&lt;/a&gt; &lt;/div&gt; &lt;div class="message"&gt; &lt;p&gt;blaat&lt;/p&gt; &lt;a href="#" class="btnRemove"&gt;Remove&lt;/a&gt; &lt;/div&gt; </code></pre> <p>The jQuery selector knows these elements. Because they already exist when I execute the jQuery script. (document.ready) But when I add another "message", jQuery can't handle the 'remove' link because it's loaded after running the jQuery script.</p> <p>Can somebody help me out? Thanks in advance!</p>
javascript jquery
[3, 5]
5,240,887
5,240,888
How come this jQuery script will not highlight the first child in my list?
<pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"&gt;&lt;/script&gt; &lt;style&gt; .emphasis { font-weight: bold; } &lt;/style&gt; &lt;script&gt; $(function() { $('li:first-child').addClass('emphasis'); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;ul&gt; &lt;li&gt;hello&lt;/li&gt; &lt;li&gt;hello2&lt;/li&gt; &lt;li&gt;hello3&lt;/li&gt; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I'm following a tutorial: <a href="http://tutsplus.com/lesson/not-so-fast-jquery/?WT.mc_id=learnjquery" rel="nofollow">http://tutsplus.com/lesson/not-so-fast-jquery/?WT.mc_id=learnjquery</a></p> <p>This code is exactly what he has near the end, yet it does not work for me. Any reason why?</p>
javascript jquery
[3, 5]
1,282,239
1,282,240
Javascript IndexOf with integers in string not working
<p>Can anyone tell me why does this not work for integers but works for characters? I really hate reg expressions since they are cryptic but will if I have too. Also I want to include the "-()" as well in the valid characters.</p> <pre><code>String.prototype.Contains = function (str) { return this.indexOf(str) != -1; }; var validChars = '0123456789'; var str = $("#textbox1").val().toString(); if (str.Contains(validChars)) { alert("found"); } else { alert("not found"); } </code></pre>
javascript jquery
[3, 5]
2,472,368
2,472,369
How to select child from parent by class starting with $(this)
<p>I'm creating a custom jQuery plugin to add a few images above an input box. The highlight class are working perfectly, but I need help with the selectors on the .toggle() for showing and hiding the INPUTBANNER class. </p> <pre><code>jQuery.fn.inputmenu = function() { function createInputMenu(node) { $(node).bind('focus', function() { $(this).parent().toggleClass('highlight'); //SHOW INPUTBANNER CLASS $(this).parent().('.inputbanner').toggle(); }); $(node).bind('blur', function() { $(this).parent().toggleClass('highlight'); //HIDE INPUTBANNER CLASS $(this).parent().('.inputbanner').toggle(); }); $(node).parent().append('&lt;div class="inputbanner"&gt;some images here&lt;/div&gt;'); } return this.each(function() { createInputMenu(this); }); }; </code></pre>
javascript jquery
[3, 5]
5,220,010
5,220,011
ASP.Net How do I execute a dynamic JavaScript and prevent a postback
<p>I have and ASP button and 2 Labels.</p> <pre><code>&lt;asp:Button runat="server" ID="btnHide" /&gt; &lt;asp:Label runat="server" ID="lblName"&gt;&lt;/asp:Label&gt; &lt;asp:Label runat="server" ID="lblPosition"&gt;&lt;/asp:Label&gt; </code></pre> <p>I have created a dynamic JS script.</p> <pre><code>string jsbtnHide = @"document.getElementByID('" + lblName.ClientID + @"').value = ''; document.getElementByID('" + lblPosition.ClientID + @"').style.display = 'none';"; </code></pre> <p>I assign the script to the button. I've tried both "OnClick" and "OnClientClick".</p> <pre><code>btnHide.Attributes.Add("OnClick", jsbtnHide); </code></pre> <p>However I cannot get the script to execute successfully and without a postback. I've tried adding OnClientClick="return false;" both dynamically and to the ascx file. Dynamically seems to be ignored, though it appears correct in FireBug. OnClick doesn't seem to prevent the Postback. When the script does run, lblName doesn't change to '', haven't got this to work once.</p> <p>What am I doing wrong? I've been at this for days :(</p>
c# javascript asp.net
[0, 3, 9]
3,755,066
3,755,067
JavaScript Best Practices: where should I include my JavaScript?
<p>I am building a website using PHP and JavaScript, and I feel that I have a good grasp on where to include my JavaScript, but a more specific situation has come up that has me confused. I currently have all of my JavaScript in one external file, which is being included on every PHP page.</p> <p>Let's say that I have a paragraph with an id='myParagraph' and I need to highlight this paragraph in red with JavaScript on page load. This paragraph is only on ONE PHP page and my website has about 50 different pages. I immediately assumed that I should throw some code into my one external JavaScript file, something like:</p> <pre><code>$('#myParagraph').css('color', 'red') </code></pre> <p>and the paragraph would be highlighted when that page loads.</p> <p>My question is: is this the best way to do it? To my understanding, every time I load a page it will be searched for an element with the id myParagraph, yet 98% of my pages won't even have that id. Is this wasteful? Should I instead include the following code:</p> <pre><code>function highlightParagraph() { $('#myParagraph').css('color', 'red') } </code></pre> <p>in my one JavaScript file and then put some inline JavaScript in the PHP file with the id myParagraph to call the function highlightParagraph() when it's loaded? That way, only the one page with myParagraph will be searched and highlighted.</p> <p>I feel like option 2 is the best, but I read all the time not to use inline JavaScript.</p> <p>edit: I realize that for this example you would just use CSS. I'm just using it to get my question across</p>
javascript jquery
[3, 5]
3,532,878
3,532,879
JQuery Order list by field and add to divider div
<p>I am trying to get listing organized by a field called letter.</p> <p>So the fields are:</p> <p>id, name, letter.</p> <p>for example:</p> <h2>id name letter</h2> <p>1 list1 a 2 list2 a 3 list3 b</p> <p>To list1 and list2 are added after id="a" and list3 is added after id="b"</p> <p>Here is a json data sample:</p> <pre><code>{"id":[{"id":"1","name":"list1","letter":"a"},{"id":"2","name":"list2","letter":"b"}]} </code></pre> <p>The code below adds the contents to the listview but I need to go a step further and add then to their own place.</p> <p>For example all listings with the letter "a" are added after the A</li> etc</p> <p>Here is the code: </p> <pre><code>$.getJSON("list.json", function(data){ var output = ''; $.each(data.id, function(index, value){ output += '&lt;li&gt;&lt;h1&gt;' + value.name + '&lt;/h1&gt;&lt;/li&gt;'; }); $('#listview').html(output).listview('refresh'); }).error(function(args) { console.log(args); }); &lt;ul id="listview"&gt; &lt;li id="a"&gt;A&lt;/li&gt; &lt;!--Listings with letter A go here--&gt; &lt;li id="b"&gt;B&lt;/li&gt; &lt;!--Listings with letter B go here--&gt; &lt;li id="c"&gt;C&lt;/li&gt; &lt;!--Listings with letter C go here--&gt; &lt;/ul&gt; </code></pre> <p>How can I get the listings for be added to its place?</p>
javascript jquery
[3, 5]
5,378,199
5,378,200
Where to store data in order to avoid database hitting?
<p>I am using webmethod which fetches data from database &amp; storing it in a static variable so that next time it will not hit the database becoz the data is being accessed frequently. Creating static variable doesn't seem to be a proper solution what is an alernative to this scenario.</p> <p>e.g</p> <pre><code>public static List&lt;SupplierGridData&gt; lstFullSupplierData; public static List&lt;SupplierGridData&gt; GetProductData() { if (lstFullSupplierData == null) { //first time get data from database lstFullSupplierData = new List&lt;SupplierGridData&gt;(); lstFullSupplierData = new POProcess().GetInquiryDetails(); } else { //use lstFullSupplierData which holds data } } </code></pre>
c# asp.net
[0, 9]
3,008,077
3,008,078
How well can the android handle incoming UDP bursts?
<p>I hope this is alright for SO. It is programming related in the design and requirements spectrum. </p> <p>I am designing an application but unsure how well the Android can handle the demands. I will require the device to accept a burst of small-ish UDP packets in rapid succession. Is that acceptable, or is it preferred to accept fewer, larger packets? </p> <p>Also, can a user use an application that requires wireless and talk on the phone without cutting off the wireless? I can't seem to get a straight answer for this problem. It seems to be carrier and model dependent. </p> <p>Thanks</p>
java android
[1, 4]
5,479,894
5,479,895
How can I pass the value of an input in a href
<p>I'm trying to pass the LoadNumber into a php file to use in a query and result in a FPDF on a button click. the button works but the value its passing is $(' not the value I wanted. Where am I going wrong. Here is my code.</p> <pre><code>$(location.href="dispatch.php? LoadNumber=$('#LoadNumber').val()")}; </code></pre>
javascript jquery
[3, 5]
480,304
480,305
Get link name in javascript
<p>Example</p> <pre><code>&lt;a href="example.html"&gt;Example Name&lt;/a&gt; </code></pre> <p>I would like to get "Example Name"</p> <p>I know I can do this with regex, but I'm looking for a simpler, faster approach. The closest I came was with Jquery using the <code>.attr("href")</code> attribute. I tried putting <code>.attr("title")</code>, but that doesn't work since I technically don't have a title there. </p>
javascript jquery
[3, 5]
3,525,932
3,525,933
How to get the text of several td which have same id name?
<p>i have table in that five td which contain same id. Id="divParent" but in that different text, i want to access all the text in array which id ="divParent" in other page using java script. how to get this i tried to do this using this code;</p> <pre><code>var divParent=new Array(); divParent=window.parent.document.getElementById('divParent'); </code></pre>
javascript asp.net
[3, 9]
3,079,868
3,079,869
Open My Documents
<p>Hi I have a link to a file in 'my documents' this is an internal web site. How can I open the users local MY Documents folder using JS or JQ </p> <p>I used this code and thought the documents would appear in a web page but it didnt</p> <pre><code>address = "G:\systems Projects" ; window.open(address,"Detail ","width=800,height=600" ) </code></pre> <p>Any help appreciated ! , thanks </p>
javascript jquery
[3, 5]
3,672,633
3,672,634
Passed Variable not working with my function - Javascript
<p>I've got text entry box and a countdown on the same page. I want to take the time from the box and enter it into the counter. I've got a variable back from the text box "setTime". I wanted to put that directly into my timeSplit function (to convert the time into seconds) but when I do I get an error that "time.split is not a function". What am I doing wrong here?</p> <p>When I have a static variable enter the function (e.g. time = "12:12:12") everything works perfectly. - except its not using the right time</p> <p>When I run the pop up alert on setTime before the timeSplit function I see my time like this "12:12:12" so its coming from the counter without a problem and I don't get a NaN error</p> <p>Why would a time variable work when its static but not when its passed</p> <p>I tried converting the setTime to a string but that just lead to NaN errors even when I tried to convert the sec variable back to an int.</p> <p>I think this is the relevant code let me know if you need more.</p> <pre><code>var setTime = 0; var $fromTime = $("#formEntry"); $("#setTime").off("click").on("click", function(){ setTime = $fromTime.val(); }); function timeSplit(){ //time = "12:12:12"; tt = time.split(":"); sec = tt[0]*3600+tt[1]*60+tt[2]*1; return sec; } var time = setTime; //var time = "12:12:12"; var sec = timeSplit(time); </code></pre>
javascript jquery
[3, 5]
1,709,651
1,709,652
how to integrate aspx page with php?
<p>I have aspx page for reading and writing word document.But my project is in PHP. Now i want to integrate that aspx page with my PHP project. I also want to know how to get textbox value of aspx page in PHP.</p>
php asp.net
[2, 9]
758,860
758,861
How to differentiate actual mouse clicks from script generated clicks?
<p>I have tabs.It has auto play.</p> <p>Take a look for example : <a href="http://jsfiddle.net/w3father/YEcZc/" rel="nofollow">http://jsfiddle.net/w3father/YEcZc/</a></p> <p>How do I get click detail which suggests if it is a click from script?</p>
javascript jquery
[3, 5]
2,893,800
2,893,801
Select only drop-down menu that has changed
<p>I have a table that includes a column for the user to select from a drop-down menu to populate the next column. Problem is the table contains the same drop-down menu for each row and on change when I select using the following syntax JQuery selects all drop-downs instead of just the one in that has actually changed. Below solution uses event.stopImmediatePropagation() to act similar to a break point and is the only solution I can think of that will work. Please let me know if there is a more elegant solution out there...</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;select name="selected_client[id]" id="selected_client_id" class="selected_client"&gt; &lt;option value=""&gt;&lt;/option&gt; &lt;option value="240"&gt;CLIENT ONE&lt;/option&gt; &lt;option value="195"&gt;CLIENT TWO&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;select name="selected_client[id]" id="selected_client_id" class="selected_client"&gt; &lt;option value=""&gt;&lt;/option&gt; &lt;option value="240"&gt;CLIENT ONE&lt;/option&gt; &lt;option value="195"&gt;CLIENT TWO&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; $j('.selected_client').change(function(event) { var client_id = $j(this).val(); // &lt;-- value of the drop down that was currently changed var tmp_row = $j(this).parent('td').parent('tr'); // perform action event.stopImmediatePropagation(); // prevents calling other matched rows return false; }); </code></pre>
javascript jquery
[3, 5]
4,809,865
4,809,866
js 'function' structure
<p>I applogoize for this stupid question, please correct me, or reference if there is a duplicate for my question but, I want to know what are the advantages of using this function:</p> <pre><code>var MyFun = (function(data){ alert(data) }); </code></pre> <p>rather than this:</p> <pre><code>function MyFun(data){ alert(data); } </code></pre> <p>As I understood, it's having overloading concept, am I right on that?</p> <p>thank you.</p>
javascript jquery
[3, 5]
3,826,111
3,826,112
How can i use Python and PHP together effectively
<p>I know PHP and i am currently learning django Python. </p> <p>I am wondering the strengths and weaknesses of each language so that i can effectively use them together in order to program fater and more securly.</p> <p>I know that PHP has much better(easier) string manipulation but python has better security. What are the other differences so that i know when to use the different languages?</p> <p>I understand this is a 'very' broad question but i am hoping to hear your personal experience because that is something most books and tutorials wont talk about on this subject. Any links, examples, theoris and facts are 'very' much appriciated!</p>
php python
[2, 7]
2,838,056
2,838,057
Cannot trigger next function when previous completed
<p>I'm trying to make a chain reaction by executing next function after executing previous one. Code looks like this:</p> <pre><code>var med = { imgLoadTime : 2000, easingEffect : 'easeOutQuart', scrollEase : 'easeInOutQuad', effectDuration : 1000, currentPage : '', runAnimations : function(){ if(this.currentPage == '#slide5'){ this.initAssets(); } }, initAssets : function(){ $('#asset-1').animate( {left : '50%'}, { duration: this.effectDuration, easing: this.easingEffect, complete: this.assetTwo }); }, assetTwo : function(){ console.log('two'); debugger; $('#asset-2').animate( {left : '50%'}, { duration: this.effectDuration, easing: this.easingEffect, complete: this.assetThree }); }, assetThree : function(){ console.log('three'); $('#asset-3').animate( {left : '50%'}, { duration: this.effectDuration, easing: this.easingEffect, complete: console.log('weszlo') }); } }; </code></pre> <p>This is how my object looks like. Then I run function runAnimations as a property of object. What is weird that during this chain only assetTwo function executes, but no further (assetThree). Why so?</p>
javascript jquery
[3, 5]
4,112,498
4,112,499
Is this a smart way to organize code in jQuery?
<p>for the longest time I was writing all my code inside like this ... </p> <pre><code>$(document).ready(function(){ $('.show_module').click(function(){ }); ... }); </code></pre> <p>putting all sorts of click handlers in there. But recently I was introduced to a new way of doing things and I wanted to get a feel for if its a smart way of going about it.</p> <p>the idea is to have all the handlers in related functions and then have minimal code in document.ready above. </p> <p>So for example ...</p> <pre><code>$(document).ready(function(){ page_handler(); // other functions follow }); function page_handler(){ $('.show_module').click(function(){ }); ... } </code></pre> <p>This seems to allow organization of related handlers in functions and use document.ready as more of an initializer.</p> <p>I know in JavaScript functions and variables are 'hoisted' before code starts executing so </p> <pre><code>do_something(); function do_something(){ } </code></pre> <p>works for this reason, since the function is ready to use before do_something() is actually called, even though it appears before the actual function definition.</p> <p>I was wondering if the same thing happens here and how 'good' this idea/way of doing things is.</p>
javascript jquery
[3, 5]
3,646,173
3,646,174
Jquery File Upload Plugin Progress Bar
<p><a href="https://github.com/blueimp/jQuery-File-Upload/wiki" rel="nofollow">This plugin</a> manages file uploads in a webpage and can add a lot of UI elements to the upload process. </p> <p>You create an input file type element and then strap the js files, use the instantiating code and walla. There are options and API instructions for accomplishing different features.</p> <p><strong>Problem:</strong></p> <p>I want to implement a progress bar for file uploads but so far there is no real instruction on how to do that in the docs.</p> <p>I found one option you can set by pasting this code in:</p> <pre><code>progress: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); } </code></pre> <p>But doing that it has not changed anything. Can someone who understands javascript please help me find out how to get a progress bar implemented? </p> <p>Thank you.</p>
javascript jquery
[3, 5]
5,723,119
5,723,120
jquert .post outputing dropdown list
<p>I have created a dropdown list, which is working well in separate page: <img src="http://i.stack.imgur.com/e26Z3.jpg" alt="normal"></p> <p>however, when I use jquery .post to output it in a table in a php page, the contents run out from the dropdown list: <img src="http://i.stack.imgur.com/bEDOw.jpg" alt="abnormal"></p> <p>the jquery that I am using us like this:</p> <pre><code>&lt;script&gt; function showestate(){ $.post('admin/page/ur/showestate.php',{ zid: document.getElementById('zone').value }, function(output){ $('#showestate').html(output); }); } showestate(); &lt;/script&gt; &lt;div id='showestate'&gt; &lt;/div&gt; </code></pre> <p>please help! Thanks!</p> <p>the dropdown list is like this:</p> <pre><code>&lt;?php include "../../db.php"; session_start(); ?&gt; &lt;select name="estate" id="estate" /&gt; &lt;?php $sql_sel_estate = "select * from [estate]"; $result_sel_estate = mssql_query($sql_sel_estate, $conn); while ($record_sel_estate = mssql_fetch_array($result_sel_estate)) { $estateid = $record_sel_estate['estateid']; $estatename = $record_sel_estate['estatename']; $estatenameen = $record_sel_estate['estatenameen']; $estatezoneid = $record_sel_estate['estatezoneid']; $estatecode = $record_sel_estate['estatecode']; ?&gt; &lt;option value="&lt;?=$estateid?&gt;"&gt; &lt;?=$estatenameen?&gt;&lt;br&gt; &lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; </code></pre>
php javascript jquery
[2, 3, 5]
4,152,280
4,152,281
Ensure file size of uploaded file is lower than maxRequestLength before the upload occurs?
<p>I've got a form with a FileUpload control where users can upload images. Can I ensure that the file size of the uploaded image is lower than the configured maxRequestLength before the upload occurs, and by doing so prevent an exception from being thrown when file size is too large?</p> <p>My initial attempt of looking at ContentLength of PostedFile of the control was to no avail as the file is already submitted.</p> <p>I have no interest in increasing the maxRequestLength.</p>
c# asp.net
[0, 9]
5,667,422
5,667,423
Copy Javascript Object into another Object, not creating new Properties
<p>Suppose there are two objects</p> <pre><code>source = { name: "A", address: { city: "B", zipcode: "C" }, car: { make: "D", model: "E" } }; target = { name: "", address: { city: "" } }; </code></pre> <p>Now I want to copy all data from source over to target. However, copying must only take place, if the corresponding property already exists in the target. It is something like jQuery's extend, without adding new properties. With the above data the result will be...</p> <pre><code>target = { name: "A", address: { city: "B" } }; </code></pre> <p>How can this be achieved easily?</p>
javascript jquery
[3, 5]
1,591,252
1,591,253
how to pick value in jquery
<p>i have build a small function whose work to get value in alert box but i want to pick only 5 character from starting. here is my function</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;script type="text/javascript" src="jquery-1.7.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function (){ $(".hhh").click(function(){ $(this).html() }) }) &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="hhh"&gt;dd:ff:aa&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
5,547,959
5,547,960
Creating elements in JavaScript
<p>I have a lot of JavaScript code that creates HTML. For example:</p> <pre><code>function Reply(postId) { if (!document.getElementById("reply" + postId)) { $("#root" + postId).after("&lt;div id='reply" + postId + "'&gt;&lt;textarea cols='70' rows='8' style='margin-bottom: 10px'&gt;&lt;/textarea&gt;&lt;br/&gt;&lt;span style='margin-bottom: 30px'&gt;&lt;input type='button' value='Submit' /&gt;&lt;input type='button' value='Cancel' onclick='$(\"#reply" + postId + "\").remove();'/&gt;&lt;/span&gt;&lt;/div&gt;"); } } </code></pre> <p>How can I use jQuery to make this more readable? What's the best way to go about making new elements in JavaScript? Can I see an example?</p>
javascript jquery
[3, 5]
4,252,938
4,252,939
$_GET undefined index
<p>By passing a js variable to php code it displays a value at the end of the program.</p> <p>But the problem is no mather what i try to initialise it with the score disapears at the end.</p> <p>If i leave it alone everything displays as it should, but with the annoying undefined message until the last screen (where the value actually gets displayed).</p> <pre><code>$varOne = $xml-&gt;addChild('one', $_GET['resultone']); </code></pre> <p>The variable in the js is being past by using <code>window.location.href</code></p> <p>I have tried several isset ways but none of them seem to have succeeded in resolving this annoying problem.</p> <p>Kind regards.</p>
php javascript
[2, 3]
709,169
709,170
Access to variabe in View class from main activity
<p>I have 2 classes, Main as main activity and DrawView (extends View) as a class where I have part of menu. I use class DrawView ONLY in main.xml file, what shows this menu part (kind of slider). In this DrawView is integer variable like 'currentSelection'. How I can have access to this variable? I need later send this value to the second activity.</p>
java android
[1, 4]
1,948,564
1,948,565
Cannot call setContentView using runOnUiThread?
<p>Is there a reason I cannot do this inside of a thread? I'm still getting a "Cannot create a handler inside thread that has not called Looper.prepare()".</p> <pre><code>_currentActivity.runOnUiThread(new Runnable() { public void run() { _currentActivity.setContentView(_nextScreen); } }); </code></pre>
java android
[1, 4]
4,840,945
4,840,946
How do I phonebook contact which also have group making facilities and image containing facilities
<p>I want to make address book application in android which can have Name,phone No, email id, also have images. it also have the group making facilities. I am new to android please help.. Thanks in advance</p>
java android
[1, 4]
676,548
676,549
asp.net website - Can I tell if it has been precompiled?
<p>I have a slightly odd situation.</p> <p>One of my customers has an Asp.net (v2 of the framework) site on a dedicated server.</p> <p>They have asked me to make some changes to the code as their developer has left. Apparently the latest version was on the server.</p> <p>I downloaded that code, opened it in VS2010, converted it and it was fine. However, when I run the code I get compile time errors from the aspx pages, where they are calling for properties that dont exist in the code. (According to Find In Files, whole soluton, <em>.</em>)</p> <p>So I did some digging. In the Bin file there is an assembly for the website. On the server this is over 300k. On my machine this is 180k. </p> <p>I accept that this might simply be that the later compilers pack code better, but I'd be suprised if this shows as a 120k improvement. </p> <p>So the only thing I can think of is that at some point he has made some changes and compiled the website, but didnt remove all the old .cs files first.</p> <p>Is this possible, or can anyone suggest a different reason for me seeing the behaviour I am witnessing?</p> <p>[Edit]</p> <p>Ok, It isn't precompiled, so Im really struggling to understand whats going on now.</p> <ul> <li>I have all the code from the website.</li> <li>On the Server the code works.</li> </ul> <p>However, as I have had my original question answered I'll close this, and no doubt come back tomorrow when I have dug a little deeper.</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,552,128
4,552,129
How to create dynamic checbox in asp.net
<p>I am creating an application where I require to add dynamic checkbox list. Please anyonr tell me how to add dynamic checkbox list using C#.</p>
c# asp.net
[0, 9]
1,023,064
1,023,065
Help replacing last occurrence of char with new char
<p>I was able to replace the first occurrence of a <code>,</code> but now I want to remove the last occurrence.</p> <pre><code> $(function() { $(".defaultUL li").each(function() { var text = $(this).html(); if(text.indexOf("...")&lt;0) { var s = text.lastIndexOf(","); $(this).html(text.replace(s," ")); } }); }); </code></pre> <p>Substituting <code>","</code> for <code>s</code> is not working like I hoped.</p>
javascript jquery
[3, 5]
477,375
477,376
How to get back data from php variable to jquery variable using jquery $.POST method
<p>In the below code the $.POST method passes two variables to the php file empProfile.php which retrieves the employee profile from the database. Know I want to receive ID and Name from the php file to the jquery variables. Can someone help me.</p> <pre><code>data = { personnelNo: $('#personnelNo').val(), cnic: $('#cnic').val() } //end of data $.post( "checkEmployee.php", data, function(data) { var ID =; Name=; } // end of function ); // end of post //} //end of if statement }); // end of blur </code></pre>
php jquery
[2, 5]
5,694,481
5,694,482
Serializing a data object AND a form field for $.ajax
<p>If I do something like this</p> <pre><code>$.getJSON('/server/validate_field', { what:'validate', email_address:field.serialize() }, function(data) </code></pre> <p>then the query string ends up like this</p> <pre><code>validate_field?what=validate&amp;email_address=email_address%3Dasdk%2540lal.com </code></pre> <p>Notice the duplicate. How can I fix this without having to manually create a key value pair for the form data?</p>
javascript jquery
[3, 5]
4,969,106
4,969,107
How to edit image when saved in Edited folder
<p>I have spent the last day or so trying to do this on my own without any luck.</p> <p>I am wondering if it is my specific device (galaxy nexus - the edited image is being saved in /mnt/sdcard/Edited) which causes the limited advice on this subject not to work as expected.</p> <p>My problem is when i start an intent to edit an image using third party app (photo studio) I can edit the image but never actually get it back.</p> <p>I never get a callback to onActivityResponse no matter what calling code I try (i have gone through every google result which contains ACTION_EDIT to see how others are doing it),</p> <p>so no response meant I had to try another way - according to a post somewhere i found the edited image should be saved over the image you send to the app if you specify some categories and data tags in your manifest which i implemented and spent a few hours on but to no avail - the image i sent was always the same image when onResume was called.</p> <p>So I have been trying another approach, listen for changes in file system using..</p> <pre><code>getContentResolver().registerContentObserver(Media.EXTERNAL_CONTENT_URI, true, myObserver); </code></pre> <p>and I get a result of sorts - my onChanged method is called when the image has been edited and saved for which i can receive an id but never am i able to build the correct uri to get the file path using </p> <pre><code> String columns[] = new String[]{ Media._ID, Media.DATA, Media.DISPLAY_NAME, Media.MIME_TYPE, Media.SIZE, Media.MINI_THUMB_MAGIC }; Uri image = ContentUris.withAppendedId(Media.EXTERNAL_CONTENT_URI, latestId); Cursor cursor = application.managedQuery(image, columns, null, null, null); </code></pre> <p>however, I always end up with a NULLPOINTEREXCEPTION using the above lines of code in a while loop (this is based on some kind kindly put out there to do with a AlbumUploader).</p> <p>I hope somebody can give me a shout on where I am going wrong or a workaround to get proper file path for such a situation.</p> <p>Regards, thanks for reading.</p>
java android
[1, 4]
471,934
471,935
Download file in chunks
<p>I've got the problem as below: There is some SOAP web service which allows to read stream files. I need to read the whole file divided to chunks and transmit to user. All actions should do not block UI main thread: user presses 'Save' button on save file dialog, and is able to move on to the next page or perform another action. I will be grateful for the sample solution. Note that the solution should work with IIS 5.1.</p> <p>Regards, Jimmy</p>
c# asp.net
[0, 9]
2,434,621
2,434,622
JQuery reverse each() with find()
<p>I know this kind of question has been asked before, but the general solution of </p> <pre><code>$($("input").get().reverse()).each(function() { /* ... */ }); </code></pre> <p>is not working for me. I have an xml document that contains a list of concerts that I'd like to display on a webpage. So, in JQuery:</p> <pre><code>$.ajax({ type: "GET", url: "concerts.xml", dataType: "xml", cache: false, success: function(xml) { $(xml).find('concert').each(function() { /*do stuff*/ }); } }); </code></pre> <p>However, I'd like to display the concerts in reverse order. So, I tried the following, but it did not work:</p> <pre><code>$.ajax({ type: "GET", url: "concerts.xml", dataType: "xml", cache: false, success: function(xml) { $($(xml).find('concert').reverse()).each(function() { /*do stuff*/ }); } }); </code></pre> <p>Any assistance would be much appreciated. Thanks.</p>
javascript jquery
[3, 5]
294,736
294,737
Dropdown list where options populate a second list js/php?
<p>I have a 2 dropdown lists side by side. When user selects from the first list, i need the second list's options to be displayed.</p> <p>The sub-options will be retrieved from a database. I have a page that will return the necessary html given the specific parent. I just need the first list's selection to trigger an update of list #2.</p> <p>Whats the best way of accomplishing this?</p> <pre><code>&lt;select id="parent" name="list1"&gt; &lt;option value="1"&gt;Parent 1&lt;/option&gt; &lt;option value="2"&gt;Parent 2&lt;/option&gt; &lt;option value="3"&gt;Parent 3&lt;/option&gt; &lt;option value="4"&gt;Parent 4&lt;/option&gt; &lt;/select&gt; &lt;select id="child" name="list2"&gt; &lt;/select&gt; </code></pre> <p>caveat: cant use a form, cause the selection's are part of another form.</p>
php javascript
[2, 3]
2,134,300
2,134,301
What's a good example for browser-specific code necessary when not using e.g. jQuery?
<p>I'm looking for a good example where a framework/lib like jQuery removes the need for browser-specific code. Please note that I'm not looking for an example where jQuery makes things just easier or nice but specifically something where the same code wouldn't work for all common browsers.</p> <p>As it'll be used for university stuff and just meant to be an example a very simple thing would be great (otherwise I'd probably use <code>e.which</code> vs <code>e.keyCode</code>)</p>
javascript jquery
[3, 5]
5,145,980
5,145,981
More problems with Jquery src and load()
<p>I am pulling my hair out as to why one of these scripts works, while the other doesn't . Upon clicking the text, the image should change. And on a side note does the load() command look ok?</p> <p>What is the difference between these two that's making the first work and the second malfunction?</p> <p>The functional: </p> <pre><code>CageImg=new Image(); CageImg.src="http://cageme.herokuapp.com/css/mrcage.jpg" function buttonInCompany() { $('#desc').load('incompany.html'); $('#midimg').attr("src",CageImg.src); } $(document).ready(function() { $("#someID").click(function() { buttonInCompany(); }); }); &lt;/script&gt; &lt;div id='someID'&gt;Everything is cage's cage.&lt;br&gt;&lt;br&gt;&lt;/div&gt; &lt;img id="midimg" src="http://3.bp.blogspot.com/-BdfyYy_Y0gY/UP_3y3F2RDI/AAAAAAAAC-Q/eHPCltO8bG8/s1600/TomEngelsnicolas+thing.jpg"&gt; </code></pre> <p>The non functional:</p> <pre><code> &lt;script src="jquery.src"&gt;&lt;/script&gt; &lt;script&gt; incompanyImage=new Image(); incompanyImage.src= "images/16581370-group-of-happy-young-business-people-in-a-meeting-at-office.jpg" function buttonInCompany() { $('#desc').load('desc.html #incompany'); $('#midimg').attr("src",incompanyImage.src); } $(document).ready(function() { $("#incompany").click(function() { buttonInCompany(); }); }); &lt;/script&gt; &lt;div id="incompany" class="art-button"&gt;Aulas in-Company&lt;/div&gt; &lt;img id="midimg" width="233" height="350" src="images/Fotolia_5170186_X-01.jpg"&gt;&lt;br&gt;&lt;/p&gt; </code></pre>
javascript jquery
[3, 5]
5,601,776
5,601,777
jquery submit form on link click
<p>i have a big form that is split over 3 pages (each page is self contained i.e. only contain part of the form wrapped around form tags). I have page buttons so the user can navigate between pages e.g. page 1, page 2, page 3 and each page is loaded depending on a page variable in the url querystring i.e. <code>www.myurl.com?page=1</code></p> <p>What I want to happen is that when the user clicks on the page button the form is submitted but also passed the page button clicked in a post/get (I don't mind which) value i.e. <code>next_page = page number clicked</code></p> <p>What is the best way to do this? I am using jQeury in my code so a solution using this would be good</p>
javascript jquery
[3, 5]
3,364,233
3,364,234
How do I get the previous HTML text prior to a node?
<p>UPDATE:<br> Someone asked: <em>for what purpose would I want to do this?</em><br> I'm trying to get the string index of a selected node server side, and since I have to account for repetition of small selections / nodes, I figure getting all html prior to the selected node on the client side would help in being the most accurate way to get the index.</p> <p>lets say I have html like this:</p> <pre><code>&lt;tag&gt; &lt;child&gt; &lt;subchild&gt; &lt;/subchild&gt; &lt;/child&gt; &lt;/tag&gt; </code></pre> <p>and I "select" subchild. I want to get all preceeding HTML as text** prior to that node.. so, in this case that would be:</p> <pre><code>&lt;tag&gt; &lt;child&gt; </code></pre> <p>is there a slick, easy way to do that?</p> <p>** I specify "as text" because, using jQuery / modern browsers, incomplete tags would become valid, as jQuery tries to make sure things don't break. Since I would not doing DOM manipulation with this information, I don't need valid HTML syntax.</p>
javascript jquery
[3, 5]
5,826,231
5,826,232
How i can use the javascript value with php
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1917576/how-to-pass-javascript-variables-to-php">How to pass javascript variables to php</a> </p> </blockquote> <p>If i have this javascript code</p> <pre><code>&lt;script type="text/javascript"&gt;document.write(top.location);&lt;/script&gt; </code></pre> <p>for example value of javascript will be "http://www.xdomain.com/index.php"</p> <p>Now i need to use the javascript value "http://www.xdomain.com/index.php" with php</p> <pre><code>&lt;?php $url = value of javascript (=http://www.xdomain.com/index.php) echo ''.$url.''; ?&gt; </code></pre> <p>In my case i can't use $_SERVER php variables</p> <p>How i can do that please ?</p>
php javascript
[2, 3]
1,187,880
1,187,881
function callback to reload a jquery plugin
<p>im new to jquery/javascript and im trying to make a function callback to reload a jquery plugin. what would be the appropriate way to do that?</p> <pre><code>$(function() { var newHash = "", $mainContent = $("#main-content"), $el; $("nav").delegate("a", "click", function() { window.location.hash = $(this).attr("href"); return false; }); $(window).bind('hashchange', function(){ newHash = window.location.hash.substring(1); if (newHash) { $mainContent .find("#guts") .fadeOut(200, function() { $mainContent.hide().load(newHash + " #guts", function() { $mainContent.fadeIn(200, function() { /*rebind plugin*/ }); $("nav a").removeClass("current"); $("nav a[href="+newHash+"]").addClass("current"); }); }); }; }); $(window).trigger('hashchange'); }); </code></pre>
javascript jquery
[3, 5]
5,514,520
5,514,521
Stack of activity from Activity stack
<p>There is a stack of activity i want to call the activity from that stack , My question is that is it possible to check from that stack and call that intent . When i press home button and again when i press the executable it should start the activity where i have left . Is it possible ? Any example related to the same would be great help </p> <p>Thnx in advance .</p>
java android
[1, 4]
5,023,146
5,023,147
Specifying Elements for jQuery
<p>I have a <code>&lt;ul&gt;</code> containing <code>&lt;h2&gt;</code> headings with text below each. I want to be able to display or hide the text below by clicking the each of the headings. How can I tell jquery to only display the text from within the same <code>&lt;li&gt;</code> when the heading is clicked without creating a seperate if statement for each <code>&lt;li&gt;</code>?</p> <pre><code>&lt;ul&gt; &lt;li&gt; &lt;h2&gt;heading&lt;/h2&gt; &lt;div id='step'&gt; text text text &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;h2&gt;heading&lt;/h2&gt; &lt;div id='step'&gt; text text text &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;script&gt; $("li").click(function () { if ($("#step").is(":hidden")) { $("#step").slideDown("slow"); } else { $("#step").slideUp("slow"); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,614,657
3,614,658
jQuery: position element next to another and fix it there
<p>I want to position ElementA next to ElementB like specified here: <a href="http://stackoverflow.com/questions/158070/jquery-how-to-position-one-element-relative-to-another">jQuery: How to position one element relative to another?</a></p> <p>with the only difference being that I want ElementA to move around with ElementB if ElementB is moved. </p> <p>Is it possible to somehow fix a certain element's position to another? It's not feasible for me to recalculate ElementA's position every time ElementB is moved.</p> <p><strong>UPDATE</strong></p> <p>In my situation, ElementB was a <code>td</code> element. Apparently, <code>td</code> elements can't be relatively positioned, which was why ElementA wasn't moving with ElementB. An easy fix for this was simply adding a relatively positioned <code>div</code> inside ElementB and then placed ElementA in there.</p>
javascript jquery
[3, 5]
1,411,803
1,411,804
Increasing the performance
<p>I was implementing an android FFT guitar tuner. Here, I have 2 text views, 1 for displaying the frequency of the sound coming from the mic port and the other 1 for displaying the pitch notation. To match with the frequency, I wrote an if condition which is having about 35 if else if conditions consisting of 150 lines (approximately). Now, when a sound is heard, the value is updated in the frequency text view, but the note pitch text view is getting late to updated since there are so many conditions to be checked before updating the text view, so when the conditions are checked, again the frequency text view may have changed and got itself updated. What can I do to get rid of this problem? The final output is not efficient..Please help me with this...</p> <pre><code>if(frequency &gt;= 62 &amp;&amp; frequency &lt;= 65) { note.setText("C"); } else if(frequency &gt;= 70 &amp;&amp; frequency &lt;= 74) { note.setText("C#"); } else if(frequency &gt;= 77 &amp;&amp; frequency &lt;= 81) { note.setText("D"); } else { note.setText("Frequency is out of range"); } </code></pre>
java android
[1, 4]
5,234,778
5,234,779
jQuery reset validation on a form in a dialog
<p>I've been struggling to reset a form within a dialog window upon close. My form is using jQuery validate and I've tried to use the documented resetForm() function, but no luck.</p> <p>Below are two attempts on how I am trying to achieve clearing the form upon the user hitting "Close". Neither are working.</p> <p>Here's the jsFiddle: <a href="http://jsfiddle.net/FjT7T/6/" rel="nofollow">http://jsfiddle.net/FjT7T/6/</a></p> <pre><code>$("#myDialog").dialog({ autoOpen: false, close: function(event, ui) { // Attempt to reset the form using JQuery validates resetForm(), not working. var validator = $("#myForm").validate(); validator.resetForm(); // Attempt to reset the form and remove the error classes, not working either. $(this).closest("form")[0].reset().removeClass("error"); } }); </code></pre>
javascript jquery
[3, 5]
5,926,070
5,926,071
Why is the last case of my switch statement getting hit?
<p>The last case of my switch statement in my Java app is always getting hit. How can I make this work properly?</p> <pre><code>public void onClick(View v) { Random r = new Random(); int x=r.nextInt(4-1) + 1; switch (x) { case 1: setContentView(R.layout.image1); case 2: setContentView(R.layout.image2); case 3: setContentView(R.layout.image3); case 4: setContentView(R.layout.image4); </code></pre>
java android
[1, 4]
1,679,413
1,679,414
put value in textarea using jquery
<p>I want to put the value in textarea using the jquery. I'm using the following code. It is not working.</p> <pre><code> &lt;link rel="stylesheet" href="css/jquery.wysiwyg.css" type="text/css" /&gt; &lt;script type="text/javascript" src="js/jquery.wysiwyg.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function wedit(topic){ $("#wysiwyg").html(topic); alert(id+topic+instructor+date+video); } &lt;/script&gt; &lt;form name="theform" action="" method="post"&gt; &lt;table border="0" cellpadding="10" cellspacing="10" width="680px"&gt; &lt;tr&gt;&lt;td width="150"&gt;Topic:&lt;/td&gt;&lt;td&gt;&lt;span id="wtopic"&gt; &lt;textarea name="wysiwyg" id="wysiwyg" &gt;&lt;/textarea&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="submit" value="Save" title="Save" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>It is working in case of text but in case of textarea it is showing empty value. please let me know how can I put the text into the textarea through jquery or javascript??</p>
javascript jquery
[3, 5]
2,060,376
2,060,377
How do I call this function on blur(), using JQuery? RESOLVED!
<p>I have this function, see below:</p> <pre><code>function checkStartPrice (){ if ($('#StartingPrice')[0].value.length == 0){ alert("The 'Starting Price' cannot be left empty!"); return false; } else { var BuyItNowPrice = parseFloat($('#BuyItNowPrice').val()); var StartingPrice = parseFloat($('#StartingPrice').val()); var Reserve = parseFloat($('#Reserve').val()); if((BuyItNowPrice &lt;= StartingPrice) &amp;&amp; (StartingPrice &gt; 0)){ alert("The 'Buy It Now' price must be higher..."); return false; } if((Reserve &lt;= StartingPrice) &amp;&amp; (StartingPrice &gt; 0)){ alert("Your 'Reserve Price' must be higher..."); return false; } return true; } } </code></pre> <p>Question: How do I call it on blur? I tried this code below but it doesnt seem to work</p> <pre><code>$('#StartingPrice').blur(function(){ checkStartPrice(); }); </code></pre> <p>Any help would be greatly appreciated, Thanks</p> <hr> <p>I found a ERROR &amp; fixed it...RESOLVED :)</p>
javascript jquery
[3, 5]
4,429,328
4,429,329
Problems simulating click of ASP.NET button
<p>I have some code like this</p> <pre><code>&lt;asp:Button ID="cancelDummyButt" runat="server" CausesValidation="False" Text="cancel" onclick="cancelDummyButt_Click" Enabled="True" /&gt; </code></pre> <p>(Javascript:)</p> <pre><code>buttid = '&lt;%=cancelDummyButt.ClientID.ToString%&gt;'; eltoclick = document.getElementById(buttid); eltoclick.click(); </code></pre> <p>The server-side code is not called. What is wrong? It goes OK until the "click". What is the best way to debug?</p> <p><em>(This is to get the right postback from an iframe within an updatepanel)</em></p>
asp.net javascript
[9, 3]
4,283,045
4,283,046
Works for google chrome but not for firefox and IE
<p>does anyone know why this works on chrome only. it is basically a code that snaps the nav-bar into the top when you scroll down by the nav-fixed class. and the function fix_top_bar is a way to center the bar that is created. </p> <pre><code>function fix_top_bar(){ var barWidth = $('.nav-fixed').width(); $('.nav-fixed').css({ 'left' : '50%', 'margin-left' : '-' + (barWidth/2 + 20) + 'px' }); } $('document').ready(function() { $(window).scroll(function() { if ($('body').scrollTop() &gt; 112) { $('nav').addClass('nav-fixed'); fix_top_bar(); }else{ $('.nav-fixed').css({ 'left' : '', 'margin-left' : ''}); $('nav').removeClass('nav-fixed'); } }); fix_top_bar(); $(window).resize(function(){ fix_top_bar(); }); }); </code></pre>
javascript jquery
[3, 5]
4,580,584
4,580,585
Get DOM elements inside a rectangle area of a page
<p>Given two points on a webpage and a set of DOM elements, how to find out the subset of those DOM elements that sit inside the rectangle area defined by the two points?</p> <p>I am working on a web-based gallery, in which every photo is wrapped in a <code>li</code> tag. When a user drag out a rectangle area with mouse, all <code>li</code> elements inside the rectangle are marked as selected.</p> <p>Prefer a jQuery solution for less wordy and an efficient way.</p>
javascript jquery
[3, 5]
5,164,983
5,164,984
What should be the best approach to add a help file in my web application project?
<p>We have a Asp.Net Vb.Net application with around 35 webforms.There are some remote users who do not have the functional idea of the webforms.So i was thinking of adding a help file in my project.Is there any special component or javascript ? will it be a good option if i go with form by form or a single help file ?</p>
asp.net javascript
[9, 3]
4,391,658
4,391,659
Dynamically created elements - How to make proper selector and access top objects
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1266604/jquery-selection-within-a-selection">Jquery: Selection within a selection</a> </p> </blockquote> <p>Consider this code:</p> <pre><code>var $el = $('&lt;div class="test"&gt;&lt;div&gt;Foor&lt;/div&gt;&lt;/div&gt;&lt;div class="test"&gt;&lt;div&gt;Bar&lt;/div&gt;&lt;/div&gt;&lt;div class="other"&gt;Leave it!&lt;/div&gt;'); // won't work $el.find('div.test').css('color','red'); $('body').append($el); </code></pre> <p>jsFiddle:</p> <ul> <li><a href="http://jsfiddle.net/bVJkR/2/" rel="nofollow">http://jsfiddle.net/bVJkR/2/</a></li> </ul> <p>How can I access <code>&lt;div class="test"&gt;</code> elements using jQuery? </p> <p>Please note I would like to access <code>.test</code> elements before using them in document.</p> <p>I know I can create wrapper for divs, but I really would like to avoid it.</p>
javascript jquery
[3, 5]
4,634,173
4,634,174
save Iframe's source as an image on desktop
<p>I have an Iframe in a webpage whose source is filled when a submit button is clicked.I need the iframe source to be saved as an image on my desktop .How can this be done. Heres the code:</p> <pre><code>&lt;iframe id="IFAEventPerformance" name="IFAEventPerformance" scrolling="auto" runat="server" width="100%" height="403" class=""&gt;&lt;/iframe&gt; </code></pre> <p>and the cs file:</p> <pre><code>protected void lnkBTNSubmit_Click(object sender, EventArgs e) { this.IFrame1.Attributes.Add("src", "https:\\anotherwebsitename"); } function for export to ppt is: protected void imgBTNExportPPT_Click(object sender, ImageClickEventArgs e) { //WebsiteToImage websiteToImage = new WebsiteToImage("http://www.google.co.in", @"C:\Users\312220\Desktop\myscreenshot.jpg"); //websiteToImage.Generate(); WebsiteToImage websiteToImage = new WebsiteToImage("C:\\Users\\304485\\Desktop\\Login.htm",(@"D:\\my\\chocos\\sample.jpg")); websiteToImage.Generate(); TextBox txtTextBoxRetailGroup = (TextBox)uscRetailParameters.FindControl("txtRetailCustomerGroup"); TextBox txtTextBoxPPGroup = (TextBox)uscRetailParameters.FindControl("txtProductGroup"); TextBox txtTextBoxEventID = (TextBox)uscEventParameters.FindControl("txtEventId"); string RetailGrp; RetailGrp = txtTextBoxRetailGroup.Text; string PPGrp; PPGrp = txtTextBoxPPGroup.Text; string EventID; EventID = txtTextBoxEventID.Text; ShowPresentation(); GC.Collect(); } </code></pre>
javascript asp.net
[3, 9]
5,058,206
5,058,207
Function for increasing number after class up to max
<p>I would like to have a class change (with an increasing number) each time this function is called.</p> <p>I currently have tried this:</p> <pre><code>function(i) { if(i &lt; 16) { $("#elm").removeClass("cls-" + (i)); i++; $("#elm").addClass("cls-" + (i++)); } else {} } </code></pre> <p>New to jQuery so I'm not sure what to fix :/ Thanks!!!</p>
javascript jquery
[3, 5]
202,173
202,174
JavaScript Photo Slider
<p>I'm working on making a JS script that will go in the header div and display a few pictures. I looked into JQuery Cycle, but it was out of my league. The code I wrote below freezes the browser, should I be using the for loop with the timer var?</p> <pre><code>&lt;script type="text/JavaScript" language="JavaScript"&gt; var timer; for (timer = 0; timer &lt; 11; timer++) { if (timer = 0) { document.write('&lt;img src="images/one.png"&gt;'); } if (timer = 5) { document.write('&lt;img src="images/two.png"&gt;'); } if (timer = 10) { document.write('&lt;img src="images/three.png"&gt;'); } } &lt;/script&gt; </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
5,508,347
5,508,348
How can I use jQuery effects on Ajax loaded content?
<p>Hi and thanks for taking some time to look at my question. I have a part of the page where content is dynamicly loaded into from another file. Reason for this is it needs to be live updated. Now I want to be able to apply jquery effects that are usually used for show/hiding content (slide, fade etc) to animate the difference between the current data and the new data. This is the code used to get the content and load it into the div:</p> <pre><code> function k() { $.post("../includes/ajaxAgenda.php", { limit : value }, function(data) { $('#tab-agenda').html(data); }); }; $(document).ready(function() { k(); $('#tab-agenda').scroll(function() { loadMore(); }); }); var refreshId = setInterval(function() { k(); }, 1000); </code></pre> <p>So I guess my question is how do I animate what gets loaded in so it doesn't just "pop" from one content to another? </p> <p>edit: I tried using the .live instead of .scroll but it doesn't seem to work:</p> <pre><code>$(document).ready(function() { $('#tab-agenda').live("scroll",function() { alert("hi"); loadMore(); }); }); </code></pre>
php jquery
[2, 5]
5,413,054
5,413,055
How does one create a method to add things in a list in Python?
<p>My background is in Java and I was only recently learning how to do some object oriented programming in it. I am currently learning python as well and I wondering how this Java code translates into python.</p> <p>Assuming I have a HockeyPlayer class that has a jerseyNumber instance variable:</p> <pre><code>public void addPlayer(HockeyPlayer h){ if(hockeyPlayers == null){ hockeyPlayers = new ArrayList&lt;HockeyPlayer&gt;(); } if(jerseyNumberExists(h.getJerseyNumber()) == false){ // this jersey number is available; add the player hockeyPlayers.add(h); } } </code></pre>
java python
[1, 7]
3,695,636
3,695,637
how to get dynamically created elements width and apply style to that?
<p>I am creating an <code>li</code> element dynamically like this:</p> <pre><code>$(data).find('slide').each(function(numSlide){ var slideLink = $(this).attr('link'); var slideimage = $(this).children('slideimage').text(); var slidedesc = $(this).children('slidedesc').text(); $('.slider ul').append('&lt;li&gt;&lt;a href="'+slideLink+'"&gt;&lt;img src="'+root+"images/top-slider-image/"+slideimage+'" alt="welcome to Burger Davis Blog" /&gt;&lt;/a&gt;&lt;div class="note"&gt;'+slidedesc+'&lt;/div&gt;&lt;/li&gt;'); }) </code></pre> <p>But I'd like to calculate the width of the <code>li</code>, and I need to apply some style to it -- how can I do that? If I add styles via the <code>css</code> method, it does not work for dynamically created elements...</p> <p>Please help me to get dynamic elements' width and how to apply styles into that?</p> <p>I know we can use the <code>live</code> function, but I can't get even by that..</p>
javascript jquery
[3, 5]
4,851,790
4,851,791
Moving an element back to its original position after animation, jQuery
<p>I'm struggling with trying to get this piece of code working properly. I'm moving an element with </p> <pre><code>$("#element").hide("slide", { direction: "right" }, 200); </code></pre> <p>Which works just great, but I need to reset it back to the original position before the animation, once the animation is complete so that it will animate again next time.</p> <p>Any help on this would be greatly appreciated.</p> <pre><code> var position = jQuery("#"+that.currentIconSlide).find('.slideInner').position(); jQuery("#"+that.currentIconSlide).find(".slideInner").hide("slide", { direction: "right" }, 200, function(){ jQuery(this).css({"left":position.left,"top":position.top}).parent().hide(); }); </code></pre> <p>JS Fiddle - <a href="http://jsfiddle.net/zalun/E4mz9/" rel="nofollow">http://jsfiddle.net/zalun/E4mz9/</a></p>
javascript jquery
[3, 5]
5,271,746
5,271,747
How to get the id value from check box?
<p>1 naga naga123</p> <p>2 Tamil tamil123 </p> <p>3 vinod vinod123 </p> <p>4 naveen naveen123 </p> <p>5 jakkir jakkir123 </p> <pre><code>save edit delete UserID: UserName: Password: </code></pre> <p>I have check box at the end of each row. When I click the check box and select edit the values should get displayed in the text boxes corresponding to userId, userName &amp; Password.</p> <p>My js code for edit is</p> <pre><code> function Edit(){ var i=dwr.util.getValue("userId"); LoginManagement.selectId(i,function(login){ dwr.util.setValues({userId:userId, userName:login.userName, passWord:login.passWord}); }); } </code></pre> <p>My js code for checkbox is </p> <pre><code> function Intialize(){ LoginManagement.getLoginDetails(function(loginList){ var x = ""; for(var i=0; i&lt;loginList.length; i++){ var login =loginList[i]; x += "&lt;tr&gt;&lt;td&gt;"+login.userId+"&lt;/td&gt;&lt;td&gt;"+login.userName+"&lt;/td&gt;&lt;td&gt;"+login.passWord+"&lt;/td&gt;&lt;td&gt;&lt;input type = 'checkbox' id = 'cbid"+login.userId+"'&lt;/td&gt;&lt;/tr&gt;"; } $("#loginTable").html(x); }); } </code></pre> <p>How should i get the id value in edit so that if i click the button it should display the values corresponding. Any suggestion please?</p>
javascript jquery
[3, 5]
2,402,589
2,402,590
jquery tipsy not firing onclick IE
<p>Hi I am using the jquery tipsy plugin to display colour names above colour swatch images.</p> <p>I am trying to trigger a checkbox to be checked/unchecked when a user clicks on the image.</p> <pre><code>$(document).ready(function(){ $('.label_check_colour').click(function(){ setupLabelColour(); }); } function setupLabelColour() { if ($('.label_check_colour input').length) { $('.label_check_colour').each(function(){ $(this).removeClass('c_on'); }); $('.label_check_colour input:checked').each(function(){ $(this).parent('label').addClass('c_on'); }); }; }; </code></pre> <p>HTML</p> <pre><code>&lt;div class="selectableSwatch"&gt; &lt;label class="label_check_colour" for="colour_1"&gt;&lt;input type="checkbox" id="colour_1" name="colour_id[]" value="1" /&gt;&lt;img class="colour_tip_1" width="20" src="img/colour-palette/1" /&gt;&lt;/label&gt; &lt;/div&gt; </code></pre> <p>Everything works great in Firefox and Safari but not in IE8.</p> <p>Help...please.</p>
javascript jquery
[3, 5]
3,374,105
3,374,106
Upload image/Photo from Iphone to webserver(ASP.net)
<p>I am pretty new in Iphone Apps. How do I upload Image/Photo from my Iphone to webserver. At web server I am using ASP.net c#.</p> <p>On Iphone i have image displayed on UIImage Control and that image I am getting from database from BLOB datatype column.</p> <p>how do I save that image bytes to application folder and then send image file to webserver.</p> <p>Please help me with the Iphone as well as ASP.net code.</p> <p>Many Thanks. </p>
asp.net iphone
[9, 8]
4,987,120
4,987,121
How to get the text-area content as exactly user entered
<p>In my webpage i am using textarea to get the details form the users and stored it in the database.</p> <p><strong>1.This is how the user entered</strong></p> <p><img src="http://i.stack.imgur.com/vkHrS.png" alt="enter image description here"> </p> <p><strong>2. This is how it stored in the database</strong></p> <p><strong>Our Needs: 1.WireSet 2.Amps 3.Lights</strong> </p> <p>Now i am retrieve the details in some-other pages How to display the result as show in the image(1) </p>
c# asp.net
[0, 9]
874,448
874,449
assign a value from a foreach loop to an asp:button CommandArgument
<p>The code behind file creates a list of employees and the asp.net page loops through list. Now, How do I assign the employeedID to the commandArgument of an asp:button?</p> <pre><code> &lt;%foreach(var employee in employeesList){%&gt; &lt;tr&gt; &lt;td&gt;&lt;%=employee.firstName%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=employee.lastName%&gt;&lt;/td&gt; /*How to access employee.Id in the commandArgument? */ &lt;td&gt;&lt;asp:Button ID="btnDeleteEmployee" runat="server" CommandArgument='' Text="Delete" OnCommand="btnDeleteEmployee_Click" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;%}%&gt; </code></pre>
c# asp.net
[0, 9]
5,215,351
5,215,352
$('input[type=checkbox]').change(function()
<p>Currently Im have the following script which checks to see if a checkbox value has changed but its not working when I try to use it!</p> <pre><code>&lt;script&gt; $('input[type=checkbox]').change(function () { if ($(this).is(':checked')) { if ($(this).prev().attr('checked') &amp;&amp; $(this).val() != $(this).prev().val()) { alert("previous checkbox has same value"); } } });​ &lt;/script&gt; &lt;input name="" type="checkbox" value="here"/&gt;(if this was checked) &lt;input name="" type="checkbox" value="here"/&gt;(then this) &lt;input name="" type="checkbox" value="there"/&gt;(would not allow prompt alert) &lt;input name="" type="checkbox" value="here"/&gt;(would allow)​ </code></pre> <p>you can see it working here yet it does not work when i try to use it <a href="http://jsfiddle.net/rajaadil/LgxPn/7" rel="nofollow">http://jsfiddle.net/rajaadil/LgxPn/7</a></p> <p>The idea is to alert when a checked checkbox value is different from the previously checked checkbox value! </p> <p>Currently my checkbox look like</p> <pre><code>&lt;input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="`key`=&lt;?php echo $rspatient['key']?&gt;" class="chk" id="chk&lt;?php echo $a++?&gt;"/&gt; </code></pre> <p>I thought the function <code>('input[type=checkbox]').change(function()</code> would get these but im wrong somewhere? </p>
javascript jquery
[3, 5]
2,220,270
2,220,271
Re-usable dropdown list when clicking various elements, what's the technique?
<p>Say I have various parts of a page, that when clicked, should display a dropdown list below the link I just clicked on.</p> <p>Since this drop down is the exact same, I noticed that some sites do this, where they have a single drop down list defined in the DOM, and when clicked, it somehow gets displayed below where they clicked.</p> <p>What's the technique to do this?</p> <p>Would it be to have a empty div below all the parts of my site where I want to inject the drop down, then when clicked, copy the div that contains the drop down list elements to the element that was just clicked? Or is there a smarter way?</p>
javascript jquery
[3, 5]