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
348,025
348,026
Compare day and show hour only using DateTime formats
<p>I have a DateTime column in my SQL database, how do I check if the Day in that is Today, or yesterday?</p> <p>What I want to is something like: If date is today then the result would be "Today, at " same for yesterday..</p>
c# asp.net
[0, 9]
3,333,935
3,333,936
Call Public variable of C# in javascript?
<p><strong>My Problem is I am try to call Public variable in Code Behind From JavaScript function I try To Do This :</strong></p> <p><strong>In Code Behind Section:</strong></p> <pre><code> public string str ="TEST"; </code></pre> <p><strong>In JavaScript Section:</strong></p> <pre><code> &lt;script type="text/javascript" language="javascript"&gt; function funDoSomething() { var strMessage = '&lt;%= str%&gt;'; alert( strMessage ); } &lt;/script&gt; </code></pre> <p><strong>Any Suggestion?</strong></p>
c# javascript
[0, 3]
5,242,614
5,242,615
How to uniquely identify the jQuery function on checkBox change click?
<p>In my program i display one question at a time and on next click it is post and get the second question. But i apply some logic for check box list for each question in Jquery, and i call it like this</p> <pre><code> $(document).ready(function () { $("input:checkbox").change(function () { var txt = $(this).parent().children("label").text(); if ($(this).is(':checked')) { if ($(this).parent().children("label").text() == 'Not Sure') { $("input:checkbox").attr('checked', false); $("input:checkbox").attr('disabled', true); $(this).attr('checked', true); $(this).attr('disabled', false); } } else { if ($(this).parent().children("label").text() == 'Not Sure') { $("input:checkbox").attr('checked', true); $("input:checkbox").attr('disabled', false); $(this).attr('checked', false); } } }); $("input:checkbox").change(function () { var txt = $(this).parent().children("label").text(); if ($(this).is(':checked')) { if (txt == 'Not Sure' || txt == 'We Are Large Business' || txt == 'None of these apply') { $("input:checkbox").attr('checked', false); $("input:checkbox").attr('disabled', true); $(this).attr('checked', true); $(this).attr('disabled', false); } } else { if (txt == 'Not Sure' || txt == 'We Are Large Business' || txt == 'None of these apply') { $("input:checkbox").attr('checked', false); $("input:checkbox").attr('disabled', false); $(this).attr('checked', false); } } }); }); </code></pre> <p>So the problem is that, for 1 question the logic is different from the other check box list question and i need to call appropriate function as you above see in document.ready has got two function. So how for some particular question i should fix the call to function?</p>
javascript jquery asp.net
[3, 5, 9]
3,217,741
3,217,742
Is there a way to do a 'scoped' add() in jQuery?
<p>The main jQuery method takes a second optional argument to provide context for the search. eg </p> <pre><code>$(".setA", ancestorOfSetsA); </code></pre> <p>However, the jQuery <code>add()</code> method does not accept this context argument. What I am trying to accomplish is:</p> <pre><code>$(".setA", ancestorOfSetsA).add(".setB", ancestorOfSetsB); </code></pre> <p>I am attempting this through a plugin that will overload the <code>add()</code> method but I can't figure out how to combine two jQuery objects into one jQuery object.</p> <p>I would like to find a way to do a scoped <code>add()</code> with jQuery, but failing that, I'll write one myself if I can find a way to merge to jQuery objects.</p>
javascript jquery
[3, 5]
1,202,364
1,202,365
checking if gridview has a selected item
<p>I have a grideview and 2 buttons. I need to only show the buttons when the gridview has a selected item. My code looks like this: </p> <pre><code>protected void Page_Load(object sender, EventArgs e) { btactivate.Visible = false; btdeactivate.Visible = false; //Show Activate and Deactivate Buttons only if an item in the gridview is selected if (GridView1.SelectedIndex != -1) { btactivate.Visible = true; btdeactivate.Visible = true; } else { btactivate.Visible = false; btdeactivate.Visible = false; } } </code></pre> <p>But the problem I have now is that only when I select the second time a item in the gridview the buttons show up. I need to have the the buttons show when I select the first time. I have tried changing the selected index to "-0" but that shows the buttons all the time (even when I dont have something selected). Can anyone please help?</p>
c# asp.net
[0, 9]
549,961
549,962
loading image before switching div background in jquery
<p>I have a web page where I want to switch the background image of a div in response to user interaction. What I have so far is:</p> <pre><code>function updateImg() { imgurl=buildImgURL(); // constructs a URL based on various form values $('#mainImage').css("background-image", "url("+imgurl+")"); } </code></pre> <p>This works exactly like I want it to except for one thing. Due to a combination of relatively large background images and a relatively slow server (neither of which can easily be fixed) it takes a while for the image to load. So when the updateImg() function is called the div goes white for half a second or so before the new background image is loaded. What I want is for the old background image to remain until the new image is finished loading and then to switch instantly. Is this possible to do?</p> <p>The background image is generated on the fly by the server so any sort of client side caching or preloading isn't possible.</p>
javascript jquery
[3, 5]
5,295,230
5,295,231
Detect the browser closing event of Alt+F4 in asp.net
<p>How to detect the browser closing event in asp.net before page unload. I need to call the javascript function to clear the cookie expire time. In body onunload method I'm able to call the function but its calling even if I refresh the page. So, Could anyone can help me out. Thanks.</p>
javascript asp.net
[3, 9]
2,009,199
2,009,200
Hashtable overriding
<p>This is my first time using this website so I apologize if I am not using it correctly. Please do let me know.</p> <p>Anyway I have an Account object that takes in 2 strings... An acctName, and lastName (Code is below). </p> <p>I want to insert this object into a hash table with the key being the acctName and I would like to use polynomials for reducing collision. I have heard that I must override hashCode() and equal method. I believe I have overridden correctly but I am not sure it is correct because it seems to not be called. Can someone tell me if I am doing this right (Overriding in the right location and adding correctly) and explain to me how to print after an add?</p> <p>Thanks and looking forward to contributing to the community in the future!</p> <p><strong>Class---> Account</strong></p> <pre><code>public class Account { private String acctName; private String lastName; public Account(String acctName, String lastName) { this.acctName= acctName; this.lastName= lastName } @Override public int hashCode() { return acctName.hashCode() + lastName.hashCode(); } @Override public boolean equals (Object otherObject) { if (!(otherObject instanceof Account)) { return false; } if (otherObject == this) { return true; } Account accountHolder = (Account) otherObject; return acctName.equals(accountHolder.acctName) &amp;&amp; lastName.equals(accountHolder.lastName); } </code></pre> <p><strong>Class----> Driver</strong></p> <pre><code> public void insertInto() { Hashtable&lt;String,Account&gt; hash=new Hashtable&lt;String,HoldInformation&gt;(); Account account= new Account ("Deposit", "Jones"); Account account2= new Account ("Withdraw", "Smith"); hash.put ("deposit", account); hash.put ("Withdraw", account2); } </code></pre> <p><strong>EDIT WITH GETTER INSIDE Account Object</strong></p> <pre><code> public String testGetter() { return acctName.hashCode() + lastName.hashCode(); } </code></pre>
java android
[1, 4]
2,448,385
2,448,386
jQuery animate on blur - but only if blur outside of form
<p>I have a search input (<code>#search_input</code>) which expands when being focused. Additional search options pop up that allow me to select specific search options.</p> <p>The input should contract after it blurs, but only when the blur was triggered outside of the form.</p> <p><a href="http://jsfiddle.net/zMp9S/" rel="nofollow">http://jsfiddle.net/zMp9S/</a></p> <p>Right now I'm using the following which contracts the search input too early even when I'm just choosing a an option from the search option menu:</p> <pre><code>$(function() { $("#search_input").focus(function(){ $("#search_input").stop().animate({width: 310}, 200); $("#search_options").show(); }) $("#search_input").blur(function(){ $("#search_input").stop().animate({width: 100}, 200); $("#search_options").hide(); }) });​ </code></pre> <p>Putting focus / blur events on the form doesn't work.</p> <p><strong>How can I tell jQuery to only contract <code>#search_input</code> when the blur happens outside the form <code>#search_form</code> ?</strong></p>
javascript jquery
[3, 5]
2,004,267
2,004,268
jQuery select change event
<p>I am trying to fire an alert depending on which value is selected from a <code>&lt;select&gt;</code> element using jQuery:</p> <pre><code>$("#optiontype").change( function () { var option = $("#optiontype").val(); if(option.Contains("Forward")){ alert("forward selected"); } }); </code></pre> <p>The alert never fires whenever I choose 'forward' from the <code>&lt;select&gt;</code> element.</p>
javascript jquery
[3, 5]
1,969,560
1,969,561
Dynamically adding jQuery's slider
<p>I've got a simple upload form to allow for multiple uploads, and for each file selected it needs to create a new slider.</p> <p>I've got it creating a new slider, and they each have individual ID's. The only problem I am having is I want the slider to input it's value into a text box each time it slides or is changed. It works fine for a normal slider, not dynamically added, but the dynamically added sliders just don't update their individual text boxes.</p> <p>Here's the code that adds the sliders and text boxes:</p> <pre><code>var pagesslider = $('&lt;div id="pages'+(x + 1)+'" class="pages"&gt;&lt;/div&gt;&lt;input name="anewslider" id="pages-box'+(x + 1)+'" type="text" onchange="$(\'#pages'+(x + 1)+'\').slider({ value: this.value });updatevalues();updatepages(\''+x+'\');" value="1" /&gt;'); $('#pages-holder').append(pagesslider); addSlider('pages'+(x + 1)); </code></pre> <p>The addSlider function is as follows:</p> <pre><code>function addSlider(element) { var slider = $('.pages').slider({ range: "min", value: 1, min: 1, max: 1000, slide: function(event, ui) { slide(element, ui.value); }, change: function(event, ui) { slide(element, ui.value); } }); $(element).val(slider.slider('value')); } </code></pre> <p>And the slide function is just a simple value change for the text box.</p> <pre><code>$(element).attr('value', changevalue); </code></pre> <p>When you manually type a number in the text box, the slider's position updates - so that works as it should. But it doesn't work the other way around. I'm guessing it's because the slider didn't load when the page loaded, but I don't know a fix for it.</p>
javascript jquery
[3, 5]
2,465,264
2,465,265
Most efficient jquery show/hide Toggle
<p>Simple question:</p> <p>What is the most efficient way of showing/hiding 2 divs based on a select control using jquery?</p> <pre><code>&lt;div id="div1"&gt;DIV 1 BRO&lt;/div&gt; &lt;div id="div2" style="display:none;"&gt;THIS BE DIV 2 CUZ&lt;/div&gt; &lt;select id="blablabla"&gt; &lt;option value="div1"&gt;div1&lt;/option&gt; &lt;option value="div2"&gt;div2&lt;/option&gt; &lt;/select&gt; </code></pre>
javascript jquery
[3, 5]
33,376
33,377
Do HttpHeaders get encrypted when not using https
<p>There is plenty of discussion for this regarding https. But do the headers get encrypted when not using https (so plain http)?</p> <p>Thanks</p>
c# asp.net
[0, 9]
1,064,173
1,064,174
Create drop down control containing page's named anchors
<p>I have a dynamically created page (read from database values) with grouped information. I wanted to add <strong>named anchors</strong> as each group is created. (Regular anchors will appear on the page also.)</p> <p>I was hoping to find a jQuery plug or codeset example that could automatically generate and populate a drop down control for the page that provides the navigation to the named anchors.</p> <p>Thanks for any pointers or examples. </p>
javascript asp.net
[3, 9]
1,706,499
1,706,500
checking session with jquery from php script then saving the item clicked to mysql database and updating the label which has been clicked
<p>hi I am trying to saving to save item into my sql database I have 3 functions </p> <pre><code>/* the function below checks if a session is pressent using jquery ajax call to php script */ function checkSess(){ $.ajax({ url: "check_s.php", cache: false, success: function(data){ processDetails1(data) } }); } &lt;?php session_start(); if(isset($_SESSION['flipmode'])) { echo "u"; } else { echo "n"; } ?&gt; /* the function below checks if value from checkSess() is true or false */ function processDetails1(info){ if(info==='u'){ return true; } else{ return false; } } /* the function below checks if value from checks all data then saves to database and changes label if the result from processDetails1 and if true is returned then changes label details and if it returns false should open dialog*/ $('.savepropertycon').live('click', function() { var chekH = checkSess(); if(chekH===true){ $.get("saveprop.php", { pid: saveId }, function(data){ $('#dialog-message').dialog('open'); $('#pro').html(data); return false; }); var saveCurrentId = $(this).attr('id'); jQuery("label", this).html('saved'); $(this).removeClass(); $(this).removeAttr('href'); $(this).addClass("savedone"); jQuery("img", this).remove(); } else { $('.dialogsign').dialog('open'); } return false; }); </code></pre> <p>The problem I have is the above keeps and returning false I have tried to debug with firebug and var chekH is coming back as undifined. Please could somebody help thank you.</p>
php jquery
[2, 5]
1,865,417
1,865,418
Find a image in code behind
<p>I would like to use the find control method to find a image on the designer and make it visible, but i keep getting a null</p> <p>This is my Code:</p> <pre><code>foreach (ImageShow image in imageList) { Image Showimage = (Image)FindControl(image.imageName); Showimage.Visible = true; } </code></pre> <p>Any help would be much appreciated, Thanks in advance </p>
c# asp.net
[0, 9]
949,655
949,656
populate another drop down on selection of first
<p>I am going to populate a another drop down on selection of first drop down. Implementing this with intermediate php file. I am showing second drop down on basis of Jquery.</p> <p>Jquery code.</p> <pre><code>$("&lt;select/&gt;", { class: "selectdoctor", name: "selectdoctor" + i, id: "selectdoctor" + i }).appendTo("#prescriptiondiv").after("&lt;br/&gt;"); </code></pre> <p>This dropdown will be shown number of times using for loop. So I can populate value in this on basis of class only. Second jquery that will send value to phpfile and fetch result using ajax has code.</p> <pre><code>$.post("getdoctorlist.php", { childid: childid }, function(data) { //alert(data); $('.selectdoctor').html(data); }); </code></pre> <p>My phpcode for <code>getdoctor.php</code> list has code,</p> <pre><code>if(mysql_num_rows($query)!=0); { while($result=mysql_fetch_assoc($query)) { echo '&lt;option value="'.$result["pcpkey"].' "&gt;'.$result["pcpfname"].'&lt;/option&gt;'; } } </code></pre> <p><strong>How can I fetch this response(data) in <code>drop down with classname='selectdoctor'</code> ?</strong></p>
php jquery
[2, 5]
3,595,455
3,595,456
First a tag created in a Javascript loop not implemented
<p>I am trying to populate a div (class='thumb") with thumnailpictures. The name of the pictures is gathered from an xml file. Every thumnail picture is encapsulated with an a-tag that points to a function to show the full picture.</p> <p>On some browsers the first thumbnailpicture seems not to have this a-tag...clicking on it gives no action...</p> <pre><code>var rubriek = gup('rubriek'), // rubriek is a parameter in the url of this page pointing a specific photogallery gallerij = rubriek + "gallery.xml", xmlDoc = loadXMLDoc(gallerij), x = xmlDoc.getElementsByTagName("filename"), legebron = x[0].childNodes[0].nodeValue; for (i = 0; i &lt; x.length; i++) { var beeldnummer = x[i].childNodes[0].nodeValue, index = i + 1, kleinbeeld = "/" + rubriek + "images/thumb/" + beeldnummer; $('.thumb').append('&lt;p&gt;&lt;a class="kleintje" onclick="toonDezeFoto(&amp;quot;' + beeldnummer + '&amp;quot;,' + index + ',' + x.length + ');"&gt; &lt;img src="' + kleinbeeld + '" id="' + index + '"&gt; &lt;/a&gt;&lt;/p&gt;'); } </code></pre> <p>See <a href="http://www.karinedaelman.be/foto.php?rubriek=Mensen/" rel="nofollow">http://www.karinedaelman.be/foto.php?rubriek=Mensen/</a> </p> <p>Found the solution: the z-index of the div that keeps the thumbnails was too low. Another div that has the site logo in it had a higher z-index and a width of 100%. Because of that the first thumbnail image was on a layer below the site logo and could not be accessed by the mouseevents....</p>
javascript jquery
[3, 5]
2,122,797
2,122,798
FileUpload Getting error for large file
<p>i save the <code>file upload object</code> in the <code>session</code>, and then use this <code>session</code> in the <code>iframe</code>, it works fine for VS web server for all file small or large </p> <p>Issue :( => but on <code>IIS</code> it work fine for small size file, but gives error for larges files. </p> <p>I THINK the reason is the file upload object dispose before completing the request so file steam in session not able to read the file.</p> <p>can anyone tell me why it is not works for larges files and how can i get FileUpload object in other page</p>
c# asp.net
[0, 9]
5,064,594
5,064,595
jQuery 'on' event, check if NOT ON
<p>I have a running event checking if I am hovering a link after something that been <code>POSTED</code>, using the on event.</p> <pre><code>$(document).on("mouseenter","#hover",function() { load(); $("#sidebar").fadeToggle("slow"); $("#sidebar").html(''); $.post("ajax_search.php?type=sidebar", { sidebar : $("#search").val() }, function(get_data) { stop_load(); $("#sidebar").html(get_data); }); }); </code></pre> <p><strong>Question</strong></p> <p>How do I make it so when you stop hovering <code>#hover</code>, <code>#sidebar</code> will hide? I am posting the <code>#hover</code>, that's why I use the <code>ON</code> event.</p> <p>Is there an even like <code>notOn</code>?</p> <p>Thanks!</p>
php jquery
[2, 5]
2,849,718
2,849,719
Javascript execute timer function only if window is in focus?
<p>Say I have two separate browser windows open:</p> <pre><code>function onload() { setTimeout("dosomething", 2000); } function dosomething() { $.ajax({ url: "someurl", success: function (data) { document.write("Hello"); } }); setTimeout("dosomething", 2000); } </code></pre> <p>I want to make it so that hello is printed every two seconds only when the window is in focus. If the window is not in focus, then the timer would essentially pause (in other words, timer would stop ticking, dosomething would not be called) until the user clicks on the browser window that is not in focus, which the timer would resume and the Hello words would continue to be printed, while the other window would stop timer, vice versa.</p> <p>How do I accomplish this?</p>
javascript jquery
[3, 5]
2,619,720
2,619,721
Fastest way to pick up Java for Android App
<p>Please don't downvote this question, I know it's not 100% in line probably with the standard set of questions...but I am really screwed at the moment. My professor decided to go against what the class said (saying we don't know how to develop in java or mobile apps) and gave us an Android Project due in 3 weeks from Friday. Half of the class has no idea what to do. We all know C/C++ but not Java.</p> <p>I know the languages are very similar in some aspects, but different in others. Also 0 idea how to program on Android, going to have to wing this project. Is there a really good set of tutorials that I can use to learn how to do all this in a week so I can spend the other 2 weeks actually completing the assignment? </p> <p>I really appreciate any points in the right direction that I can get.</p> <p>Thanks</p>
java android
[1, 4]
1,850,043
1,850,044
adding an "active" class to parent and child element
<p>Need to add an active class to both parent and child element if a user clicks on the child element in a list. My html is as follows:-</p> <pre><code>&lt;ul class="tabs"&gt; &lt;li class="accordion"&gt;&lt;a href="#tab1"&gt;Bar&lt;/a&gt; &lt;ul class="sub"&gt; &lt;li&gt;lorem/li&gt; &lt;li&gt;ipsum&lt;/li&gt; &lt;li&gt;Lorem Ipsum&lt;/li&gt; &lt;li&gt;Dolor Sit Amet&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre> <p>and I'm using the jquery code below to add an active class to both the parent and child element yet I'm having errors:-</p> <pre><code>$("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active").find(".sub li").removeClass("active"); $(this).addClass("active").find(".sub li").addClass("active"); }); </code></pre> <p>Then styled my active class in CSS. say example</p> <pre><code>.active {background:#EFEFEF;} </code></pre> <p>only the clicked (this) child element should have the active class applied to it and not the whole li child elements. Now together with the child li (say lorem) the parent li (bar) should also be highlighted. Think of it like a tree accordion menu where both the selected child element and it's parent li have the active class with different css styling.</p>
javascript jquery
[3, 5]
1,098,696
1,098,697
Determine response from PHP in jQuery
<p>All, I've got a function that basically gets triggered when an Upload finishes. I have the following code in that function:</p> <pre><code>onFinish: function (e, data) { console.log(data.result); }, </code></pre> <p>When I do this I get the following response in my console:</p> <pre><code>[{ "name": "1_3266_671641333369_14800358_42187036_5237378_n.jpg", "size": 35535, "type": "image\/jpeg", "url": "\/web\/upload\/1_3266_671641333369_14800358_42187036_5237378_n.jpg", "thumbnail_url": "\/web\/upload\/thumbnails\/1_3266_671641333369_14800358_42187036_5237378_n.jpg", "delete_url": "\/web\/upload.php?file=1_3266_671641333369_14800358_42187036_5237378_n.jpg", "delete_type": "DELETE", "upload_type": "video_montage" }] </code></pre> <p>I'd like to get the value that is in the <code>upload_type</code> and do some actions based on that but I'm not sure how to get this from my function. Any help would be appreciated to get this information.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
336,411
336,412
Referencing variables from C# in ASP.NET
<p>I am trying to use QueryStrings from my C# file in my ASPX file:</p> <pre><code>&lt;asp:Button ID="LinkButtonDetails" runat="server" Text="DETAILS" PostBackUrl='&lt;%# string.Format("~/projectdetails.aspx?guid=&lt;%= id%&gt; &amp;name=&lt;%= name%&gt; &amp;role=&lt;%= company_role%&gt; &amp;member=&lt;%= mem_id%&gt; &amp;company={0} &amp;project={1}&amp;id={2}", Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %&gt;' /&gt; </code></pre> <p>The values are not appended to the url, what am I doing wrong? Thanks for your help!</p>
c# asp.net
[0, 9]
4,245,602
4,245,603
How many line of code are in a program? (I know this is kind of vauge and depends but...)
<p>It seems when I try to research all I can find are how many lines are in Linux, call of duty, windows and other things that are massive applications with millions of lines of code.</p> <p>Does anyone have examples of code size of applications that don't take teams and teams of people?</p> <p>P.S.</p> <p>I'm 24 yrs old and just starting to learn I feel like I got a really late start but I'm tired of sales and love technology so I'm just looking for something to gauge by.</p> <p>Thanks in advance!</p>
java php javascript c++ python
[1, 2, 3, 6, 7]
319,436
319,437
Go back to to previous page ASP.NET
<p>Im having an issue of going back to the previous page. The page i want to go back to had a few radio buttons which you had to select, after this you went to the next page which is the current page which then you can select certain things BUT I want to be able to go back to the previous page and the original selections for that page still be selected.</p> <p>Anyway i could do this if so how?????</p>
c# asp.net
[0, 9]
2,163,103
2,163,104
How do I reset an asp.net website within the site itself with a button?
<p>I am working on an ASP.NET 2.0 website. The issue that I'm having is that it queries a database to get the info it displays on screen, but the database occasionally gets to where it has too many open connections. This causes the website to reject the attempt to log-in for anyone, after that database error.</p> <p>This is caused because many users will log-in, do what they need to do, but then leave the website running while they do other things without logging out. It will time out on them, but the connection still seems to be open. We then have to contact the person in charge of the server it's running on and have him reset it for us.</p> <p>I have looked and all connections made to the database seem to be closed after the request and query is made. So, what I want to do is to add a button that when clicked will reset the website, instead of having to call the guy in charge of the server every time. Then we can reset it whenever we need to. So, how do I reset an ASP.NET 2.0 website with a button on one of the pages inside the site?</p> <p>Many thanks,</p> <p>Mike</p>
c# asp.net
[0, 9]
824,994
824,995
JQuery Self in Data
<p>I am having trouble with the following code:</p> <pre><code>function Class() { var self = this; var $div = $('&lt;div/&gt;'); $div.data('obj',self); this.get = function() { return $div; } } var x = new Class(); var $y = x.get(); </code></pre> <p><a href="http://jsfiddle.net/t8ZTW/2/" rel="nofollow">http://jsfiddle.net/t8ZTW/2/</a></p> <p>The problem is that I store the object "self" data using jQuery's .data() function, but I cannot seem to access it later. What is going wrong?</p> <p>EDIT:</p> <p>The following is the code I should actually be asking about:</p> <pre><code>function Class() { var self = this; var $div = $('&lt;div/&gt;'); $div.data('obj',self); var sample = "S"; this.get = function() { return $div; } } var x = new Class(); var $y = x.get(); alert($y.data('obj').sample); // &lt;-- This returns 'undefined' </code></pre>
javascript jquery
[3, 5]
1,373,217
1,373,218
How listeners work
<p>Can someone please tell me how the listener interface works, when you set a onclicklistener, what really happens in the background?</p>
java android
[1, 4]
538,279
538,280
Leverage .Net to deal with 133 textBoxes?
<p>I have a 19 X 7 table with a textBox in each cell. Some textBoxes need to be read only, depending on the data that is loaded into them. On saving I have to examine each textbox and see if the value needs to be saved. Having to list 133 textboxes by hand takes a long while. I would be ecstatic to get it down to a row level, so I would only need to deal with 7 textBoxes and let .Net duplicate my effort 19 times. </p> <p>Is there better way to leverage .Net? </p> <p>The repeater looks promising, but I don't know how to reference a control that has been repeated, more over a group of controls.</p>
c# asp.net
[0, 9]
2,823,196
2,823,197
how to validate Request.QueryString.Keys.Count null value in conditon?
<p>I have included this <code>if (Request.QueryString.Keys.Count == 0)</code> condition in the page load event. In some scenarios it throws <code>Index was outside the bounds of the array</code> exeception. How to handle this exception?</p>
c# asp.net
[0, 9]
509,846
509,847
Jquery: everything works, but my function wont fire
<p>Everything works just fine, but when I remove</p> <pre><code>{queue:false, duration: 800, easing: 'easeInOutQuart'} </code></pre> <p>from </p> <pre><code>$(".chapters_list").slideDown( </code></pre> <p>with a 500, it stops working. So if I don't want easing in my script, it will work fine, when I insert easing into the top function, like is shown below, it stops working. Why wont it allow me to have easing?</p> <pre><code>$('.article_book_title').click(function () { if ($(".chapters_list").is(":hidden")) { $(".chapters_list").slideDown({queue:false, duration: 800, easing: 'easeInOutQuart'}, function () { doSlide($('UL.chapters_list li:first')) }); } else { $(".chapters_list").slideUp({queue:false, duration: 800, easing: 'easeInOutQuart'}); } }); function doSlide(current) { $(current).animate({ backgroundColor:'#d6f4aa', color:'#eee' },40, function() { $(this).animate({backgroundColor:'#252525', color:'#fff'}, 500) doSlide($(current).next('li')); }); } </code></pre>
javascript jquery
[3, 5]
4,336,170
4,336,171
asp:Image bug onload in IE
<p>I have a tag in mypage.aspx:</p> <pre><code> &lt;asp:Image ID="imgDedoPid" runat="server" Height="100%" data-big="" ImageAlign="AbsBottom" /&gt; </code></pre> <p>and on mypage.aspx.cs i have this call:</p> <pre><code> Image imgDedoPid.ImageUrl = "Handler1.ashx?file=" + pathImgLoad imgDedoPid.Attributes["data-big"] = imgDedoPid.ImageUrl; imgDedoPid.Attributes.Add("onload", "lupa();"); </code></pre> <p>and the js page is this: </p> <pre><code>&lt;script type="text/javascript"&gt; function lupa() { $("#imgDedoPid").mlens( { imgSrc: $("#imgDedoPid").attr("data-big"), // path of the hi-res version of the image lensShape: "circle", // shape of the lens (circle or square) lensSize: 180, // size of the lens (in px) borderSize: 4, // size of the lens border (in px) borderColor: "#fff", // color of the lens border (#hex) borderRadius: 0 // border radius (optional, only if the shape is square) }); &lt;/script&gt; </code></pre> <p>this code works perfectly in google chrome, but does not work in IE9 (The image is already loaded in automatically zoom, but I want this effect: <a href="http://mlens.musings.it/" rel="nofollow">http://mlens.musings.it/</a>)</p> <p>Can anyone help me?</p> <p>Thank you!</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
2,775,229
2,775,230
.submit() without reloading page
<p>I am trying do some file upload using jquery. The upload box have to be in the dialog box. Now I just want to know after I click on the dialog's upload button. How can I submit yet the page do not load. I tried using this $('#uploadForm').submit().preventDefault(); It has not action at all.</p> <p><strong>html</strong></p> <pre><code>&lt;script&gt; $( "#dialog-upload" ).dialog({ autoOpen: false, height: 200, width: 350, modal: true, buttons: { "Upload": function() { var bValid = true; bValid = bValid &amp;&amp; checkCSV() if(bValid){ **$('#uploadForm').submit().preventDefault();** } $( "#dialog-upload" ).dialog( "close" ); }, Cancel: function() { allFields.val( "" ).removeClass( "ui-state-error" ); $( this ).dialog( "close" ); } }, close: function() { allFields.val( "" ).removeClass( "ui-state-error" ); $( this ).dialog( "close" ); } }); &lt;/script&gt; &lt;div id="dialog-upload" title="Upload csv file"&gt; &lt;form&gt; &lt;fieldset&gt; &lt;form action='ajax.php' id = 'uploadForm' method='post' enctype='multipart/form-data'&gt; &lt;input type="text" name="file" id="fileUpload" size = 30 class="text ui-corner-all" /&gt; &lt;/form&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p><strong>php</strong></p> <pre><code>if (isset($_FILES['file'])) { echo "success"; } </code></pre>
php jquery
[2, 5]
1,463,856
1,463,857
Uncaught TypeError: Object #<Object> has no method 'newsticker'
<p><br/> I've done a search, and I've found a few results, but none that seem to work - hoping someone can help me or point me in the right direction.<br/><br/> I have a web page with jQuery loaded and a 3rd party script, News Ticker. I have an existing site with this working fine with no problems, however, when I copy the code to another side, I keep getting:<br/> <code>Uncaught TypeError: Object #&lt;Object&gt; has no method 'newsticker'</code><br/><br/></p> <p>The code causing this error is the following:</p> <pre><code>$(document).ready(function() { $("#guestbook").newsticker(); }); </code></pre> <p>The News Ticker script details can be seen at their site - <a href="http://www.texotela.co.uk/code/jquery/newsticker/" rel="nofollow">http://www.texotela.co.uk/code/jquery/newsticker/</a>.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
5,968,318
5,968,319
What is equivalent of DateTime.ToOADate() in javascript?
<p>How can I get the OADate (OLE Automation date) in javascript? I need to pass my date object (to my web service) in the form of a double value.</p> <p>in c#:</p> <pre><code>var d = DateTime.Now.ToOADate(); </code></pre> <p>what is the equivalent in js?</p>
c# javascript
[0, 3]
5,482,720
5,482,721
Slide Effect happening too many times
<p>I call this functions on onmouseover and onmouseout for several divs. </p> <pre><code>//Takes effect on divs with id, 62,63,64,65... function slide_it(id){ $('#options_'+id).slideToggle('slow'); } </code></pre> <p>The problem is that if I move my mouse over and then mouse out, then again, mouse over and then mouse out. If I do this several times, the slide effect happens the same number of times I moved my mouse over and out of the div, as expected.</p> <p>But I can't figure out how I can do this <strong>once</strong>? I can set a variable, but I have several divs that this function is used by and I can't think of a simple way of doing this rather than storing things into an array, but this is messy!</p> <p>I really appreciate any help on this that is simple to implement!</p> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
5,054,357
5,054,358
Conditional statement not responding to results
<p>On my page there may be any number of UL's populated, with a maximum of 3 LI's in each. I have set this conditional statement up to handle the left margin, depending on how many LI's there may be. It logs the correct result, but it always applies the css as if the result was 1, even if the result is 2 or 3... I'm quite new to this so maybe I'm missing something obvious to a more experienced person. Each LI has a width and height of 40px and a background image. Text is indented so it doesn't show.</p> <pre><code>$("ul.links").each(function(){ var num = $(this).children().length; if (num == 1) { $('ul.links li:first-child').css('margin-left','125px'); } else if (num == 2) { $('ul.links li:first-child').css('margin-left','96px'); } else { $('ul.links li:first-child').css('margin-left','71px'); } //console.log(num); }); &lt;ul class="links"&gt; &lt;li&gt;&lt;a href="#"&gt;First&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Second&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Third&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
1,034,691
1,034,692
Adding controls to a table control dynamically
<p>I have one table control "table1"</p> <p>And added controls to it in click event of one button as :</p> <pre><code>protected void Button2_Click(object sender, EventArgs e) { TableRow row; TableCell cell; for (int i = 0; i &lt; 3; ++i) { TextBox txt = new TextBox(); txt.Text = i.ToString(); row = new TableRow(); cell = new TableCell(); cell.Controls.Add(txt); row.Controls.Add(cell); Table1.Controls.Add(row); } } </code></pre> <p>but i cant retrieve this controls in click event of another button. i think it is because of postback.</p> <p>How can i prevent it?</p>
c# asp.net
[0, 9]
916,462
916,463
Confirmation box with yes and No option, on drop down list's selected index change
<p>I am using Following code to show a confirmation box.</p> <pre><code>protected void cmbPayerBucketMain_SelectedIndexChanged(object sender, EventArgs e) { ClientScriptManager CSM = Page.ClientScript; if (!String.IsNullOrEmpty(hiddenF1.Value) || !String.IsNullOrEmpty(hiddenF2.Value)) { CSM.RegisterClientScriptBlock(this.GetType(), "Confirm", "show();", true); } //Some Code } </code></pre> <p>And function show() as follows</p> <pre><code>function show() ( if(confirm('Chnages you made will be lost. Do you want to continue?')) { return true; } else { return false; } return ) </code></pre> <p>But irrespective of what option i have selected from confirmation box, it is executing the whole code. And after executing the whole event code it pops up msg box. How can I restrict the combo box for waiting for the response of confirmation box and execute the event code only when user select 'ok' (or 'yes' also suggest me the way to change the text of buttons in confirmation box. I want to make this OK to YES and CANCEL to NO).</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
2,994,751
2,994,752
Created a carousel but can't solve the idea of fading each div the comes in next and fade out the last
<p><a href="http://jsfiddle.net/rgbjoy/q9VGh/" rel="nofollow">http://jsfiddle.net/rgbjoy/q9VGh/</a> - As you can see, after viewing (1), when you hit next, (2) opacity will fade in, while 1 will fade back to .25. Not sure how to go about this.</p> <p>edit: Updated fiddle to working copy.</p> <p>jQuery</p> <pre><code>$('.project').each(function() { var count = 1; var itemWidth = $(this).find('.detail li:first').outerWidth() + 10; var total = $(this).find('.detail li').length; $(this).find('.detail li:first').fadeTo(400,1); $('.next').click(function() { var leftIndent = parseInt($(this).siblings('.detail').css('left'), 10) - itemWidth; if (count &lt; total) { count += 1; $(this).siblings('.detail').animate({ 'left': leftIndent }, 400); } }); $('.prev').click(function() { var leftIndent = parseInt($(this).siblings('.detail').css('left'), 10) + itemWidth; if (count &gt; 1) { count -= 1; $(this).siblings('.detail').animate({ 'left': leftIndent }, 400); } }); }); </code></pre> <p>HTML</p> <pre><code>&lt;div class="project"&gt; &lt;div class="prev"&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="next"&gt;&amp;nbsp;&lt;/div&gt; &lt;ul class="detail"&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;li&gt;3&lt;/li&gt; &lt;li&gt;4&lt;/li&gt; &lt;li&gt;5&lt;/li&gt; &lt;li&gt;6&lt;/li&gt; &lt;/ul&gt; </code></pre> <p></p>
javascript jquery
[3, 5]
4,604,325
4,604,326
is it possible to open a popup when a checkbox is checked using jquery?if yes how?
<p>In my application i have popup box whichis initially hidden and there is a checkbox.so when a user checks the checkbox a popupup should open .please help...</p>
javascript jquery
[3, 5]
5,503,582
5,503,583
php $_POST array: what in java?
<p>I'm "translating" a PHP class in Java.</p> <p>I've a function that takes a key and checks if it's in the $_POST array.</p> <p>How could I do a similar thing from a class Java method?</p>
java php
[1, 2]
950,683
950,684
displaying array elements
<p>I am creating a JavaScript array is the following manner:</p> <pre><code>var selectedColors= { 'Orange' : $("#Orange").val(), 'Light Blue' : $("#LightBlue").val(), 'Dark Red' : $("#DarkRed").val(), 'Dark Blue' : $("#DarkBlue").val()}; </code></pre> <p>Then loop through each item to see which color was not selected, and then store them in another array:</p> <pre><code>var colorsNotSelected = []; $.each(selectedColors, function (key, value) { if (value.length == 0) colorsNotSelected.push({key:key}); }); </code></pre> <p>Here I want to display the colors not selected, but doing it the following way display the keys: 0,1,2,3 instead of Orange, Light Blue, Dark Red, Dark Blue.</p> <p>What am I doing wrong here?</p> <pre><code>if (colorsNotSelected.length &gt; 0) $.each(colorsNotSelected, function (key) { alert(key) }); return false; </code></pre> <p>Any help is much appreciated.</p>
javascript jquery
[3, 5]
2,573,332
2,573,333
Javascript/Jquery how to get Key from Key/Value
<p>I have a field called City that is a drop down. It has a key value pair.</p> <p>To get the value, I can simply do the following in Jquery:</p> <pre><code> var city = $("#city").val(); </code></pre> <p>How do I get the key value though? </p>
javascript jquery
[3, 5]
4,024,572
4,024,573
Loading List Items with JQuery dynamically
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4932506/load-list-items-dynamically-with-jquery">Load List Items dynamically with JQuery</a> </p> </blockquote> <p>I have the following JQuery used to load list items:</p> <pre><code>$('li').css('display', 'none').first().fadeIn(1900).next().delay(500).fadeIn(1900).next().delay(700).fadeIn(1900).next().delay(900).fadeIn(1900); </code></pre> <p>I would like to load each list item 1 at a time with a delay like the above would like to do it in a cleaner way, so that I won't have to edit the JQuery to add more items to the list.</p> <p>Example: Here's the <a href="http://satbulsara.com/tests/" rel="nofollow">JQuery in action</a>.</p>
javascript jquery
[3, 5]
5,286,083
5,286,084
Is there a js function that scrolls a site left right up and down?
<p>I was wondering if anyone knows if there was a javascript or something that scrolls a site left right up and down on a click.</p> <p>For example I want to create a site with multiple divs. Look at photo below.</p> <p><img src="http://i.stack.imgur.com/ygCBW.jpg" alt="enter image description here"></p> <p>I want each div to fit to screen and div 1 being the main div, the starting point. Say that I had a link in the menu for biography and the content for biography was in div 4 and someone click biography, I want the site to move down to div 3 and then right to div 4 and the same thing goes for div 4 and all the divs. When someone clicks a link in the divs I want the site to scroll in a direction I specify, is this possible.</p> <p>Left Right Up Down</p>
javascript jquery
[3, 5]
3,354,063
3,354,064
How do I load results using php and jquery as I scroll?
<p>How do I load results using php and jquery as I scroll? E.g. like twitter, facebook and Especially <a href="http://cssline.com/" rel="nofollow">http://cssline.com/</a></p>
php jquery
[2, 5]
1,284,954
1,284,955
How to write the condition to check the validation using jquery or javascript
<p>hello friends, </p> <pre><code> $('input[name=checkedRecordsCat]').attr('checked', true); $('input[name=checkedRecordsSubCat]').attr('checked', true); $('input[name=checkedRecordsAtta]').attr('checked', true); $('input[name=checkedRecordsTextComp]').attr('checked', true); $('input[name=checkedRecordsVariableText]').attr('checked', true); $('input[name=checkedRecordsFreeFormText]').attr('checked', true); </code></pre> <p>I have this in my page. i need to check if non of them are checked I need to show a popup message. atleast one check box checked I need do return true.</p> <p>how to write this condition using jquery or javascript</p> <p>thanks</p>
javascript jquery
[3, 5]
3,094,608
3,094,609
How to show/hide divs based on selection using jQuery?
<p>Using jQuery, I'd like to display a different set of text based on a user's selection. As I'm new to jQuery, I wanted to see if there is a cleaner way to write this out? My current code is functioning fine, but would love any input on other functions that could accomplish this more quickly before I move further. Thanks!</p> <p>HTML:</p> <pre><code>&lt;div&gt; &lt;label&gt;Select:&lt;/label&gt; &lt;select class="toggle_div" /&gt; &lt;option value=""&gt;Select&lt;/option&gt; &lt;option value="a"&gt;A&lt;/option&gt; &lt;option value="b"&gt;B&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div id="group_a"&gt; Text A &lt;/div&gt; &lt;div id="group_b"&gt; Text B &lt;/div&gt; </code></pre> <p>jQuery:</p> <pre><code>$(document).ready(function() { $('#group_a').hide(); $('#group_b').hide(); $('.toggle_div').on('change',function(){ if($(this).val() == "a"){ $('#group_a').show(); $('#group_b').hide(); } if($(this).val() == "b"){ $('#group_a').hide; $('#group_b').show(); } if($(this).val() == ""){ $('#group_a').hide(); $('#group_b').hide(); } }) }); </code></pre>
javascript jquery
[3, 5]
2,925,346
2,925,347
Javascript CRM Conversion Error
<p>I am working in a Corporate Real Estate CRM. Javascript is allowed but not supported. When I insert this:</p> <pre><code>&lt;script&gt; function tick(){ $('#ticker li:first').slideUp( function () { $(this).appendTo($('#ticker')).slideDown(); }); } setInterval(function(){ tick () }, 5000); </code></pre> <p></p> <p>The code is converted to this:</p> <pre><code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[ function tick(){ $('#ticker li:first').slideUp( function () { $(this).appendTo($('#ticker')).slideDown(); }); } setInterval(function(){ tick () }, 5000); // ]]&gt;&lt;/script&gt; </code></pre> <p>How do I fix this problem? Thanks in advance for helping a "newbie"!</p> <p>Alex T.</p>
javascript jquery
[3, 5]
1,492,516
1,492,517
how to get the querystring from a parent page?
<p>i am using an iframe ipage in my parentpage. I would like to get the querystring in javascript of the parentpage?</p>
javascript asp.net
[3, 9]
1,806,162
1,806,163
file contents are getting erased in /data/data/package/files folder in android java
<p>From my apk i am writting some contents to /data/data/package/files/settings.data files, when i reboot the system file is still exists but contents in the file are empty.</p> <p>Can somebody help me .</p>
java android
[1, 4]
3,621,182
3,621,183
Richtextbox in web application and highlighting the text
<p>I am a beginner to web application development. I am loading some text to the text box and checking for certain errors like if occurring of space before <code>.</code>(dot/full-stop). <br>I want to display the line no, column no and cursor position of the errors. Which control is suited for this. How to find the line no,column no and cursor position and how to highlight the error text in the text box.? <br>I have heard that through <code>RichTextBox</code> it is possible, but richtextbox control is not there in web application toolbox controls list.</p>
c# javascript asp.net
[0, 3, 9]
3,489,477
3,489,478
How to get the dynamically created text box value in jsp using jquery javascript
<p>I am using code in Javascript like below:</p> <pre><code>newTextBoxDiv.html('&lt;td border="2"&gt;'+number+'&lt;/td&gt;' +'&lt;td&gt;'+grouptext+'&lt;/td&gt;' +'&lt;td style="display:none"&gt;'+groupVal+'&lt;/td&gt;'+'&lt;td&gt;'+itemText+'&lt;/td&gt;' +'&lt;td style="display:none"&gt;'+itemId+'&lt;/td&gt;'+'&lt;td&gt;' +cuttingText+'&lt;/td&gt;'+'&lt;td style="display:none"&gt;' +cuttingId+'&lt;/td&gt;'+'&lt;td&gt;&lt;input type="text" class="ui-state-default ui-corner-all" size="6" name="textbox' + counter +'" id="textbox' + counter + '" value="" size="13" &gt;&lt;/td&gt;' +'&lt;td&gt;&lt;input type="checkbox" name="samples"/&gt;&lt;/td&gt;' +'&lt;td&gt;&lt;input type="text" class="ui-state-default ui-corner-all" size="8" name="textbox' + counter +'" id="textbox1' + counter + '" value="" size="13" &gt;'); newTextBoxDiv.appendTo("#example"); </code></pre> <p>My problem is that when I click on each row I need to get a text box value.</p>
javascript jquery
[3, 5]
4,253,528
4,253,529
Why when I change the src of an image with jquery, the the src is not changed in my c# codebehind?
<p>I have a gallery of thumbnails. When you click on a thumbnail, the main image changes to the thumbnail clicked by using jQuery and changing the 'src' tag of the . This works as expected. </p> <pre><code>$('#ContentPlaceHolder1_photoSpotImage').attr('src', src.replace(/-thumbs/, '')); </code></pre> <p>I have a link that, when clicked, makes the image a downloadable file using the Content-Disposition methods in the header. When hard-set in the code it works as expected. </p> <pre><code>&lt;asp:LinkButton runat="server" PostBackUrl="" ID="link2TheDownload" Text="+ download it" onclick="link2TheDownload_Click"&gt;&lt;/asp:LinkButton&gt; </code></pre> <p>Now, I have added programmatically in the codebehind get the filename of the selected image from the 'src' tag of the tag. </p> <pre><code> string thisServerName = Request.ServerVariables["SERVER_NAME"].ToString(); string thisHref = "http://" + thisServerName + "/" +photoSpotImage.Src.ToString(); Uri uri = new Uri(thisHref); string filename = Path.GetFileName(uri.LocalPath); string thisAttachment = "attachment; filename=" + filename.ToString(); Response.ContentType = "image/jpeg"; Response.AppendHeader("Content-Disposition", thisAttachment.ToString()); Response.TransmitFile(strDirectFilePath.ToString() + "/photos/1/" + filename.ToString()); Response.End(); </code></pre> <p>The C# only has the filename that is initially set Onload and it appears that the jQuery has not changed the src.</p> <p>I need to get the current filename so I the user can download the proper image file.</p> <p>Help!</p>
c# jquery asp.net
[0, 5, 9]
4,584,556
4,584,557
Save dynamically generated textfield from PHP
<p>I have a table which is being dynamically generated based on the user input, in some cases rows have a textfield and i want to save the values updated by the user in the textfield by in the MySql database. e.g:</p> <p>Actual Code:</p> <pre><code>echo "&lt;tr&gt;&lt;td&gt;".$sql3[0]."&lt;/td&gt;&lt;td&gt;".$row1[2]."&lt;/td&gt; &lt;td&gt;&lt;input type='text' class='span1' value='".$recieved."'/&gt; &lt;/td&gt;&lt;td&gt;".$status."&lt;/td&gt;&lt;/tr&gt;"; </code></pre> <p>Simplified example: </p> <pre><code>//some user input e.g Microsoft Table: item quantity received Windows 7 1000 'textfield' Office 2007 200 nothing required Windows 8 20000 'textfield' </code></pre> <p>Now i want to save the values entered in the textfield and update them in the database. The problem is i am not sure how to define an <code>id</code> (id of the textfield) which can be read using a javascript so that i know which textfield i am currently talking about.</p> <p>Any suggestions would help.</p>
php javascript jquery
[2, 3, 5]
370,650
370,651
Character Creator in Javascript
<p>I've had an idea for a website and would like a character creator.</p> <p>One that has options for different eyes, mouth, hair, etc.</p> <p>Then the options the person has chosen be submitted to their wordpress account photo.</p> <p>What would be the best way to pull this off?</p> <p>Any help is greatly appreciated! :)</p> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
5,404,510
5,404,511
issue with sort data
<p>i am developing an app in which i get data from server and display in map. but before display it on map's balloon i have just sort data by one field name is "Destination" and there are method made na,e is ..GOTOSORT.... </p> <p>now problem is i got variables <code>s</code> with length 1 and there for the for loop are run only 1 time , but there are 42 data are come from webservices so please check it and tell me what is the problem</p> <pre><code>private void GOTOSORT() { Log.i(TAG, " SORT "); Map&lt;Float, Integer&gt; map = new TreeMap&lt;Float, Integer&gt;(); for (int i = 0; i &lt; lng_timeStamp.length; ++i) { map.put((float) lng_timeStamp[i], i); } Collection&lt;Integer&gt; indices = map.values(); System.out.println("indices" + indices); Integer s[] = (Integer[]) indices.toArray(new Integer[0]); Log.i(TAG, "s.length"+s.length); for (int i = 0, n = s.length; i &lt; n; i++) { System.out.println(s[i]); int_sort_MyhourGetTime[i] = int_MyhourGetTime[s[i]]; int_sort_MyMinGetTime[i] = int_MyMinGetTime[s[i]]; lng_sor_timeStamp[i] = lng_timeStamp[s[i]]; arr_sort_ServiceNumber[i] = arr_ServiceNumber[s[i]]; arr_sort_Destination[i] = arr_Destination[s[i]]; } </code></pre>
java android
[1, 4]
269,500
269,501
How to disable sorting on column in jQuery.tablesorter?
<p><br><br>i try to find a way how to disable sorting on column. I use jquery tablesorter. And by default if you click on header cell it sort column data, but what i need to do if i don't need to use sorting on one or two column in four columns table. <br><br> Thanks in advanced.</p>
javascript jquery
[3, 5]
1,203,788
1,203,789
Update HiddenFiled value on parent window after child window is close Javascript,VS2005 c#
<p>I have a child window and a parent window with a hiddenfield hdnSelectedFields .I am changing the value of hdnSelectedFields.</p> <p>Code:</p> <pre><code>String vStrScript = "&lt;script language=javascript&gt;function CloseParent() {window.opener.document.getElementById('hdnSelectedFields').Value = '" + tempstring + "'; alert(window.opener.document.getElementById('hdnSelectedFields').Value);window.close(); } window.opener.document.forms[0].submit(); setTimeout(CloseParent, 5);&lt;/script&gt;"; </code></pre> <p>When I close the window the hdnSelectedFields value is set but when I access the hdnSelectedFields on parent window pageload it shows old value of hdnSelectedFields.</p> <p>if you see the alert in JavaScriptit shows updated hdnSelectedFields value when parent is loaded completed.</p> <p>Any suggestion how can I access hdnSelectedFields updated value on parent pageload.</p> <p>Dee</p>
asp.net javascript
[9, 3]
5,366,688
5,366,689
how to make onchange event happened in code-behind in ASP.NET?
<p>Suppose I have a textbox Mytbx and I have a javascript for its onchange event. I hook it up in code behind in Page_Load event like:</p> <pre><code>Mytbx.Attributes.Add("onchange", "test();") </code></pre> <p>Then I changed the text in code-behind for this textbox like (in a button click event for example):</p> <pre><code>Mytbx.Text = MyValue </code></pre> <p>I expect onchange event fired. but actually, it's not. When I click on the button to change value for Mytbx, nothing happening.</p> <p>How to resolve this problem?</p>
javascript asp.net
[3, 9]
1,600,270
1,600,271
jQuery won't find elements
<p>I have this js code:</p> <pre><code>(function($, undefined) { $("a").click(function(event) { //or another elemtnt alert('Hello!'); }) })(jQuery); </code></pre> <p>And of course link:</p> <pre><code>&lt;a href="http://google.ru/" target="_blank"&gt;Google&lt;/a&gt; </code></pre> <p>the JS code doesn't work, but if I change it to:</p> <pre><code>(function($, undefined) { $("*").click(function(event) { alert('Hello!'); }) })(jQuery); </code></pre> <p>all works!</p>
javascript jquery
[3, 5]
1,471,499
1,471,500
saving XMLHttpRequest.responseText in a variable
<p>I'm writing a small script in JS to save the data using a php website like this:</p> <pre><code>function getPopulation(id) { var xhr_object = null; if(window.XMLHttpRequest) // Firefox xhr_object = new XMLHttpRequest(); else if(window.ActiveXObject) // Internet Explorer xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); else { // XMLHttpRequest non support? par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); return; } var url = "http://localhost/inf347/td-svg/population.php?id=1"; var res = 0; xhr_object.open("GET", url,true); xhr_object.send(null) ; xhr_object.onreadystatechange=function() { if (xhr_object.readyState==4) { //alert(xhr_object.responseText) ; res = xhr_object.responseText ; } } alert(res); //return -1; } </code></pre> <p>If I uncomment the line "//alert(xhr_object.responseText) ;" then the program prints the correct answer. But there is no way to save that value into a variable. Does anyone know how to get round it?</p> <p>Thanks, Son</p>
php javascript
[2, 3]
4,202,211
4,202,212
How do we update URL or query strings using javascript/jQuery without reloading the page?
<p>Is there a way to update the URL programatically without reloading the page?</p> <p>EDIT: I added something in the title in post .I just want to make it clear that I don't want to reload the page</p>
javascript jquery
[3, 5]
4,820,268
4,820,269
Disabling Javascript execution when loggining in
<p>I have an <code>Index.php</code> page that launches a <code>JQuery</code> dialog (in <code>modal</code> mode). Dialog consists of a login form. When form gets submitted an <code>Ajax request</code> is sent to another php file (where the request gets handled). If request is succeded I just close the dialog.</p> <p>I know I can use <code>&lt;noscript&gt;</code> tag. But what if I disable <code>javascript</code>, at any time I wish?. Is it possible to respond (redirect user to a login page) dynamically?</p> <p>Thanks!</p>
php javascript
[2, 3]
423,005
423,006
Refer to attributes from multiple selector in jQuery
<p>I have a bunch of DIVs identified by class screen-cat-comment and I want for each div to execute a plugin that receives as a parameter an attribute value from each DIV. </p> <pre><code>&lt;div class="screen-cat-comment" catId="1"&gt;&lt;/div&gt; &lt;div class="screen-cat-comment" catId="2"&gt;&lt;/div&gt; &lt;div class="screen-cat-comment" catId="3"&gt;&lt;/div&gt; </code></pre> <p>then, the selector</p> <pre><code>$('.screen-cat-comment').fragment({ code: $(this).attr('catId') }); </code></pre> <p>Passing catId to myPlugin doesn't work -- from the current code, $(this).attr('catId') returns undefined. Is there any way to re-write this selector to pass attr('catId') to the plugin?</p>
javascript jquery
[3, 5]
5,833,278
5,833,279
Proper use of for and if statements in Java/Android
<p>I have an two arrays, one is cityUSA[i] and one is decimalUSA[i]. Each has over 1500 entries, cityUSA[100] goes with decimalUSA[100] and so on. I find the city people are in via location services in Android and then I compare it to the list of cities I have in the cityUSA[i] array. I then search for a match and use the i of the match to find the related value of decimalUSA[i] in that array. Here is the code:</p> <p>loc.getLatitude(); loc.getLongitude(); Geocoder geocoder = new Geocoder(rate.this, Locale.ENGLISH);</p> <pre><code> try { List&lt;Address&gt; addresses = geocoder.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1); TextView rateText = (TextView)findViewById(R.id.taxRate); TextView locationText = (TextView)findViewById(R.id.taxLocation); if(addresses != null) { Address returnedAddress = addresses.get(0); String city = returnedAddress.getLocality(); locationText.setText(city); int i; for (i = 0; i &lt;= cityUSA.length; i++){ if (cityUSA[i] == city) { String PrecentString = decimalRate[i]; rateText.setText(PrecentString); break; } } } else{ locationText.setText("No City returned!"); rateText.setText("No Rate returned!"); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); TextView locationText = (TextView)findViewById(R.id.Rate); locationText.setText("Cannot get Location!"); } </code></pre> <p>The application bombs out when I try to run it. If I remove the for statment:</p> <pre><code> int i; for (i = 0; i &lt;= cityUSA.length; i++){ if (cityUSA[i] == city) { String PrecentString = decimalRate[i]; rateText.setText(PrecentString); break; } } </code></pre> <p>It does not bomb out, but then again it does not perform the search either.</p> <p>Any suggestions?</p>
java android
[1, 4]
2,572,101
2,572,102
Getting the closes element in the form with javascript
<p>I have the following two fields in a form:</p> <pre><code> &lt;input type="button" value="Rep" id="rep" name="rep" style="width:50px" onclick="addRep()"/&gt; &lt;input type="hidden" value="&lt;?php echo $comment_id; ?&gt;"/&gt; </code></pre> <p>I need to get the value of the hidden field in the form. So I thought to use some function to call the hidden field field next to the button whenever it is triggered.</p> <p>I need to get that hidden field specifically, that comes after the button pressed.</p> <p>I cant use methods like getElementByID,,cause I generate many of those hidden fields and buttons with the same id.. (I generate them dynamically with php).</p> <p>In theory, I think that I could get the context of the button pressed (after trapping its event) and then use some function to find the next element in the form.. </p> <p>But I am not sure how to do that!</p>
php javascript
[2, 3]
5,344,990
5,344,991
embedded javascript that is based on jQuery
<p>I'm building a service that allows people to put a javascript code I gave them to their site. The javascript code is based on jQuery.</p> <p>My question is how to do this to be safe and optimized, cause I don't want to break certain users website.</p> <p>The thing I'm looking for so far( you can update if you think I need to face other problems):</p> <ol> <li>what happens when the user already has jquery loaded on their page? should I load my jquery library using different namespace or should I use his jquery library.</li> <li>in case I can use his jquery library, I think I'll need to check to see if the versions corespond, but again is this safe?</li> <li>in case I want to use his jquery library, how do I check if he has jquery loaded and if he has the right version</li> <li>this is related to 3. what happen if he changes his jquery library that doesn't correspond with the library I think it will be, leading to a bad result.</li> </ol> <p>Looking for your answers. Thanks</p>
javascript jquery
[3, 5]
2,397,881
2,397,882
jquery tabs selection
<p>the jquery code is like this:</p> <pre><code> $(document).ready(function() { //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); </code></pre> <p>and the tabs:</p> <pre><code> &lt;ul class="tabs"&gt; &lt;li&gt;&lt;a href="#tab1"&gt;Gallery&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab2"&gt;Submit&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="tab_container"&gt; &lt;div id="tab1" class="tab_content"&gt; &lt;!--Content--&gt; &lt;/div&gt; &lt;div id="tab2" class="tab_content"&gt; &lt;!--Content--&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>whenever the page loads the 1st tab is opened 1st. but if i want the 2nd tab to show, then how can i do that. like from inside a function im loading the page like: window.location="display.php"; when loaded i want the 2nd tab to open how to do that?? also from another function if i want the 1st tab to show how to do that?</p> <p>thanks in advance..</p>
javascript jquery
[3, 5]
1,617,355
1,617,356
Get uri LocalPath in jquery/JS?
<p>simple problem with a simple question. I have a string, in C# i can put it through a uri and access LocalPath</p> <p>How do i get LocalPath in jquery or javascript? ( LocalPath: "/asas")</p> <p>{http://z.com/asas?sadfdsgfg}</p> <pre><code>AbsolutePath: "/asas" AbsoluteUri: "http://z.com/asas?sadfdsgfg" Authority: "z.com" DnsSafeHost: "z.com" Fragment: "" Host: "z.com" HostNameType: Dns IsAbsoluteUri: true IsDefaultPort: true IsFile: false IsLoopback: false IsUnc: false LocalPath: "/asas" OriginalString: "http://z.com/asas?sadfdsgfg" PathAndQuery: "/asas?sadfdsgfg" Port: 80 Query: "?sadfdsgfg" Scheme: "http" Segments: {string[2]} UserEscaped: false UserInfo: "" </code></pre>
javascript jquery
[3, 5]
1,879,228
1,879,229
Using Python vs PHP for Web Development - When and Where
<p>First of all, please don't make a comment that is based on your opinion or preferences or some magic hatred for PHP.</p> <p>I work at a web development company and I'm going to write a new CMS soon. I'm currently using WordPress, but I have lots of experience with Python/Django.</p> <p>My question to this great community is what are the practical benefits of using PHP or Python. What does Python give me that PHP doesn't <strong>that I'll actually use.</strong> Will Python add an extra level of complexity, will it allow better testing, etc etc.</p> <p>I know this topics been beaten to death already, but most of the replies on objective. I want facts that are of <strong>actual use to people.</strong> </p> <p>Some Topics:</p> <ul> <li>Security</li> <li>Speed</li> <li>Easy of use</li> <li>Scalability</li> <li>Maintainability</li> <li>Extendability </li> </ul> <p>Thanks :)</p>
php python
[2, 7]
3,807,211
3,807,212
jquery lightbox issue
<p>on <a href="http://www.holzschild24.com/schritt1.php" rel="nofollow">http://www.holzschild24.com/schritt1.php</a> i use <a href="http://leandrovieira.com/projects/jquery/lightbox/" rel="nofollow">http://leandrovieira.com/projects/jquery/lightbox/</a></p> <p>and i get an error: <code>$("#slider").easySlider</code> is not a function</p> <p>Any ideas, what that can be? All files are laoded correctly, i want that when i click on a pic, i get a big version,...any ideas?</p>
javascript jquery
[3, 5]
1,197,726
1,197,727
Unrecognized element 'authentication'.
<p>I am trying to write a simple authentication. I'm also trying to make this quick and learn about the forms authentication via web.config.</p> <p>So i have my authentication working if I hard code my 'user name' and 'password' into C# code and do a simple conditional.</p> <p>However, I get en error message '<strong>Unrecognized element 'authentication'.</strong></p> <pre><code>Line 2: &lt;system.web&gt; Line 3: &lt;customErrors mode="off"&gt; Line 4: &lt;authentication mode="Forms"&gt; Line 5: &lt;forms name=".C#FEWD" Line 6: loginUrl="/schools/admin/login/index.aspx" </code></pre> <p>My web.config file looks like this:</p> <pre><code>&lt;configuration&gt; &lt;system.web&gt; &lt;customErrors mode="off"&gt; &lt;authentication mode="Forms"&gt; &lt;forms name=".C#FEWD" loginUrl="/schools/admin/login/index.aspx" protection="All" timeout="60"&gt; &lt;credentials passwordFormat="Clear"&gt; &lt;user name="schools" password="magic" /&gt; &lt;/credentials&gt; &lt;/forms&gt; &lt;/authentication&gt; &lt;authorization&gt; &lt;deny users="?" /&gt; &lt;/authorization&gt; &lt;/customErrors&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre>
c# asp.net
[0, 9]
3,320,081
3,320,082
Swipe to switch tabs with TabHelper
<p>I'm creating an app that is required to be used on older devices, I used the included source at <a href="https://developer.android.com/training/backward-compatible-ui/index.html" rel="nofollow">https://developer.android.com/training/backward-compatible-ui/index.html</a> to create the tabs but I would like to be able to switch between them using swipes.</p> <p>Now I guess I probably messed everything up by using the java files in that training article and adapting it for my app, but I've got my app working exactly how I want it albeit without swiping.</p> <p>So, start anew? or any other suggestions?</p>
java android
[1, 4]
1,454,362
1,454,363
ASP.NET Login box positioning
<p>I am using VS2005 C#. I have a login box in my .aspx page, but I can't find the parameter I have to set too position it in the middle of my webpage.</p> <p>I have tried using <code>&amp;nbsp;</code> but it did not work as well.</p> <p>Below is my code for my login box:</p> <pre><code>&lt;asp:login id="Login1" runat="server" font-size="Large" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#333333" DestinationPageUrl="~/Common/Default.aspx" DisplayRememberMe="False" FailureText="Login failed" RememberMeSet="False"&gt; &lt;TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" /&gt; &lt;InstructionTextStyle Font-Italic="True" ForeColor="Black" /&gt; &lt;TextBoxStyle Font-Size="0.8em" /&gt; &lt;LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" /&gt; &lt;/asp:login&gt; </code></pre> <p>Anyone knows how to position login control?</p> <p>Thank you</p>
c# asp.net
[0, 9]
3,776,872
3,776,873
JScrollbar - Can i use internal links within the scollable part?
<p>I am using Jquery JScrollbar. It works fine except when I want internal links in the scrollable part. The scrollbar dissapears when I click on the internal link:</p> <pre><code> &lt;div class="jScrollbar"&gt; &lt;div class="jScrollbar_mask"&gt; &lt;a href="#some link"&gt;link&lt;/a&gt; </code></pre> <p>Any ideas?</p>
javascript jquery
[3, 5]
5,886,646
5,886,647
How to remove data- attribute from the div element?
<p>I have an html <code>div</code> element, which contains lot of HTML-5 <code>data-</code> attributes to store extra </p> <p>data with element. I know that we can use <code>removeAttr</code> of jquery to remove specific attribute, </p> <p>but i want to know that is there any way to remove <code>data-</code> all atonce?</p>
javascript jquery
[3, 5]
3,370,295
3,370,296
JS statement separator with commas
<p>I found the following js sample and am confused by the syntax. Notice the statements are separated by commas instead of semicolons. Are commas a valid statement separator in js? I have not seen this before.</p> <pre><code> $('selector').each(function () { this.onclick = function () { this.select(); }, this.onblur = function () { }, this.onfocus = function () { }, this.onkeyup = function () { } }); </code></pre>
javascript jquery
[3, 5]
4,494,781
4,494,782
With asp.net, how do I cause a browser to open a tab delimited txt file in Excel?
<p>We have a tab delimited file that we are making available for download. The file extension is txt, but the users want it to open automatically in Excel. The previous developer had used the following code:</p> <pre><code>private void DownloadLinkButtonCommandEventHandler(object sender, CommandEventArgs e) { Response.ContentType = "Application/x-msexcel"; var filePath = (string)e.CommandArgument; Response.AppendHeader("content-disposition", "attachment; filename=" + filePath); Response.WriteFile(filePath); Response.End(); } </code></pre> <p>The ContentType is being set to Excel, but that doesn't seem to have any effect. I am guessing the txt file extension is causing it to be picked up by notepad or the like instead. I have tried just renaming it to a xls extension, which works but Excel complains that I am trying to trick it or it might be a corrupted file. Any easy win on this? Maybe I should just convert it to an Excel file.</p>
c# asp.net
[0, 9]
4,885,073
4,885,074
Using javascript to fade a thumbnail image from grayscale to to color
<p>I'm relatively new to web development and wouldn't even know where to start in coding a javascript that fades a grayscale thumbnail image into a color thumbnail image on mouseover, and vice versa on mouseoff (&lt;--or whatever this is called). </p> <p>I've looked all over and can't find a script that does this. Is this possible? Could I use jquery to do this? Other thoughts?</p> <p>Thanks so much in advance for all your help!</p>
javascript jquery
[3, 5]
5,858,503
5,858,504
Selecting textbox value when pressing the next button
<p>I have a grid of textboxes. When the user presses the arrow button I need the cursor to select the contents of the textbox in the direction they have just pushed. I have tried using JQuery's .select() method, but this doesnt seem to work in IE. </p> <p>Could you give me suggestions on how to get this working?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
3,293,348
3,293,349
jquery ajax request failing in IE6
<p>I have got a ajax request working in safari,FF and Chrome but not in IE6.I get the error message and the xhr.statusText is <strong>unknown</strong>.I know I should be ditching IE6 but its in the requirements list so I'm helpless.If anyone has a solution to please lemme know.</p> <p>Thanks</p> <pre><code>$.ajax({ type: "GET", url: "vMenu.xml", dataType: "xml", error:function(xhr, status, errorThrown) { alert(errorThrown+'\n'+status+'\n'+xhr.statusText); }, success: function(data) { alert('success') ; } }); </code></pre> <p>the XML file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="vMenu.xsl"?&gt; &lt;vMenuList&gt; &lt;menu loc="menu1.htm"&gt;menu1&lt;/menu&gt; &lt;menu loc="menu2.htm"&gt;menu2&lt;/menu&gt; &lt;menu loc="menu3.htm"&gt;menu3&lt;/menu&gt; &lt;menu loc="menu4.htm"&gt;menu4&lt;/menu&gt; &lt;menu loc="menu5.htm"&gt;menu5&lt;/menu&gt; &lt;menu loc="menu6.htm"&gt;menu6&lt;/menu&gt; &lt;menu loc="menu7.htm"&gt;menu7&lt;/menu&gt; &lt;menu loc="menu8.htm"&gt;menu8&lt;/menu&gt; &lt;/vMenuList&gt; </code></pre> <p>All the files are in the same folder </p>
javascript jquery
[3, 5]
3,953,588
3,953,589
jquery val() not working
<p>jQuery val() didnt working, this is the simple script:</p> <pre><code>$("#com_form").submit(function() { var name = $("#nama").val(); var komentar = $("#komentar").val(); alert.("Hi, "+name+" this is your comment: "+komentar) }); });*/ </code></pre> <p>this is the HTML form:</p> <pre><code>&lt;form method="post" name="com_form" id="com_form"&gt; &lt;p&gt;What is your name:&lt;br&gt; &lt;input type="text" name="nama" id="nama"&gt; &lt;/p&gt; &lt;p&gt;Leave your comment here:&lt;br&gt; &lt;input type="text" name="komentar" id="komentar"&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="submit" name="button2" id="button2" value="Submit"&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>actually, I was tried to create ajax post, the value "nama" is submited but not "komentar". So I tried to debug using alert (like one above) and still "komentar" is not change. What should I do?</p>
javascript jquery
[3, 5]
1,809,548
1,809,549
Android - TouchDrag moves image within view, but need entire view to move
<p>My image simply moves within my image view based upon the touch location. I need the entire view to move (not just the image in it).</p> <p>Here is my code in onTouch:</p> <pre><code>ImageView image = (ImageView)v; switch (event.getAction() &amp; MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: savedMatrix.set(matrix); start.set(event.getX(),event.getY()); mode = DRAG; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: mode = NONE; break; case MotionEvent.ACTION_MOVE: if (mode == DRAG) { matrix.set(savedMatrix); matrix.postTranslate(event.getX() - start.x, event.getY() - start.y); } break; } image.setImageMatrix(matrix); return true; </code></pre>
java android
[1, 4]
2,680,938
2,680,939
How would I prevent JQuery from selecting more than 1 level of children dom elements?
<p>How would I only select Item A and Item B pragmatically while excluding the sub item? </p> <pre><code>&lt;div id="nav"&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;Item A&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;Sub Item A&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Item B&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
2,193,150
2,193,151
How to store a list of values so that it can be accessed in other pages in ASP.NET?
<p>I have some 10 permission in my table. Some users have all 10 permissions. </p> <p>Each page in the website have to check whether the user have the particular permission. </p> <p>In the home page I can do a query and store the permission list to a list box, and check whether Permission1 is in the list box, when I navigate to other page Again I have to check whether the permission is present in the list box. </p> <p>Here the list box is in home page and I will not be able to access it in page2. I have to check permission in page load in page 2. </p> <p>How can I access the list of permission in page2 can I add to session? </p> <p>Is there any better way to do this?</p>
c# asp.net
[0, 9]
2,004,116
2,004,117
question-suggestion list
<p>i have a asp.net page. i m writing some words in a question textbox named txtTitle, after moving to another txtbox named txtbox2, i want that it should open a question-suggestion page based on that keyword typed in txtbox1 in the space before txtbox2. i hv tried this but it is not working. can anyone provide me the all the codes which are required to do this function.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $("#txtTitle").blur(function() { QuestionSuggestions(); }); }); function QuestionSuggestions() { var s = $("#txtTitle").val(); if (s.length &gt; 2) { document.title = s + " - ABC"; $("#questionsuggestions").load("QuestionList.aspx?title=" + escape(s)); } } &lt;/script&gt; </code></pre>
c# asp.net jquery
[0, 9, 5]
511,102
511,103
How to optimize my javascript slider loading?
<p>I've been coding up a little responsive image slider to display my wedding photos using <a href="http://responsive-slides.viljamis.com/" rel="nofollow">responsiveslides.js</a> and a little script to deal with vertical images (it sets a max-height based on the browser viewport). You can see it at <a href="http://johnandalex.us/photos" rel="nofollow">http://johnandalex.us/photos</a> It's finally working pretty much how I want it to, with 2 exceptions:</p> <ol> <li>The pics show up and then resize after a delay (when the browser window is smaller than the full size of the picture)</li> <li>The prev/next arrows don't show up until the pics are completely loaded (which takes a while, especially on slower connections because there are over 100 images)</li> </ol> <p>Any ideas for how to improve on these 2 items? I'm totally comfortable with HTML and CSS, but am a complete novice when it comes to JS.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
836,164
836,165
how to submit form from jQuery and navigate to the page?
<p>I have two php pages. Page 1 contains one form which i submitted with jQuery. Page 2 is form query page. I want to read all the data from Page 2 after submitting from page 1 through navigation. My following code does not work as I expected.</p> <p>Page 1:</p> <pre><code>$.ajax({ type: "POST", url: "requestProcessor.php", data: "fname="+ fname +"&amp;amp; lname="+ lname, success: function(){ window.location.href = "requestProcessor.php"; } }); </code></pre> <p>Page 2: requestProcessor.php</p> <pre><code>&lt;?php require("db/phpsql_info.php"); echo htmlspecialchars(trim($_POST['fname'])); echo htmlspecialchars(trim($_POST['lname'])); ?&gt; </code></pre> <p>Thanks in advance..</p>
php jquery
[2, 5]
4,282,509
4,282,510
focusin jquery ui datepicker removes text but filtered dates as well
<p>Hi I have two jquery UI datepickers to filter a range of dates in which input box I want to have some text that clears at the focus before the selection, so I used the following:</p> <pre><code>&lt;input name="From" type="text" id="From" class="datepicker initialClass" value="From" /&gt; &lt;input name="To" type="text" id="To" class="datepicker2 initialClass" value="To" /&gt; $('.datepicker').val("From") .focusin(function () { if ($(this).hasClass('initialClass')) $(this).removeClass('initialClass').addClass('normalClass').val(''); }) .focusout(function () { if ($(this).hasClass('normalClass') &amp;&amp; $(this).val() == '') $(this).removeClass('normalClass').addClass('initialClass').val('From'); }); $('.datepicker2').val("To") .focusin(function () { if ($(this).hasClass('initialClass')) $(this).removeClass('initialClass').addClass('normalClass').val(''); }) .focusout(function () { if ($(this).hasClass('normalClass') &amp;&amp; $(this).val() == '') $(this).removeClass('normalClass').addClass('initialClass').val('To'); }); </code></pre> <p>Everything works fine, the problem I have is that it removes the dates from the input as well once I filtered. How could I have this and not loose the dates?</p>
jquery asp.net
[5, 9]
2,265,825
2,265,826
A JQUERY standard way of storing the original value of a form field?
<p>Is there a standard way in JQUERY to (at document ready time) store the original values of the form fields on the page in order to check (later) whether the fields have truly changed or not?</p> <p>Normally I will do something like this:</p> <pre><code>var NameField = $("INPUT[name='NameField']"); //Record the original value. NameField.OriginalVal = NameField.val(); </code></pre> <p>This is simple enough, but I'm wondering of there is a "Standard" way to do it.</p> <p><B>EDIT</B></p> <p>One added requirement that I forgot is that it needs to work for all types of form fields including select and textareas.</p>
javascript jquery
[3, 5]
5,311,678
5,311,679
remove blank values from array and suggest a better method to read text file data delimited by '|'
<p>Am trying to get values from a text file in which entries are delimited using '<strong>|</strong>'.am getting the values using string .Split method..but in some places the delimiter appears multiple times in succession like '<strong>||||||||</strong>',so empty space gets inserted in the array how should i remove those empty elements from array or is there any efficient technique to read values from text file delimited by '|".below is my code and the screen shot of array values</p> <pre><code> var reader = new StreamReader(File.OpenRead(@"d:\er.txt")); while (!reader.EndOfStream) { var line = reader.ReadLine().Trim(); var values = line.Split('|'); string[] ee = values; } </code></pre> <p><img src="http://i.stack.imgur.com/q6nq3.png" alt="array with empty values in between"></p> <p><strong>can any one suggest a better method for reading data from text file delimited by '|'</strong></p>
c# asp.net
[0, 9]
416,662
416,663
external link icon
<p>Using a script, that works great. It pops in a external link icon next to external links. Whoopydoo... and also adds a target="_blank" attribute.</p> <p>The issue I have is, I dont want it to work on IMAGES.</p> <p>Only on text links , so any sugestions.</p> <p>The jquery is:</p> <pre><code>(function(a){ a.fn.link_external_icon=function(p){ var p=p||{}; var icon_path=p&amp;&amp;p.icon_path?p.icon_path:"link_external.png"; var n=a(this); n.find("a[target='_blank']").css("padding-right","13px").css("background-image","url("+icon_path+")").css("background-repeat","no-repeat").css("background-position","center right"); } </code></pre> <p>})(jQuery);</p> <p>The Script is:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(function() { $("body").link_external_icon({ icon_path:"../images/link_external.png" }); }); &lt;/script&gt; </code></pre> <p>Image is: <img src="http://i.stack.imgur.com/ikX0m.png" alt="enter image description here"></p> <p>Any help appreciated.</p> <p>Original code is: <a href="http://htmldrive.net/items/show/161/Link-external-icon-jQuery-plugin-for-show-external-linktarget_blank-icon.html" rel="nofollow">http://htmldrive.net/items/show/161/Link-external-icon-jQuery-plugin-for-show-external-linktarget_blank-icon.html</a></p>
javascript jquery
[3, 5]
2,480,326
2,480,327
jquery each loop only looping once and if using else code stops
<p>I've got two problems with the following javascript and jquery code. The jquery each loop only iterates once, it gets the first element with the right ID does what it needs to do and stops.</p> <p>The second problems is that when I use the else in the code the one inside the each function, it doesn't even tries the next if, it just exits there. I'm probably doing something fundamental wrong, but from the jquery each function and what I'd expect from an else, I don't see it.</p> <p>Javascript code:</p> <pre><code>var $checkVal; var $checkFailed; $("#compliance").live("keypress", function (e) { if (e.which == 10 || e.which == 13) { var checkID = $(this).parents('td').next().attr('id'); var checkVal = $(this).val(); $('#' + checkID).each(function () { var cellVal = $(this).text(); if (checkVal == cellVal) { $(this).removeClass("compFail").addClass("compOk"); } else { $(this).removeClass("compOk").addClass("compFail"); var checkFailed = True; } }); if (checkFailed == 'True') { (this).addClass("compFail"); } else { (this).addClass("compOk"); } } }); </code></pre> <p>How could I get the each loop to iterate through all instances of each element with the id assigned to the variable checkID, and get the code to continue after the else, so it can do the last if?</p>
javascript jquery
[3, 5]
1,209,136
1,209,137
Checking if a form field is numeric while using Jquery to get its value
<p>Basically, I'm doing this:</p> <pre><code>var phone = $("#phone").val(); </code></pre> <p>Then I want to check if:</p> <p>1) Phone contains only numbers</p> <p>2) Phone contains at least 10 digits</p> <p>But the problem is, from my experience, using <code>$("something").val()</code> returns it as a string so <code>isNaN()</code> fails. But I don't want use <code>parseInt()</code> either since it will change strings into numbers as well and then <code>isNaN()</code> will always pass.</p> <p>Thoughts?</p>
javascript jquery
[3, 5]
4,285,257
4,285,258
how to add class to a listitem from code behind
<p>I am dynamically generating paging from code behind but my html design is different. How to add a class to listitem. The code is as below</p> <pre><code> if (pageCount &gt; 0) { pages.Add(new ListItem("First", "1", currentPage &gt; 1)); for (int i = 1; i &lt;= pageCount; i++) { pages.Add(new ListItem(i.ToString(), i.ToString(), i != currentPage)); } pages.Add(new ListItem("Last", recordCount.ToString(), currentPage &lt; pageCount)); } </code></pre> <p>Html for the same is</p> <pre><code> &lt;ul class="pages-pagina"&gt; &lt;li class="pages previous"&gt;&lt;a href="#"&gt;Previous&lt;/a&gt;&lt;/li&gt; &lt;li class="pages selected"&gt;&lt;a href="#"&gt;1&lt;/a&gt;&lt;/li&gt; &lt;li class="pages"&gt;&lt;a href="#"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li class="pages"&gt;&lt;a href="#"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;li class="pages"&gt;&lt;a href="#"&gt;4&lt;/a&gt;&lt;/li&gt; &lt;li class="pages"&gt;&lt;a href="#"&gt;5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;...&lt;/li&gt; &lt;li class="pages last"&gt;&lt;a href="#"&gt;10&lt;/a&gt;&lt;/li&gt; &lt;li class="pages next"&gt;&lt;a href="#"&gt;Next&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Thanks,</p>
c# asp.net
[0, 9]
388,694
388,695
Is there any GoogleGroup API to fetch data from Google Groups
<p>How to Access Google group information from asp.net using C#. Please suggest for any avaliable API or documentations to refer.</p> <p>Thanks Karteek.</p>
c# asp.net
[0, 9]