Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,511,976
1,511,977
jquery/javascript if else statement not working, detecting empty textbox
<p>I have this code:</p> <pre><code>if ($('#txtEdit').val == '') { window.parent.$('#note' + appid + dbid).html('&lt;img src="images/note_gray.png"&gt;'); } else if ($('#txtEdit').val != '') { window.parent.$('#note' + appid + dbid).html('&lt;img src="images/note.png"&gt;'); }; </code></pre> <p>I've also tried it with a simple "else" instead of the "else if". I have also tried val(null) instead of val == ''. In all instances, it will work one way, but not the other. For example, as it is now (above) if I put something in the text box (txtEdit) it will set the div to note.png. However, emptying the textbox will not change it to note_gray.png.</p> <p>I am new to jquery/javascript. Sorry.</p>
javascript jquery
[3, 5]
13,883
13,884
How to share a link with image and description on custom website in PHP
<p>How to share a link with image and description on custom website in PHP like linkedin, facebook.</p> <p>If users share any valid link it show image with descriptions like facebook and linkedin.</p>
php jquery
[2, 5]
5,342,895
5,342,896
creating a document comparison software
<p>I want to create an application that can determine if some text was copied between two documents by reading the text from the two documents and comparing them. I wanted to know if anyone had ever tried to do this and what was the best way of handling the same. If machine learning and natural language processing are involved: to what level?</p>
java php python
[1, 2, 7]
3,126,142
3,126,143
Is there an android java example to implement latify including oauth
<p>Is there an android java example to implement latify android app including oauth?</p>
java android
[1, 4]
285,507
285,508
getting pictures into an array in javascript
<p>im kinda new to javascript i mean i know the syntax but not so much the libraries.</p> <p>i need some help to get some files (pictures) from a folder into an arry lets say:</p> <pre><code>var[] pictures = ?; </code></pre> <p>(the folder is in my project and contain some pictures)</p> <p>so i can loop over them and diplay them on the page i did some search but i didnt find any guide on how to do this.</p> <p>i realy want to understand on how to do this for future projects even a link to known guid you guys know we will be a big help.</p> <p>if it help im using asp.net.</p>
javascript jquery asp.net
[3, 5, 9]
3,821,140
3,821,141
Animate tooltip on user hover with jQuery
<p>Im trying to make my tooltip bounce onmouse hover, </p> <p>I have the following that works with sporadic results, as in the the tooltip bounces fast for 3 seconrds ro so, then slow for 3 seconds etc... I also need to stop this function on mouseout, Can somebody see where im going wrong to get the variation in bounce speed?</p> <pre><code>// Tooltip title $('.male').mouseover(function(e) { var tiptitle = $(this).find('.highlight'); setInterval(function(){ tiptitle.animate({top:'-85px'}, 100, function() { tiptitle.animate({top:'-75px'}, 100); }); },200); }).mouseout(function() { }); </code></pre>
javascript jquery
[3, 5]
422,482
422,483
MasterPages Inherit another MasterPage
<p>I am working on a website that has many MasterPages and one of them inherits from another master page and I am trying to add a control to the parent masterpage like this</p> <pre><code>myMasterPage.Page.Controls.Add(new LiteralControl(theSuperStoreString.ToString())); </code></pre> <p>But I get the following error</p> <pre><code>The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases. </code></pre> <p>How can i do this?</p> <p>Thank you</p>
c# asp.net
[0, 9]
1,495,667
1,495,668
Input fields not registering focus event
<p>I am confused as to why this is not doing anything (no errors):</p> <pre><code>&lt;div id="vehicle_form"&gt; &lt;input class="dField" type="email" name="email" value="Email"&gt;&lt;br/&gt; &lt;input class="dField" type="text" name="firstname" value="First Name"&gt;&lt;br/&gt; &lt;input class="dField" type="text" name="lastname" value="Last Name"&gt;&lt;br/&gt; &lt;button type="submit"&gt;Submit&lt;/button&gt; &lt;/div&gt; $('.dField').focusin(function(){ console.log('focus'); }); </code></pre>
javascript jquery
[3, 5]
47,459
47,460
Why can't I stop this js click event propogation
<p>I'm trying to override a click handler by intercepting the event in an inline handler and stopping propagation (propogation disabling code taken from <a href="http://stackoverflow.com/a/5108218/165673">here</a>). </p> <p>The following code not only doesn't stop the propagation, it's not even firing the inline handler. I can't tell what's wrong.</p> <p>fiddle: <a href="http://jsfiddle.net/trKN4/3/" rel="nofollow">http://jsfiddle.net/trKN4/3/</a></p> <p><strong>HTML:</strong></p> <pre><code>&lt;a onclick='stopIt(event);'&gt;do it&lt;/a&gt;​ </code></pre> <p><strong>JS:</strong></p> <pre><code>function disableEventPropagation(event) { if (event.stopPropagation){ event.stopPropagation(); } else if(window.event){ window.event.cancelBubble=true; } } function stopIt(event) { disableEventPropagation(event); alert('dont do it'); } $(function() { $('a').click(function(e){ alert('im doing it'); }); }); </code></pre>
javascript jquery
[3, 5]
1,370,533
1,370,534
Can I set dimensions ( width ) of progress dialog and how?
<p>I need to show <code>ProgressDialog</code> with message and I am doing this like </p> <pre><code>pd = ProgressDialog.show(Login.this, "Connecting...", "Please wait", true, false ); </code></pre> <p>Can I set dimensions ( width ) of progress dialog and how ? It works but it looks small and ugly.</p>
java android
[1, 4]
1,773,678
1,773,679
How to access hidden field from usercontrol
<p>I have a hidden variable in my aspx page i.e mainpage.aspx</p> <pre><code>&lt;asp:HiddenField runat="server" id="hdnCommonvCode" /&gt; </code></pre> <p>mainpage.aspx contains tabcontainer control. On each tab an usercontrol is added. If i try to access this hidden field <code>alert($find("&lt;%=hdnCommonvasCode.ClientID %&gt;"));</code> from usercontrol it shows compiler error msg</p> <pre><code>Compiler Error Message: CS0103: The name 'hdnCommonvCode' does not exist in the current context </code></pre>
javascript asp.net
[3, 9]
1,948,645
1,948,646
php/javascript for calendar-start and date picker
<p>I'm searching for php/javascript for calendar-start and date picker. Based on these date i need to retrieve the database cash and bank amount details.</p>
php javascript
[2, 3]
3,308,277
3,308,278
What is the user-agent string for Firefox beta for android?
<p>I can't test it because my Android isn't supported.</p> <p>Thanks!</p>
javascript android
[3, 4]
3,551,817
3,551,818
AutoCompleteExtender - Get Primary Key into HiddenField
<p>I want to use autoComplete extender in a way similar to a dropDownList. Currently I have a dropdown List that holds a collection of companies. Selecting a company name enables me to get the value associated with the listItem.</p> <p>I want to replace the dropDownList with autocomplete extender and place a text box. While typing user will be able to view the company. After selecting the company, I want to capture the value (such as company ID). I don't want this ID to be visible to user.</p> <p>Please advice how to achieve this functionality with autoComplete extender.</p>
c# asp.net
[0, 9]
1,794,575
1,794,576
List all session info
<p>I want to display all the session information of my asp.net page (aspx) in the page. How can I do that?</p> <p>The programming language is C#.</p> <p>Thanks for the help.</p> <p>Best regards</p>
c# asp.net
[0, 9]
404,791
404,792
How do you call a C# function from an ASP.NET event?
<p>I have written a function in my .cs page. On the event onselectedindexchanged in .aspx I want to call this function.</p> <p>How do I do this?</p>
c# asp.net
[0, 9]
3,347,213
3,347,214
Jquery Hide/show table cell for multiple tablecells
<p>I have one table, which having 15 columns and around 2000+ records. Now I want to hide/show last 5 columns. To do that I use following jQuery Statement.</p> <pre><code> $("table.border-box td.disp").toggle(); </code></pre> <p>td having "disp" class will hide/show table cells.</p> <p>But this will result in Browser with following stop script error.</p> <p>A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.</p> <pre><code>Script: http://localhost:8080/XXX/resources/js/jquery/jquery-1.6.4.js:4055 </code></pre> <p>How can I optimize this and also solve browser error.(Browser: Mozilla Firefox:15.0)</p>
javascript jquery
[3, 5]
5,899,418
5,899,419
Lose contact with resources - why
<p>Im developing in eclipse with 5 activities, but suddenly I loose contact with all my resources.</p> <p>Have anyone experienced this phenomenon and knows what to do about it? I have already tried cleaning up the project but no luck</p> <p>Update: I managed to resolve the issues by deleting the project and then importing an older version, which worked. Then copying and pasting from the new and damaged version to the old version..</p>
java android
[1, 4]
2,972,351
2,972,352
How do I use jQuery to display an HTML element?
<p>I have some code here that is supposed change <code>display: none</code> to <code>display: block</code> on 1 element when you mouse over another element.</p> <p><strong>HTML:</strong></p> <p><code>&lt;li onmouseover="popup('Ipsum');"&gt;Lorem&lt;/li&gt;</code></p> <p><strong>Javascript:</strong></p> <pre><code>$(document).ready(function(){ $("body").append('&lt;div id="pup"&gt;&lt;/div&gt;'); // Appends a popup div to the page $(document).mousemove(function(e){ var x,y; // This sets the mouse // coordinates into 2 x = $(document).scrollLeft() + e.clientX; // variables in order to y = $(document).scrollTop() + e.clientY; // display the tooltip }); // relative to mouse postition function popup(text) { $('#pup').html(text); // This is supposed to enter text into the tooltip $('#pup').show(); // div and change it from display: none to // display: block } </code></pre> <p>Currently, the div exists (however you can't see it because it is set to <code>display: none</code> in the CSS, but when you mouse over the li it isn't displayed. Thanks!</p>
javascript jquery
[3, 5]
2,658,621
2,658,622
android image upload to quick base db
<p>i am developing an android app to upload images to quick base Data Base (https://www.quickbase.com) according to the quick base API , image should upload in base64 format,and its should send via xml formatted post request and no MIME headers and types allowed (http://www.quickbase.com/api-guide/whnjs.htm) . every text data going to the data base but image not uploading to the server,here is my code, anyone can give me a help ? </p> <pre><code>String tempXml = "&lt;?xml version='1.0' ?&gt;&lt;qdbapi&gt;&lt;udata&gt;mydata&lt;/udata&gt;" + "&lt;ticket&gt;6_bg4at2ksw_bzazsh_b_cmti6qddhsrvgqds7cqmgbt32t6wcdkcse2c8j8ypyb&lt;/ticket&gt;" + "&lt;apptoken&gt;cwfcy7gdzqrsyncqbi2bn4u4kr&lt;/apptoken&gt;" + "&lt;field fid='6'&gt;sample data&lt;/field&gt;&lt;field fid='7'&gt;sample data&lt;/field&gt;" + "&lt;field fid='8'&gt;sample data&lt;/field&gt;&lt;field fid='9'&gt;sample data&lt;/field&gt;" + "&lt;field fid='10'&gt;sample data&lt;/field&gt;&lt;field fid='12'&gt;sample data&lt;/field&gt;" + "&lt;field name='message' filename='testImage.jpg'&gt;" + testImageName + "&lt;/field&gt;&lt;/qdbapi&gt;"; DefaultHttpClient httpclient = new DefaultHttpClient(); String strURL = "https://www.quickbase.com/db/bgtc5pacu?act=API_AddRecord"; HttpPost httpPost = new HttpPost(strURL); httpPost.addHeader("Content-Type", "application/xml"); StringBuilder sb = new StringBuilder(); sb.append(tempXml); StringEntity entity = new StringEntity(sb.toString(), "UTF-8"); httpPost.setEntity(entity); HttpResponse res = httpclient.execute(httpPost); </code></pre>
java android
[1, 4]
1,503,065
1,503,066
redirection follow by post
<p>just wonder how those air ticket booking website redirect the user to the airline booking website and then fill up(i suppose doing POST) the required information so that the users will land on the booking page with origin/destination/date selected?</p> <p>Is the technique used is to open up new browser window and do a ajax POST from there?</p> <p>Thanks.</p>
javascript python
[3, 7]
3,818,995
3,818,996
Setting a listbox to a predefined value from generic list
<p>I have a listbox, I want to set some of the items in the listbox to be selected. These items are coming from a System.collections.generic list so in other words, I have a list of</p> <pre><code>ABC 5 DEF 6 PQR 9 </code></pre> <p>and a listbox that has around 100 items including <code>ABC, DEF</code> and <code>PQR</code>. I want to loop through the listbox and list and set these items as selected in my code behind.</p> <p>How can I achieve this?</p> <p>Any help will be appreciated.</p>
c# asp.net
[0, 9]
1,059,453
1,059,454
Sending mixed structured data over network
<p>As part of my first shot at network programming, I'm trying to figure out how to send a custom data structure over the internet. Specifically, the structure will have two images, plus a few bits of textual/numerical data to go with them. The server is written with PHP and the client (an Android app) is Java.</p> <p>After researching the subject, I've come away somewhat confused. It looks like encoding/decoding a MIME message is the most appropriate way, but while I found a PHP library to do the encoding, I can't find a free Java library or Android SDK feature for the other side. Is there something I've missed? Or is there a better way to do this?</p> <p>Also, at some point I may want to port this app to iOS, so whatever method is used should work there too.</p> <p>Thanks in advance for your help!</p>
java php android
[1, 2, 4]
3,610,304
3,610,305
Easy way to catch all unhandled exceptions in C#.NET
<p>I have a website built in C#.NET that tends to produce a fairly steady stream of SQL timeouts from various user controls and I want to easily pop some code in to catch all unhandled exceptions and send them to something that can log them and display a friendly message to the user.</p> <p>How do I, through minimal effort, catch all unhandled exceptions?</p> <p><a href="http://stackoverflow.com/questions/944/unhandled-exception-handler-in-net-11">this question</a> seems to say it's impossible, but that doesn't make sense to me (and it's about .NET 1.1 in windows apps): </p>
c# asp.net
[0, 9]
1,109,556
1,109,557
serialize/unserialize in jQuery
<p>Is there something like serialize/unserialize PHP functions in jQuery?</p> <p>These functions return a string representations of an array or an object which can than be decoded back into array/object.</p> <p><a href="http://sk2.php.net/serialize" rel="nofollow">http://sk2.php.net/serialize</a></p>
php javascript jquery
[2, 3, 5]
5,857,750
5,857,751
Building a large form, need advice
<p>I have to build a large form for users to fill out in order to apply for graduate study at the college I work for. There will be a large amount of information to collect (multiple addresses, personal information, business information, past school information, experience, etc...) and I want to know the best way to handle all this. I'm going to be using PHP and Javascript. </p> <p>Are there any helpers or pieces of frameworks that I can use to help with the building/validation of the form, something I can just pop into my existing project?</p> <p>Also would like any advice as far as keeping track of a large form and the resulting data.</p>
php javascript
[2, 3]
4,018,438
4,018,439
Image button OnClientClick() event issue in ASP.net using C#
<p>I am having one Web page(First window). In that page I am having one image button, Which is having OnClientClick event. In that event I call a javascript method as <code>OpenHelpWindow()</code> i.e. </p> <pre><code>OnClientClick ="OpenHelpWindow()" </code></pre> <p>Now whenever I clicked that image button the event in the javascript method<code>(OpenHelpWindow())</code> will get trigger and it will open the New help web window. Its working properly but the problem is, When I press Enter key then also the event will get fire and show me the help window.<br/><br/> Now I want to stop the second window (Help window) opening when the Enter key pressed. </p> <p>How can I resolve this problem?</p> <p>My Code for the first web window Image button is,</p> <h1>.aspx code</h1> <pre><code>. . &lt;asp:ImageButton ImageUrl="~/Images/help.png" runat="server" ID="ibtnHelp" AlternateText="Help" ToolTip="Help" OnClientClick="OpenHelpWindow()" /&gt; . . </code></pre> <h1>Javascript code for OpenHelpWindow() is</h1> <pre><code>function OpenHelpWindow() { var newWin = null; try { newWin = window.open("../Common/OpenHelpUrl.aspx"); newWin.focus(); return false; } finally { newWin = null; } } </code></pre>
c# javascript asp.net
[0, 3, 9]
4,744,802
4,744,803
Working with DOM after AJAX call
<p>I have this function:</p> <pre><code>$('body').on('click', '.kategorija_izbor ul a, .mali_oglas a[role=pretraga]', function(e){ var mgl_wrapper = $('.mali_oglasi_wrapper'), mgl = $(".mali_oglasi"), mgl_space = $(this).attr('href').replace(/\s+/g, '-').toLowerCase(); link = mgl_space + ' .mali_oglasi'; mgl.animate({'opacity' : 0}, 400, function(){ mgl_wrapper.load(link, function(){ mgl.animate({'opacity' : 1}, 400); }); }); e.preventDefault(); }); </code></pre> <p>It is working, but I would like to know is there another way to do it. It seems to me that this way is time consuming and resource inefficient. Every time page is clicked script is going through DOM and search for specific elements. Is there a way to store <strong>.kategorija_izbor ul a</strong> and .mali_oglas a[role=pretraga] (they are bout loaded via load function )?</p> <p><strong>EDIT I</strong></p> <p><strong>.kategorija_izbor ul a</strong> and .mali_oglas a[role=pretraga] are children of <strong>mgl_wrapper *( $('.mali_oglasi_wrapper'))</strong>, and they are dynamically created every time they are clicked.</p>
javascript jquery
[3, 5]
3,861,851
3,861,852
(js/jquery) Rotating an image in FF/Saf/Chrome without Canvas OR Zooming a canvas item
<p>I am working on a project where I need to rotate and image to the users' liking then allow them to zoom a bit in and out.</p> <p>Using jquery.rotate.1-1.js in IE everything works perfectly (how rare) as MS wrote their own rotation tool (progid:DXImageTransform) so the img is rotated and then kept as an image. However looking at the JS I see that if the browser is not IE then a canvas is rendered (i've never really used canvas) which means that once the canvas is drawn with the image rotated I cannot zoom in on the image because if I understand it correctly the canvas doesn't actually hold the information.</p> <p>I've also attempted CSS3 transforms with my non-IE browser and have everything rotating correctly however when I try and zoom it's using now non-existant div sizes.</p> <p>Are there any tools out there that allow rotation and then zooming on the client-side? OR Is there a way to rotate an img tag in FF/Chrome/Saf &amp; maintain the rotate image after?</p>
javascript jquery
[3, 5]
1,041,237
1,041,238
In Android project include another project
<p>I'm just starting my long way to Android programming and building app where I would like to use this library <a href="https://github.com/cfgxy/DevsmartLib-Android/tree/" rel="nofollow">https://github.com/cfgxy/DevsmartLib-Android/tree/</a></p> <p>This is another Android project, how should I include this in my project using Eclipse?</p>
java android
[1, 4]
3,557,264
3,557,265
WritableRaster in android
<p>I have following piece of code:</p> <pre><code>private static byte[] accessBytes(Bitmap image) // access the data bytes in the image { WritableRaster raster = image.getRaster(); DataBufferByte buffer = (DataBufferByte) raster.getDataBuffer(); return buffer.getData(); } // end of accessBytes() </code></pre> <p>I want to convert this code so that it will work in my android application, is there any way I can do that? I also have the working code in java, can i make a class library of this code and then import in the android? will this work? </p>
java android
[1, 4]
494,545
494,546
Get id of element and post in sql query?
<p>Hey, I am trying to get the id of an element and then post that id in a sql query like this:</p> <p>jQuery gets id of checkbox:</p> <pre><code>$(document).ready(function() { $(":checkbox").change(function(){ var id = $(this).attr('id'); $.post("index.php", { id: this.id, checked: this.checked }, function(data){ alert("Data Loaded: " + id); } ); //return false to insure the page doesn't refresh }); }); </code></pre> <p>Then I insert that into the php query, but it doesn't display anything on the page. What am I missing?</p> <pre><code> $query1 = "SELECT * FROM explore WHERE category IN ('".$_POST["id"]."') ORDER BY category LIMIT $start, $limit"; </code></pre>
php jquery
[2, 5]
1,602,585
1,602,586
Get raw data from Http Request?
<p>I want to save the raw, full data of an <code>HttpRequest</code>. At the moment I have this:</p> <pre><code>Request.ContentEncoding.GetString(Request.BinaryRead(int.MaxValue)); </code></pre> <p>But this only gets the body of the HttpRequest. I also want to get the headers. In the raw form, http requests are transfered as header fields followed by the body, so it should be possible to get the raw text representation of the whole request, but I can't work out how.</p>
c# asp.net
[0, 9]
4,377,692
4,377,693
Adding Quests to my game
<p>I've finally decided to add quests to my game. I'd like the quests to be individual to each other. Maybe later one, one having another quest completed before that one is accessed. Anyway.</p> <p>How do I go about this? I've thought about it a ton. I'm a PHP/Javascript/Mysqli guy. </p> <p>You talk to a NPC, if you pick the right "answers" they will start the quest. You do the tasks, you might have to talk to other NPCs. It all depends. How do i store the conversations and show them?</p> <p>Thanks.</p> <p><em><strong>EDIT</em></strong></p> <p>This is what I've "Done".</p> <pre><code>var people = []; people[1]=['name'=&gt;'Joe']; people[1]['questions'][1] = 'Why, hello there'; people[1]['questions'][1]['send'] = 1; people[1]['questions'][2] = 'My name is Joe, You seem to be new around here'; people[1]['questions'][2]['send'] = 2; people[1]['questions'][3] = 'Why certainly! How about I send you on a quest to help you. It will get you aquainted with Corgate'; people[1]['questions'][3]['send'] = makequest(1); people[1]['answers'][1] = array('Hello, who are you?'); people[1]['answers'][1]['send'] = 2; people[1]['answers'][2] = array("I'm not new! Good bye!",'Yes I am, Can you help me?'); people[1]['answers'][2]['send'][1] = 3; people[1]['answers'][2]['send'][2] = endthis(); </code></pre> <p>Very sloppy. yes. Basically, It starts with the question. Then "sends" to the answer with that Id. Then, based one the array of answers chosen, it then sends that to the corresponding question.</p>
php javascript
[2, 3]
5,818,337
5,818,338
Is it possible to use a variable value as part of another variables name?
<pre><code>var b = '1'; </code></pre> <p>How can I create a variable name using the contents of variable b? I am doing this in a each loop, so b will change.</p> <p>I am wanting the final product to be something like:</p> <pre><code>var trip1 = ''; </code></pre> <p>How would I accomplish something like that?</p> <pre><code>var trip + b = ''; var trip.b = ''; </code></pre>
javascript jquery
[3, 5]
3,242,196
3,242,197
Disable a form and all contained elements until an ajax query completes (or another solution to prevent multiple remote requests)
<p>I have a search form with inputs and selects, and when any input/select is changed i run some js and then make an ajax query with jquery. I want to stop the user from making further changes to the form while the request is in progress, as at the moment they can initiate several remote searches at once, effectively causing a race between the different searches.</p> <p>It seems like the best solution to this is to prevent the user from interacting with the form while waiting for the request to come back. At the moment i'm doing this in the dumbest way possible by hiding the form before making the ajax query and then showing it again on success/error. This solves the problem but looks horrible and isn't really acceptable. Is there another, better way to prevent interaction with the form? To make things more complicated, to allow nice-looking selects, the user actually interacts with spans which have js hooked up to them to tie them to the actual, hidden, selects. So, even though the spans aren't inputs, they are contained in the form and represent the actual interactive elements of the form.</p> <p>Grateful for any advice - max. Here's what i'm doing now:</p> <pre><code>function submitQuestionSearchForm(){ //bunch of irrelevant stuff var questionSearchForm = jQuery("#searchForm"); questionSearchForm.addClass("searching"); jQuery.ajax({ async: true, data: jQuery.param(questionSearchForm.serializeArray()), dataType: 'script', type: 'get', url: "/questions", success: function(msg){ //more irrelevant stuff questionSearchForm.removeClass("searching"); }, error: function(msg){ questionSearchForm.removeClass("searching"); } }); return true; } </code></pre> <p>where the 'searching' class currently has just {display: none}</p>
javascript jquery
[3, 5]
4,294,136
4,294,137
How to find all the id's associated with a particular class
<p>Using jquery how is it possible finding out all the id's associated with a given class?</p> <p>Any help??</p>
javascript jquery
[3, 5]
2,028,264
2,028,265
How to add action to the disabled elements via JQuery?
<p>Purpose: To make sure some elements couldn't be modified, I disabled some elements once the page was loaded. But if I double clicked the element, the element could be modifiable.</p> <p>Please see the below code.</p> <p>My version is jquery-1.5.min.js</p> <pre><code>function disableAccounts($column){ $column.find('.input_application').attr("disabled","true"); } </code></pre> <p>// this doesn't work since '.input_username' has been disabled.</p> <pre><code>function addEditUsername($column){ $column.find('.input_username').dblclick(function(){ $(this).removeAttr('disabled'); }); } </code></pre>
javascript jquery
[3, 5]
1,351,507
1,351,508
How can i remove columns which contains 0 using lambda expression
<p>I have a list which contains suppose 4 columns i want to remove columns which contains 0 from first row to last row. In this case i want to remove 2nd &amp; 4th column how can i achieve this using lambda expression c# 4.0</p> <pre><code>c1 c2 c3 c4 1 0 10 0 2 0 20 0 3 0 30 0 </code></pre> <p>o/p should be</p> <pre><code>c1 c2 1 10 2 20 3 30 </code></pre>
c# asp.net
[0, 9]
4,778,844
4,778,845
Python in java, is it possible
<p>I have a class that is written in Java.<br> Can it be used in Python so i dont have to rewrite it?</p>
java python
[1, 7]
4,116,394
4,116,395
Button used for redirecting, with a php function
<p>I would like to be able to redirect to a page with a button. I do not want to use the headers function. I want to be able to call some function inside a php file. My function for redirecting looks something like this. Basicly the first part set what page to load in a static variable and then executes a reload of page which then executes the load function in some other initialization function.</p> <p>This can be modified, its just how i taught of doing it.</p> <pre><code>public function WSP_Redirect($site) { self::$_mainsite = $site; //This is one option //$this-&gt;LoadPage(); // This is another option echo '&lt;script&gt;window.location.reload()&lt;/script&gt;'; } </code></pre> <p>The in another file i would, say press a button, and the button would then call this function(via post or whatever) to redirect to some page...</p> <p>To me its not important how it is done but it is important that it uses the redirect function.</p> <p>Any suggestions would be nice, I did check out the ajax and jquery but nothing i have tryed has worked so far :(</p>
php javascript jquery
[2, 3, 5]
1,281,553
1,281,554
Determine if element is a text node using jQuery
<p>Given a jQuery element, how can I determine if the sibling on the right is a text node and not another element? In PHP, you would compare the <code>nodeType</code> to <code>#text</code> - what's the equivalent in this case?</p> <pre><code>window.jQuery('body').find('a').each(function (i) { if(window.jQuery(this).next() == '?'){ } }); </code></pre> <p>I am trying to work out what I can put in the condition part.</p> <h2>Update</h2> <pre><code> if(window.jQuery(this).next().length != 0){ alert(window.jQuery(this).next().get(0).nodeType); if(window.jQuery(this).next().get(0).nodeType == 3){ alert('right has text'); } </code></pre> <p>For some reason, all my tests keep returning a 1 rather than a 3 to indicate text nodes!</p>
javascript jquery
[3, 5]
2,318,806
2,318,807
How to compare Time in java/android (given input in strings)?
<p>I have two strings which are used to store time in the format <strong>hh:mm</strong>.I want to the compare these two to know which time is greater.Which is the easiest way to go about this?</p>
java android
[1, 4]
4,543,130
4,543,131
How to determine which enemy is hit and destroy it alone
<p><a href="http://jsfiddle.net/5DB6K/" rel="nofollow">http://jsfiddle.net/5DB6K/</a></p> <p>I have this game being made where you shoot enemies from the sides of the screen. I've got the bullets moving and being removed when they reach the end of the screen (if they didn't hit any enemy) and removing the enemy when they collide with it. </p> <pre><code>//------------collision----------------// if(shot === true){ bulletY = $('.bullet').position().top + 2; bulletX = $('.bullet').position().left + 2; $('.enemy').each(function(){ if($('.enemy').hasClass('smallEnemy')){ enemyY = $(this).position().top + 7; enemyX = $(this).position().left + 7; if(Math.abs(bulletY - enemyY) &lt;= 9 &amp;&amp; Math.abs(bulletX - enemyX) &lt;=9){ $(this).remove(); score = score + 40; bulletDestroy(); } } }); } </code></pre> <p>However, the bullet destroys every enemy if the collision check is right which isn't what I want. I want to check if the enemy has the class of either smallEnemy, medEnemy, or lrgEnemy and then do the collision check which is what I thought I had but it doesn't seem to work. </p> <p>Also, the game starts to lag the more and more time goes on. Would anyone know the reason for that?</p>
javascript jquery
[3, 5]
5,614,876
5,614,877
How to prevent page lagging/hanging everytime I render a part of the page using innerHTML or jquery html()
<p>I have a webapp, and I'm using jquery to request from a server using $.ajax. Now everytime a get the response and displaying the response using jquery .html(). My browser hangs or lagging. So when I type in the textbox, my ajax will request a data from the server. Then the response will render in the browser but my typing in the searchbox will hang. So basically my problem here is in the diplaying of the response.</p> <p>Is there any way that I can render the response asynchronously, so that I can still type in my search box without hanging or lagging?</p> <p>Please advise.</p> <p>Many thanks.</p>
c# javascript asp.net
[0, 3, 9]
2,860,615
2,860,616
How to handle Json data that is sometimes return in an array of objects and sometimes just an object?
<p>I am getting some Json from the server that I loop through to dynamically build a table in the dom. When there are more than one objects the data is returned as an array of objects like this:</p> <pre><code>{ "ProductList": { "Products": [{ "ProductID": "1", "Name": "ProdName"}, { "ProductID": "2", "Name": "ProdName2"}] } } </code></pre> <p>however when there is only one object it is returned simply as an object and not an array like this:</p> <pre><code>{ "ProductList": { "Products": { "ProductID": "3", "Name": "ProdName3" } } } </code></pre> <p>So what I have been doing is checking if it is an array like this:</p> <pre><code>if ($.isArray(productDetails.ProductList.Products) === true) { for (i = 0; i &lt; productDetails.ProductList.Products.length; i++) { //Create the dom elements by accessing the object properties with [i] //ie. productDetails.ProductList.Products[i].ProductsID } } else { //Create the dom elements by accessing the object properties w/o [i] //ie. productDetails.ProductList.Products.ProductsID } </code></pre> <p>It works but I have a lot of code that is exactly the same except for the way the object properties are accessed and whenever I change one i need to remember to change the other or I will have problems. On the client side is their a better way to handle this?</p>
javascript jquery
[3, 5]
2,655,568
2,655,569
Why does the 'as' keyword work while the () cast does not
<pre><code>//always works, returning a valid object into _page _page = _httpContext.Handler as System.Web.UI.Page; //Fails throwing the exception : Unable to cast object of type 'System.Web.DefaultHttpHandler' to type 'System.Web.UI.Page' _page = (System.Web.UI.Page)_httpContext.Handler; </code></pre> <p>I would like to know why this happens?</p> <p>EDIT:</p> <pre><code> //Fixes the problem if(_httpContext.Handler is System.Web.UI.Page) _page = (System.Web.UI.Page)_httpContext.Handler; </code></pre> <p>If i debug the 'as' keyword statement, i never get a null reference (object always assigned properly). However the () cast creates exceptions unless it has the if statment. </p> <p>EDIT: After about 15 runs through the class i was able to get a null. Seems like it took more runs to find a null compared to how fast the () cast would catch an exception.</p> <p>OLD: When there is a debug at the 'as' statement every time the class runs the break point hits - never null.</p> <p>When tthere is a debug in the '()' statement within the if, every time the break point hits the cast works properly. Werid</p>
c# asp.net
[0, 9]
4,477,346
4,477,347
Dynamically generated div isn't attaching my event listener
<p>I made a modal plugin but for some reason one of the divs that I generate isn't getting a click event listener that I am attaching to it.</p> <p><code>&lt;a class="close" id="js-close-modal"&gt;&lt;/a&gt;</code> is what I'm referring to. I'm using jQuery's on, but that doesn't seem to help.</p> <pre><code> var $caller = $(this); var $modal = $('.modal'); $caller.on('click', $caller, function(e) { e.stopPropagation(); $('#js-close-modal').on('click', $('#js-close-modal'), function(e) { $('.modal_outer').remove(); $('#modal_page_cover').remove(); }); var modal_outer = $('&lt;div /&gt;'); modal_outer.addClass('modal_outer'); modal_outer.css({ top: ($(window).scrollTop()) + 'px' }); var $div = $('&lt;div /&gt;'); var modal = $('&lt;div /&gt;'); modal.addClass('modal'); var modal_inner = $('&lt;div /&gt;'); modal_inner.addClass('modal_inner'); modal.append(modal_inner); modal_outer.append(modal); var body = $('body'); body.append(modal_outer).hide().fadeIn(100); modal_inner.text('yo'); var close = $('&lt;a /&gt;'); close.addClass('close').attr('id', 'js-close-modal'); close.insertBefore(modal_inner); var page_cover = $('&lt;div /&gt;'); page_cover.attr('id', 'modal_page_cover'); body.prepend(page_cover); }); </code></pre> <p>Demo: <a href="http://jsfiddle.net/someprimetime/P5B4q/19/" rel="nofollow">JSFiddle</a></p> <p>Any idea why?</p>
javascript jquery
[3, 5]
2,451,971
2,451,972
Change Javascript script execution context
<p>I wanted to change the JavaScript Execution context from parent window to child window. The different library's inline script, loaded in parent window should be made available to child window execution context. I am able to load my script objects, functions to the child window context but the third party library's is not possible .</p> <p>This is what i am doing to load my script's</p> <pre><code>// In parent window function JJ(){}; JJ.prototype.param = {"k":"v"}; function CNF(){ return new JJ(); }; </code></pre> <p><hr /></p> <pre><code>// In child Window var opener = window.opener; var CHILD_CNF = opener.CNF(); alert(CHILD_CNF.param.k); </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
5,995,476
5,995,477
How to get the Id of corresponding th of td in a table
<p>I have a scenario like</p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th id ="myid1"&gt;header1&lt;/th&gt; &lt;th id ="myid2"&gt;headre "2&lt;/th&gt; &lt;th id ="myid3"&gt;header3&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tr&gt; &lt;td&gt;v1&lt;/td&gt; &lt;td&gt;v2&lt;/td&gt; &lt;td&gt;v3&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;v10&lt;/td&gt; &lt;td&gt;v11&lt;/td&gt; &lt;td&gt;v12&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;v20&lt;/td&gt; &lt;td&gt;v21&lt;/td&gt; &lt;td&gt;v22&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;v30&lt;/td&gt; &lt;td&gt;v31&lt;/td&gt; &lt;td&gt;v32&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>there can be thousands of row .</p> <p>i need to get the id of the td on which that perticulat td belongs to.</p> <p>for example . if i click the third td of third row .. i should get the id of corresponding th , here it is myid3 (here its hard coded but it will set based on the value from server side)</p> <pre><code>$('tbody td').live('click', function() { var idOfTh = ?? }); </code></pre>
javascript jquery
[3, 5]
3,826,904
3,826,905
Object reference not set to an instance of an object Message with String Array
<p>I have the following code:</p> <pre><code>protected void btnSave_Click(object sender, EventArgs e) { StarBusModel.BookingDetail1 objBooking = new StarBusModel.BookingDetail1(); objBooking.TourID = tourID; objBooking.Name = txtName.Text; objBooking.Phone = txtPhone.Text; objBooking.Amount = Convert.ToDecimal(Request.Form[txtAmount.ClientID]); string [] seats = Request.Form[txtSeatNo.ClientID].Split(new char[] {','}); for (int i = 0; i &lt; seats.Length; i++) objBooking.SeatDetails.Add(new StarBusModel.SeatDetail1() {SeatID = Convert.ToInt32(seats[i])}); objEntities.BookingDetail1.AddObject(objBooking); objEntities.SaveChanges(); BindSeats(); } </code></pre> <p>I get the error </p> <p><code>System.NullReferenceException: Object reference not set to an instance of an object.</code></p> <p>at the following code:</p> <pre><code>string [] seats = Request.Form[txtSeatNo.ClientID].Split(new char[] {','}); </code></pre> <p>Please advise where I am wrong. I searched for various answers but cannot pinpoint where I am wrong. </p>
c# asp.net
[0, 9]
4,829,363
4,829,364
How to add additional functionality into existing apk file
<p>I have an apk file but i have to add some additional functionalities to the existing apk file. Is this possible?</p>
java android
[1, 4]
1,181,623
1,181,624
Java, what do you call this? and why )};
<p>I am going through Hello Android (Android PDF/tutorial) and have now seen this syntax a couple of times. Can someone please explain to me what Java syntax is used when run Runnable is defined? </p> <pre><code>private class AndroidBridge { public void callAndroid(final String arg) { // must be final handler.post(new Runnable() { public void run() { Log.d(TAG, "callAndroid(" + arg + ")" ); textView.setText(arg); } ... </code></pre> <p>Is the code defining a Runnable object and overriding it's run method?</p>
java android
[1, 4]
4,729,005
4,729,006
Android : Searching items using there barcodes in ebay
<p>I have a project idea for my college project to develop an android application which can take images of the bar codes of various electronic equipments like cameras laptops and then to read models and brands of them using that bar codes and then to search for that model and brand in Ebay to point the user to relevant web pages. I want to know that is it possible to do this project ?</p> <p>Thanks! </p>
java android
[1, 4]
2,523,182
2,523,183
if element in array in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/237104/array-containsobj-in-javascript">array.contains(obj) in JavaScript</a> </p> </blockquote> <p>Coming from python, I'm used to the convenient <code>in</code> keyword:</p> <pre><code>if "bunch" in ["a", "bunch", "of", "stuff"]: print "Party" </code></pre> <p>The best way I could find to emulate this use of a list display in javascript is</p> <pre><code>if(["a", "bunch", "of", "stuff"].indexOf("bunch") != -1){ console.log("Party"); } </code></pre> <p>Is there a more commonly used javascript idiom for this, or am I spoiled by python's clean semantics?</p> <p>EDIT: To be clear, I'm not asking only whether this is possible in JS, but what is the most commonly used idiom.</p>
javascript python
[3, 7]
459,642
459,643
How to fade in appended HTML with jQuery?
<p>I have the following line of code:</p> <pre><code>var html = "..."; $("#id_name").append(html).fadeIn("slow"); </code></pre> <p>This causes the entire div #id_name to fade in. I want <em>only</em> the <em>appended HTML</em> to fade in. How can this be accomplished?</p>
javascript jquery
[3, 5]
423,456
423,457
Is there ANY way a website visitor can see the contents of an aspx.cs file? Just curious to know what all loop holes, breaks or whatever are there.
<p>Is there ANY way a website visitor can see the contents of an aspx.cs file? Just curious to know what all loop holes, breaks or whatever are there.</p>
c# asp.net
[0, 9]
5,346,177
5,346,178
Exit Pop-up window that appears when the user tries to close the tabs or browser or press back button
<p>I need an Exit Pop window that appears when the user tries to exit a page like: <a href="http://www.mydomain.com/popup.php" rel="nofollow">http://www.mydomain.com/popup.php</a> if they try and back out of the page or close it, they should get the Exit pop up.Pop up box must contain with an image. If that case I have used this code segment.</p> <pre><code>window.onbeforeunload = function(){ return 'Are you sure you want to leave?'; }; </code></pre> <p>But I want to add an image in pop up box. Is there a way to do that?</p>
javascript jquery
[3, 5]
4,914,106
4,914,107
Is there a online/offline tool to convert the values of given numbers in proportion and in percentage?
<p>For example</p> <p>There should be field for 2 values</p> <p><strong>31 X 12</strong></p> <p>now if change <strong>31</strong> to <strong>30</strong> then second field should change accordingly </p> <p>and 2nd functionality should give values in <strong>%</strong></p> <p>so if <strong>31 X 12</strong></p> <p>and if put <strong>50%</strong> in another field and press submit it should give the <strong>50%</strong> of <strong>31 X 12</strong> > <strong>15.5 X 6</strong></p> <p>I given above values just for example to explain. Actually values can be any number.</p>
javascript jquery
[3, 5]
5,900,435
5,900,436
What's the difference of keyboard Single Byte Character Code and keyboard Double Byte Character Code
<p>I use jquery code:</p> <pre><code>$.ui.keyCode.COMMA </code></pre> <p>only can Capture Single Byte Character input,How can Capture Double Byte Character also. who can help me ? thanks</p>
javascript jquery
[3, 5]
2,347,604
2,347,605
How do you convert a folder to zip file?
<p>What is the best way to convert a whole folder (including it's contents) into a <code>.zip</code> file?</p>
c# asp.net
[0, 9]
5,908,155
5,908,156
JavaScript tutorials for Kids
<p>Could you recommend fun resources to teach JavaScript/jQuery to kids (10-12 yo)? I am looking for the next step after "Hello World".</p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,867,160
1,867,161
.slideDown() Doesn't Seem To Work
<p>JQuery's <a href="http://api.jquery.com/slideUp/" rel="nofollow"><b>.slideUp()</b></a> doesn't work after <a href="http://api.jquery.com/append/" rel="nofollow"><b>.append()</b></a> is used to append value of textarea to the div. <br/><br/><b>HTML:</b></p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="cont"&gt; &lt;textarea id="txt"&gt;&lt;/textarea&gt; &lt;button onclick="click()"&gt;Click&lt;/button&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><br/> <b>JavaScript:</b></p> <pre><code>function click(){ var txt = $('#txt').val(); var html = document.createElement('div'); $(html).hide().html(txt); $('#cont').append(html); $(html).slideUp(500); } </code></pre> <p>I can't figure out what the problem is because when I used <b>.show()</b> instead of <b>.slideUp()</b> it works fine.</p>
javascript jquery
[3, 5]
3,648,508
3,648,509
prevent Page refresh after pop-up
<p>How can i prevent page refresh when the user clicks on the <code>OK</code> button of the <code>javascript alert</code> window.</p> <pre><code> &lt;asp:Button ID="btnComplete" runat="server" Text="Complete" OnClientClick ="verify_complete()" /&gt; function verify_complete() { if (!chkCmnts()) { alert("Categories/comments are required. "); return false; } } </code></pre> <p>Thanks</p> <p>BB</p>
javascript asp.net
[3, 9]
1,087,049
1,087,050
Orbit Object Around Center Point
<p>I am attempting to orbit an object around a center point, much like the sun and our planets. However I am having no luck at all. Any help would be really great. Thanks. I'm writing in luna and I dont think there is a category for that here, but this probably is just general code. But if its in the wrong place, my apologies.</p> <pre><code>local function animate(event) local rads = degrees * (Math.PI / 180); ballOne.x = 20 * Math.cos(rad); ballOne.y = 20 * Math.sin(rad); degrees = degrees + 1 end Runtime:addEventListener("enterFrame", animate) </code></pre>
iphone android
[8, 4]
1,226,609
1,226,610
Live listener on other's resizable div width
<p>Lets say we have one div:</p> <pre><code>&lt;div id="left"&gt;Some content&lt;/div&gt; </code></pre> <p>Div with id "left" is resizable div (it can be re sized with mouse in the browser) and when re-sized, it receives CSS style for current width like this:</p> <pre><code>&lt;div id="left" style="width: 289px;"&gt;Some content&lt;/div&gt; </code></pre> <p>What I want to achieve is to read width value on live event (or something like that) of #left div and based on that value add some conditions (it must be live event, not to read it on click or on mouse release click etc.) ... Thanks for your help in advance!</p> <p><strong>SOLUTION:</strong></p> <p>You can use your custom bind function to achieve this:</p> <pre><code>(function(){ var interval; jQuery.event.special.liveresize = { setup: function(){ var self = this, $this = $(this), $originalContent = $this.width(); interval = setInterval(function(){ if($originalContent != $this.width()) { $originalContent = $this.width(); jQuery.event.handle.call(self, {type:'liveresize'}); } },100); }, teardown: function(){ clearInterval(interval); } }; })(); </code></pre> <p>And then just call it:</p> <pre><code>$(function() { $('#left').bind('liveresize', function() { var actual_width = $(this).width(); if(actual_width &lt; 930) { $('#left').addClass('ng-av-small-left'); $('#left').addClass('ng-av-small-right'); } else { $('#left div.block div.left').removeClass().addClass('left'); $('#left div.block div.right').removeClass().addClass('right'); } }); }); </code></pre>
javascript jquery
[3, 5]
3,338,839
3,338,840
wp_register_script Question
<p>I need to add the following JS to the head, but I don't know how to add the "data-cfasync="false" " by using "wp_register_script" or "wp_enqueue_scripts". Please help!!</p> <pre><code>&lt;script data-cfasync="false" type="text/javascript" src="http://use.typekit.com/YOUR-KIT-ID.js"&gt;&lt;/script&gt; &lt;script data-cfasync="false" type="text/javascript"&gt;try{Typekit.load();}catch(e){}&lt;/script&gt; </code></pre>
jquery javascript
[5, 3]
5,351,725
5,351,726
Javascript array with default values (equivalent of Python's defaultdict)?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11503666/set-undefined-javascript-property-before-read">Set undefined javascript property before read</a> </p> </blockquote> <p>Is there an equivalent of <a href="http://docs.python.org/library/collections.html#collections.defaultdict" rel="nofollow">Python's defaultdict</a> in Javascript? This would be a Javascript array where the value returned for a missing key is definable. Something like:</p> <pre><code>var a = defaultArray("0"); console.log(a['dog']); // would print 0 </code></pre> <p>If not, how would you implement it?</p>
javascript python
[3, 7]
3,059,872
3,059,873
what is the difference between CharSequence[] and a String[]?
<p>What is the difference between <code>CharSequence[]</code> and <code>String[]</code>?</p>
java android
[1, 4]
2,452,260
2,452,261
Can't set HTML using jQuery
<p>For some reason, my script isn't writing out the text after I remove the textbox element. Am I incorrectly using the <code>.html</code> or is something else wrong?</p> <pre><code> $('.time').click(function () { var valueOnClick = $(this).html(); $(this).empty(); $(this).append("&lt;input type='text' class='input timebox' /&gt;"); $('.timebox').val(valueOnClick); $('.timebox').focus(); $('.timebox').blur(function () { var newValue = $(this).val(); var dataToPost = { timeValue: newValue }; $(this).remove('.timebox'); if (valueOnClick != newValue) { $.ajax({ type: "POST", url: "Test", data: dataToPost, success: function (msg) { alert(msg); $(this).html("88"); } }); } else { // there is no need to send // an ajax call if the number // did not change alert("else"); $(this).html("88"); } }); }); </code></pre> <p>OK, thanks to the comments, I figured out I was referencing the wrong thing. The solution for me was to change the blur function as follows:</p> <pre><code> $('.timebox').blur(function () { var newValue = $(this).val(); var dataToPost = { timeValue: newValue }; if (valueOnClick != newValue) { $.ajax({ type: "POST", url: "Test", data: dataToPost, success: function (msg) { } }); } else { // there is no need to send // an ajax call if the number // did not change } $(this).parent().html("8"); $(this).remove('.timebox'); }); </code></pre>
javascript jquery
[3, 5]
1,903,993
1,903,994
Get link name in javascript
<p>Example</p> <pre><code>&lt;a href="example.html"&gt;Example Name&lt;/a&gt; </code></pre> <p>I would like to get "Example Name"</p> <p>I know I can do this with regex, but I'm looking for a simpler, faster approach. The closest I came was with Jquery using the <code>.attr("href")</code> attribute. I tried putting <code>.attr("title")</code>, but that doesn't work since I technically don't have a title there. </p>
javascript jquery
[3, 5]
4,807,181
4,807,182
Javascript cookies vs php cookies
<p>Is there a difference between javascript cookies and php cookies?</p>
php javascript
[2, 3]
3,164,587
3,164,588
How can I target an element's 'parent'
<p>I have some <code>&lt;TD&gt;s</code> without unique names. Inside them there are spans with unique classnames so I have no problem targetting the spans. How can I target the parent <code>&lt;td&gt;</code> so I can change its class?</p> <p>I want to do something like <code>$(".classname").parent("TD").className="newClassclassname"</code>.</p>
javascript jquery
[3, 5]
3,022,479
3,022,480
echofon's website like Logo's Hover Effect
<h1>What I Want</h1> <p>First, Go here -> <a href="http://www.echofon.com/twitter/windows/" rel="nofollow">http://www.echofon.com/twitter/windows/</a> and then, hover your mouse over the Echofon logo on the top bar ( top-left corner ). I want to achieve the same thing.</p> <h1>What I am doing</h1> <p>I have two images -> logo1.png and logo2.png. When a user hovers over the img tag with src:logo1.png, the current logo should fade out and the logo2.png should fade in just like the echofon logo. I tried to do it myself and the code is given below:</p> <pre><code>$(document).ready(function(){ $(".mainlogo") .mouseover(function() { $(this).fadeOut('slow',function(){ $(this).attr("src", "/CSS/logo2.png"); $(this).fadeIn(); }); }) .mouseout(function() { $(this).fadeOut('slow',function(){ $(this).attr("src", "/CSS/logo1.png"); $(this).fadeIn(); }); }); }); </code></pre> <h1>The Problem with the Code</h1> <p>Yes, the script is working, but the problem is that the timing is wrong. on hover, logo1.png completely fades out leaving behind a blank space and then logo2.png appears. But, I want the same effect as echofon logo. Please Help.</p>
javascript jquery
[3, 5]
532,988
532,989
Events triggered by dynamically generated element are not captured by event handler
<p>I have a <code>&lt;div&gt;</code> with <code>id="modal"</code> generated dynamically with the jQuery <code>load()</code> method:</p> <pre><code>$('#modal').load('handlers/word.edit.php'); </code></pre> <p><code>word.edit.php</code> contains a few input element, which are loaded into a modal <code>&lt;div&gt;</code>.</p> <p>Using jQuery's <code>keyup</code> method I can capture the input values after an event fires, but when the elements are added dynamically to the modal div, the event no llonger fires when the user enters their text.</p> <p>Which jQuery method supports handling events triggered by dynamically created elements?</p> <p>The code for creating the new input elements is:</p> <pre><code>$('#add').click(function() { $('&lt;input id="'+i+'" type="text" name="translations' + i + '" /&gt;') .appendTo('#modal'); </code></pre> <p>The code for capturing the user's values is:</p> <pre><code>$('input').keyup(function() { handler = $(this).val(); name = $(this).attr('name'); </code></pre> <p>This second code block seems to work for the original elements, but it is not fired by the new dynamically generated elements.</p>
php javascript jquery
[2, 3, 5]
3,148,495
3,148,496
use of .size() and don't work in my project?
<p>Did you can help me that why don't work following code in my project?<br> My project: <a href="http://www.binboy.gigfa.com/admin/accommodation/show" rel="nofollow">see this link</a> -> please go to select box or input box and select or typed value.</p> <pre><code>var length_pa = $('#pagination a').size(); if(length_pa &gt;= 16){ $('#prev_pag, #next_pag').show(); $('#pagination').css('float','left') }else{ $('#prev_pag, #next_pag').hide(); } if(length_pa == 0){ alert('0000000000') $('#hesar_number').hide();//.css('display','none'); } </code></pre> <p><strong>EDITE:</strong> Sorry, my mistake in typing the code here. Now What is cause problem?</p>
javascript jquery
[3, 5]
2,014,047
2,014,048
File upload progress bar: is flash-based the only way possible
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/653063/upload-progress-using-pure-php-ajax">Upload progress using pure PHP/AJAX?</a> </p> </blockquote> <p>I'm trying to have a file upload input field in my form and to have a status bar that shows upload progress as a percent and kb of the file. I keep seeing a lot of flash-based uploaders like swfupload. What non-flash alternatives are there that depend on js/jquery (no swf)</p>
php javascript jquery
[2, 3, 5]
2,847,208
2,847,209
Asp.Net, accessing variables from previous page a good approach?
<p>While redirecting from page to page generally i used to pass values as querystring but as you know query string is not a good approach as there are many security concerns and more over its having a maximum size is of 256 Bytes or ie length 2048 characters. So is it a good approach to access variables by setting previous page ie <code>"&lt;%@ PreviousPageType VirtualPath="" %&gt;"</code> and accessing previous page items</p> <p>Please let me know, is there any other way for passing variables other than <code>Sessions</code> and is using Previous page concept a Good Approach? </p>
c# asp.net
[0, 9]
3,170,427
3,170,428
jquery $.each gives me an object that does not have hasClass method
<p>I'm trying to iterate over a collection of items with the class <code>required</code>. I think I must be using the <code>$.each</code> function incorrectly.</p> <pre><code>function required(address) { //object to hold elements not passing validation tests var pass = true; $('.required').each(function(index, elem){ console.log(elem); //check if it has the class indicating it is an email if (elem.hasClass('re')) { var validEmail = validateEmail(address.email); if (!validEmail){ $(this).addClass('nv'); } } }); } </code></pre> <p>I see that the element in the console is <code>&lt;input type=​"text" id=​"name_input" class=​"pr required"&gt;​</code></p> <p>And then the error <code>Uncaught TypeError: Object #&lt;HTMLInputElement&gt; has no method 'hasClass'</code></p> <p>How can that object not have the hasClass method?</p>
javascript jquery
[3, 5]
1,341,074
1,341,075
ArrayList binds data from class in alphabetically increasing order in android
<p>I am getting a list of data from an ArrayListlstarticle, where GRN_LIST is a class which i have made having many values where i used get and set property of a class to bind the array list data inside lstarticle of arraylist..</p> <p>I am having number of data in sqlite database table where through cursor i get the count and using hashmaptemp = new Hashmap ,i bind the lstarticle data of the class. but i am getting in the lstarticle is all the data of class GRN_ARTICLE comes in alphabetically increasing order, which is not the order i want or i have inserted data from hashmap. how to resolve this please kindly let me know.. Ravi Kabra Thank you..</p>
java android
[1, 4]
948,662
948,663
Android launching intents for one page on a site
<p>I've built a little mobile web app for the town I live in which aggregates a lot of info and makes it readable. Lately, on my android phone browser, when I go to a certain page it asks me do I want to open it with Browser or MX Android Player. I've looked at the request headers in Chrome and I can't find anything wrong with it. I've had someone test this on an iphone and the issue doesn't happen. Any ideas? </p> <p>The site in question is <a href="http://sligo.me" rel="nofollow">http://sligo.me</a></p> <p>The page throwing errors is <a href="http://sligo.me/Events" rel="nofollow">http://sligo.me/Events</a>. </p>
php android
[2, 4]
2,493,012
2,493,013
Is jQuery always the answer?
<p>I've come across a couple questions, such as <a href="http://stackoverflow.com/questions/432144/cross-browser-ajax-function-to-dynamically-load-html">this one</a>, and I really have to wonder why "Use jQuery" seems to be the answer when somebody asks how to do something in JavaScript. I understand that jQuery can save you a lot of time, and can help you out a lot, especially when you are doing a lot of fancy JavaScript in your site. However, in instances like this, and in many other instances, it seems like it's just jumping around the problem instead of answering the question.</p> <p>I also feel like this builds too much dependency into libraries. I've seen way too many developers that simply rely too much on libraries, and if they encounter a situation where they didn't have the library, they would be completely unable to function. I feel like there are already enough developers who don't know JavaScript, without just telling everybody to not learn JavaScript, and use jQuery.</p> <p>So, just to reiterate the question. Do you think there's too much of a tendency to use jQuery, for small pieces of JavaScript, when most of the functionality of jQuery isn't being used. Should developers be fluent in the use of bare JavaScript so they don't get too dependent on using libraries?</p> <p>[Additional related conversation topic]</p> <p>Does the existence of jQuery give too much slack to web browser developers who write the JavaScript engines? If we just have workarounds to cover all the inconsistencies in JavaScript, what pressure is there on browser makers to ensure that their JavaScript library works as it should. I feel like this extrapolates the same problem discussed in <a href="http://blog.stackoverflow.com/2009/01/podcast-36/" rel="nofollow">SO Podcast #36</a> of "be conservative in what you send, liberal in what you accept". By being so liberal with bad JavaScript engines, and using a common library to work around the flaws, we are promoting their use, and extending the problem.</p>
javascript jquery
[3, 5]
2,644,768
2,644,769
How a Dialog window can modify JS in the parent window
<p>I have a site that opens a dialog. In that dialog I want to be able to modify a JS value in the parent window. The sites are at the same domain.</p> <p>in the parent I can do:</p> <pre><code>currentUserModel.guest(false) </code></pre> <p>In the dialog, how can I do currentUserModel.guest(false)?</p> <p>Right now if I try I get:</p> <pre><code>Uncaught ReferenceError: currentUserModel is not defined </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
830,877
830,878
Open a url, in jquery php
<p>when I click on "Click Here" then a page must open inside </p> <pre><code>&lt;script....&gt; $('yahoo').html('&lt;a href=desc.php&gt;'); &lt;/script&gt; &lt;div id='yahoo'&gt;&lt;/div&gt; &lt;div id='clickhere'&gt;Click here&lt;/div&gt; </code></pre> <p>Thanks Dave</p>
php jquery
[2, 5]
4,921,263
4,921,264
How to append <script> that will be executed?
<p>Tried <a href="http://jsfiddle.net/kxALH/2/" rel="nofollow">this</a> :</p> <pre><code>&lt;a href="#" id="showAlert"&gt;Click me&lt;/a&gt; &lt;div id="pasteContent"&gt;&lt;/div&gt; ​ var elemFunc = '&lt;script&gt;alert("myString");&lt;/script&gt;'; $("#showAlert").click(function () { $("#pasteContent").html(elemFunc); }); ​ </code></pre> <p>What I'd like to do is to append the string alert(myString); (which is a script) that must be executed... how can I do? Is it not correct?</p>
javascript jquery
[3, 5]
5,931,178
5,931,179
How to change attribute of surrounding div/parent effectively?
<p>I have a table with some radiobuttons in it. When i click on a radiobutton, i want to update two of the sorrounding containers ID attribute (a div and a table). The problem is, i need to go 4 and 6 levels up, and the only way i know how to do this is parent().parent().parent().parent() etc. I am looking for a better solution, and was hoping someone could point me in the right direction. You can see an image of how the "parent-child" tree is here:</p> <p><a href="http://imageshack.us/photo/my-images/834/imgkz.png/" rel="nofollow">http://imageshack.us/photo/my-images/834/imgkz.png/</a></p> <p>I already have a clickhandler etc set up.</p> <p>Basicly i need to check if the table's id attribute is "answeredTable", if not i need to change it. Also i need to check if the div two levels up from the table is "answered", if not, i need to change that too.</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,800,918
5,800,919
How to add contacts directly to a group without creating an account?
<p>I have this contacts that needs to be imported directly to a particular group that i created in which AFAIK that adding of contacts in an Account ,in the api seems to be broken(can't add other fields) so i implemented my own Activity to add accounts.</p> <p>how do i add them directly to a group? </p>
java android
[1, 4]
3,497,830
3,497,831
Can't run my Android application on my phone
<p>So I have started to create some android applications for my personal phone.</p> <p>I transfer the apk to my phone, install and run it.<br> This have worked a couple of times with my current application. But now I can only install the application but not run it...<br> I have created 1-2 other applications after this, and they ran. But this one do not.</p> <p>My application got an SQLite DB, some xml layouts, I have added some stuff to the manifest, and got a few java classes.</p> <p>It runs perfect in the emulator.</p> <p>Do anyone have a possible sollution to what is wrong or what else to try?</p>
java android
[1, 4]
3,373,911
3,373,912
In C#, what is analogous to the CHAR_BIT from C++? Fast Abs
<p>Does C# have something analogous to C++'s <a href="http://tigcc.ticalc.org/doc/limits.html#CHAR_BIT" rel="nofollow">CHAR_BIT</a>?</p> <p><strong>Update:</strong><br> Basically, I'm trying to compute abs without branching, here is the C++ version:</p> <pre><code>// Compute the integer absolute value (abs) without branching int v; // we want to find the absolute value of v unsigned int r; // the result goes here int const mask = v &gt;&gt; sizeof(int) * CHAR_BIT - 1; r = (v ^ mask) - mask; </code></pre> <p>Here is my C# version:</p> <pre><code>private int Abs(int value) { int mask = value &gt;&gt; sizeof(int) * 8 - 1; return ((value ^ mask) - mask); } </code></pre> <p>Strangely, this also works:</p> <pre><code>private int Abs(int value) { int mask = value &gt;&gt; sizeof(int) * sizeof(byte) - 1; return ((value ^ mask) - mask); } </code></pre>
c# c++
[0, 6]
5,040,020
5,040,021
asp.net confirm delete action conditionally
<p>In a Asp.net page I have a grid of departments that is displayed with checkboxes that can be checked to delete departments. If the selected record(department) has child records (Employees) I need to confirm the delete - otherwise I will delete the records without confirmation. What is the standard and most elegant way to perform this thanks</p>
jquery asp.net
[5, 9]
812,517
812,518
Error while taking SUM() of column in datatable
<pre><code>DataTable dtStock = new DataTable(); DataColumn dcTotalCases = new DataColumn("TotalCases"); dcTotalCases.DataType = System.Type.GetType("System.Int32"); dcTotalCases.ReadOnly = false; dtStock.Columns.Add(dcTotalCases); </code></pre> <p>Method 1</p> <pre><code>int sum = Convert.ToInt32(dtStock.Compute("Sum([TotalCases]) ", "[TotalCases] &lt;&gt; ''")); </code></pre> <p>When I use this method, I get an error </p> <blockquote> <p>Invalid usage of aggregate function Sum() and Type: String.</p> </blockquote> <p>Method 2</p> <pre><code>int sum = Convert.ToInt32(dtStock.Compute("SUM(Convert([TotalCases], 'System.Int32'))", ""); </code></pre> <p>When I use this method, I get an error </p> <blockquote> <p>Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier.</p> </blockquote> <p>Please help me...</p>
c# asp.net
[0, 9]
2,381,687
2,381,688
Open an overlay while nextpage is loading
<p>Trying to open an overlay (with JqueryTools) with loading message before the page changes, can't find how to use the href attribute of my trigger (i'm using a class .btn_menu for multiple button)</p> <p>HTML</p> <pre><code>&lt;div class='btn_menu'&gt; &lt;a class='modalInput' rel='#loading' href="a_mailling.php"&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>JS</p> <pre><code>$(function() { var triggers = $(".btn_menu a").overlay({ expose: { color: '#000', loadSpeed: 200, opacity: 0.9 }, closeOnClick: false, onBeforeLoad: function(){ //right ? window.location = //need to get href attribute of clicked trigger } }); var buttons = $("#loading button").click(function(e) { var yes = buttons.index(this) === 0; }); }); </code></pre>
javascript jquery
[3, 5]
4,717,613
4,717,614
Prevent jquery show/hide div to goto top of page
<p>The following script works for me to show a certain div when clicking a link and hiding any other that might be shown (so that only one is shown at a time). But the script also goes to top when clicking a link. How can I aboid that.</p> <p>Code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $('a').click(function () { var divname= this.name; $("#"+divname).show("slow").siblings().hide("slow"); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#" name="div1" &gt;Show div1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" name="div2" &gt;Show div2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" name="div3" &gt;Show div3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" name="div4" &gt;Show div4&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div&gt; &lt;div id="div1" style="display:none"&gt; This is div1 &lt;/div&gt; &lt;div id="div2" style="display:none"&gt; This is div2 &lt;/div&gt; &lt;div id="div3" style="display:none"&gt; This is div3 &lt;/div&gt; &lt;div id="div4" style="display:none"&gt; This is div4 &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
5,028,130
5,028,131
Looking for a simple fade javascript image rotator
<p>I need a simple image rotator that rotates images by fading, centers vertically and is accepted by most if not all browsers. I however need to be able to customize the arrow images and place them anywhere i like. Anyone know of one? </p> <p>If I try to visually show you what I need it would look like this.</p> <p>&lt; -- My back button [ image ] My next button -- ></p> <p>I use jquery :) I've given plenty of rotators a shot already but they don't accept images of varying sizes or are not customizable. </p>
javascript jquery
[3, 5]
2,903,740
2,903,741
Jquery Dynatree plugin using clicks in id
<p>Using Firebug I have found that the Dynatree plugin changes the following code:</p> <pre><code>&lt;li id="id3.1" class="expanded"&gt;Menu 1 &lt;ul&gt; &lt;li id="id3.1.1"&gt;Sub-menu 1&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre> <p>To this:</p> <pre><code>&lt;li class=""&gt; &lt;span class="dynatree-node dynatree-exp-c dynatree-ico-c"&gt; &lt;span class="dynatree-connector"&gt;&lt;/span&gt; &lt;span class="dynatree-icon"&gt;&lt;/span&gt; &lt;a class="dynatree-title" href="#"&gt;Sub-menu 1&lt;/a&gt; &lt;/span&gt; &lt;/li&gt; </code></pre> <p>So when I try to make a click event on the <code>id="id3.1.1"</code> nothing happens because this id doesn't exist anymore.</p> <p>I made a search here and found the <code>onActivate</code> option that will make my click happen on the menu:</p> <pre><code>$("#treeMenu").dynatree({ onActivate: function(node){ var menuTitle = node.data.title; alert(menuTitle); } }); </code></pre> <p>My question: Is this the only way to do the click event using Dynatree?</p>
javascript jquery
[3, 5]
1,901,947
1,901,948
Javascript in PHP in Javascript in PHP
<p>I have a PHP file that contains a javascript function. This function takes "user" as a parameter. How can I include this parameter in embedded PHP? </p> <pre><code>$("#items-table").html("&lt;p&gt;&lt;?php echo(hello " + user + "); ?&gt;&lt;/p&gt;") </code></pre> <p>The error I get is:</p> <blockquote> <p>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING</p> </blockquote> <p>Must I result to appending to the html in separate chunks?</p>
php javascript
[2, 3]
5,936,709
5,936,710
asp.net parameter is not valid when using bitmap
<pre><code>private void LoadButtonImage() { if(buttonPicture != null) buttonPicture.Dispose(); string templateFileName = "PicTemplate/RoundedRectangle.png"; buttonPicture = new Bitmap(templateFileName); } </code></pre> <p>This is my coding ..... parameter is not valid in runtime ... what can i do? Please Give result for this error very urgent....... any one help me.......... very urgent</p>
c# asp.net
[0, 9]
702,865
702,866
How do I trigger a function when the time reaches a specific time
<p>I want to trigger a javascript function when the time reaches, say, 3:00 PM.</p> <p>The time will be assigned dynamically. So is there any javascript function to achieve that??</p>
javascript jquery
[3, 5]
432,347
432,348
c# Compilation on runtime
<p>I am working on a C# Web application which in fact the user is going to built through this application a new web application with his requirements. It is going to be like an Object relational mapping online platform. For this i will need a runtime compiler. I found some examples for winforms projects but nothing for web application runtime compilation. Any help or examples from where can i start? </p>
c# asp.net
[0, 9]
2,945,933
2,945,934
How to return error from webmethod?
<p>suppose i am going to call aspx page method decorated with webmethod. so i need to know that how to return error from my webmethod as a result jquery error portion will be invoked and show the error detail?</p> <p>below is a sample code by which i am calling my aspx method.</p> <pre><code>$.ajax({ type: "POST", url: "./Default.aspx/GetData", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: AjaxSucceeded, error: AjaxFailed }); [WebMethod] public static string GetData() { } </code></pre> <p>so please help in terms of code that how to return error from my webmethod as a result jquery error portion will be invoked and show the error detail...guide me in detail. thanks</p>
jquery asp.net
[5, 9]