Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,354,791
1,354,792
How can this Javascript be expressed more succinctly?
<p>I have some Python code that I'm porting to Javascript:</p> <pre><code>word_groups = defaultdict(set) for sentence in sentences: sentence.tokens = stemmed_words(sentence.str_) for token in sentence.tokens: word_groups[sentence.actual_val].add(token) </code></pre> <p>I don't know a lot about Javascript, so this was the best I could do:</p> <pre><code>var word_groups = {} for(var isent = 0; isent &lt; sentences.length; isent++) { var sentence = sentences[isent] sentence.tokens = stemmed_words(sentence.str_) for(var itoken = 0; itoken &lt; sentence.tokens.length; itoken++) { var token = sentence.tokens[itoken] if(!(sentence.actual_val in word_groups)) word_groups[sentence.actual_val] = [] var group = word_groups[sentence.actual_val] if(!(token in group)) group.push(token) } } </code></pre> <p>Can anyone suggest ways to make the javascript code look more like the python?</p>
javascript python
[3, 7]
2,049,803
2,049,804
How to set header Access-Control-Allow-Origin for XDomain
<p>How to set header Access-Control-Allow-Origin for XDomain</p> <p>i am trying to do this by java code or by script code.</p> <p>Please suggest me some way.</p>
java javascript
[1, 3]
3,336,705
3,336,706
Display image in new tab
<p>I display the image thumbnail on datalist as: <img src="http://i.stack.imgur.com/28Y3P.png" alt="enter image description here"></p> <pre><code>&lt;asp:DataList ID="dtlistImages" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px"&gt; &lt;ItemTemplate&gt; &lt;%--&lt;img id="imgImageHtml" height="83px" width="150px" src="&lt;%Eval("img_tb") %&gt;" alt="Image not displyed" runat="server" /&gt;--%&gt; &lt;a href="" target="_blank"&gt; &lt;asp:Image ID="imgnewspaper" style="float:right; margin:5px; margin-left:10px; border:2px solid #BAB9BE;" Width="90px" Height="95px" runat="server" OnClick="MyPicture_Click" AlternateText='&lt;%# Eval("newspaperName") %&gt;' ImageUrl='&lt;%# Eval("img_tb") %&gt;' Autopostback="true" /&gt; &lt;/a&gt; &lt;/br&gt; &lt;asp:Label ID="lblID" runat="server" Text='&lt;%# Eval("pageNumber") %&gt;' Font-Bold="true" Font-Size="10pt" ForeColor="#336699" Width="100%"/&gt; &lt;/ItemTemplate&gt; &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Top" /&gt; &lt;/asp:DataList&gt; </code></pre> <p>Now I want to show the thumbnail big image on new tab. How can I do???</p>
c# asp.net
[0, 9]
3,180,744
3,180,745
Odd behavior in javascript
<p>I have a table like so</p> <pre><code>&lt;table&gt; &lt;tr id="trRow1" runat="server" style="display: none"&gt; &lt;td&gt;First Name:&lt;/td&gt; &lt;td&gt;&lt;asp:Label id="lblFirstName" runat="server"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Last Name:&lt;/td&gt; &lt;td&gt;&lt;asp:Label id="lblLastName" runat="server"&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>As you can see, initially the first row is not being displayed. When the user clicks a certain radio button on the page an asynchronous postback occurs, and at that time I set the style of trRow1 to "inline". Nothing fancy; nothing new. It works just great.</p> <p>Or at least up until I try to do the following in a javascript function.</p> <pre><code>function Test() { var obj = trRow1.getElementsByTagName("select"); alert(obj.length); } </code></pre> <p>At the point I call Test(), I get an error that says "Microsoft JScript runtime error: 'trRow1' is undefined."</p> <p>My guess is it has something to do with the fact that I'm messing with setting the Display style using AJAX, and for whatever reason the DOM can't find trRow1 even after I set it's display to "inline".</p> <p>Can anyone throw me a bone on this one? I'm stuck.</p>
asp.net javascript
[9, 3]
5,341,195
5,341,196
This JQuery works in Chrome and Safari, Not FF?
<p>I have a bunch of code that will open and close a div using the slidetoggle/toggleclass method</p> <p>Now while the DIv is opened, I added in this little bit to allow the window to close if someone clicks outside of the now opened div.</p> <pre><code>$("body").live("click", function() { if($(event.target).parents().index($('.subpanel')) == -1) { if($('.subpanel').is(":visible")) { $(".alerts").toggleClass("notiftitleactive"); $(".alerts").toggleClass("active").next().slideToggle(50); $("body").die("click"); } } }); </code></pre> <p>This works perfectly well in google chome and safari. But in firefox, clicking outside of the div does nothing (does not trigger the .alerts to toggleclass/slidetoggle).</p> <p>Any idea why this wouldnt work in FF ?</p> <p>Thanks!</p>
php jquery
[2, 5]
5,311,603
5,311,604
Is Id necessary in applying jquery functions?
<p>Suppose I have two <code>p</code> tags in the document. I want to call two different effects using <strong>jQuery</strong> when <strong>onMouseOver</strong> event happens. Is it necessary that these two <code>p</code> tags be given Ids. Can't it be achieved without giving Ids to these tags ?</p>
javascript jquery
[3, 5]
2,190,392
2,190,393
jquery treeview expand given node
<p>Im building ul li list dynamically on the serverside code. How can I determine which node should be expanded when page is loaded ?</p> <p>Im using plugin: <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" rel="nofollow">http://bassistance.de/jquery-plugins/jquery-plugin-treeview/</a></p> <p>thank You very much for help</p>
javascript jquery asp.net
[3, 5, 9]
2,218,525
2,218,526
javascript variable into php
<p>I have a php function, in this function I have a javascript which get the value of my element from parent window. My problem now is, how can I pass this value into php variables</p> <p>Any help would greatly appreciated.</p> <p>Thanks</p> <p>Tirso</p> <p>I tried this code but I got value always 1</p> <p>here is my code</p> <pre><code>function do_upload() { $categories = print '&lt;script type="text/javascript"&gt;window.top.window.$("#categories").val();&lt;/script&gt;'; } </code></pre> <p>the value I've got for $categories is always 1;</p>
php javascript
[2, 3]
2,538,217
2,538,218
JQuery get text start with an element
<p>i have this code.</p> <pre><code>&lt;p&gt;jQuery is free, open source software, dual-licensed under the &lt;span&gt;MIT License&lt;/span&gt; or the GNU General Public License, Version 2.&lt;/p&gt; &lt;p&gt;&lt;span id="elt"&gt;jQuery is a&lt;/span&gt; cross-browser &lt;span&gt;JavaScript&lt;/span&gt;library designed to simplify the client-side scripting of HTML. &lt;span&gt;It was released in January 2006&lt;/span&gt; at BarCamp NYC by John Resig. Used by over 52% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use &lt;span&gt;today&lt;/span&gt;.&lt;/p&gt; &lt;img src="character1.jpg" height="200"/&gt; &lt;p&gt;jQuery is free, open source software, dual-licensed under the &lt;span&gt;MIT License&lt;/span&gt; or the GNU General Public License, Version 2.&lt;/p&gt; &lt;p&gt;... </code></pre> <p>i want to get the first 500 characters start with <code>$(".elt")</code> ,like this:</p> <pre><code>jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML.It was released in January 2006 at BarCamp NYC by John Resig. Used by over 52% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use today.jQuery is free, open source software, dual-licensed under the MIT License or the GNU General Public License, Version 2. </code></pre> <p>just text, remove all the html tags.</p>
javascript jquery
[3, 5]
1,362,076
1,362,077
Does JQuery get() + array access break the chain?
<p>I'm a noob at Jquery so forgive me if this is ridiculous, but does get() and [] break the method chain ? I'm attempting to retrieve a single element from a returned Jquery Object :</p> <pre><code>&lt;HTML&gt; &lt;HEAD&gt;&lt;TITLE&gt;A test page&lt;/TITLE&gt;&lt;/HEAD&gt; &lt;BODY&gt; &lt;p&gt;This is a paragraph&lt;/p&gt; &lt;p&gt;This is a second paragraph&lt;/p&gt; &lt;/BODY&gt; &lt;/HTML&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var x = $("p").get(1).text(); //This doesn't work var y = $($("p").get(1)).text(); //re-wrapping the result does however. &lt;/script&gt; </code></pre> <p>If this is the case, how do I more succinctly retrieve a designated value, because at the moment the approach I'm using above is a little clunky to say the least.</p>
javascript jquery
[3, 5]
224,927
224,928
How display data in the textbox in jquery
<p>I am getting problem to display selected data in textbox I have following code which display data bellow the text box according to user suggestion</p> <pre><code>$('input[name=profileOrg]').keyup(function(){ var q = $(this).val(); $.get("CHI_custom/customScripts/getorgname.php?q="+q, function(data){ $('#name').html(data).show(); }); </code></pre> <p>Following is code which give me the list from the database</p> <pre><code>$term = $_GET['q']; $query = "SELECT organization_name FROM members WHERE organization_name LIKE '".$term."%'"; $result = $db-&gt;query($query); while ($row = $result-&gt;fetch_array()) { //$member[] = $row['organization_name']; echo '&lt;a href="#"&gt;'.$row['organization_name'].'&lt;/a&gt;&lt;br&gt;'; } </code></pre> <p>In this code i can able to display data bellow the text box according to user suggestion but i am getting problem when the user select data from the list how can i display selected value in the textbox?</p> <p><strong>I don't want to use jquery UI auto complete</strong>. </p>
php jquery
[2, 5]
3,529,416
3,529,417
String manipulation in Javascript code
<p>I have two text boxes on my Form. One is <code>txtNumberOfTablets</code> and the other one is <code>txtTotalQuantity</code>.</p> <p>I have a HiddenField and I am setting its value in code behind file on page load.</p> <p><code>hdfMedicationDosage = "2/3/4";</code></p> <p>What I want is, whatever user enters to <code>txtNumberOfTablets</code> textbox, should be multiplied with <code>hdfMedicationDosage</code> value when focus is out of <code>txtNumberOfTablets</code>.</p> <p>For example <code>txtNumberOfTablets</code> contains value 2, and focus is out of <code>txtNumberOfTablets</code>, then that <code>txtTotalQuantity</code> will have a value <code>2*2/3*2/4*2</code> i.e.<code>4/6/8</code></p> <p>I want to achieve this in JavaScript. Any help would be appreciated.</p>
c# javascript asp.net
[0, 3, 9]
3,736,128
3,736,129
IOException: Broken pipe when running Android application
<p>When trying to run my Android app from Eclipse I get this error in the console:</p> <pre><code> [2013-03-04 14:19:05 - ddmlib] Broken pipe java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:89) at sun.nio.ch.IOUtil.write(IOUtil.java:60) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450) at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213) at com.android.ddmlib.Client.sendAndConsume(Client.java:605) at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:348) at com.android.ddmlib.Client.requestAllocationStatus(Client.java:451) at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:837) at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:805) at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:765) at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:652) at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:44) at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:580) </code></pre> <p>How do I fix this kind of error? </p> <p>When I did <code>adb connect &lt;IP_ADDRESS&gt;</code> it showed connected to 192.168.0.109:5555</p>
java android
[1, 4]
1,280,560
1,280,561
setInterval works online on same sytem (with 2 browsers open) but not online on separate systems
<p>I have a setinterval code updating a div. This works fine when tested in two separate browsers on the same system but when I test online on say a separate mac and PC and it stops. </p> <p>The code is as follows:-</p> <p>Javascript:</p> <pre><code> function setupAjaxIntervalDiscuss(){ setInterval(function() { var datastring = 'refreshchat=true&amp;projid=' + proj_id + '&amp;uid=' + uid; ajaxUpdateDiscussion(datastring); }, 2000); } function ajaxUpdateDiscussion(ajaxdata){ $.ajax({ type: "POST", url: "uploaddata.php", data: ajaxdata, success: function(data){ $("#discussresult").html(data); refreshNav();//Updating a scrollbar styled with JS } }); } </code></pre> <p>PHP(this update correctly just here for ref) :</p> <pre><code> if(isset($_POST["refreshchat"])){ $user_id= $_POST['uid']; $proj_id=$_POST['projid']; echo '&lt;img class="closeddiscuss" src="images/closey.png" title="close" alt="close"/&gt;'; $get_discuss_query = "SELECT * FROM discuss INNER JOIN user ON discuss.user_id=user.user_id WHERE discuss.project_id=$proj_id ORDER BY discuss_id DESC"; $get_discuss_result=mysql_query($get_discuss_query); while($row=mysql_fetch_assoc($get_discuss_result)){ $text = nl2br($row['discuss_text']); $name = $row['user_name']; $user_profileimageurl = $row['user_profileimageurl']; echo '&lt;div class="discussbubble"&gt;&lt;p&gt;'.$text.'&lt;/p&gt;&lt;img class="smallprofileimage" src="'.$user_profileimageurl.'" alt="user profile image"/&gt; by '.$name.'&lt;/div&gt;'; } } </code></pre>
php javascript jquery
[2, 3, 5]
3,941,068
3,941,069
Javascript if syntax
<p>i have syntax error when i'm trying to run a simple if statements</p> <blockquote> <p>[Break On This Error] }); </p> </blockquote> <p>invalid assignment left-hand side [Break On This Error] container += </p> <p>what is my problem and how i can make:</p> <pre><code>if this.ewCount != 0 then {} elseif NotDoneh == 0 then {} ELSE {} </code></pre> <p>this is my current code:</p> <pre><code>var conta = '&lt;div&gt;'; $.each(items, function () { if (this.ewCount != 0) { if (DoneWidth == 0) { conta += '&lt;br/&gt;dddddddddddddddddd&lt;br/&gt;&lt;br/&gt;' + }); if (NotDoneh == 0) { conta += '&lt;br/&gt;dddddddddddddddddd&lt;br/&gt;&lt;br/&gt;' + }); }); container += '&lt;/div&gt;' + </code></pre>
javascript jquery
[3, 5]
862,084
862,085
when a web app generate most markup by javascript ...
<p>I have seen a web app that generate most of a page's markup by javascript+ jquery. The server only generate a web page with just 1 DIV . The rest are done with create on client side via javascript+jquery+AJAX .</p> <p>What are the pros and cons of this javascript centric approach ?</p>
javascript jquery asp.net
[3, 5, 9]
5,693,145
5,693,146
Show random classes
<p>Let's say I have some classes like:</p> <pre><code>&lt;div class="something" style="display: none"&gt;Some text I would like to show&lt;/div&gt; &lt;div class="something" style="display: none"&gt;Some text2 I would like to show&lt;/div&gt; &lt;div class="something" style="display: none"&gt;Some text3 I would like to show&lt;/div&gt; &lt;div class="something" style="display: none"&gt;Some text4 I would like to show&lt;/div&gt; &lt;div class="something" style="display: none"&gt;Some text5 I would like to show&lt;/div&gt; </code></pre> <p>And I want to show random class every few seconds. I suppose pseudo-code would be something like that:</p> <pre><code> setInterval(function() { $('.something').hide(); var rand_number = random(1, ('.something').length); $('.something').array[rand_number].show(); }, 5000); </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
3,311,012
3,311,013
Without using jquery, how to cycle through images to make a simple slideshow
<p>You have a div, with 3 images in it.</p> <p>How to create a simple slideshow that cycles through the images, and displays each image for 5 seconds and goes back to the first image when done and continues looping.</p> <p><strong>Without using jquery or any other framework.</strong></p>
javascript jquery
[3, 5]
4,801,584
4,801,585
Can set the div content with jquery
<p>Why can't I put dynamic text on a div called foo? The following is on a metho in the asp.net codebehind.</p> <pre><code>StringBuilder script = new StringBuilder(); script.Append("&lt;script type='text/javascript'&gt;"); script.Append(" $(document).ready(function () {"); script.Append(" $('&lt;div id=foo&gt;&lt;/div&gt;').appendTo('body');"); script.Append(" var dlg = $('#foo');"); script.Append(" dlg.dialog({"); script.Append(" autoOpen: true,"); script.Append(" resizable: false,"); script.Append(" draggable: false,"); script.Append(" modal: true,"); script.Append(" title: 'Información',"); script.Append(" width: 400,"); script.Append(" height: 200,"); script.Append(" buttons: {"); script.Append(" 'Cerrar': function () {"); script.Append(" $(this).dialog('close');"); script.Append(" }"); script.Append(" }"); script.Append(" });"); script.Append(" $('#foo').html(&lt;p&gt;"+info+"&lt;/p&gt;);"); script.Append(" });"); script.Append("&lt;/script&gt;"); ClientScript.RegisterStartupScript(this.GetType(), "launchModalWindow", script.ToString()); </code></pre> <p>The problem is in this line:</p> <pre><code>script.Append(" $('#foo').html(&lt;p&gt;"+info+"&lt;/p&gt;);"); </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,799,507
1,799,508
Open Ms Word in write mode using microsoft.office.interop.word
<p>I am trying to open a MS Word Document through C#. But the open method is opening the document in a read-only mode. I want the file to be opened in write mode without creating another copy of i, so that I can save the changes to Database. Here is the code for opening the file.</p> <pre><code>public void def() { Word.Application app = new Word.Application(); Word.Document dd = app.Documents.Open("C:\\hi12.docx", ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing,ref repair); dd.TrackRevisions = true; dd.CommandBars["Reviewing"].Controls["Reviewing Pane"].Execute(); int count = dd.Words.Count; dd.Close(ref Nothing, ref format, ref Nothing); } </code></pre>
c# asp.net
[0, 9]
5,829,589
5,829,590
AJAX validation "freezes" in jQuery?
<pre><code>function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data) { if (data == 1) ret = true } }); return ret; } </code></pre> <p>I use bvalidator to validate fields. It seems to fire this function on every keypress and the user is not able to continue typing before the ajax call is competed. I'm not really sure what to do here. </p> <p>How could I make the function not be ran more than once every two seconds for example?</p>
javascript jquery
[3, 5]
1,131,463
1,131,464
Assign a Value to a Div so I can keep track of it
<p>I am creating and appending images (divs) like this:</p> <pre><code>$('#event_list_main').append('&lt;img class="listed_event" id="random_event" src="final_tutorial_buttons/random.png" height="50" width="50" onclick="one_band_event_action();" /&gt;'); </code></pre> <p>so each time this is executed, an image pops up next to the previous one and so on! The problem is that I want to keep track of these! </p> <p>I came accross this </p> <blockquote> <p><a href="http://www.webdeveloper.com/forum/showthread.php?t=147935" rel="nofollow">http://www.webdeveloper.com/forum/showthread.php?t=147935</a></p> </blockquote> <p>but I don't know how to implement it. Another thing I thought of is, to pass a reference number (something like a counter) in "append()" like this:</p> <pre><code>$('#event_list_main').append('&lt;img class="listed_event" id="random_event &lt;INSERT REFERENCE&gt;" src="final_tutorial_buttons/random.png" height="50" width="50" onclick="one_band_event_action();" /&gt;'); </code></pre> <p>but how can I pass it? is there an escape symbol?</p>
javascript jquery
[3, 5]
5,446,755
5,446,756
Jquery multi DIVs hide/show
<p>i want to show hide multiple divs with jquery or javascript. I seached the web but i find codes that must have unique divs like:</p> <pre><code>&lt;div id="div1"&gt;text&lt;/div&gt; &lt;div id="div2"&gt;text&lt;/div&gt; </code></pre> <p>and so on, but i want to add the divs in a foreache php function so i can't have multiple IDs, the foreache is a div wrapper. So, my question is how can i do that ?</p> <p>EDIT Because i am complete noob at JQuery i don't know how to implement anything, so i have this</p> <pre><code> &lt;div id="wrapper"&gt; &lt;div class="title"&gt; &lt;div class="hide"&gt; Hidden Text&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>When i click the title div, i want the class="hide" to be shown.</p> <p>Solution:</p> <pre><code> .box { margin:10px; height:auto; } .panel,.flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } .panel { padding:50px; display:none; } &lt;/style&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".flip").click(function(){ $(this).next().slideToggle(500); }); }); &lt;/script&gt; &lt;div class="box"&gt; &lt;h1&gt;This is the div&lt;/h1&gt; &lt;div class="flip"&gt;If u click &lt;/div&gt; &lt;div class="panel"&gt; This will show&lt;/div&gt; </code></pre> <p> The problem was as i said the div were generated by the foreach function and this solved it, Thanks to all ! I have much to learn.</p>
php javascript jquery
[2, 3, 5]
4,104,364
4,104,365
Asp.net webpage has a lot of blank space at bottom
<p>My asp.net webpage has a ton of white space at the bottom of a div within a content page, and I have no idea where its coming from. There are NOT a ton of <code>&lt;br /&gt;</code> 's or &amp;nbsp's in the source view. How can I find out where the space is coming from and correct?</p> <p>Could this element be taking up space???</p> <pre><code> &lt;ul style="display: none; visibility: hidden; z-index: 10000; overflow-x: hidden; overflow-y: auto; width: 246px; position: absolute; height: 320px;" class="ajax__combobox_itemlist" id="ctl00_ctl00_PageContent_PageContent_cboTurnOver_OptionList"&gt;&lt;li&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;Aaron Ament - 034 &lt;/li&gt;&lt;li&gt;Aaron Stack - 235 &lt;/li&gt;&lt;li&gt;Accounting - OA &lt;/li&gt;&lt;li&gt;Adam Kauth - 289 &lt;/li&gt;&lt;li&gt;Admin - 481 &lt;/li&gt;&lt;li&gt;Aimee Tatge - 149 &lt;/li&gt;&lt;!--Over 100 entries removed for security and brevity--&gt;&lt;li&gt;Zeddie Roshelle - 346 &lt;/li&gt;&lt;/ul&gt; </code></pre>
c# asp.net
[0, 9]
884,992
884,993
Remove common string from a string using jquery or Javascript
<p>How can remove the 'tp.','ta.' and 'tta.' from below string from each place where it is coming</p> <pre><code>str = " tp.FirstName, tp.FamilyName, ta.DOB, tta.TypeOfLocation WHERE tp.DateStamp BETWEEN '2012-02-12 15:13:00' AND '2013-02-12 15:13:00' AND tta.db_name_id =21 AND tp.FirstName = 'Darlene'"; </code></pre> <p>I need result as below:</p> <pre><code>FirstName, FamilyName, DOB, TypeOfLocation WHERE DateStamp BETWEEN '2012-02-12 15:13:00' AND '2013-02-12 15:13:00' AND db_name_id =21 AND FirstName = 'Darlene'"; </code></pre> <p>Note: I have asked same question but this time I am using multiple removing string. Please assist me</p>
javascript jquery
[3, 5]
2,052,902
2,052,903
Redirect to same page after login becuse of session time out in asp.net
<p>Hi is there a anyway to land same page after sign in because of session time out in asp.net web application. I am recently migrated from java to .net and any suggestion will be greatly helpful. As a example </p> <p>I am on <strong>Page1</strong> and while i am idle on <strong>Page1</strong> my session was destroyed and i was redirected to <strong>Logging</strong> page. After i logging to system currently i am on <strong>Default</strong> page. What i want to do is simply redirect to <strong>Page1</strong> after logging. Sorry for my bad English.</p> <p>Here is Web.config</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Login.aspx" timeout="2880"/&gt; &lt;/authentication&gt; </code></pre> <p>and the login button function #region"Validate login user" public void ValidateUser() {</p> <pre><code> try { string con = ConnectionSetting.SQLDBConnectionString(); sUserNameT = this.txtUname.Text.ToLower(); sPassWordT = this.txtPassword.Text; Some required functions user...... if (check some stuff) { Decrypting and other stuff.... if (matching password) { if (if the logging success) { LoadScreensByUser(userbyactive.UserId, con); UserLogedDetails(userbyactive.UserId);//Log User Loging Records. Response.Redirect("~/Main.aspx"); } else { Output...(); } } else { Output...(); } } else { Output...(); } } catch (Exception ex) { throw ex; } } #endregion </code></pre> <p>Here i have provided the minimum required codes..</p>
c# asp.net
[0, 9]
4,954,273
4,954,274
Floating tab on page?
<p>I'm looking to create a simple page tab... thing.</p> <p>The issue is, I don't even know the proper terminology for them. I'm talking about those little tabs that stick to one side of the window, they're commonly used for support windows.</p> <p>Here's an example: <a href="http://www.livechatinc.com/" rel="nofollow">http://www.livechatinc.com/</a> (bottom right)</p> <p>Could someone give me the code for one? and I'll modify it appropriately. I just want a simple image that links to another page.</p> <p>Thanks.</p>
php javascript
[2, 3]
4,679,098
4,679,099
AlphaAnimation Class Not Work In CountDownTimer
<p>Actually I write a AlphaAnimation in XML and use it in my activity. When I want to use it onFinish CountDownTime method, it doesn't work. How can I fix it?</p> <p>This is my code:</p> <pre><code>new CountDownTimer(1000, 1000) { @Override public void onTick(long millisUntilFinished) {} // end -&gt; method -&gt; onTick @Override public void onFinish() { googleAccount.startAnimation(loginFadeOut); password.startAnimation(loginFadeOut); login.startAnimation(loginFadeOut); googleAccount.setFocusableInTouchMode(true); password.setFocusableInTouchMode(true); login.setEnabled(true); } // end -&gt; method -&gt; onFinish }; </code></pre>
java android
[1, 4]
214,170
214,171
Making a jquery name tagger
<p>I am trying to make a name tagger in jquery + php. I have done the PHP part and jquery code is 99% done, but my problem is passing the string to search for after the '@' sign. I currently use a div with contentEditable set to true. From what I see in console log the name variable is indeed @+search string, but the list div will not be populated, I tried running the script manually just to debug and it works, including setting the name variable to one specific letter and it populates the list div. Any tips and suggestions appreciated my code below:</p> <pre><code>$("#chat-message").bind("keyup", function (event) { //auto name complete var search = $(this).text(); var searchbox = search.split(search.indexOf('@') + 1); var checker = search.substr(search.length - 1); //Checks last charcter inserted if its '@' var name = search.match(/@(\w+)/ig); console.log(name); var dataString = 'searchword=' + name + '&amp;search=yes'; if (name == '' || checker == " ") { $("#display-search").hide(); } else if (checker === "@") { $.ajax({ type: "POST", url: "searchy.php", data: dataString, cache: false, success: function (html) { $("#display-search").html(html).show(); } }); } return false; }); </code></pre>
javascript jquery
[3, 5]
1,244,674
1,244,675
How to similate download speed with bar?
<p>How is it possible to simulate a download speed with a bar?</p> <p>Example show with a bar how long time it takes to download 5 MB with a 1 Mbyte/s connection.</p> <p>I have made a bar with CSS and HTML to simulate 40%: <a href="http://jsfiddle.net/JxfAk/3/" rel="nofollow">http://jsfiddle.net/JxfAk/3/</a></p> <p>My Jquery:</p> <pre><code>$(document).ready(function() { var Download = 1048576 var Data = 1048576 * 5 }); </code></pre> <p>HTML:</p> <pre><code>&lt;div id="barboks"&gt;&lt;div id="bar"&gt;&lt;/div&gt;&lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>#barboks {width:200px;height:40px;border:1px solid #CCCCCC;} #bar {width:50px;height:40px;background:blue;display:block;} </code></pre> <p>I just don't know how I should very-ate the width of the bar as the download speed of the data. </p>
javascript jquery
[3, 5]
1,301,149
1,301,150
Can I reduce this jquery script down to one line?
<p>I have written this code</p> <pre><code>if (forw == true) { if ($('.tickertape li.active')[0] != $('.tickertape li').last()[0]) { $('.tickertape li.active').removeClass('active').next().addClass('active'); } else { $('.tickertape li.active').removeClass('active'); $('.tickertape li').first().addClass('active'); } } else { if ($('.tickertape li.active')[0] != $('.tickertape li').first()[0]) { $('.tickertape li.active').removeClass('active').prev().addClass('active'); } else { $('.tickertape li.active').removeClass('active'); $('.tickertape li').last().addClass('active'); } } </code></pre> <p>Which works but really feels like it should only be on one line. This there a way to do this?</p>
javascript jquery
[3, 5]
5,520,285
5,520,286
Push Notification in Asp.net
<p>I am working on the Asp.net and want to send the push notification to iPhone using ASP.NET(C#). How can I achieve this.Can you provide the detail on the same. I have little bit Knowledge about APSN-sharp",but I don't know how to user it. </p> <p>Thanks in Advance.</p>
c# iphone asp.net
[0, 8, 9]
531,062
531,063
Only swipeone is working with jGestures
<p>I'm trying to implement touch evens with jGestures. swipeone works fine but anything else (swipeleft, swiperight etc) is not firing.</p> <pre><code>&lt;div id="wrap" style="height:500px; width:500px; background: blue;"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $('#wrap').bind('swipeleft', function(){ alert("test"); }); &lt;/script&gt; </code></pre> <p>This is just a test page I did. It was actually working at one point in my main project but seemed to have stopped for no reason at all, not even when I reverted to an older version. I've tried a different version of jGestures with no luck.</p>
javascript jquery
[3, 5]
2,004,367
2,004,368
How to check the last char of a string and see its a blank space
<p>How to check the last char of a string and see its a blank space.If its ablankspace remove it ?</p>
c# asp.net
[0, 9]
4,068,154
4,068,155
PHP code in JavaScript to get variable
<p>When I press on any of the ‘region’ names in the list ('<code>href</code>' links), the matching list of 'cities' is showing underneath.</p> <pre><code>&lt;?php while(has_list_regions()) { ?&gt; &lt;a href="javascript:show_region('&lt;?php echo list_region_id() ?&gt;');"&gt;&lt;/a&gt; &lt;?php } ?&gt; &lt;script type="text/javascript"&gt; function show_region(chosen_region_id) { ; $(this).slideDown(200); ; &lt;?PHP $clicked_tag = 'chosen_region_id'; ?&gt; } &lt;/script&gt; </code></pre> <p>Is it possible to include PHP code within a section of JavaScript? Because I need to get the ID of the selected ‘<code>href</code>’ that I clicked. I am trying to include the PHP code in the above JavaScript function but it doesn’t work.</p>
php javascript
[2, 3]
4,413,335
4,413,336
Can you write Javascript object init shorthand C# style?
<p>I have the following Javascript:</p> <pre><code>function TestModel() { this.name = "Testvalue"; this.id = 0; } var test = new TestModel(); alert(test.name); </code></pre> <p>If I want to initialize an object with different parameters without the use of a constructor I would need to call the following code:</p> <pre><code>var test = new TestModel(); test.name = "other value"; test.id = 5; alert(test.name); </code></pre> <p>What I would like to do is something similar to the C# style:</p> <pre><code>class TestModel { public string name = "Testvalue"; public int id = 0; } TestModel test = new TestModel() { name = "other value", id = 5 }; System.Windows.MessageBox.Show(test.name); </code></pre> <p>But if I try something like that in javascript it won't work.</p> <p>In short: I am trying to init a object in 1 line without the use of a constructor. Is this possible in javascript?</p>
c# javascript
[0, 3]
498,325
498,326
Asp.Net page reload problem after login
<p>I am devolping a web application.the problem is that i am using a login control (not a .NET control) which is a part of master page and is acessible from all pages. if user log In from a page the login control updates itself and displlay some statistics of logged In user but the specific page does not reload. (some options on page are visible only to authenticated users, so that after login, page should be reloaded to display such options)</p> <p>after logIn methoed I wrote </p> <pre><code>Reponse.Redirect(Request.Url.AbsoluteUri) </code></pre> <p>after this the browser response the "Page cannot be displayed"</p> <p>It would be of great help to me.</p> <p>Many Thanks, Regards. AZHAR</p>
c# asp.net
[0, 9]
3,271,589
3,271,590
Having problems with importing dropbox and getting it to run?
<p>I downloaded the dropbox sdk zip off the dropbox website, then imported the program into eclispe. Then i configured the build path and added the 2.2 jar file to run, theres no errors until I load up the aplication, when I ran it on the 1.5 emulator it gave me a Uncaught handler: thread main exiting due to uncaught exception error, then when I ran it on the 2.2 emulator it gave me a at android.app.Instrumentation.newActivity(Instrumentation.java:1021) error its not even letting the ap run, any ideas?</p>
java android
[1, 4]
5,744,725
5,744,726
How do you make animations not fire unless previous is done (withtout using callback)
<p>I have a function called: </p> <pre><code>this.makeStuffHappen() </code></pre> <p>Which makes different animations according to a switch statement and a couple of variables. Is it possible to make a function not fire unless all previous are done resolving.</p> <p>I want to write something like </p> <pre><code>$('button').click(function(){ a.makeStuffHappen(); b.makeStuffHappen(); c.makeStuffHappen(); d.makeStuffHappen(); }); </code></pre> <p>And then it should only run b after a is done, c after b is done and d after c is done. Is it only possible to make animations wait for the previous by chaining them? Is it possible to chain any function? </p> <p>Edit: makeStuffHappen() is animating different elements so a.makeStuffHappen() will animate a different element than b.makeStuffHappen and so on.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
3,270,108
3,270,109
jQuery ":contains" alternative for a links
<p>There is a selector in jQuery - :contains</p> <p>Example:</p> <pre><code>str = 'test'; blocked_div = $(".mydiv:contains("+str+")"); blocked_div.find('img').hide(); ... &lt;a href="http://example.com"&gt;test&lt;/a&gt; ... </code></pre> <p>As I understand it's search for a "test" text inside a ".mydiv" element. But now i need to find a link "http://example.com" inside a ".mydiv" element, and :contains dont work in this situation. Can you recommend a solution to do this ?</p>
javascript jquery
[3, 5]
169,593
169,594
Can't understand how to do it with javascript and jquery code
<p>Sorry guys for asking that dumb question but I have problem with that thing. Have such script, it should return true or false, but after drawing that html pop-up window and getting response from that methods. </p> <pre><code> $("#pageInfo a.btnDel").click(function () { $("#cmsSmallPopUpWindowMessage").html("&lt;h2&gt;Do you really want to delete this page?&lt;/h2&gt;&lt;center&gt;&lt;div style='width:130px'&gt;&lt;ul class='bactions'&gt;&lt;li&gt;&lt;a id='cmsSmallPopUpWindowBYes' href='javascript:void(0)'&gt;&lt;span&gt;&lt;span&gt;Yes&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id='cmsSmallPopUpWindowBNo' href='javascript:void(0)'&gt;&lt;span&gt;&lt;span&gt;No&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class='archor'&gt;&lt;/div&gt;&lt;/div&gt;&lt;/center&gt;"); $.blockUI({ message: $("#cmsSmallPopUpWindow"), css: { width: "530px", border: "0px", backgroundColor: "transparent"} }); setTimeout(function () { $.unblockUI(); }, 6000); $("#cmsSmallPopUpWindowBNo").click(function () { $.unblockUI(); return false; }); $("#cmsSmallPopUpWindowBYes").click(function () { $.unblockUI(); location.reload(); return onDelete($(this).attr('href')); }); return true; // this should change for "false" or "true" but after click on "yes" or "no" }); </code></pre>
javascript jquery
[3, 5]
5,197,449
5,197,450
How to write xml file using C#
<p>I am newer person in c# asp.net . I want to write xml file in c# code behind file in my asp.net web application and pass this xml file as a string to a webservice . Can any one able to help me its will very useful for my project . Thank you </p>
c# asp.net
[0, 9]
2,257,694
2,257,695
javascript code to edit&save file on linux server?
<p>is there any javascript code that I can use to <strong>edit</strong> (and maybe download and later upload the modified) text file on a linux server?</p> <p>So I do not have to leave my web browser and do ssh all the time when I need to edit or even only check some config files? The server is not accessible from the Internet.</p>
php javascript
[2, 3]
1,056,521
1,056,522
jQuery toggle running twice
<p>It seems that this code:</p> <pre><code>$(function(){ $('.show_hide_login').toggle( function (){ alert('show'); $("div#fullpage").show(); $("div#loginbox").show(); }, function (){ alert('hide'); $("div#loginbox").hide(); $("div#fullpage").hide(); } ); }); </code></pre> <p>Any idea on why it would be running twice when I click on either link (two, one is a div and one is an anchor)?</p>
javascript jquery
[3, 5]
2,949,415
2,949,416
ie prevent mousewheel while mouse is over a div
<p>How do i prevent the mouse wheel from scrolling the entire html page which im over a div which can mousewheel?</p>
javascript jquery
[3, 5]
2,696,933
2,696,934
Why does has my javascript stopped working on live site, but works fine in test environment?
<p>Okay, this is very weird...</p> <p><a href="http://connecttofriends.com/admin/login" rel="nofollow">http://connecttofriends.com/admin/login</a></p> <p>I'm writing an administration control panel and am using a template from Theme Forest (because I didn't sign on to create any graphics, so my client bought it). For the login page listed above, I had to program it to run through Javascript due to the way it was set up.</p> <p>I got it working and everything. Suddenly, though, something bizarre happened, and Javascript has not worked on that page at all since. None of my Javascript will even appear in Firebug, and I haven't been able to find anything to suggest that there's a Javascript error. Worse yet... on my local test server, it works perfectly fine. It just refuses to work on the live server for whatever reason.</p> <p>Has anything like this ever happened before? How can I possibly fix this? I can't find anything wrong, and it works fine on my test server. I've at least been able to continue development on the test server, but without the live version working its useless.</p> <p>I'll post code if people ask, but I don't see much of a reason to under these circumstances because the code actually works.</p> <p>Any help is appreciated...</p>
javascript jquery
[3, 5]
5,534,747
5,534,748
Javascript object key by element id? (jQuery)
<p>This looks like a very simple issue, but I just can't get it to work.</p> <p>I have a Javascript object like this:</p> <pre><code>var person = {}; person.one = {gender: 'male', name: 'John'}; person.two = {gender: 'male', name: 'Doe'}; person.three = {gender: 'female', name: 'Jane'}; </code></pre> <p>Then I have some HTML like so:</p> <pre><code>&lt;a id="one"&gt;click&lt;/a&gt; &lt;a id="two"&gt;click&lt;/a&gt; &lt;a id="three"&gt;click&lt;/a&gt; </code></pre> <p>Now, I need to get the correct object value by the id of the clicked link. So basically, I need to dynamically access the 1st-level object keys without a for-loop, since the keys are strings.</p> <p>I've tried this:</p> <pre><code>$('a').click(function() { alert(person[$(this).attr('id')['gender']]); }); </code></pre> <p>It didn't work. Neither did this:</p> <pre><code>$('a').click(function() { alert(person.($(this).attr('id')).gender); }); </code></pre> <p>All I get back is an "uncaught exception: Syntax error, unrecognized expression". Obviously, my syntax is way off.</p> <p>I've already read through many posts on here, but couldn't find the solution. Any ideas?</p>
javascript jquery
[3, 5]
5,302,525
5,302,526
Online Python interpreter for use *from* the iPhone?
<p>Is there an online Python interpreter or some such that would allow me to try out simple python code from my iPhone?</p> <p>Something like <a href="http://tryruby.hobix.com/">try ruby! (in your browser)</a> for Python, and works with the iPhone?</p>
iphone python
[8, 7]
5,642,196
5,642,197
PHP and mySQL Data Errors
<p>I currently have 2 users registered on my website; jason and jason1.</p> <p>I have a mySQL database that stores the following fields: <code>id message reciever sender</code></p> <p>When a message is sent from jason1 to jason, the data comes up correctly. However, when a message is sent from jason to jason1 both the <code>sender</code> and <code>reciever</code> fields come up as having the value of jason1. Here is some script info:</p> <p>The way the function is called: <a href="http://pastebin.com/BqVQ7vVE" rel="nofollow">http://pastebin.com/BqVQ7vVE</a><br> The function itself: <a href="http://pastebin.com/1hTEhxAN" rel="nofollow">http://pastebin.com/1hTEhxAN</a><br> <code>getmessage.php</code>, called with XHR: <a href="http://pastebin.com/u1A4hPG3" rel="nofollow">http://pastebin.com/u1A4hPG3</a><br> And a screenshot of the database: <a href="http://img263.imageshack.us/img263/7804/mysqlz.png" rel="nofollow">http://img263.imageshack.us/img263/7804/mysqlz.png</a></p> <p>I will take any suggestions, this is really frustrating. </p>
php javascript
[2, 3]
5,985,080
5,985,081
jQuery ID Number Range
<p>I am trying to write a jQuery script that will add a class to list items within a certain ID range. I use numbers in my ID's and want to adjust a range of ID's.</p> <pre><code>&lt;li id="item-15"&gt;Something&lt;/li&gt; &lt;li id="item-16"&gt;Something&lt;/li&gt; &lt;li id="item-17"&gt;Something&lt;/li&gt; &lt;li id="item-18"&gt;Something&lt;/li&gt; &lt;li id="item-19"&gt;Something&lt;/li&gt; </code></pre> <p>I want to add a class to say items 16 through 19. How would I do this?</p> <pre><code>jQuery('li#item-[16-19]).addClass('the-class'); </code></pre> <p>I am not really sure how to do it. Maybe <code>.each()</code>?</p>
javascript jquery
[3, 5]
5,127,988
5,127,989
Update datatable from gridview
<p>I have a scenario in my project I have a grid view and submit button which generates dynamic rows and there is an image button <code>Edit</code> which edits those rows and these rows bind with datatable first and when we click on save button all the reflect changes in datatable save in database there is no <code>Update</code> button </p> <p>Question:</p> <p>How can I save the previously edited rows into the <code>DataTable</code> and in which event?</p> <p>Plz help its urgent</p>
c# asp.net
[0, 9]
3,214,848
3,214,849
Using a different connection string in web.config and a different sitemap based on if it is a development server or live server?
<p>Currently,</p> <p>When I deploy to a development server, I use one connection string, but when I deploy to a live server, I have to comment out the development connection string and use a live connection string. I also have to do this with a sitemap, where I may have a menu item show up on the development server, but when I deploy to the live server and I don't want to show that menu item, I have to comment it out. Is there a way to currently display a different sitemap and use a different connection string based upon if you are on a development server or live server. I heard this is going to be addressed in .net 4.0?</p>
c# asp.net
[0, 9]
768,356
768,357
Android 1.6 SDK - Internal File Path Issue
<p>I am trying to read a csv file from assets/file.csv, but the log keeps spitting out that it doesn't exist. Is my path correct for internal file storage? This is the class file:</p> <pre><code>package com.xxx.view; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class ReadList { public String[][] mainMenuList() throws IOException { String [][] arrayList = new String [24][24]; File file = new File("/data/data/com.xxx.view/file.csv"); BufferedReader bufRdr = new BufferedReader(new FileReader(file)); String line = null; int row = 0; int col = 0; while((line = bufRdr.readLine()) != null &amp;&amp; row &lt; 24) { StringTokenizer st = new StringTokenizer(line,","); while (st.hasMoreTokens()) { arrayList[row][col] = st.nextToken(); col++; } col = 0; row++; } return arrayList; } } </code></pre>
java android
[1, 4]
5,892,572
5,892,573
How to Load Google's jQuery in External Script?
<p>Stupid question, but does anyone know how to load google's jquery from an external script so it doesnt clunk up my header? In other words, I want to take the code below (probably starting at the google.load stuff and save it inside another file to include in my header. I want to keep my view source pretty :)</p> <pre><code>&lt;script src="http://www.google.com/jsapi?key=MySeCretKeyHere" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;google.load("jquery", "1.4.0");google.load("jqueryui", "1.7.2"); google.setOnLoadCallback(function(){ $(document).ready(function(){ //onload stuff goes here });}); &lt;/script&gt; </code></pre>
php javascript jquery
[2, 3, 5]
2,781,231
2,781,232
How to render text in Directwrite?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5166709/is-there-any-way-to-render-text-into-directwrite">Is there any way to render text into DirectWrite????</a> </p> </blockquote> <p>Hello, all is it possible to render text in Directwrite and save it as png image using ASP.NET C# for my web application. IF YES please HELP. Thanks </p>
c# asp.net
[0, 9]
3,896,312
3,896,313
How do I get an auto completion from a database in visual studio ?
<p>I'm trying to make a program, which is basically a shopping list. The purpose is to type something in, while typing the program will fetch items from the database that matches and you will be able to select an item and write a quantity. Later I want to sorts this.</p> <p>My problem is I have no idea how to make this auto completion thing and I have no idea what I would be searching for, cause I'm sure it's not just called auto completion.</p> <p>I have programmed a lot with C# in Unity and C++ with console apps and also some java in eclipse. But I have mostly never done anything with visual studio where you are able to design and then program for each item.</p> <p><a href="http://i.imgur.com/6WXDq.jpg" rel="nofollow">http://i.imgur.com/6WXDq.jpg</a> &lt;- heres a picture of what I'm going to make.</p> <p>I'm not asking anyone to build this for me, I just need to know what I will be searching for to make the first thing work.</p>
c# c++
[0, 6]
424,014
424,015
In ASP.NET, what's a good strategy for maintaining dynamically generated controls across Postbacks?
<p>Although <a href="http://www.4guysfromrolla.com/articles/092904-1.aspx" rel="nofollow">this</a> is a great article on handling dynamic controls in ASP.NET, I have an application where I cannot generate controls on PageLoad or PageInit. They are generated much later, after the user has input data. Is there a good strategy for maintaining dynamically generated controls when I cannot generate them during PageLoad or PageInit?</p>
c# asp.net
[0, 9]
3,258,025
3,258,026
Toggle .html text on click with jQuery
<p>Im trying to build a collase expand function on my website. </p> <p>I have the following that toggle ths hidden div only im trying to change the 'Expand' text to collapse, and then if clicked again, collapse > expand. </p> <p>Can anybvody see what im doing wrong?</p> <pre><code>$('.coverage .expand').click(function(){ $(this).parent().parent().find('.subitems').toggle('slow', function() { var togtit = $(this).parent().find('.expand'); if((togtit).is('Expand')){ togtit.html('Collapse') } else { togtit.html('Expand') } }); }); </code></pre>
javascript jquery
[3, 5]
5,144,440
5,144,441
adding a try catch around a large method call
<p>I have a web service that's pretty simple; something like this:</p> <pre><code>public class LeadService : System.Web.Services.WebService { [WebMethod(EnableSession = true)] public string MyService(string TheIncomingData) { string ReturnData = ""; MyClass TheClass = new MyClass(); ReturnData = TheClass.MyMethod(TheIncomingData); return ReturnData; } } </code></pre> <p>You might have guessed it, the MyMethod is a pretty long-running method with some room for errors (for now). If I add a try/catch statement around the method call like this:</p> <pre><code>try { ReturnData = TheClass.MyMethod(TheIncomingData); } catch { ReturnData = ""; } </code></pre> <p>Is this going to make the service and the app exception-proof? And, is using a try statement like this going to have any performance impact even if no error occurs?</p> <p>Thanks for your advice.</p>
c# asp.net
[0, 9]
1,745,818
1,745,819
function from on:press not firing
<p>I am trying to call a function from a on:press event and for some reason, it is not firing. I am using flexigrid and am passing the correct parameters to the function so it should respond. Can anyone spot an error with this or offer some debug advice. Thanks</p> <pre><code>function editbox(com,grid) { if(com == 'Edit') { if( $('.trSelected').length&gt;0 ) { $("#boxeditform").dialog('open'); } } else { alert('you must select a row'); } } </code></pre>
javascript jquery
[3, 5]
3,994,532
3,994,533
How to change the color of string
<p>I am making an application in which i am using strings to diaplay some text on screen.But i want to change the color of the string to red.I don't know how to change the color of string to red.Please tell me how to do it.This is the string:</p> <pre><code>strRightAnswer = "Right Answers:" + " " + String.valueOf(nRightAnswers); </code></pre>
java android
[1, 4]
4,043,836
4,043,837
How can i access static class without using object in android?
<p>Can i access static class to another class without using object for that static class. help me how to access.</p>
java android
[1, 4]
3,218,389
3,218,390
How to create an empty jQuery result
<blockquote> <p><strong>Edit</strong>: As of jQuery 1.4, using <code>$()</code> will work as described below.</p> </blockquote> <hr> <p>I need to loop through an array and create a number of elements which I want to have in a single jQuery result object.</p> <pre><code>for (var i = 0; i &lt; 10; ++i) { $myJQueryObj = $myJQueryObj.add($("&lt;span&gt;blahblah&lt;/span&gt;")); } </code></pre> <p>The problem with this, however, is that you need a jQuery object to begin with, and you obviously want to start it empty. In the above example, how should I initialise <code>$myJQueryObj</code> ?</p> <p>The following examples do not work, as they all select the document object:</p> <pre><code>$('') $() $(null) $(false) </code></pre> <p>These do work... but...</p> <pre><code>$('#nonExistantElement') // yuck $().slice(0,0) // surely there's a nicer way? </code></pre> <p>Is there a better way?</p>
javascript jquery
[3, 5]
138,103
138,104
Javascript alert in php script
<p>I wanted to popup an alert box. After that, the site would redirect to main page. But, it seems that it directly redirect to the mainpage without alerting anything. </p> <pre><code>if($registerquery) { ?&gt; &lt;script&gt;alert('received!')&lt;/script&gt; &lt;?php } header("Location: mainpage.php"); exit(); ?&gt; </code></pre> <p>I wanted to do this to ensure users that the process of submission ended successfully. How can i alert something before the page redirect to mainpage and more importantly what causes this? I think the page should not have redirected before the alert box.(Before these codes, site registers what users submitted but not relevant i guess.)Thanks</p>
php javascript
[2, 3]
4,356,734
4,356,735
My jQuery BBCode script doesn't work properly, there is a little bug
<p>I currently use a basic BBCode script for my projects.</p> <p>The problem is, BBCode only works for the first textarea. If I include other textareas, it start bugging.</p> <p>For example; In the first textarea, if I press the B image (means BBCode bold) it writes "[b] [/b]" in <strong>both</strong> of the textareas. In the second textarea, if I press the B image (means BBCode bold) nothing happens. </p> <p>Edit: I just erased wall of text in my comment and moved everything to JSFiddle. The live example is here: <a href="http://jsfiddle.net/vveaQ/4/" rel="nofollow">http://jsfiddle.net/vveaQ/4/</a></p> <p>Let me explain you the issue. Try clicking on the B button at third row. It will write [b] [/b] on all textareas. The one above when clicked, will write [b] [/b] to second and third textareas, the one at top will write [b] [/b] to top only. (works as intended.)</p> <p>I have tried several things to solve this (e.g renaming textarea ID's) but nothing has helped. Can anyone help me about this issue?</p> <p>I'll appreciate any kind of help.</p>
javascript jquery
[3, 5]
1,181,186
1,181,187
Inline javascript checks in PHP
<p>I was trying to use <code>&lt;script&gt; &lt;noscript&gt;</code> checks inline with my PHP to render different form elements depending on weather or not someone has javascript enabled.</p> <p>To display something to non enabled users <strong>only</strong> I can successfully use </p> <pre><code>&lt;noscript&gt; &lt;?php ... ?&gt; &lt;/noscript&gt; </code></pre> <p>To display something to enabled users <strong>only</strong> I tried whats below but it does not work the same as above. Instead it allows all users to still see the PHP.</p> <pre><code>&lt;script&gt; &lt;?php ... ?&gt; &lt;/script&gt; </code></pre> <p>How can I limit something to only those with javascript enabled without having two totally different pages?</p>
php javascript
[2, 3]
311,663
311,664
Detect if capslock is down
<p>What I need is to detect, whether the caps lock key at the very moment is down. So I don't need the state (on/off), I want to check if the user keeps the caps lock pressed down. Is it possible with javascript? I want to create something like an Enso Launcher inside the browser.</p>
javascript jquery
[3, 5]
4,631,568
4,631,569
Retrieving Android Battery Metrics Every n Seconds [Efficiently]
<p>I have found numerous sources for monitoring battery levels, but none of them describe how to check it at a fixed time interval. Suppose I want to check the battery every n seconds. What is the most efficient way to do this?</p> <p>Currently, I create a BroadcastReceiver and register it in my service with a filter. I then use a ScheduledExecutor to "fetch" the information from the battery. If I understand what's going on correctly, the BroadcastReceiver I made receives all broadcasts from the battery rather at a dynamic rate as they come in, rather than the constant rate I want to check it at.</p> <p>It appears that when I create the BroadcastReceiver, it receives an "initial" message with the current info. Would it be more efficient to create a receiver object every so often, receive this initial message, then destroy it every time I want to check it? Or, is there a different way that I haven't thought about?</p> <p>Sources that I used for monitoring the battery, in case if anybody is interested:</p> <ul> <li><a href="http://developer.android.com/training/monitoring-device-state/battery-monitoring.html" rel="nofollow">http://developer.android.com/training/monitoring-device-state/battery-monitoring.html</a></li> <li><a href="http://developer.android.com/reference/android/os/BatteryManager.html" rel="nofollow">http://developer.android.com/reference/android/os/BatteryManager.html</a></li> <li><a href="http://stackoverflow.com/questions/1805895/android-battery-in-sdk">Android Battery in SDK</a></li> </ul>
java android
[1, 4]
4,322,941
4,322,942
Enter Key as Tab and Move Focus to next Control in asp.net
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4494552/change-enter-from-submission-to-tab">Change Enter from submission to Tab?</a> </p> </blockquote> <p>Hi Experts How to override tab key with enter key in asp.net web form and move to next control on enter key</p>
javascript asp.net
[3, 9]
2,728,332
2,728,333
RegisterStartupScript on master page not working. Alternatives?
<p>I have tried using RegisterStartupScript and ScriptManager.RegisterClientScriptBlock to no effect. both are failing to send my list of javascript arrays.</p> <p>I am doing this on the masterpage's page load and can only assume the fact that I'm doing it on a master page is the problem.</p> <p>I have the exact same C# code on another page (that is not being loaded at this time and holds different value names, thus will not conflict to create this current issue) and it works flawlessly.</p> <p>Any insight would be greatly appreciated. </p> <p>Upon further debugging the problem seems to lie in the fact that the code I send to be written in js from the C# file is being done 'after' it reads the masterpage's javascript somehow.. Though it should have to read the CS file and do it's work first, yeah? Hmph. I'm not sure.</p> <p><strong>Edit: FIX'D</strong></p> <p>Oh! I found a cheap way around. What I was doing was:</p> <ul> <li>A) creating arrays in C# to be sent to javascript (so creating javascript arrays that are already filled) </li> <li>B) trying to call registerstartupscript /RegisterClientScriptBlock<br> <ul> <li>C) Getting an error because window.onload reads the builder that required those variables before they're created (god knows why)</li> </ul></li> </ul> <p><strong>Solution</strong>: instead of using window.onload to run the generator, I put it in the code block I was sending to javascript after I declare the variables. A devilish way that doesn't actually solve the problem, just works around it.</p>
c# javascript asp.net
[0, 3, 9]
73,554
73,555
jQuery: What is a "Value Callback"?
<p>I'm working my way through "Learning jQuery" (Third Edition).</p> <p>In Chapter 4: "Manipulating the DOM" there is a section explaining something called the "<strong><em>Value Callback</em></strong>". This is a new one for me.</p> <p>The author explains this via an example of list of links wherein the ID's of each <em>must be unique</em>.</p> <p>From the book:</p> <blockquote> <p>"A value callback is simply a function that is supplied instead of the value for an argument. This function is then invoked once per element in the matched set. Whatever data is returned from the function is used as the new value for the attribute. For example, we can use this technique to generate a different id value for each element, as follows:"</p> <p>Chaffer, Jonathan (2011-09-23). Learning jQuery, Third Edition (p. 116). Packt Publishing. Kindle Edition. </p> </blockquote> <pre><code>jQuery(document).ready(function($){ // get all external links $('div.chapter a').attr({ rel:'external', title:'Learn more at Wikipedia', id: function ( index, oldValue ) { return 'wikilink-' + index; } }); }) </code></pre> <p>Works like a charm, but <strong><em>the mechanics</em></strong> of the id: property escape me.</p> <ol> <li><strong>How</strong> does parameter 1 (index) <strong><em>know</em></strong> to be an integer?</li> <li>How does the function know to <strong><em>increment</em></strong> index?</li> <li>How does the second parameter (oldValue) know to hold the old value of the property (before modification)?</li> <li>Is this a jQuery construct? A JSON thing? It's cool. it works, but ...what the heck <strong><em>is</em></strong> this "value callback" thing made of?</li> </ol> <p>Please advise</p>
javascript jquery
[3, 5]
806,039
806,040
what are the OOP features which are not in java but c++ has those features?
<p>Respected Sir!</p> <p>As i have not learnt java yet but most people say that C++ has more OOP features than Java, I would like to know that what are the features that c++ has and java doesn't. Please explain.</p>
java c++
[1, 6]
1,433,911
1,433,912
Call c# function in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3713/call-asp-net-function-from-javascript">Call ASP.NET Function From Javascript?</a> </p> </blockquote> <p>I have a C# function containing an if statement </p> <pre><code>if (condition) test=true else test= false </code></pre> <p>How do I call that function in javascript and use the result of that test variable to do an if statement ?</p> <p>The c# file I am referencing is the code behind (.aspx.cs) to an .aspx page. Is there not a way I can call the following function from this .aspx page.</p> <pre><code>public void write(bool complete) { System.IO.StreamWriter writer = new System.IO.StreamWriter(Server.MapPath("~file.txt"), true); if (complete == true) { writer.WriteLine("completed"); } else { writer.WriteLine("FAILED"); } writer.Flush(); writer.Close(); writer.Dispose(); } </code></pre>
c# javascript asp.net
[0, 3, 9]
5,686,116
5,686,117
Is there a way to bypass or throw away a mouse event?
<p>I was wondering if there was a way to "throw away", if that is the right term, or ignore a mouse event when it occurs.</p> <p>For example,</p> <p>Say I have a mouseenter bound to an object and I have a specific handler attached to it. Is there a way to ignore certain mouseenter events on that object so that the handler is not called during those instances?</p> <p>Note: I realize you can do this with an 'if' statement but assume I do not have access to the handler function.</p>
javascript jquery
[3, 5]
4,888,518
4,888,519
jquery .find callbak
<p>I was wondering is there a way to get a callback from a jquery .find function.</p> <p>So it would be</p> <pre><code>$('#Div').find($('.items')).each(function () {}).Callback(function(){//Do stuff}); </code></pre> <p>Thanks to anyone who can help</p>
javascript jquery
[3, 5]
586,266
586,267
Page_ClientValidate() Question
<pre><code>function Subscribe() { if (typeof (Page_ClientValidate) == 'function') { Page_ClientValidate(); } if (Page_IsValid) { // do something CheckUser(); } } </code></pre> <p>The script is tied to an asp.net button with regular expression validators. I have another form on my page with a different validation group specified.</p> <p>When I click on this button (with all conditions met). It fires an error on the other validationgroup. How and why is this happening? Is there a way to counter this?</p> <p>Its as if Javascript is validating all fields irrespective of which group they are from/in</p>
javascript asp.net
[3, 9]
5,728,041
5,728,042
Jquery - if page loaded
<p>Is there any trick how to start a function in javascript, which starts when the page is completly loaded?</p> <p>thanks</p>
javascript jquery
[3, 5]
4,435,854
4,435,855
How to handle click event in jquery for a button?
<p>I have a grid view in which I have a button feild for deleting that particular row in the grid view, using the GridView_RowDeleting() event.</p> <p>So when that particular row gets renders it's such</p> <pre><code>&lt;input type="button" value="Delete" onclick="javascript:__doPostBack('ctl00$ContentPlaceHolderBodyMasterPage$grdvwUsers','Delete$0')" class="delete" /&gt; </code></pre> <p>The delete functionality works fine.</p> <p>But I want to show a confirmation message on this button click whether to delete the user or not. For that I have added query code for that to display the confirmation message, but thats not working , don't know why,</p> <pre><code> $(".delete").click(function(e) { // code for displaying the confirmation dialog }); </code></pre> <p>Please help me out, thanks !</p>
c# jquery asp.net
[0, 5, 9]
5,848,883
5,848,884
Using :not selector with $(this)
<p>I have the following line which works OK</p> <pre><code>$("#myDiv img:not(:eq(0))").hide(); </code></pre> <p>I want to write a similar line but using "this". So:</p> <pre><code>$(this":not(:eq(0))").hide(); </code></pre> <p>But that doesn't work... Any ideas where it's gone wrong?</p>
javascript jquery
[3, 5]
183,252
183,253
Want to show Busy Loading message with percentage download when form will load using JQuery
<p>suppose my page content is huge so in my asp.net application i want to show busy icon with percentage downloading the content in client side. i saw many flash and sliver light site that they show busy icon and also they show percentage that means how much content has been loading in client machine. how could i achieve this using JQuery and when page content has been downloaded in client machine the busy icon goes out and actual page content will display.</p> <p>please me with sample code to achieve it. thanks</p>
asp.net jquery
[9, 5]
5,827,573
5,827,574
Calling JavaScript Function on Demand Causing Strange Results
<p>I have a dropdownlist which is declared as follows: </p> <pre><code>&lt;select onchange="reloadValues(this,event);"&gt; ... options here &lt;/select&gt; </code></pre> <p>When the user change the selection reloadValues is invoked and everything works perfectly. Now, I want to add the reloadValues when the user adds a new row which contains the dropdownlist so I did the following: </p> <pre><code>reloadValues(rowToBeAdded.find("select")[0]); </code></pre> <p>The reloadValues function is shown below: </p> <pre><code> function reloadValues(obj, event) { { var ele = obj.parentElement.parentElement; var select2 = ele.cells[2].childNodes[1]; // ele.cells is empty when invoking // the reloadValues on demand through another method. } </code></pre> <p>Any ideas! </p> <pre><code>obj.parentElement.parentElement is a TR element </code></pre>
javascript jquery
[3, 5]
245,947
245,948
Android most efficient way to have many views
<p>I have an app that will allow the user to drag many views onto a "canvas". The user can pan, rotate, flip, and scale these views. Each view will need to have a image on it. I was thinking of simply inflating imageviews and letting the user interact with those.</p> <p>Is there a more efficient way to have up to 50 images on screen that can be interacted with?</p> <p>If so, can you point me to some code examples?</p> <p>EDIT:</p> <p>I have noticed there are multiple ways to do this: Some tutorials use a surfaceview and bitmaps and threads Other tutorials use open gl Other tutorials simply have views on views,</p> <p>What route should I take?</p> <p>Thanks</p>
java android
[1, 4]
2,623,904
2,623,905
Display label text with line breaks in c#
<p>Is it possible to display the label text with line breaks exactly as per the image</p> <p><img src="http://i.stack.imgur.com/YkAPV.jpg" alt="enter image description here"></p> <p>I need the text on the label to be printed exactly can some one help me, my desired text that has to be shown on the label will be stored in a string-builder</p>
c# asp.net
[0, 9]
110,856
110,857
C# Eval aspx Fun
<p>This works:</p> <pre><code>&lt;asp:Label ID="asdf" runat="server" Text='&lt;%# Eval("Image1") %&gt;'&gt;&lt;/asp:Label&gt; </code></pre> <p>displaying data like: L8_Pic_1.jpg</p> <p>This doesn't:</p> <pre><code>&lt;asp:Label ID="asdfaf111" runat="server" Text='&lt;%# Eval("Image1").ToString() %&gt;'&gt;&lt;/asp:Label&gt; </code></pre> <p>It gives an Object Reference not set to an instance of an object error</p> <p>I'm aiming to do this:</p> <pre><code>String.IsNullOrEmpty(Eval("Image1").ToString()) ? "noImage.jpg" : Eval("Image1") </code></pre>
c# asp.net
[0, 9]
1,828,775
1,828,776
Changing just the text in a div with jQuery
<p>I have a structure like so:</p> <pre><code>&lt;div class="comment"&gt; Some text goes here. &lt;div class="controls"&gt; Controls go here. &lt;/div&gt; &lt;/div&gt; </code></pre> <p>How can I replace just "Some text goes here" without affecting the <code>controls</code> div?</p> <p>Clearly another div can be added around "Some text goes here", and then its contents replaced, but for the sake of this question assume that I cannot.</p>
javascript jquery
[3, 5]
3,404,278
3,404,279
Number of app columns is different on different devices
<p>So the issue I'm having right now is that my widget for my app should be 2x4 and on my device (Nexus 4) it is. However I tested it on my Note 2 and the widget is 1x4 and doesn't display all the content. I specified the minimum size, shouldn't that work. Or is there a way to always make sure its 2x4?</p> <p><strong>AppWidget provider</strong>:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="294dp" android:minHeight="72dp" android:updatePeriodMillis="12000" android:initialLayout="@layout/widget_layout"&gt; &lt;/appwidget-provider&gt; </code></pre> <p>Thanks for your time.</p>
java android
[1, 4]
5,871,683
5,871,684
jQuery persistent non-event bindings
<pre><code> var $thingy = $('.thingy'), $window = $(window); $window.on('resize', function(){ thingy.width($window.width()/12); }); </code></pre> <p>Is it possible to add more <code>.thingy</code>s to the page and have them resize without re-querying?</p> <p>I am aware that the following will work:</p> <pre><code> var $window = $(window); $window.on('resize', function(){ $('.thingy').width($window.width()/12); }); </code></pre> <p>the problem is, I am not adding <code>.thingy</code>s to the page very often, making the creation of new jQuery objects and rapid re-querying of the DOM seem like alot of overhead. </p> <p>Is there a better way?</p>
javascript jquery
[3, 5]
4,510,158
4,510,159
how to Validate Client Side with jquery and Server side at same time?
<p>i really love the jquery validation plugins, look neat stylish and accessible, but as you know JavaScript can be turned off and boom your user can enter what ever he wants, therefore you should validate on server too, so what is the best approach here ?</p> <p>do double validation one with jquery and one on server side or is there a better solid secure way ? </p>
c# asp.net jquery
[0, 9, 5]
3,896,470
3,896,471
Launch / Check application
<p>I have the following script which I am using in an intranet environment:</p> <pre><code>function LaunchApp(the_app) { var ws = new ActiveXObject("WScript.Shell"); ws.Exec(the_app); } </code></pre> <p>This allows me to pass it an exe path to launch directly from a web page as long as internet explorer's intranet security settings are adjusted.</p> <p>The problem is, that not everyone in out network has the same applications, some has more, others have less. So I was wondering, is it possible to extend the script above to some how check if the path given exists on the users computer before attempting to launch it?</p>
javascript jquery
[3, 5]
1,733,877
1,733,878
Click on Div to get information box for a few seconds
<p>I have this code below: And what I need to do is to be able to click on the Div right below and when done the #info_page div would show up in the middle of the screen for a few seconds. Like a dialog but just a simple jquery temp show() with a timer? Is this possible?</p> <p>The current code is below.</p> <pre><code>&lt;div onclick="show_info_box"&gt;Click to get message&lt;/div&gt; &lt;div id="info_box" style="display:none"&gt; &lt;span class="custom info"&gt; &lt;img src="info.png" alt="info" height="48" width="48" /&gt; &lt;em&gt;Information&lt;/em&gt; Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. &lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
972,394
972,395
Dynamically add/remove function while calling one single function using parameters
<p>I have a function called f0 having some parameters. When i call it, it calls some other functions with some parameters(for example the same parameters). The problem is, can i add somehow these functions dynamically?</p> <p>A simple solution would be something like this:</p> <pre><code>var callf1=true; var callf2=true; var callf3=true; function f1(params){ //some code } function f2(params){ //some other code } function f3(params){ //some code } function f0(params){ if(callf1){ f1(); } if(callf2){ f1(); } if(callf3){ f1(); } } function mymain(){ f0(params); } setInterval("mymain()",5000); </code></pre> <p>This option is much time consuming because every time it has to check the variables. Could i use somehow the trigger option in JQuery using runtime and giving parameters?</p> <p>I would be glad if you can recommend me an easier and simpler solution.</p>
javascript jquery
[3, 5]
822,237
822,238
Multiple Selection Tree View Control for ASP.Net Web Application using C#.Net
<p>Would like to know about the TREE VIEW CONTROL which would allow me to select multiple nodes and those selected nodes can then be dragged and dropped onto the other drive.Is there any Property available for multiple selection or how exactly we can go about doing it.. Thank You</p>
c# asp.net
[0, 9]
1,467,315
1,467,316
DropDownList.SelectedIndexChanged does not fire when selecting index in C# code behind
<p>i am trying to select the index in DropDownList in C# code behind but the SelectedIndexChanged event does not fire. What is the right way to do it?</p> <pre><code> DropDownListChapterTitles.SelectedIndex = 1; protected void DropDownListChapterTitles_SelectedIndexChanged(object sender, EventArgs e) { } </code></pre>
c# asp.net
[0, 9]
3,230,459
3,230,460
disabling controls via checkbox in javascript
<p>I currently have 4 textboxes, 1 checkbox and a dropdownlist. I am attempting to disable the textboexes and dropdownlist upon the checkbox being checked. My current code does not work, but I can't seem to find the error in it. I am new to using JavaScript. </p> <pre><code>function enableCheckBox(phyAddressCheckBox, tb1, tb2, tb3, file1, tb4) { if (document.getElementById(phyAddressCheckBox).checked) { document.getElementById('tb1').enabled = true; document.getElementById(tb2).enabled = true; document.getElementById(tb3).enabled = true; document.getElementById(file1).enabled = true; document.getElementById(tb4).enabled = true; } else { document.getElementById(tb1).enabled = false; document.getElementById(tb2).enabled = false document.getElementById(tb3).enabled = false; document.getElementById(file1).enabled = false; document.getElementById(tb4).enabled = false; } } </code></pre> <p>edit I set all property to disabled on both conditions and nothing works. </p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function enableCheckBox(phyAddressCheckBox, tb1, tb2, tb3, file1, tb4) { if (document.getElementById(phyAddressCheckBox).checked) { document.getElementById('tb1').disabled = 'disabled'; document.getElementById(tb2).disabled = 'disabled'; document.getElementById(tb3).disabled = 'disabled'; document.getElementById(file1).disabled = 'disabled'; document.getElementById(tb4).disabled = 'disabled'; } else { document.getElementById(tb1).disabled = 'disabled'; document.getElementById(tb2).disabled = 'disabled'; document.getElementById(tb3).disabled = 'disabled'; document.getElementById(file1).disabled = 'disabled'; document.getElementById(tb4).disabled = 'disabled'; } } &lt;/script&gt; </code></pre> <p>I also added in the control code.</p> <pre><code>&lt;asp:CheckBox ID="phyAddressCheckBox" runat="server" onclick="enableCheckBox(this.ID, physicalAddressTextbox, PhysicalAddress2Textbox, CityTextbox, physicalStateDropDownList,physicalZipTextbox)" style="text-align: left" /&gt; </code></pre>
javascript asp.net
[3, 9]
1,318,298
1,318,299
Is there a way to export the content in DIV to a image programmatically?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/60455/take-a-screenshot-of-a-webpage-with-javascript">Take a screenshot of a webpage with javascript?</a> </p> </blockquote> <p>I hope to export the content in DIV to a image programmatically? How can I do? which code can do that ,server code or client code? Thanks! </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;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="a"&gt; Content to export to image &lt;/div&gt; &lt;div id="b"&gt; Normal text &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript asp.net
[3, 9]
2,733,027
2,733,028
Is there a better way to write this simple line of jQuery?
<p>I am learning jQuery and I have written a very simple script that works great. Now I would like to find out if there is a better way to write this line.</p> <pre><code>$("form").submit(function() { $('div.beforeRecover').animate({ opacity: 'toggle' }, 300).delay(800); $('div.betweenRecover').animate({ opacity: 'toggle' }, 200).delay(1200); $('div.betweenRecover').animate({ opacity: 'toggle' }, 800); $('div.afterRecover').delay(1800).animate({ opacity: 'toggle' }, 1400); return false; }); </code></pre> <p>To briefly explain:</p> <ol> <li>Form gets submitted</li> <li>Form fades</li> <li>Loading gif appears</li> <li>Loading gif fades</li> <li>Confirmation message appears.</li> </ol> <p>I appreciate any help!</p>
javascript jquery
[3, 5]
658,173
658,174
.net membership unsuspend account
<p>I am using .net membership to manage my user roles. Currently users are suspended after a long period of inactivity. Is there a membership api to unsuspend the user?</p>
c# asp.net
[0, 9]
529,317
529,318
Javascript/Jquery click enable
<p>The following code's else part isnt working, i.e. click is not getting enabled.</p> <pre><code>if $("#section1").click(function(event){ return false; }); else $("#section1").click(function(event){ return true; }); </code></pre> <p>So basically, I want to remove the click functionality over a certain div section, which is working fine but while returning the click functionality back it is not working. Any suggestions?</p>
javascript jquery
[3, 5]
739,111
739,112
Use UP/DOWN arrow keys to call a function (and passing parameter)
<p>I have a survey in which there are numerous text inputs taking numerical value each of which has a pair of increment/decrement buttons. I have a working function as follows:</p> <p>HTML:</p> <pre><code>&lt;div class="text-input-wrapper"&gt; &lt;input type="text" /&gt; &lt;div class="buttons inc-dec"&gt; &lt;button class="increment"&gt;Increment&lt;/button&gt; &lt;button class="decrement"&gt;Decrement&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; function incDec(btnClass) { var input = $(this).closest('.text-input-wrapper').find('input'); var inputVal = $(this).closest('.text-input-wrapper').find('input').val(); if ($(this).hasClass('increment')) { if (inputVal.length == 0) { ($(input).val('1')); } else { inputVal++; $(input).val(inputVal); } } // increment else if ($(this).hasClass('decrement')) { if (inputVal.length == 0) { ($(input).val('0')); } else { inputVal--; $(input).val(inputVal); } } // decrement return false; } // function incDec </code></pre> <p>Now I need to enable incrementing and decrementing value using the UP &amp; DOWN keys; I took a stab with the following but with no joy:</p> <pre><code>$(document).keydown( function(eventObject) { // UP arrow if(eventObject.which==38) { var btnClass = "increment"; } else // DOWN arrow if(eventObject.which==40) { var btnClass = "decrement"; } incDec(btnClass); </code></pre> <p>I’d greatly appreciate some clarification as to how to go about firing the increment/decrement using the up/down keys,</p> <p>Many thanks in advance, </p> <p>svs</p>
javascript jquery
[3, 5]
1,527,252
1,527,253
get the title from a context
<p>How Do I select the title of the context? I am suppose to select it to change the title of the page.</p> <pre><code>var handler = function(context){ document.title = //context's title .... } //sample context from ajax request var context = '&lt;!DOCTYPE html&gt;&lt;html&gt;\ &lt;head&gt;&lt;title&gt;Hello&lt;/title&gt;&lt;/head&gt;\ &lt;body&gt;\ &lt;a href="#"&gt;Click Here&lt;/a&gt;&lt;p&gt;This is my sentence.&lt;/p&gt;\ &lt;/body&gt;&lt;/html&gt;'; .ajax{( ... success: function(data){ handler(data); } }); </code></pre> <hr> <p><strong>EDIT</strong>: I forgot the doctype just incase it's necessary. The context was from an AJAX Request.</p>
javascript jquery
[3, 5]