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
2,621,619
2,621,620
populate datagrid columns between two template fields
<p>I have a datagrid "dgData" <code>AutoGenereateColumns="true"</code></p> <p>In this i have 2 templateFields.</p> <p>Now i want to populate all the data between these 2 template fields.</p> <p>How can i do this using C#</p>
c# asp.net
[0, 9]
329,632
329,633
jQuery, PHP - How to make a 'Get started' popup box
<p>I'm trying to create one of those pop-up boxes you'll get the first time you log in to my website. I wan't this to have some 'Get started' articles, FAQ and so one. </p> <p>But I can't figure out how I would make this happen? I would like to create it in jQuery and PHP. </p> <p>But should I have a row['getStarted'] in my database set to 0 or 1, and then display the popup box if it's set to 1? Or is there a better way to do it? </p> <p>And I've also been looking for how to change a row in the Database, with just a simple click on a button like: "Don't show me this again". I've figured out I need ajax, but how would an action like this look like?</p> <p>I hope to get some links or a way to get started.</p>
php jquery
[2, 5]
4,422,069
4,422,070
to write and read in pdf file
<p>Is it possible to create or generate PDF files through c#.net in asp.net,</p> <p>This PDF file mostly will be dynamic . here in generated PDF file the user Id who logs into the application has also be written, i.e, userid is 2 then it must be in the PDF file ,which the user is generating.</p> <p>After generating the PDF file, the user or any user will enter data s into the PDF file, and those values in the PDF file has to be saved in database table [MS Sql]</p>
c# asp.net
[0, 9]
4,486,240
4,486,241
objectdatasource question
<p>For the moment, I'm binding my gridviews by calling a linq query that returns a list collection of objects MyObject. In my gridview, if I'm using a boundfield I set its Datafield property to the name of the property of MyObject and if I'm using an itemtemplate I work with Eval. In my code behind, I have</p> <pre><code>MyGridview.DataSource = MyListOfMyObject; MyGridview.DataBind(); </code></pre> <p>All seems to work fine.</p> <p>What's the purpose of adding an ObjectDataSource control in the aspx file. What does it do extra?</p> <p>Thanks.</p> <p>PS: I'm new to the .net framework and I'm still figuring things out. </p>
c# asp.net
[0, 9]
1,223,912
1,223,913
JQuery function to simple java script function
<p>Here is a simple question. I have this jQuery function that is called upon <code>onload</code> of page can I make it simple JavaScript function so that I would call it whenever I want to. </p> <pre><code>(function ($){ //DO SOMETHING HERE })(jQuery); </code></pre> <p>The above the jQuery function. I want something like.</p> <pre><code>function my_func(paramertes){ //DO SOMETHING HERE } </code></pre> <p>Help me please if anyone has idea.</p>
javascript jquery
[3, 5]
1,899,676
1,899,677
jQuery form and select box?
<p>I have built a form using 3 select boxes that are used dynamically together, when one is in use the other must be at the default setting this ensures that any of the dynamic events for that select box are turned off, I accomplish this so far by using this jquery:</p> <pre><code>$('form select').click(function() { $('form select').not(this).val(''); }); </code></pre> <p>This does what I want in all other browsers except IE. </p> <p>In other browsers it returns the other select inputs to the top most option of the select meaning the only select box in action is the one selected. But, in IE it actually does delete the option altogether leaving me with an empty select box until it is clicked!</p> <p>Is there a way around this?</p>
javascript jquery
[3, 5]
3,162,787
3,162,788
alert with src attribute of any element i click with jQuery or Javascript
<pre><code>&lt;img src="pic1.jpg" class="mythumbs"&gt; &lt;img src="pic2.jpg" class="mythumbs"&gt; &lt;img src="pic3.jpg" class="mythumbs"&gt; &lt;img src="pic4.jpg" class="mythumbs"&gt; &lt;script&gt; /* here is the code which makes me when i click on any image, it shows me its src attribute (without using idTag 'preferred'). */ alert(theAttribute); &lt;/script&gt; </code></pre> <p>i need to type a code which shows me the clicked item's src attribute without using idTags</p>
javascript jquery
[3, 5]
1,757,466
1,757,467
android application can run in emulator but it can't run in devices using apk
<p>My app can run in emulator. Then I install my app in devices (Hp) but when I opened my app, my app is <em>force close</em> and say "application is not installed in your phone"</p> <p>Can you help me how to fix my problem?</p>
java android
[1, 4]
3,228,434
3,228,435
Javascript and JQuery conflict
<p>I'm not very expert in using javascript and jquery but I'm working with them for a client.<br> I have encountered a problem using two script: the first one makes a top panel sliding, the second is in a form. This one is used in order to hide or show a particular field basing on the drop down list choice. </p> <p>I've found that if I disable the first script (the panel), the second script is working fine and vice versa. I tried usign JQuery noConflict() in the head of the page but nothing happened. </p> <p>Here the code of the first script (sliding panel): </p> <pre><code>$(document).ready(function () { // Lets make the top panel toggle based on the click of the show/hide link $("#sub-panel").click(function () { // Toggle the bar up $("#top-panel").slideToggle(); // Settings var el = $("#shText"); // Lets us know whats inside the element var state = $("#shText").html(); // Change the state state = (state == 'Nascondi' ? '&lt;span id="shText"&gt;Entra&lt;/span&gt;' : '&lt;span id="shText"&gt;Nascondi&lt;/span&gt;'); // Finally change whats insdide the element ID el.replaceWith(state); }); // end sub panel click function }); // end on DOM </code></pre> <p>Here the JS code for the form (hide/show field): </p> <pre><code>$document.addEvent('domready', function () { $('motivo_contatto').addEvent('change', function () { if ($('motivo_contatto').value == 'Invia CV') { $('upload_file').style.visibility = 'visible'; } else { $('upload_file').style.visibility = 'hidden'; } }); $('upload_file').style.visibility = 'hidden'; }); }); </code></pre> <p>Can anyone help me ? Thank you and have a nice day! </p>
javascript jquery
[3, 5]
4,458,339
4,458,340
Check Whether Incoming Call to Web Service is over Https
<p>We want to make sure any calls that are coming into our .asmx are https. I'm not sure how/where to check that. In our asmx I assume I can check the HttpContext?</p>
c# asp.net
[0, 9]
766,046
766,047
Break the string on Full Stop for (Chinese, Arabic, Japanese, Russian, Korean, Dutch, Hindi, Greek, Urdu) using javascript
<p>I am working on languge segmentation project. I applied language segmentation for English by using regular expression breaking the string at . ("Full Stop"). Now i want to provide the support for following languages (Chinese, Arabic, Japanese, Russian, Korean, Dutch, Hindi, Greek, Urdu). I want to break the above mentioned language strings on Full stop. </p> <p>e.g.</p> <p>For Chinese Full stop is 。 (Unicode value U+3002) String</p> <pre><code>以有效應對各種事態」。他還表示,希望以符合21世紀的方式切實深化美日同盟關係。 </code></pre> <p>Expected Result</p> <pre><code>Segment 1 :- 以有效應對各種事態」。 Segment 2 :- 他還表示,希望以符合21世紀的方式切實深化美日同盟關係。 </code></pre> <p>Same logic I have to apply for other languages (Arabic, Japanese, Russian, Korean, Dutch, Hindi, Greek, Urdu).</p> <p>Thanks in Advanced</p>
php javascript
[2, 3]
5,174,967
5,174,968
Jquery: slideToggle() multiple divs independently using one function
<p>Markup:</p> <pre><code>&lt;div&gt; &lt;h3 class = "trigger"&gt;Heading 1&lt;/h3&gt; &lt;ul class = "toggle"&gt; &lt;li&gt;Line One&lt;/li&gt; &lt;li&gt;Line Two&lt;/li&gt; &lt;li&gt;Line Three&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;h3 class = "trigger"&gt;Heading 2&lt;/h3&gt; &lt;ul class = "toggle"&gt; &lt;li&gt;Line One&lt;/li&gt; &lt;li&gt;Line Two&lt;/li&gt; &lt;li&gt;Line Three&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>and the JQuery:</p> <pre><code>$(".toggle").slideUp(); $(".trigger").click(function(){ $(".toggle").slideToggle("slow"); }); </code></pre> <p>I'd like to be able to toggle these <code>&lt;ul&gt;</code>s independently. Currently, when either <code>&lt;h3&gt;</code> title is clicked both divs toggle...</p> <p>code is at: <a href="http://jsfiddle.net/CPvCZ/4/" rel="nofollow">http://jsfiddle.net/CPvCZ/4/</a></p>
javascript jquery
[3, 5]
531,290
531,291
jQuery/javascript synchronously load an iframe
<p>We are trying to load an openx banner when a user exits our site. We don't want to preload the banner in a div because it will incorrectly record impressions, we only want it loading when window.onbeforeunload fires. </p> <p>We add the iframe in onbeforeunload but the exit prompt is presented before the iframe loads and blocks it from loading until after they have answered yes or no. I would like to prevent onbeforeunload from returning until after the iframe has completed loading or a timeout is reached. I can't use callbacks because everything has to take place inside this one function, unless I am missing something.</p> <pre><code>window.onbeforeunload = function () { $('&lt;iframe /&gt;', { id: 'myId', src: 'http://openx.mydomain.com/ad.php', width: 640, height: 480, frameborder: 0 }).appendTo('#contentWrap'); $("#prompt").overlay({ mask: { color: "#ebecff", loadSpeed: 0, opacity: 0.9 }, closeOnClick: false, speed: 0, load: true }); return "lorem ipsum 25% off"; } //); </code></pre>
javascript jquery
[3, 5]
1,429,683
1,429,684
jquery custom cycle plugin with prev and next
<p>I'm trying to create a custom jquery cycle plugin which basically displays the contents of an <code>&lt;li&gt;</code> element upon click. The html is as follows:-</p> <pre><code>&lt;ul class="ticker"&gt; &lt;li&gt;Boo1&lt;/li&gt; &lt;li&gt;More boo1&lt;/li&gt; &lt;li&gt;Even more boo&lt;/li&gt; &lt;a class="prev" href="#"&gt;previous&lt;/a&gt; &lt;a class="next" href="#"&gt;next&lt;/a&gt; &lt;/ul&gt;​ </code></pre> <p>so when the user clicks the next button, the next <code>&lt;li&gt;</code> shows and when he clicks the prev button, the previous <code>&lt;li&gt;</code> shows.</p> <p>Achieving this has never been easy :( I'm still quite new to jquery so please pardon. Any help guys</p>
javascript jquery
[3, 5]
3,872,779
3,872,780
Using jQuery to replace each ' with &apos
<p>I can't seem to find the correct way to take some html being returned from the server, replace each ' with &amp;apos and finally - append the new html to the DOM.</p> <p>Before the modification, the below works just fine to append the html (not altered)</p> <pre><code>$(xhtml).find("#inner").appendTo("#appendTD"); </code></pre> <p>But now that I want to alter the xhtml first, the below doesn't seem to work as expected</p> <pre><code>var html = $(xhtml).find("#gridFormInformation").find("'").replaceWith("&amp;apos;"); $(html).find("#inner").appendTo("#appendTD"); </code></pre> <p>As you can see from the above, I want to replace each ' w/ the &amp;apos inside a table element w/ the id #gridFormInformation. Part of this doesn't work because the html obj i'm trying to append is a jQuery object (not the simple string that I append in the first working example)</p> <p>Any help?</p>
javascript jquery
[3, 5]
632,763
632,764
PHP Syntax Error With jQuery
<p>I'm using DreamWeaver and I get this error from time to time and cannot figure out what is causing it.</p> <p>When I add a little bit of jQuery from scripts I want into a php file, DW will tell me there is a syntax error. Here is where it says my error is(with a few lines before and after it):</p> <pre><code> echo ' &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;'; echo ' &lt;script type="text/javascript"&gt; (function( $, document, window, undefined ) { \'use strict\'; </code></pre> <p>I don't understand it. Why is it saying there is a syntax error?</p>
php jquery
[2, 5]
5,291,751
5,291,752
Image editing in Android
<p>In my application image editor I want to implement image brightness, contrast, sharpness, zooming, rotating, and save the image to my gallery. </p>
java android
[1, 4]
656,596
656,597
Possible to make IE7 reload the DOM? Trying to update RSS href url in link tags
<p>I can use this jQuery code to dynamically change the RSS link in the DOM in Firefox &amp; Chrome. <a href="http://path.com/feed" rel="nofollow">http://path.com/feed</a> is normally replaced by a variable, but not for this example.</p> <pre><code>$('#rssfeed').remove(); $('head').append('&lt;link id="rssfeed" rel="alternate" type="application/rss+xml" href="http://path.com/feed"/&gt;'); </code></pre> <p>The live bookmark feature immediately updates. However, this doesn't work in IE7. In IE7 I have tried this method, also created an in the html and tried updating with .setAttribute(href,'path.com/feed'), and tried creating a new DOM element and attaching it to "&lt;_head>" (no _ in the actual code, of course). </p> <p>The only "success" I have had was doing a document.write. The big problem with this is that I can't change it after the page has loaded. </p> <p>Can anyone recommend an alternate way to change the link element href and have it dynamically reloaded by IE7? Alternatively, is there a way to force the browser to re-interpret or reload the DOM without doing a full page refresh?</p>
javascript jquery
[3, 5]
2,475,256
2,475,257
Checking to make sure the same item can't be clicked twice in a row with jQuery / jScript
<p>So, I have a script I've been working on it can be seen here: <a href="http://xeo.tryptamine.tv/lookbook2/" rel="nofollow">http://xeo.tryptamine.tv/lookbook2/</a> Now if you play around with that script you will see if you click the image it's already on it still gets that fade effect. I need to know how to properly unbind the event and rebind it after another one is clicked. Here is the click function for it:</p> <pre><code> $('.righticons img').click(function(){ var z = $(this).attr("class"); $('.main a img:eq('+z+')').hide(); $('.main a img:eq('+z+')').css({"z-index": y}); $('.main a img:eq('+z+')').fadeIn(); y++; </code></pre> <p>I have tried to make an if statement something like this, but last came up undefined.</p> <pre><code> $('.righticons img').click(function(){ var z = $(this).attr("class"); if (z != last){ var last = z; $('.main a img:eq('+z+')').hide(); $('.main a img:eq('+z+')').css({"z-index": y}); $('.main a img:eq('+z+')').fadeIn(); y++; }; </code></pre> <p>I even started toying around with .unbind('click') but have no clue how to bind it back. PS, I have the script generating a number for each thumb on the side and appending it to the class attribute according to it's array position. Thanks for any answers!</p>
javascript jquery
[3, 5]
3,055,470
3,055,471
Android - open image from drawable in default gallery application
<p>I'm working on app that have number of imageviews, when i click on the image i want it to open via android default gallery image picker. i've tried in this way :</p> <pre><code>String str = "android.resource://" + getPackageName() +"/"+R.drawable.wall1; Uri path = Uri.parse(str); Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(path, "image/*"); startActivity(intent); </code></pre> <p>but it doesn't work and i get exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=android.resource://com.example.demo/2130837505 typ=image/* }</p>
java android
[1, 4]
4,152,644
4,152,645
Singleton function description
<p>I searched but didn't find any normal information for Java Singleton functions or classes , So can anybody explain why I need them? What is he difference from other functions? </p>
java android
[1, 4]
1,673,375
1,673,376
jQuery click function using same classes
<p>I have a dropdown function that I need to work only on the div clicked, not all (I have 14+ of the same classes on the page that need to be displayed when a certain one is clicked) </p> <p>At the moment my jQuery is as follows.</p> <pre><code>$('.qacollapsed').hide(); $('.qa').click(function () { $('.qacollapsed').slideToggle(); $(this).toggleClass('active'); }); </code></pre> <p>Of course, that is toggling all qacollapsed classes when there is 14 on the page (Q&amp;A) </p> <p>Is there a way for it to only drop down the one that is clicked? </p> <p>the HTML</p> <pre><code>&lt;div class="qa"&gt; &lt;h4 class="question"&gt; &lt;/h4&gt; &lt;/div&gt; &lt;div class="qacollapsed"&gt; &lt;p&gt; &lt;/p&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
2,908,452
2,908,453
jQuery: How to determine the index of <li> element in an unordered list when clicked?
<p>I want to know the index of the clicked li element in the unordered list. How to achieve this with jQuery?</p>
javascript jquery
[3, 5]
1,598,615
1,598,616
Condition to check if value from gridview cell was edited or not?
<p>I would like to know if there's any condition to check if values from cells were edited or not . I can do it in other way ( with If value == value ) bla bla..but I need to write a lot to compare the values ..and I need another way .</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,982,083
4,982,084
Value in TextView doesn't update
<p>There is the following code from custom AsyncTask:</p> <pre><code> @Override public void onPreExecute() { setTitle(); dialog.show(); } private void setTitle() { Activity activity=(Activity)context; TextView title=(TextView)activity.findViewById(R.id.textViewToDoListTitle); Log.e("title", title.getText().toString()); title.setText("123"); Log.e("title", title.getText().toString()); } </code></pre> <p>This code works without exceptions, but setTitle() function doesn't update text in TextView title! In log I can see that title stores "123" after executing the last row in setTitle(). But the value doesn't update on the screen! How can I fix it? </p>
java android
[1, 4]
3,817,407
3,817,408
Change text color in first row of spinner
<p>I have a spinner. When user clicks on it a dialog box appears with several rows and text inside that rows to choose from. The default text inside spinner is <code>Select facility</code>. And the first row text is the same i.e. <code>select facility</code>. Now what I want is to change the text color in first row in spinner dialog box i.e. the color of select facility.</p> <p>How can I achieve this?</p> <p>Here is the code where I believe I can change it.</p> <pre><code>if (position == 0 &amp;&amp; hideFirstText) { ((TextView) convertView).setText(R.string.select_facility); convertView.setBackgroundResource(R.color.light_green); return convertView; } </code></pre> <p>Here is what I already tried</p> <pre><code> ((TextView) convertView).setTextColor(4737352); </code></pre> <p>But above solution completely removes the first row text.</p> <p>I also tried this</p> <pre><code> convertView.setTextColor(4737352); </code></pre> <p>But convertView does not have setTextColor() method.</p>
java android
[1, 4]
566,398
566,399
pass the number of link
<p>I have a html.twig file with this</p> <pre><code>{% set num= 1%} {% for idea in ideas %} &lt;div class="add"&gt; &lt;a href="#"&gt; Comentar &lt;/a&gt;|&lt;a href="#" rel="like{{num}}"&gt; Tomado &lt;/a&gt;|&lt;a href="#"&gt;Valorar&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; {% set num= num +1 %} {% endfor %} </code></pre> <p>so depend of the number of ideas I have more o less likes, like this</p> <pre><code>&lt;a rel="like1" href="#"&gt; Tomado &lt;/a&gt; &lt;a rel="like2" href="#"&gt; Tomado &lt;/a&gt; &lt;a rel="like3" href="#"&gt; Tomado &lt;/a&gt; </code></pre> <p>If I want to do a click in jquery,but how I indicate the number of link, the value of num variable</p> <pre><code> $("a[rel='like']").click(function(){ alert($("a[rel='like']").text()); }); </code></pre> <p>any idea!</p>
javascript jquery
[3, 5]
892,662
892,663
Grab code behind property in Javascript?
<p>I would like to burn in a c# code behind property into the javascript alert(&lt;%= someProperty%>); . For some reason it is not working. Is there a way you can burn the codebehind property into the javascript? thanks</p>
c# asp.net javascript
[0, 9, 3]
2,666,634
2,666,635
Simple jQuery Count Up timer help please
<p>Trying to make a simple count up timer in jquery... this sort of works but is adding the numbers to the end of '0000' and I want it to go <code>'0001' '0002' '0003'</code> etc...<br> This is all happening in the jqury onReady scope.</p> <pre><code>var i = '0000' var timer = function doSomething ( ) { i = i+= 1 $('.counter').text(i); console.log(i); } setInterval (timer, 1000 ); </code></pre>
javascript jquery
[3, 5]
134,328
134,329
Object reference not set to an instance of an object when sending URL
<p>I have a password recovery controls in my web form. Upon entering all the necessary particular, an email will be send to the user's email account. </p> <p>It would be like -- if a user forgets his/her password, sending a password change link to the user's email account instead of a new password. </p> <p>However, after clicking on the submit button, " Object reference not set to an instance of an object." error appear. </p> <pre><code>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. And the error occurred on line 66. Source Error: Line 64: System.Web.UI.WebControls.Login Login1 = (System.Web.UI.WebControls.Login)LoginView1.FindControl("Login1"); Line 65: MembershipUser pwRecover = Membership.GetUser(Login1.UserName); **Line 66: Guid userInfoId2 = (Guid)pwRecover.ProviderUserKey;** </code></pre> <p>Following is the the behind code for the sending url in the message body: </p> <pre><code> protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e) { System.Web.UI.WebControls.Login Login1 = (System.Web.UI.WebControls.Login)LoginView1.FindControl("Login1"); MembershipUser pwRecover = Membership.GetUser(Login1.UserName); Guid userInfoId2 = (Guid)pwRecover.ProviderUserKey; //Create an url that will link to a UserProfile.aspx and //accept a query string that is the user's id //setup the base of the url string domainName = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath; //setup the second half of the url string confirmationPage = "/UserProfile.aspx?ID=" + userInfoId2.ToString(); //combine to make the final url string url = domainName + confirmationPage; // Replace &lt;%VerifyUrl%&gt; placeholder with url value e.Message.Body = e.Message.Body.Replace("&lt;%ResetPassword%&gt;", url); } </code></pre>
c# asp.net
[0, 9]
1,023,881
1,023,882
jquery background image rotating script doesn't work
<p>I'm writing this script to rotate a background Image every 3 seconds but it doesn't work at all and i'm stumped as to why not.</p> <pre><code>$(document).ready(function() { var inc = 0; var bgImages = new Array(); bgImages.push("Images/backgroundDog-small.jpg"); bgImages.push("Images/backgroundDog1-small.jpg"); bgImages.push("Images/backgroundDog2-small.jpg"); bgImages.push("Images/backgroundDog3-small.jpg"); setInterval(change, 3000); function change() { //if we're not at the end of the array if (inc &lt; (bgImages.length)) { var image = bgImages[inc]; $('body').css('backgroundImage', image); console.log(image); inc++; //reset the counter inc and go through the array again } else { inc = 0; } } }); </code></pre>
javascript jquery
[3, 5]
1,206,301
1,206,302
Remove draggable functionality when button is clicked
<p>In this fiddle - <a href="http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/35/" rel="nofollow">http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/35/</a> I'm attempting to remove the draggable functionality of all divs that are styled with .myDivs when the button 'Remove Draggable' is clicked.</p> <p>The function call <code>$('.myDivs').draggable('disable');</code> does not seem to achieve this ?</p>
javascript jquery
[3, 5]
4,620,353
4,620,354
SmtpMail.Send() doesn't work
<p>i have a problem with send mail in c#; it doesn't send any mail and also doesn't throw any exceptions with failure :</p> <pre><code>using System.Web.Util; public static void SendEmail(string _FromEmail, string _ToEmail, string _Subject, string _EmailBody) { // setup email header . SmtpMail.SmtpServer = "localhost"; MailMessage _MailMessage = new MailMessage(); _MailMessage.From = _FromEmail; _MailMessage.To = _ToEmail; _MailMessage.Subject = _Subject; _MailMessage.Body = _EmailBody; try { SmtpMail.Send(_MailMessage); } catch (Exception ex) { throw new ApplicationException("error has occured: " + ex.Message); } } </code></pre> <p>please help!</p>
c# asp.net
[0, 9]
2,976,823
2,976,824
tablesorter - Don't want the Footer to sort
<p>I'm using an asp.net repeater control with tablesorter. How can i disable sorting on the footer.I have a total on the footer but i don't want sorting to apply. Thanks in Advance</p>
jquery asp.net
[5, 9]
1,387,759
1,387,760
The operator || is undefined for the argument type(s) java.lang.String, java.lang.String in Android app
<p>I am trying to fetch database stored values and checking if ANY of the values exist then a method should be called.However, while checking I am getting this error--> The operator <code>||</code> is undefined for the argument type(s) <code>java.lang.String</code>, java.lang.String</p> <pre><code>if ((DBAdapter.KEY_AUDIENCE_TARGETING_COUNTRY || DBAdapter.KEY_AUDIENCE_TARGETING_WORLD) != null) { populate(); } </code></pre>
java android
[1, 4]
1,274,532
1,274,533
How to do user selectable background in own app in android?
<p>I have an android app which is a simple home screen. What I want is to create an option where users can select background by themselves. Currently I have made the option but it does not hold the background after I restart or press back button. It goes back to the background what I set in the xml file as android:background. Is there any way out? I heard by using shared preference it's possible. but don't know how to do it. Can any one help on this?</p>
java android
[1, 4]
5,359,477
5,359,478
Overloaded constructor in Python from C++ perspective
<p>There is this code:</p> <pre><code>#include &lt;iostream&gt; class SomeClass { int someInteger; float someFloat; public: SomeClass(int someInteger_) { // do something for int std::cout &lt;&lt; "Int constructor\n"; } SomeClass(float someFloat_) { // do something for float std::cout &lt;&lt; "Float constructor\n"; } }; int main() { SomeClass a(2); SomeClass b(2.0f); return 0; } </code></pre> <p>Objects of class SomeClass are differently created when float or int arguments for constructors are passed. There is similar class in Python:</p> <pre><code>class SomeClass: someInteger = 0 someFloat = 0.0 def __init__(self, value): # I want to do different things when int or float is passed print value a = SomeClass(2) b = SomeClass(2.0) </code></pre> <p>General question is - how to make function behavior dependent from types of passed arguments?</p>
c++ python
[6, 7]
2,308,614
2,308,615
Create an array variable for a class in Javascript
<p>The following is a Javascript class that I have created. </p> <pre><code>(function(window){ function Project(name,description){ this.name = name; this.description = description; } window.Project = Project; }(window)); </code></pre> <p>I know to create variables inside the class using the 'this' keyword. But can someone help as how to create an array as member of the class. In this situation I need to create an array variable 'projectMemebers'</p>
javascript jquery
[3, 5]
5,205,468
5,205,469
Search element using div class
<p>I need to search elementid based on div class as my element id in html page keep on changing based on different navigation, but my div class seems to be same everytime. I want to access the elementid and then i need to change the style.overflow ='visible' . Also even my elementid are getting changed it has same postfix pattern, is there a way to search for the elementid using pattern in jquery ?</p> <p>Please help as I'm new to javascript as well as jquery.</p>
javascript jquery
[3, 5]
2,634,399
2,634,400
jQuery hierarchy issue with next()
<p>Seems like <code>$("img").next().hide();</code> is not working when both the image and div tag are a child of a paragraph.</p> <pre><code>&lt;p&gt; &lt;img src="image.jpg" /&gt; &lt;div&gt;text&lt;/div&gt; // this div is set to 'display: none' by default in css &lt;/p&gt; </code></pre> <p>Yet, if I substitute <code>&lt;div&gt;</code> with <code>&lt;span&gt;</code></p> <pre><code>&lt;p&gt; &lt;img src="image.jpg" /&gt; &lt;span&gt;text&lt;/span&gt; &lt;/p&gt; </code></pre> <p>or if I omit the <code>&lt;p&gt;</code> tags</p> <pre><code>&lt;img src="image.jpg" /&gt; &lt;div&gt;text&lt;/div&gt; </code></pre> <p>the jQuery selector does work properly. Any ideas why this is the case? Is it related to inline and block display? How can I make it work as described in the top code example?</p> <p>This is the jQuery code I am using:</p> <pre><code>$(document).ready(function(){ $("img").hover( function() { $(this).next().show(); }, function() { $(this).next().hide(); } ); }); </code></pre> <p>Thanks for your help!</p>
javascript jquery
[3, 5]
5,782,721
5,782,722
How to get element content by id from HTML object by JavaScript ( JQuery )
<p>i write the following code to access page "JQueryPage.aspx" and get data from it using jQuery</p> <pre><code>&lt;script type="text/javascript"&gt; $.get ( "JQueryPage.aspx", function(data) { alert("Data Loaded: " + data); } ); &lt;/script&gt; </code></pre> <p>"JQueryPage.aspx" is just a page that contain DIV called 'resultsDIV' that contain the data that i want to return <br><br> the above code return data variable that contain "JQueryPage.aspx" html and i want to get DIV content from it .. <BR> i have 2 questions: <br/> 1- how can i extract DIV content from data object <br/> 2- is this way is th best to get that data ?</p>
asp.net javascript jquery
[9, 3, 5]
1,124,662
1,124,663
ASP.NET Forms Authentication Expiry
<p>Can someone explain to me how ASP.NET Forms Authentication works because I don't seem to get it and I keep getting signed out.</p> <p>As it stands, I have username, password and a "Keep me signed in" checkbox. From these values I'm creating a ticket and cookie, as follows:</p> <pre><code> // Create ticket FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,email,DateTime.UtcNow,DateTime.UtcNow.AddMinutes(30),remember,String.Empty); // Encrypt ticket string cookie_contents = FormsAuthentication.Encrypt(ticket); // Create cookie HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,cookie_contents); if (remember) { cookie.Expires = DateTime.UtcNow.AddDays(90); } cookie.Path = FormsAuthentication.FormsCookiePath; cookie.Secure = true; // Add cookie to response Response.Cookies.Add(cookie); </code></pre> <p>I would expect with this code that I can sign in to my website and assuming I check "Keep me signed in" that I stay signed in, for at least 90 days?</p> <p>However what I am seeing is that I'm being signed out at least 30 minutes after initial login (which is the time set aside for the ticket?).</p> <p>What is the difference between cookie expiration and ticket expiration and how do I keep myself signed. Do I need to set 90 days to both cookie and ticket?</p>
c# asp.net
[0, 9]
3,420,543
3,420,544
How does jQuery's .delay method work under-the-hood?
<p>I just saw this and think it's cool.</p> <pre><code>console.log("Starting..."); $("#my_element") .fadeIn() .delay(3000) .fadeOut(); console.log("Finishing..."); </code></pre> <p>How does the .delay method work under-the-hood? I mean, how does it figure out how to wait 3 seconds but not interrupt the main control flow?</p>
javascript jquery
[3, 5]
5,608,076
5,608,077
Use next and prev() in jquery
<pre><code>&lt;label for="a1"&gt;First:&lt;/label&gt; &lt;input id="a1" class="first" type="text" name="a1" value="123"&gt; &lt;label for="b1"&gt;Second:&lt;/label&gt; &lt;input id="b1" class="second" type="text" name="b1"&gt; &lt;br /&gt; &lt;label for="a2"&gt;First:&lt;/label&gt; &lt;input id="a2" class="first" type="text" name="a2"value="3424"&gt; &lt;label for="b2"&gt;Second:&lt;/label&gt; &lt;input id="b2" class="second" type="text" name="b2"&gt; &lt;br /&gt; &lt;label for="a3"&gt;First:&lt;/label&gt; &lt;input id="a3" class="first" type="text" name="a3"value="1235"&gt; &lt;label for="b3"&gt;Second:&lt;/label&gt; &lt;input id="b3" class="second" type="text" name="b3"&gt; &lt;br /&gt; $('.second').click(function(){ var get_first = // ??? $(this).val(get_first); }) </code></pre> <p>i would like for example - if i click on input b3 then in this value now is value from a3. how can i make it with next and prev in one class?</p> <p><a href="http://jsfiddle.net/Bgkrz/" rel="nofollow">http://jsfiddle.net/Bgkrz/</a></p>
javascript jquery
[3, 5]
1,913,207
1,913,208
Fight theft of plugin by sending parameters with AJAX callback
<p>I have built a new jQuery plugin and I want to be able to demo this to the user before they can purchase this. But I also don't want anybody to be able to simple copy the code without paying for it. </p> <p>For that reason I have encoded the plugin using <a href="http://www.vincentcheung.ca/jsencryption/" rel="nofollow">http://www.vincentcheung.ca/jsencryption/</a></p> <p>I thought of 2 ideas to further protect/make it harder to copy:</p> <ul> <li>Hard code the domain name check against <code>window.location.hostname</code></li> <li>Using AJAX send as much information about the website back to a PHP script on my server. </li> </ul> <p>What extra information can be fetch using Javascript apart from the domain name. E.g. PHP you have the $_SERVER[]. </p> <p>Do you have any ideas to protecting it further?</p> <p>Ok I just have just wrote this myself and this, seems to work on two different domains. </p> <pre><code>$.ajax({ url: 'http://example.co.uk/record.php', type: 'post', data: 'href='+document.location.href + '&amp;referrer='+document.referrer }); </code></pre> <p>Record.php</p> <pre><code>mysql_query("INSERT INTO `demo` (`id` ,`datetime` ,`href` ,`referrer`)VALUES (NULL ,CURRENT_TIMESTAMP , '".$_POST['href']."', '".$_POST['referrer']."')"); </code></pre>
javascript jquery
[3, 5]
3,965,927
3,965,928
Sending "alert/notification" to cell phone from website
<p>I was wondering if there was a way for a website to send an alert/notification to a cell phone (smart phone, android, iphone... stuff like that) where the notification will ask the user a question and they have to answer the question and the response is sent back to the website and their answer is logged in the database.</p> <p>I would also like to know if this notification could have checkboxes? I am needing this for a project and would like to know if there is anything out there like this.</p> <p>If you need more description, please let me know.</p> <p>Thanks in advance!</p>
php iphone android
[2, 8, 4]
5,459,236
5,459,237
Javascript issue inside of a Python Module
<p>I'm trying to have Python run some Javascript, and I am running into a few issues. Namely that when I am trying to inject some text into a textarea of a page, it doesn't seem to work if and only if there is a newline (\n) as part of the variable inserted for the Javascript.</p> <p>Here's my line:</p> <pre><code>br.runjs("document.getElementById('edit-body').value = '%s'" % (brag)) </code></pre> <p>if the variable "brag" has any sort of newline in it at all, the insertion does not work. Any idea how to go around this?</p>
javascript python
[3, 7]
851,942
851,943
Moving Div by everyclick without JQuery
<p>I used this jquery to move a div by every click.</p> <pre><code>$(document).ready(function(){ $('#hero').click(function(){ $(this).animate({ left: '+=50px' },300); }) }) </code></pre> <p>I'd like to avoid jquery whenever it is possible to get deeper into pure JS.</p> <p>Is there anyway to achieve the same effect without using jquery?</p> <p>I know that this will be more complex, but just trying to learn.</p>
javascript jquery
[3, 5]
5,712,724
5,712,725
Making a control visible on a seperate page, but not visible on the page which contains the control
<p>I have a masterpage (which we will call 'default'). This contains a second page (web user control) - 'second'. And finally a third 'print' page. The 'print' page is also a web user control, however, it merely has a placeholder that contains the 'second' page.</p> <p>Is there a way I can add a control to the 'second' page - such as a literal, and only have it visible on the 'print' page? </p>
c# asp.net
[0, 9]
2,009,631
2,009,632
Shortcut for adding one item to an array in javascript
<p>I want to add just one item to an array in Javascript and use that array as an argument for a method. How can I complete this <em>with an easy syntax</em>.</p> <p>I tried this:</p> <pre><code>[].push({ "value" : "test"}); </code></pre> <p>But that only returns 1. I want the complete array as a return. So any ides? Something similar to what I tried?</p>
javascript jquery
[3, 5]
2,168,159
2,168,160
jQuery: Mouseover Timeout
<p>i have script like this</p> <pre><code>$('.parent a').live('mouseover mouseout', function(event) { if (event.type == 'mouseover'){ if ($(this).siblings('.child').css('width') == '0px' ){ $(this).siblings('.child').animate({'width': window.innerWidth}, 500); } }else{ if ( !$(this).hasClass('active') ){ $(this).siblings('.child').animate({'width': 0}, 500); } } }); </code></pre> <p>as you notice from script above, if we mouse over <code>$('.parent a')</code> then it's sibling will expand it width. </p> <p>for now its siblings exapnd instantly if we mouse over, i want to make it happen when we already mouse over after <code>5 seconds</code></p> <p>how to make it?</p>
javascript jquery
[3, 5]
626,342
626,343
problem using page.registerstartupscript
<p>I am using page.registerstartupscript in my code behind C#. Its like this:</p> <p>string item1="category1"; string Script = "window.program = '" + item1 + "';"; Page.RegisterStartupScript("PopupScript", Script);</p> <p>item1 gets generated dynamically from some value in code behind. But its not working. Any suggestoins where I m getting wrong?</p>
asp.net javascript
[9, 3]
5,201,273
5,201,274
Android AnimationDrawable memory management
<p>I'm creating an android application &amp; it has background animations for each activity. I used <code>AnimationDrawable</code> <code>setBackgroundResource(anim.xml)</code> to run the animation xml files and works fine. problem is, when I test on devices,some devices gives me an <code>FATAL EXEPTION</code> telling that <code>bitmap size exeeds VM budget(out of memory)</code>.</p> <p>so I surfed web and found some solutions like executing <code>animation.setCallbacks(null)</code> before run the animation,<a href="http://developer.android.com/training/displaying-bitmaps/load-bitmap.html" rel="nofollow">scaling down bitmaps</a>(programmatically) and resizing drawables. I tried them but few devices which has low heap still gives the same error.</p> <p>so I want to know am I doing something wrong or missing something? is their any other solution to this problem?</p> <pre><code>//animation private void animate() { imgView = (ImageView)findViewById(R.id.imageView1); imgView.setVisibility(ImageView.VISIBLE); imgView.setBackgroundResource(R.drawable.level_animation); frameAnimation = (AnimationDrawable) imgView.getBackground(); if (frameAnimation.isRunning()) { frameAnimation.stop(); } else { frameAnimation.stop(); frameAnimation.start(); } } xml &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true" &gt; &lt;item android:drawable="@drawable/top_anim1" android:duration="200" /&gt; &lt;item android:drawable="@drawable/top_anim2" android:duration="200" /&gt; &lt;item android:drawable="@drawable/top_anim3" android:duration="200" /&gt; &lt;item android:drawable="@drawable/top_anim4" android:duration="200" /&gt; &lt;item android:drawable="@drawable/top_anim5" android:duration="200" /&gt; &lt;/animation-list&gt; </code></pre>
java android
[1, 4]
4,934,118
4,934,119
I want to access the values of the keys of an object?
<p>I'm using an API and I'm getting the response of it on success function as a data.</p> <p>I'm trying to use which only gives me the "keys" of all objects but not there values, so my question is: can I get the values using below approach?</p> <p>I have got the "keys" of all objects using JavaScript's <code>object.key()</code> method but now I want to get their values too.</p> <p>Here is the response. I have taken a snippet of response here which I got in console.</p> <pre><code>division: Object active: 1 country: "United States" lat: 42.3584647 lon: -71.05962 name: "Boston" url: "http://yipit.com/boston/" </code></pre> <p>Below the function written to get the key of an object:</p> <pre><code>function getvalues(data){ for(var i = 0;i &lt;= data.response.deals.length-1; i++){ var obj = []; var num = i + 1; var keyArray = Object.keys(data.response.deals[i].division); $('#empid h6').html(keyArray); //here i get the keys of objects which is country,lat,lon etc. console.log("value of keyArray "+num+" is "+keyArray); } } </code></pre>
javascript jquery
[3, 5]
4,593,100
4,593,101
JS slideshow "nextPhoto"/"prevPhoto" not working
<p>I'm working on a JavaScript slideshow someone else originally built, and I seem to have busted it. The "previous" and "next" buttons don't work - they don't do anything, actually. </p> <p>Using the HTML Validator plugin for Firefox when I load the page, I get an error message: "Undefined variable: random_photo in [filename.php]"</p> <p>When I click on "next" or "previous", I get an additional error: "nextPhoto is not defined"</p> <p>I have compared the code on this page to another existing (and functional) slideshow, and I cannot find any differences. </p> <p>I'm happy to pup up code snippets, but I'm not sure what's relevant...I'm kind of a newbie to JavaScript.</p> <p>What am I missing/what can I do to define the supposedly undefined variables?</p>
php javascript
[2, 3]
4,804,192
4,804,193
How can I find the size of a table cell with javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5221831/how-can-i-find-out-the-size-of-a-cell-with-javascript">How can i find out the size of a cell with javascript</a> </p> </blockquote> <p>I want to find the width of a table header. when I do this <code>var width = $('myTH').width</code> it returns "12%" but i want to return the width in pixles. How can I do that? I cant change the width of the <code>&lt;th&gt;</code> to pixles because i want them to be in percentages so they resize with the screen.</p> <p>i am using jquery-1.5.js when i do something like $('#myTH') i get an error. I dont knwo if this is related but it means i couldnt use methods suggested to me like <code>$('#myTH').width()</code> or <code>$('#myTH').outerWidth()</code> i get an error "object does not support this property or method" i am guessing it's the # sign</p> <p><strong>EDIT:</strong></p> <pre><code>&lt;th id="telephoneTH" width="25%" &gt; &lt;span id="telephoneSpan" class="headerShortDetails"&gt;Telephone&lt;/span&gt;&lt;span onclick="showContactPopup();" class="infoSpans"&gt; ${bean.phoneNumber}&lt;/span&gt; &lt;/th&gt; var width2 = $('#telephoneTH').outerWidth(); alert(width2); </code></pre> <p>I get an error 'null' is null or not an onject</p>
javascript jquery
[3, 5]
1,378,872
1,378,873
Alarm manager In android SDK
<pre><code>private static final int HELLO_ID = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Date dat = new Date();//initializes to now Calendar cal_alarm = Calendar.getInstance(); Calendar cal_now = Calendar.getInstance(); cal_now.setTime(dat); cal_alarm.setTime(dat); cal_alarm.set(Calendar.MONTH,3); cal_alarm.set(Calendar.YEAR,2012); cal_alarm.set(Calendar.DAY_OF_MONTH,4); cal_alarm.set(Calendar.HOUR_OF_DAY,19);//set the alarm time cal_alarm.set(Calendar.MINUTE, 15); cal_alarm.set(Calendar.SECOND,0); if(cal_alarm.before(cal_now)){//if its in the past increment cal_alarm.add(Calendar.DATE,1); } Intent intent = new Intent(AlarmManagerTestActivity.this, AlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast( AlarmManagerTestActivity.this, 0, intent, 0); AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, cal_alarm.getTimeInMillis(), pendingIntent); } </code></pre> <p>Hello,I want to set alarm and notification on specific date,i am using code given here but i am unable to set alarm on specifc date.Please let me know what is the mistake here.</p> <p>Thanks in advance Trapti</p>
java android
[1, 4]
181,597
181,598
Get client machine's operating system name for both - tablet devices and PC
<p>I have a website created in asp.net 3.5, c# 2008 - hosted on IIS 7. I want to check from which operating system the client is accessing the site, whether from browser of computer or from browser of tablet devices like ipad, dell streak, samsung galaxy etc or from the smart phone. Is it possible to know. I have tried out </p> <pre><code>Page.Request.Browser.Platform.ToString(); </code></pre> <p>but accessing from android device browser I am getting it undefined.</p> <p>I also have tried </p> <pre><code>Request.Browser.Capabilities["OS"].ToString(); </code></pre> <p>but for android I am getting the OS name Linux !! </p> <p>I want the exact name whether it is windows, Symbian, Android, iOS, MAC or Linux. </p>
c# asp.net
[0, 9]
417,617
417,618
How to make page autoscroll to DIV onload
<p>I have a quicklaunch (<em>bookmark list</em> if you'd like) which will send the user to different pages with lots of text. So I want them to be sent to the specific paragraph.</p> <p>Is it possible to make a page autoscroll to a specific DIV onload and how?<br> I'll live without the animation. If it can just go to it directly that'll make my day. Like when you have an <code>&lt;a href="#SomeId"&gt;</code> tag and when you click that anchor it sends you to that div.</p> <p>Edit: If the user bookmarks the top paragraph, an ID isn't saved for the link. So in that case I just want it to go to the where the content div starts. How is this possible?</p>
javascript jquery
[3, 5]
2,872,545
2,872,546
ASP.NET ListView containing LinkButtons - catching events
<p>I have a ListView in which the ItemTemplates are a series of LinkButtons.</p> <p>The LinkButtons' text is populated from a db, this is done by simply binding the text property to the column I want. This works well and fine, when ran the page displays the LinkButtons in a list with their correct names.</p> <p>The problem is then selection, my objective is to 'expand' when each link is clicked, so more data about the item can be displayed. The SelectedItemView is set up and if I go into the properties of the ListView and forcefully set the pre-selected index, it displays as I'd like it to. I'd like the page to start off with nothing selected, so the SelectedIndex is set to -1 at start.</p> <p>As far as I can tell the SelectedIndex isn't changing when I click each LinkButton in the ListView. In the C# code, I have the method prototype defined:</p> <pre><code>protected void ListView3_SelectedIndexChanged(object sender, EventArgs e) </code></pre> <p>Though a console write or break point set within that method is not being hit. I'm not entirely sure why this method isn't being triggered, in the HTML code, with regards to this ListView I have:</p> <pre><code>&lt;asp:ListView ID="ListView3" runat="server" DataSourceID="AccessDataSource1" onselectedindexchanged="ListView3_SelectedIndexChanged"&gt; </code></pre> <p>As the opening tag.</p> <p>The CommandName property of the LinkButton <em>IS</em> set to 'Select', so it should be changing the SelectedIndex and triggering the above method, from what I should tell, but it isn't. It's not doing anything (no error). Any advice?</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,791,060
3,791,061
JQuery get Value of an Element: onfocus="inputInlineHint(self);"
<p>i have an input field which calls the function "inputInlineHint(self)" on blur and on focus. It also passes self...</p> <pre><code>&lt;input type="text" id="one" class="textbox" value="Your Name" onfocus="inputInlineHint(self);" onblur="inputInlineHint(self);" /&gt; </code></pre> <p>Now i'd like to retrieve the current value of the field:</p> <pre><code>function inputInlineHint(e) { var theValue = ''; //Now i need to retrieve the value... but how? } </code></pre> <p>I hope you guys can help me with that... should be pretty basic but i'm new to jquery.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
1,037,167
1,037,168
asp.net validator add class to input if validation is wrong
<p>Is it possible to add css class to validated input if value isnt valid ? Im using asp.net validators.</p> <p>Maybe there is javascript event on taht validators which I can use ?</p> <p>thanks for any advice</p>
c# asp.net
[0, 9]
553,312
553,313
Problem with getting source code of page
<p>I'm new in Java and in programming on android. Have a look at this code:</p> <pre><code>TextView tv = new TextView(this); URI uri; HttpResponse response = null; String str = "dupa2"; try { uri = new URI("http://google.com"); HttpGet get = new HttpGet(uri); HttpClient client = new DefaultHttpClient(); try { response = client.execute(get); HttpEntity enity = response.getEntity(); str = enity.toString(); str = "2"; } catch (IOException ex) { tv.setText("blad"); Logger.getLogger(MainActivity.class.getName()).log(Level.SEVERE, null, ex); } } catch (URISyntaxException ex) { tv.setText("blad"); Logger.getLogger(MainActivity.class.getName()).log(Level.SEVERE, null, ex); } tv.setText(str); setContentView(tv); </code></pre> <p>It doesn't work and i dont have idea why :/ str value is "dupa2" when it should be "2" (i added it because i didnt know whats going on) or "blad") WTF? </p> <p>Must I add that try...catch statements? Thanks in advance, Chris</p>
java android
[1, 4]
691,504
691,505
Is this a bad practice for droppable?
<p>Whenever a user presses a div button I want to register a droppable. I'm setting a the closure<br> <code>add.droppable({})</code> to the <code>var toDrop</code> and then invoking methods on <code>toDrop</code> as below, is this a bad practice ?</p> <p>For example instead of <code>toDrop.addClass("newColors");</code> should I be using something like </p> <pre><code>this.addClass("newColors") </code></pre> <p>Here is the complete snippet : </p> <pre><code>$("#myDiv").on('click' , '.colors' , function() { var add = $(this).parent(); var toDrop = add.droppable({ drop: function(event, ui) { toDrop.addClass("newColors"); toDrop.attr("portletName", parameter); } }); }); </code></pre>
javascript jquery
[3, 5]
1,164,505
1,164,506
Using Jquery for multiple values?
<p>I'm trying to display a reply form for each comment but I hide the form using Jquery and I was wondering how can I grab the comment id and add it to Jquery so it can hide each reply form and display the correct reply form correctly instead of displaying the wrong reply form?</p> <p>For example, <code>form_show_hide1, form_show_hide2, form_show_hide3, form_show_hide4</code> and so on.</p> <p>I;m using PHP and JQuery.</p> <p>Here is the Jquery code.</p> <pre><code> $(function(){ $('a#form_show_hide').click(function(){ $('#form_container').slideToggle('slow'); // prevent default action return false; }); }); </code></pre> <p>Here is the HTML code. Note I changed the ids to classes.</p> <pre><code>&lt;a href="#" title="Reply Link" class="form_show_hide"&gt;Reply&lt;/a&gt; &lt;form method="post" action="' .htmlentities($_SERVER['REQUEST_URI']) . '" class="form_container&gt; &lt;fieldset&gt; &lt;textarea rows="6" cols="70"&gt;&lt;/textarea&gt; &lt;input type="submit" name="reply" value="Submit" /&gt; &lt;input type="hidden" name="id" value="' . urlencode($comment_id) . '" /&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre>
php jquery
[2, 5]
909,665
909,666
Multiple random results in a for loop?
<p>I'm trying to create 64 squares and give each a unique background color. I'm pretty close, but I can only seem to get one random color.</p> <pre><code>function randomCol() { return Math.floor(Math.random()*16777215).toString(16); } $(function(){ for(i=0; i&lt;64; i++) { $('&lt;div class="square"&gt;&lt;/div&gt;').insertAfter(".starter"); $(".square").css({'background':'#' + randomCol()}); } }); </code></pre>
javascript jquery
[3, 5]
1,879,472
1,879,473
Calling a parameterized javascript function from php
<p>I need to call a javascript function from php, by passing a value in php variable. My code goes like this:</p> <pre><code>echo '&lt;tr class="trlight"&gt;&lt;td onclick="callVehicle('.$qry_vehicleid.');"&gt;&lt;label&gt;Call Vehicle&lt;/label&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;'; </code></pre> <p>And in javascript file I try to execute the following code:</p> <pre><code>function callVehicle(vid) { alert('Call '+vid); document.getElementById("SearchResult").style.visibility="hidden"; } </code></pre> <p>and an error <code>test is not defined</code> occurs. <code>test</code> is the value that I assigned to variable <code>$qry_vehicleid</code>. Can someone please point out what the mistake is?</p>
php javascript
[2, 3]
2,427,612
2,427,613
jQuery - Running a function to replace commonly used code
<p>I have the following code below. Id like to replace the highlighted section with a single line of code that will run all that code. The reason behind this is because i reuse this code a lot, and would save me a lot of time by being able to copy and paste a single line of code.</p> <p>Any ideas on the best way to write this?</p> <p>This is the part i would like replacing with a single line of code.</p> <pre><code>$(".menu-item-1").show(); $(".menu-item-2").show(); $(".menu-item-3").show(); $(".menu-item-4").show(); $(".menu-item-5").show(); $(".menu-item-6").show(); </code></pre> <p>And the entirety of the code below.</p> <pre><code>if (index == 2) { $("#prev").show(); $("#next").show(); $(".menu-item-1").show(); $(".menu-item-2").show(); $(".menu-item-3").show(); $(".menu-item-4").show(); $(".menu-item-5").show(); $(".menu-item-6").show(); $("#p3-1").delay(1000).fadeIn("slow", function () { $("#p3-2").delay(500).fadeIn("slow", function () { $("#p3-3").delay(500).fadeIn("slow", function () { $("#p3-4").delay(500).fadeIn("slow", function () { $("#p3-5").delay(500).fadeIn("slow", function () { $("#p3-6").delay(500).fadeIn("slow", function () { $("#p3-7").delay(500).fadeIn("slow") $("#next").show(); }); }); }); }); }); }); } </code></pre>
javascript jquery
[3, 5]
4,256,660
4,256,661
document.getElementById working for one form element but not another
<p>I have a web page that takes a 10 digit code which is split across two textboxes, 4-chars in the first textbox and 6 chars in the second.</p> <p>I've been trying to implement some javascript so that when the user enters the fourth character in the first textbox the cursor jumps to the second textbox.</p> <p>The page is laid out as following:</p> <pre><code>&lt;asp:TextBox ID="txtCode1" onkeyup="Next()" runat="server" Width="45" MaxLength="4"/&gt; &lt;asp:TextBox ID="txtCode2" runat="server" Width="70" MaxLength="6"/&gt; </code></pre> <p>I'm using the following Javascript :</p> <pre><code>function Next() { var control1 = document.getElementById('&lt;%= txtCode1.ClientID %&gt;'); var control2; if (control1.value.length == 3) { control2 = document.getElementById['&lt;%= txtCode2.ClientID %&gt;']; control2.Focus(); } } </code></pre> <p>My problem is that the function doesn't recognise the second textbox. If I step through the Javascript has no problem is able to locate <code>txtCode1</code> and get the length but when the length hits 4 chars and it has to populate <code>control2</code> with the <code>getElementById()</code> call it sets control2 as undefined and then the control2.Focus() call throws an error.</p> <p>I don't understand how the code for getting control1 and control2 is the same but this doesn't work, what am I missing?</p>
javascript asp.net
[3, 9]
1,232,710
1,232,711
any way to catch a page-refresh and pause it?
<p>Is there any way to catch a page refresh and pause it for a certain time period using javascript, jquery or whatever?</p> <p>This is necessary to prevent accidentally pressing the refresh key amid an important work which is one-time ,and needs to be processed and saved before the page gets refreshed.</p> <p>In one of my previous questions posted in this forum, I had to face this issue, which is still unsolved, at a certain point during the discussion of the question. I think posting it as an individual question is quite worth it. The said question is <a href="http://stackoverflow.com/questions/8111018/do-something-on-selecting-a-radio-button">here</a> .Edit part of the question contains the issue.</p> <p>Scripting language is php. Or should I use any other language to achieve the goal?</p>
php javascript jquery
[2, 3, 5]
3,726,345
3,726,346
RadioGroup.check(int) not working
<p>I'm having a little trouble with RadioGroups. I created a blank radiogroup in layout. And then filled it with equalizer presets in the code. Then I tried to set one of the option using radiogroup.check(1). But it threw a null pointer exception.</p> <p>Below is the code:</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.equalizer); //rgEqualizer = (RadioGroup) findViewById(R.id.rgEqualizerPreset); mPlayer = new MediaPlayer(); mEqualizer = new Equalizer(0, AuID); rgEqualizer = new RadioGroup(this); radioButtonList = new ArrayList&lt;RadioButton&gt;(); layoutParams = new RadioGroup.LayoutParams( RadioGroup.LayoutParams.FILL_PARENT, RadioGroup.LayoutParams.WRAP_CONTENT); fillRadioGroupWithRadioButtons(); rgEqualizer.setEnabled(true); rgEqualizer.setOnCheckedChangeListener(this); addContentView(rgEqualizer, layoutParams); loadPresetsettings(); } private void fillRadioGroupWithRadioButtons() { Short noPresets = mEqualizer.getNumberOfPresets(); short i = 0; while (i &lt; noPresets) { RadioButton rb = new RadioButton(this); rb.setText(mEqualizer.getPresetName(i)); rgEqualizer.addView(rb, layoutParams); i++; } } private void loadPresetsettings() { rgEqualizer.check(1); } </code></pre> <p>It seems like even after adding the child radio buttons fillRadioGroupWithRadioButtons(), there are no childs added in radiogroup. What am I missing/</p> <p>Thanks in advance</p>
java android
[1, 4]
4,693,524
4,693,525
Why is $(this).val() giving me the value from this first method in this second method?
<p>The $(this).val() in the second method returns the same value that I get in the first method. I expected to get the first value of the fields with the secondGroup class. What am I doing wrong?</p> <pre><code>$(document).ready(function(){ jQuery.validator.addMethod("method1", function(value, element, options) { .....some code here.... var elems = $(element).parents('form').find(options[0]); jQuery.each(elems, function(){ thisVal = $(this).val(); }); .....some code here...... }, jQuery.format("some message.")); jQuery.validator.addMethod("method2", function(value, element, options) { .....some code here.... var elems = $(element).parents('form').find(options[0]); jQuery.each(elems, function(){ thisVal = $(this).val(); }); .....some code here...... }, jQuery.format("some message.")); $("#formName").validate({ rules: { firstMethod1:{ method1: ['.firstGroup'] }, secondMethod1:{ method1: ['.firstGroup'] }, thirdMethod1:{ method1: ['.firstGroup'] }, firstMethod2:{ method2: ['.secondGroup'] }, secondMethod2:{ method2: ['.secondGroup'] }, thirdMethod2:{ method2: ['.secondGroup'] } } }); }); </code></pre>
javascript jquery
[3, 5]
4,124,400
4,124,401
Jquery add tr to last but one row in a table
<p>Sample Code </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>Now when i click this Add button it should add tr before this row i.e </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>so the next time i click Add button it has to be </p> <pre><code>`&lt;table&gt; &lt;tr&gt; &lt;td&gt; first column &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; some content &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="addRow"&gt; &lt;td&gt;&lt;input type="button" id="add_button" name="add" value="Add" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; ` </code></pre> <p>How is this done?? Please help</p>
javascript jquery
[3, 5]
5,859,911
5,859,912
Is there a way to write iphone and android apps using visual studio and c#?
<p>Is there a way to write iphone and android apps using visual studio and c#? Also if I make a phone app can I easily write it for android, iphone, and windows without havong to write it in 3 different languages?</p>
c# iphone android
[0, 8, 4]
2,596,580
2,596,581
JQuery addclass to another div (but not parent) if no data is found
<p>I have this to add a class to the main table that the report is in if there is no data returned. </p> <p><code>$('#report-area table td:contains("Sorry, your search did not return any data")').parents('#report-area').addClass('no-report-data')</code></p> <p>However, I have another div area <code>"#report-footer"</code> but it's not inside <code>#report-area</code>. I'd like to also add the <code>.no-report-data</code> class to <code>"#report-footer"</code> as well but in this case I don't think the <code>.parents</code> selector will work. Is there another selector I can use to do this?</p>
javascript jquery
[3, 5]
4,766,715
4,766,716
jQuery/JavaScript program breaks after completion number is changed
<p>In a spelling game I have created there is a grid that is populated with words. The aim of the game is to spell the words by clicking on the letters on the side, which animate into the empty spaces in the grid. Words are highlighted if they are to be spelt, so the user can see where to go next. The aim of the game is to spell the required amount of words in the grid to complete the game. I usually set this to two, but have just changed it to 3 and the program keeps breaking after I spell the second word.</p> <pre><code> if (score.right == 3) { ................ ................ } </code></pre> <p>Usually when you spell a word correctly I use a "click.trigger" function to move to the next highlighted word in the grid. At the moment after 2 correct ones the program either just doesn't go onto the next one or goes back to the last one and doesn't allow you to click the letters.</p> <pre><code>setTimeout(function() { jQuery('.next-question').trigger('click'); }, 1500); </code></pre> <p>I have tried to go through with break points but cannot seem to find the issue. Can someone help me to get it working again and tell me where I was going wrong?</p> <p>At the moment in my game there is no hint pictures or hint sounds so to find the highlighted word you have to use the console. Try answering two right then it will crash.</p> <p>Here is a fiddle for the broken one: <a href="http://jsfiddle.net/smilburn/Dxxmh/101/">http://jsfiddle.net/smilburn/Dxxmh/101/</a></p> <p>Here is a fidddle to a previous one that worked fine: <a href="http://jsfiddle.net/smilburn/Dxxmh/100/">http://jsfiddle.net/smilburn/Dxxmh/100/</a> (some class names may have changed)</p>
javascript jquery
[3, 5]
1,675,361
1,675,362
Confusing Javascript quotes
<p>In the jQuery docs mostly every string is "declared" using single quotes. Including the <a href="http://jqueryui.com/demos/datepicker/#option-dateFormat" rel="nofollow" title="documentation">documentation</a> for jQuery UI.</p> <p>So why doesn't this</p> <pre><code>$(".datepicker").datepicker({ dateFormat: 'dd.mm.yy' }); </code></pre> <p>work, but this</p> <pre><code>$(".datepicker").datepicker({ dateFormat: "dd.mm.yy" }); </code></pre> <p>does? When using single quotes, the datepicker ignores my <code>dateFormat</code> setting.</p> <p>(Ignore my silly habit of using double-quotes in the jQuery selector, but single quotes everywhere else :P )</p>
javascript jquery
[3, 5]
2,174,871
2,174,872
jQuery events don't work when html is injected
<p>I have something like this:</p> <pre><code>function SetTableBehavior() { $(".displayData tr").hover(function(e) { $(this).children().addClass('displayDataMouseOver'); }, function () { $(this).children().removeClass('displayDataMouseOver'); }); $(".displayData tr td").click(function(e) { var rowsSel = $(".displayData .displayDataRowSelected"); for (var i = 0; i &lt; rowsSel.length; i++) { var rowSel = rowsSel[i]; $(rowSel).children().removeClass("displayDataRowSelected"); } $(this).parent().addClass('displayDataRowSelected'); var p = $(this).parent(); p.children().addClass('displayDataRowSelected'); }); } </code></pre> <p>When the body of the table is injected neither hover or click work. If i use</p> <pre><code>$(".displayData tr td").live('click',function(e) { </code></pre> <p>the click event works but</p> <pre><code>$(".displayData tr").live('hover',function(e) { </code></pre> <p>doesn't work</p> <p>What is the solution so that hover works. Thanks.</p> <p>It seems to work like this:</p> <pre><code>function SetTableBehavior() { $(".displayData tr").live('mouseenter', function (e) { $(this).children().addClass('displayDataMouseOver'); }).live('mouseleave', function(e) { $(this).children().removeClass('displayDataMouseOver'); }); $(".displayData tr td").live('click',function(e) { var rowsSel = $(".displayData .displayDataRowSelected"); for (var i = 0; i &lt; rowsSel.length; i++) { var rowSel = rowsSel[i]; $(rowSel).children().removeClass("displayDataRowSelected"); } $(this).parent().addClass('displayDataRowSelected'); var p = $(this).parent(); p.children().addClass('displayDataRowSelected'); }); } </code></pre>
javascript jquery
[3, 5]
2,020,084
2,020,085
move cursor to the beginning of the input field?
<p>when you click on 'Ask question' here in Stackoverflow you see a text "What's your programming question? Be descriptive."</p> <p>i want the same thing and all i need for that is to move my cursor to the beginning of the text field. how do i do that with jquery?</p>
javascript jquery
[3, 5]
2,455,648
2,455,649
Combine more than 1 image into a gif
<p>I'm wondering if it's possible to combine more than 1 image into a gif?</p> <p>So, essentially you import 2 photos and make a gif out of them. </p> <p>Thanks.</p>
java android
[1, 4]
4,842,579
4,842,580
CSS and animate() in jquery
<p>I'm trying to make navigation with some effects but my jquery code dosen't works like I expected. Actually I want to pass this css statement background: #ccc url('image.jpg') no-repeat; to animate function.</p> <p>How to do that ?</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; $('ul li').hover(function() { $(this).animate({ 'background' : '#ccc' }, 'fast'); } }); </code></pre>
javascript jquery
[3, 5]
5,503,002
5,503,003
How to access PHP variables in JavaScript or jQuery rather than <?php echo $variable ?>
<p>How do I access PHP variables in JavaScript or jQuery? Do I have to write </p> <pre><code>&lt;?php echo $variable1 ?&gt; &lt;?php echo $variable2 ?&gt; &lt;?php echo $variable3 ?&gt; ... &lt;?php echo $variablen ?&gt; </code></pre> <p>I know I can store some variables in cookies, and access these values via cookies, but values in cookies are relatively stable values. Moreover, there is a limit, you can not store many values in cookies, and the method is not that convenient. Is there a better way to do it?</p>
php javascript jquery
[2, 3, 5]
774,166
774,167
Reading parameters like signup[product][handle] in ASP.NET
<p>I need to read parameters from Context.Request that is written in a format like:</p> <pre><code>url?event=open&amp;signup[customer][first_name]=John&amp;signup[customer][last_name]=Doe&amp;signup[payment_profile][card_number]=xxxxxxxx </code></pre> <p>Is there an easy way to parse this into a c# object? Would it be recommended to parse this in to a <code>NameValueCollection</code>, or is it to complex? </p> <p>I am not familiar with this way of posting data, I don't even know what it is called when you do it like this, anyone care to fill me in? Thanks!</p> <p>In case you are interested, this is the way stuff get posted:</p> <pre><code>&lt;form method="post" action="https://...."&gt; &lt;input type="hidden" name="signup[product][handle]" value="basic" /&gt; &lt;input type="text" name="signup[customer][first_name]" /&gt; &lt;input type="text" name="signup[customer][last_name]" /&gt; &lt;input type="text" name="signup[customer][email]" /&gt; &lt;input type="text" name="signup[payment_profile][first_name]" /&gt; &lt;input type="text" name="signup[payment_profile][last_name]" /&gt; &lt;input type="text" name="signup[payment_profile][card_number]" /&gt; &lt;input type="text" name="signup[payment_profile][expiration_month]" /&gt; &lt;input type="text" name="signup[payment_profile][expiration_year]" /&gt; &lt;input type="submit" value="Sign Up" /&gt; &lt;/form&gt; </code></pre>
c# asp.net
[0, 9]
2,036,790
2,036,791
How do i delete a file? And file questions about limits? Java Android
<pre><code>FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_WORLD_READABLE); fos.write(string.getBytes() fos.close(); </code></pre> <p>Above is how i write my files. Now is there a limit to it? i'm asking this because i set some text to it that i get from my text view, then later, when i get the text from that file, it isn't the full text.Secondly, how would i delete a file when using the above method?</p>
java android
[1, 4]
2,370,778
2,370,779
Get image from external server
<p>We are storing our images at Amazon S3. Let's say the location is <a href="http://media.sitename.com/folder1/image1.jpg" rel="nofollow">http://media.sitename.com/folder1/image1.jpg</a>.</p> <p>I want to copy this file and store it in our server. Is it possible to do this using C#. I am using asp.net 4.0.</p> <p>Please help. Thanks.</p>
c# asp.net
[0, 9]
4,918,028
4,918,029
Making my mouseevent coded in jquery a lot more elegant
<p>I wrote this in order to fix the problem IE has with select drop down lists being truncated if their options were longer than the default value of the select. Now it works fine but I want to improve the code in order to learn how to write things in a much more useable fashion. </p> <pre><code> $(document).ready(function() { if ($.browser.msie) { $('select').focus(function() { $(this).addClass('expand').removeClass('clicked'); }) $('select').blur(function() { $(this).removeClass('expand clicked'); }) $('select').mousedown(function () { $(this).addClass('expand').removeClass('clicked'); } ) $('select').hover(function () { }, function () {if (!$(this).hasClass('clicked')) { $(this).removeClass('expand'); $(this.blur()) }}) $('select').click (function() { $(this).toggleClass('clicked'); }) $('select').change(function(){ $(this).removeClass('expand clicked'); $('select.widerIE').blur() }) } }); </code></pre> <p>I tried making functions which were called by each event but that seemed to fail eg: </p> <pre><code> $('select').click(test (a)) function test (a) { $(a).addClass('expand').removeClass('clicked') } </code></pre>
javascript jquery
[3, 5]
3,594,990
3,594,991
Question regarding execution of JS code
<p>I just encountered with this code:</p> <pre><code>foo = (function() { var div = document.createElement('div'); return function(html) { div.innerHTML = html; var item = div.firstChild; div.removeChild(item); return item; }; })(); </code></pre> <p>and it is being used like this:</p> <pre><code>var element=foo('&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;table&gt;'); </code></pre> <p>I noticed that the above return the JavaScript element with it. I wonder can't it be done only with this -</p> <pre><code>var element=$('&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;table&gt;')[0]; </code></pre> <p>What exactly the original JS function is doing actually? What is the benefit of taking this <em>var div = document.createElement('div');</em> outside the return statement ?</p>
javascript jquery
[3, 5]
5,172,358
5,172,359
TextRenderer.DrawText() does not work on my Web application?
<p>I have to render text into GDI(not GDI+) and save as image in C#.NET web application not windows application, SO for that I have chosen <code>TextRenderer.DrawText()</code>, to render the text into GDI, But I am getting an red lined highlight below the <code>TextRenderer</code> with message if mouse over <strong>"The name 'TextRenderer' does not exist in the current context"</strong> . here my code is:</p> <pre><code>Bitmap Bit = new Bitmap(1000,500); Graphics g = Graphics.FromImage(Bit); g.Clear(Color.Red); TextRenderer.DrawText(graphics, myText, new Font("Ariel", 50, FontStyle.Regular), new Point(20, 20), Color.Black, Color.Gold); Bit.Save(pathToSaveImg + "image.png", ImageFormat.Png); Bit.Dispose(); </code></pre> <p>So PLEASE help if any Thanks.</p>
c# asp.net
[0, 9]
5,331,738
5,331,739
json encoding 2 dimension array
<p>I have the following in php:</p> <pre><code>$query = mysql_query($sql); $rows = mysql_num_rows($query); $data['course_num']=$rows; $data['course_data'] = array(); while ($fetch = mysql_fetch_assoc($query) ) { $courseData = array( 'course_name'=&gt;$fetch['course_name'], 'training_field'=&gt;$fetch['training_field'], 'speciality_field'=&gt;$fetch['speciality_field'], 'language'=&gt;$fetch['language'], 'description'=&gt;$fetch['description'], 'type'=&gt;$fetch['type'], ); array_push($data['course_data'],$courseData); } echo json_encode($data); </code></pre> <p>when I receive the result of this script in jquery (using post) </p> <p>I log it using :</p> <pre><code>console.log(data['course_data']); </code></pre> <p>and the output is :</p> <pre><code>[Object { course_name="Introduction to C++", training_field="Engineering" , speciality_field="Software", more...}] </code></pre> <p>But I can't seem to figure out how to access the elements.</p> <p>I tried</p> <pre><code>data['course_data'].course_name data['course_data']['course_name'] </code></pre> <p>Nothing worked. Any ideas</p>
php javascript jquery
[2, 3, 5]
5,508,756
5,508,757
Can I give a 'web address format' to my local host application
<p>I host a local application on my machine which i provide access on network by normally type "http://computername/app". Can I change it to a real web address format "www.myapplication.org" for my local hosting.</p> <p>I would appriciate for every of your suggestion.</p> <p>vic,</p>
c# asp.net
[0, 9]
2,435,847
2,435,848
Jquery - Pseudo-recursive function with "this" element
<p>I'm trying to apply a cool animation effect on a list with Jquery using a pseudo-recursive function.</p> <p>It works pretty well for the first item, but after the first loop, the <code>this</code> which was selecting <code>#column-left section</code> becomes the <code>li</code> so of course, the function does not find the next <code>li:hidden</code> because it is already inside. Is there a way for me to come back to my original <code>this</code> once the "this" has changed or maybe do something different ?</p> <pre><code>$("#column-left section").mouseenter(function fadeItem(){ console.log(this); $(this).find('ul li:hidden:first').delay(500).fadeIn(fadeItem); }); </code></pre> <p>Thank you very much for your help.</p>
javascript jquery
[3, 5]
3,382,410
3,382,411
How can I enable sychronization with Google Calendar?
<p>Is it possible to enable synchronization of internal device's calendar with Google Calendar(which is used by user in his work room on Google) programatically? I know that I can do it in settings, but I need to do it programatically. </p>
java android
[1, 4]
5,422,684
5,422,685
jQuery: using fadeIn() with .html()
<p>I have a piece of jQuery code that queries a page via POST and then that page returns some text that gets displayed on the page. This is the code I am using to successfully do this:</p> <pre><code>$.post( "query.php?module=vote", {answer: ans, pid: pid, to: to, page: page}, function(responseText){ $("#poll").html(responseText); }, "html" ); </code></pre> <p>I've tried changing <code>$("#poll").html(responseText)</code> to <code>$("#poll").html(responseText).fadeIn(1500);</code> but it does not work. </p> <p>What must I do/change to have the text fade into the page?</p>
javascript jquery
[3, 5]
1,987,180
1,987,181
How to check that panel is visible or not in JavaScript?
<p>How do I check that panel is visible or not in JavaScript?. I am using ASP.NET 2.0.</p>
javascript asp.net
[3, 9]
885,725
885,726
Interpolate or "tween" between two values (but not animating)
<p>I have a variable that is increasing let's say from 0 to 99.</p> <p>Then I have a div that I want to move at the same rate of the increasing variable but I only want to define the two ends of the movement (for example moving from top to down, I only define the topmost position and the downmost position). The rest should be interpolated automatically while the main variable is changing it's value from 0 to 99.</p> <p>All the search results I got were related to animating. But this is not exactly animating since the div should not move if the variable is not changing. How would you do this best in javascript?</p> <p>EDIT: Some mock up code (probably has syntax errors ):</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="increase"&gt;&lt;/div&gt; &lt;div id="move"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;script&gt; var counter =0; var topValue =50; var bottomValue =150; var interpolatedValue $('#increase').click(){ counter++; } $('#move').css(){ top: interpolatedValue; //this should be an interpolation between 50 and 150 based on the current counter value } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,480,615
3,480,616
how to keep track of accordion(in masterpage) open status after page navigation?
<p>i am using jquery accordion as a menu in asp.net Masterpage.</p> <p>This is jquery</p> <pre><code>$(document).ready(function() { $(".header").click(function() { $(this).toggleClass("display"); $(this).next("div .menu_body").slideToggle(500); }); }); </code></pre> <p>This is html.</p> <pre><code> &lt;div id="MasterPage_Menu" class="menu_list"&gt; &lt;p class="header"&gt;Header-1&lt;/p&gt; &lt;div class="menu_body"&gt; &lt;a href="page1.aspx"&gt;Link-1&lt;/a&gt; &lt;/div&gt; &lt;p class="header"&gt;Header-2&lt;/p&gt; &lt;div class="menu_body"&gt; &lt;a href="page2.aspx"&gt;Link-2&lt;/a&gt; &lt;/div&gt; &lt;p class="header"&gt;Header-3&lt;/p&gt; &lt;div class="menu_body"&gt; &lt;a href="page3.aspx"&gt;Link-3&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>According the code above, when the header is clicked, the content (menu_body) will be slided toggle. The menu_body is hide at default, when the user click on the header, the menu_body is visible. </p> <p><strong>Example Problem:</strong> eg: 2 menu_body is visible, when i click on href = "page1.aspx", the page will be navigated to page2.aspx but the accordion will return to be default which all the menu_body is hidden.</p> <p>Since I am using this accordion in master page, i fail to store the value to keep track of the accordion menu_body status into the hiddenfield when the page is navigated away. The value in hiddenfield will be reset. </p> <p>I am thinking to store this in session, but in client page, it doesn't allow us to store value into the session.</p> <p>Any solution for this?</p>
javascript jquery asp.net
[3, 5, 9]
5,934,016
5,934,017
how to move auto generated columns to left side?
<p>i have gridview and i am adding rows at runtime using datatable as datasource.but i want to add delete command field to grid view.I add it and run it.But i got delete button at left position.I want to change that delete button to last of gridview.Means after autogenerated columns.Please help me.Thanks in advance</p>
c# asp.net
[0, 9]
1,314,815
1,314,816
How to store class hierarchy so I can generate a tree most efficiently?
<pre><code>List&lt;myObject&gt; objects = new List&lt;myObject&gt; myObject { string a; string b; } </code></pre> <p><code>a</code> holds the name of the <code>objects[i]</code>, and <code>b</code> holds the name of the parent of <code>objects[i]</code>.</p> <p>How can I serialize this list to a file so I can later create a tree-like image?</p> <p>As an example, <code>objects</code> list has four elements:</p> <pre><code>{a=planet, b=solarsystem}, {a=moon, b=planet} {a=solarsystem, b=universe} {a=meteor, b=solarsystem} </code></pre> <p>I want to serialize this so I can later, using javascript, read the file and have enough information to generate this diagram:</p> <p><img src="http://i.stack.imgur.com/w7x9x.png" alt="tree"></p>
c# javascript
[0, 3]
4,190,715
4,190,716
How to remove class which are created dynamically using jQuery
<pre><code>$("#my").click(function() { $(this.title).remove(); }); </code></pre> <p>I have work with jQuery dynamically add and remove html content,but how to remove which create dynamically added. </p>
javascript jquery
[3, 5]
2,951,092
2,951,093
condition if two checkboxes are checked doesn't work in jquery
<p>I have two radio groups. I wish to put a condition where if pRange is checked (val=pRange) and periodType value is 'one', 'two' or 'three', it displays a div called message. but my js code below doesn't seem to work. Any help is much appreciated.</p> <pre><code>$("input[name$='periodType']").change(function() { var grpname = $(this).val(); var pname = $("input:radio[name='mainPeriod']:checked").val(); if (((grpname == "one") || (grpname == "two") || (grpname == "three")) &amp;&amp; (pname=="pRange")) { alert( pname + ' gname= ' + 'yes'); $('.message').show; } else { alert( pname + ' gname= ' + 'no'); } }); </code></pre> <p>GROUP 1</p> <pre><code>&lt;input type="radio" name="mainPeriod" id="pRange" val="pRange" /&gt; &lt;input type="radio" name="mainPeriod" id="pHour" val="pHour" /&gt; &lt;input type="radio" name="mainPeriod" id="pDay" val="pDay" /&gt; &lt;input type="radio" name="mainPeriod" id="pWeek" val="pWeek" /&gt; &lt;input type="radio" name="mainPeriod" id="pMonth" val="pMonth" /&gt; </code></pre> <p>GROUP 2</p> <pre><code>&lt;input type="radio" name="periodType" val="one" /&gt; &lt;input type="radio" name="periodType" val="two" /&gt; &lt;input type="radio" name="periodType" val="three" /&gt; &lt;input type="radio" name="periodType" val="four" /&gt; &lt;input type="radio" name="periodType" val="five" /&gt; &lt;div class="message" style="display:none;"&gt;Message&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]