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,889,778
1,889,779
move event handler with jQuery
<p>I have an issue which is driving me crazy and as a last resort I am placing a question here.</p> <p>I want to move the onclick event from an element to the onfocus event of the same element and I am using the following code:</p> <pre><code>$("#theElement").bind("focus", {}, $("#theElement").data("events").click); $("#theElement").unbind("click"); </code></pre> <p>Maybe you have guess it. IT DOES NOT WORK.</p> <p>How do I make this work? I am getting a "fn.apply is not a function" message in the following piece of code from jquery 1.3.2:</p> <pre><code>proxy: function( fn, proxy ){ proxy = proxy || function(){ return fn.apply(this, arguments); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; // So proxy can be declared as an argument return proxy; } </code></pre> <p><strong>EDIT:</strong> I'm sorry, I should have mentioned. This comes from a plugin which does some stuff when clicking an element. I want to make the same thing when the element gets focus not when it is cliked so the simplest solution I thought off was this since I can't modify the code for the plugin.</p> <p><strong>EDIT:</strong> Found the problem. It is similar to what @sje397 posted in his answer, not</p> <pre><code>$('#theElement').data('events').click[0] </code></pre> <p>but</p> <pre><code>$('#theElement').data('events').click[3] </code></pre> <p>For some reason, even if only one event is registered the thing ends up as 3 (the guid in that piece of code from jquery).</p>
javascript jquery
[3, 5]
3,105,577
3,105,578
$.post() jQuery and PHP
<p>Here is a piece of code : </p> <pre><code>$username="anant"; $name="ana"; echo $username; echo $name; </code></pre> <p>Now if using jquery $.post() i want to retrieve $username and $name ,how would I do it ?</p> <p>Thanks!</p>
php jquery
[2, 5]
2,094,130
2,094,131
execute javascript when a usercontrol become visible
<p>I have a usercontrol wich is visible=false when the page is loaded. Then, it becomes visible=true. I want some javascript to be executed when this usercontrol is set to visible=true in the code-behind. the only solution i found is to use ScriptManager.RegisterStartupScript in the </p> <p>usercontrol's code behind. But i don't like writing my javascript in the codeBehind.</p> <p>This jQuery in the usercontrol doesn't work : $(document).ready(function() { alert('test'); });</p> <p>The usercontrol is into an updatepanel.</p>
asp.net jquery
[9, 5]
4,235,752
4,235,753
how to stop form submit in when in a ajax call
<p>i can only modify the code in the ajax call a ajax call made when i click the submit in form named $('#form1')</p> <pre><code>$('#form1').submit(function(){ $.ajax({ url:'some.php', type:'POST', data:somedata, success:function(msg){ if(!msg){ //i wanna to stop form1 submit here,how to do that? you can only modify the code in the ajax call } } }) }) </code></pre>
javascript jquery
[3, 5]
4,516,019
4,516,020
I need to have 2 symbols after dot
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript">How can I format numbers as money in JavaScript?</a><br> <a href="http://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places">Format number to always show 2 decimal places</a><br> <a href="http://stackoverflow.com/questions/8225558/how-do-i-round-to-2-decimal-places">How do I round to 2 decimal places?</a> </p> </blockquote> <p>In PHP I can do the following to round to 2 decimal places;</p> <pre><code>$number = 3.45667; $result = number_format($number, 2, '.', ''); // 3.46 </code></pre> <p>How can I do the same in JavaScript?</p>
php javascript
[2, 3]
3,449,868
3,449,869
How to get duration of audio file in java script?
<p>Is there is any way to get duration of audio file in java script ?</p>
javascript asp.net
[3, 9]
3,679,308
3,679,309
filtering on gridview control VS-2008
<p>This is what I am working with to get back to the web dev world</p> <p>ASP.Net with VS2008</p> <p>Subsonic as Data Access Layer</p> <p>SqlServer DB</p> <p>Home Project description: I have a student registration system. I have a web page which should display the student records. </p> <p>At present I have a gridview control which shows the records</p> <p>The user logs on and gets to the view students page. The gridview shows the students in the system, where one of the columns is the registration status of open, pending, complete.</p> <p>I want the user to be able to apply dynamic sorting or filters on the result returned so as to obtain a more refined result they wish to see. I envisioned allowing user to filter the results by applying where clause or like clause on the result returned, via a dataset interface by a subsonic method. I do not want to query the databse again to apply the filter</p> <p>example: initial query </p> <pre><code>Select * from studentrecords where date = convert(varchar(32,getdate(),101) </code></pre> <p>The user then should be able to applly filter on the resultset returned so that they can do a last name like '%Souza%'</p> <p>Is this even possible and is binding a datasource to a gridview control the best approach or should i create a custom collection inheriting from collectionbase and then binding that to the gridview control?</p> <p>PS: Sorry about the typo's. My machine is under the influence of tea spill on my laptop </p>
c# asp.net
[0, 9]
2,751,509
2,751,510
How to navigate to another screen using a TextView link - Android
<p>I followed the instructions in the following post to make active links in a textview:</p> <p><a href="http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable">How do I make links in a TextView clickable?</a></p> <p>What I'd like to figure it out is if there's a way to alter the "a href" in the string resource to link to another screen in my app, rather than a website. I have a number of links in a single block of text, and each one should link to a different screen in the app. I can't find this information anywhere.</p> <p>Thanks.</p>
java android
[1, 4]
5,896,783
5,896,784
How to add name value pair to existing query string
<p>i need to add new name ,value pair to existing query string when the user click on some button.</p> <p>i'm using jquery for client side operations.</p> <p>any idea..?</p> <p>thank in advance!</p>
javascript jquery
[3, 5]
5,722,762
5,722,763
scope in javascript (why at the scope of $.post() method array is local?)
<pre><code>externalCSSContents = []; function getExternalCSSContents(){ href = document.styleSheets[0].href; $.post(href, function(result){ externalCSSContents.push(result); alert(externalCSSContents.length); // 1 }); } getExternalCSSContents(); alert(externalCSSContents.length); // 0 </code></pre> <p>Can someone please explain to me why at the scope of $.post() method array externalCSSContents is local?</p>
javascript jquery
[3, 5]
5,286,300
5,286,301
want to create a loop in jquery based on a value
<pre><code> var cnt = document.getElementById('counter'); //row1 is incremental and based on some value from // database this value will increase. want to create a loop Here $(".row1").mouseenter(function(){ $(this).addClass("answer_hover_row"); document.getElementById('row1').style.visibility = "visible"; }).mouseleave(function(){ $(this).removeClass("answer_hover_row"); document.getElementById('row1').style.visibility = "hidden"; }); $(".row2").mouseenter(function(){ $(this).addClass("answer_hover_row"); document.getElementById('row2').style.visibility = "visible"; }).mouseleave(function(){ $(this).removeClass("answer_hover_row"); document.getElementById('row2').style.visibility = "hidden"; }); </code></pre> <p>I am trying to create a loop for the mouseenter function so that i can create it for as many divs that are printed dynamicaly. The count of the divs is in a hidden text box with id as counter. Please help me with the loop. .each function wont work out for me</p>
javascript jquery
[3, 5]
1,710,566
1,710,567
Inheritance in Jquery Plugin
<p>I'm trying to create a jQuery plugin and having problems with selecting the DOM.</p> <p>for example, when I initialize the plugin (ex. $('#test').customplugin();</p> <pre><code>this.each(function() { // Var var $this = $(this); $this.hide(); var thisOpts = $( this + ' option'); </code></pre> <p>$this.hide(); works as expected, hiding the element #test.</p> <p>however, when I try to get for example the li of #test, nothing seems to work.</p> <p>Can someone help me understand what "this" exactly is, and why "thisOpts" won't target "#test option"?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,994,492
2,994,493
How to disable asp.net after click?
<p>I want to disable a server side asp.net button control after click for some seconds &amp; then fire a server side event. I am trying to use setTimeout but if I use setTimeout the server side event is never fired. Can anybody help?</p> <pre><code> &lt;script type="text/javascript"&gt; function disableBtn(btnId, dspTxt) { var btn = document.getElementById(btnId); btn.value = dspTxt; setTimeout(btn.disabled = true,1000); } &lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
4,339,724
4,339,725
logging into a website using java?
<p>I am working on an Android application. I just started on android development and wanted to know if some how it is possible to log into a website using java. Is there is library or API for achieving something like that?</p> <p>thanks</p>
java android
[1, 4]
3,676,282
3,676,283
How to check whether the jQuery file is loaded on the page or not?
<p>How do I check whether jQuery is loaded in the page or not? I have to run a jQuery script which has a jQuery library link, but when I use the code I want to make sure to load that file only if the page does not have any jQuery file, otherwise use that file. Any suggestions?</p>
javascript jquery
[3, 5]
1,931,917
1,931,918
check for file existence on the web using url passed
<p>Friends:</p> <p>I found these 2 pieces of code to test for file existence over the web. The JQuery version is very popular all over and the second one is simple javascript. I just grabbed a file from yahoo.com -- <a href="http://l.yimg.com/cv/mntl/tra/11q2/img_48880236.jpg" rel="nofollow">http://l.yimg.com/cv/mntl/tra/11q2/img_48880236.jpg</a></p> <p>and made a small .html file using the code below. But i always get SUCCESS(or rather EXISTS) in my message, even after i modified the .jpg file mentioned above. I tried my .html file in IE* and Google chrome. Had linked the following jQuery file - jquery-1.4.2.min.js. Any help or suggestions would be welcome.</p> <p>JQuery version - </p> <pre><code>$.ajax({ url:'http://l.yimg.com/cv/mntl/tra/11q2/img_48880236--.jpg', type:'HEAD', error: function(){ alert('DOES NOT EXISTS'); }, success: function(){ alert('EXISTS'); } }); </code></pre> <p>Javascript version - </p> <pre><code>var _url="http://l.yimg.com/cv/mntl/tra/11q2/img_48880236--.jpg" ; var http = new XMLHttpRequest(); http.open('HEAD', _url, false); http.send(); http.status !=404 ? alert('EXISTS') : alert('DOES NOT EXIST') ; </code></pre>
javascript jquery
[3, 5]
2,420,054
2,420,055
onfocus="this.blur();" problem
<pre><code>// I am trying to apply an "onfocus="this.blur();"" so as to remove the dotted border lines around pics that are being clicked-on // the effect should be applied to all thumb-nail links/a-tags within a div.. // sudo code (where I am): $(".box a").focus( // so as to effect only a tags within divs of class=box | mousedown vs. onfocus vs. *** ?? | javascript/jquery... ??? function () { var num = $(this).attr('id').replace('link_no', ''); alert("Link no. " + num + " was clicked on, but I would like an onfocus=\"this.blur();\" effect to work here instead of the alert..."); // sudo bits of code that I'm after: // $('#link_no' + num).blur(); // $(this).blur(); // $(this).onfocus = function () { this.blur(); }; } ); // the below works for me in firefox and ie also, but I would like it to effect only a tags within my div with class="box" function blurAnchors2() { if (document.getElementsByTagName) { var a = document.getElementsByTagName("a"); for (var i = 0; i &lt; a.length; i++) { a[i].onfocus = function () { this.blur(); }; } } } </code></pre>
asp.net javascript jquery
[9, 3, 5]
2,751,201
2,751,202
how to get a data from a DB using MYSQL and store it in javascript Array
<p>Is there any possible way to get a data from a DB using MYSQL and store it in javascript Array.</p> <p>Thanks in Advance</p>
php javascript
[2, 3]
3,368,996
3,368,997
Looping through DOM and show hide elements
<p>I have a group of records which are split into segements of 5 each wrapped around a div with an id and class.</p> <p>e.g.</p> <pre><code>&lt;div id="myid" class="myclass"&gt; &lt;p&gt;record1&lt;/p&gt; &lt;p&gt;record2&lt;/p&gt; &lt;/div&gt; </code></pre> <p>The first set of 5 records are displayed and the rest are hidden. I have a link underneath that has click for more. Once clicked it will then show another 5, etc etc.</p> <p>Each container has a class with an Off and an On. This tells me what div is showing and what div isnt.</p> <p>Now I want to show each set of records on each indivudual click of the click. I have done this code but does not seem to work. My knowledge in jquery is limited.</p> <pre><code>$(document).ready(function () { // get first reviewBulkContainer and show $(".reviewBulkContainer:first").show().addClass("On"); $("#showMoreReviews").click(function (e) { e.preventDefault(); $("#reviewContainer .reviewBulkContainer").each(function () { if ($(this).hasClass("Off")) { $(this).show(); $(this).removeClass("Off"); $(this).addClass("On"); return; } }); }); </code></pre> <p>But this ends up showing all record segments and not just one as a time. Could anyone help me on this?</p> <p>Thanks...</p>
javascript jquery
[3, 5]
5,326,935
5,326,936
Focus Does not move on Enter Key in asp.net
<p>Hi Experts I have a web Page i want to move Focus on Enter key on Next Control But it does not work TextBox1 to Text2 focus move Properly But not in Text3 and Text4 and Further. follow in my aspx Code</p> <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" /&gt; &lt;asp:TextBox ID="TextBox2" runat="server" /&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:TextBox ID="TextBox3" runat="server" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:TextBox ID="TextBox4" runat="server" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;asp:TextBox ID="TextBox5" runat="server" /&gt; &lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" /&gt; </code></pre> <p>I Have Write the following JQuery</p> <pre><code> $(function () { $('input:text:first').focus(); var $inp = $('input:text'); $inp.bind('keydown', function (e) { var key = e.which; if (key == 13) { e.preventDefault(); var nxtIdx = $inp.index(this) + 1; $(":input:text:eq(" + nxtIdx + ")").focus(); } }); }); </code></pre>
jquery asp.net
[5, 9]
4,975,053
4,975,054
problem while encoding string to XML
<p>i am gettting problem while encoding string R.F.&lt; 1 into Xml</p> <p>i am using <code>node.innerxml=string;</code></p> <p>it shows exeption name cannot start with 1 or hexadecimal value 0x33.....</p> <p>pls help me to solve this</p>
c# asp.net
[0, 9]
4,121,677
4,121,678
JQuery: Iterating through table rows for 2 specific cells
<p>I am a total JQuery newbie and I have been researching this for the past 2 days but my brain is now fried.</p> <p>Here is what I have:</p> <p>A table that has a certain amount of rows (like an online store's cart)</p> <p>I do not want the last row (since that contains cart total) and I do not want the first row (which are the column headers)</p> <p>Here is what I want:</p> <p>On document load, I want to go through each row of that table (except first and last) and grab (for example) the first column and last column, pass those values to a web service, and have the web service return a value to put in another column's text box of that row</p> <p>the table structure is as follows:</p> <pre><code>&lt;table id="blahzayblahgrdItems"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;product&lt;/td&gt; &lt;td&gt;req.ship date&lt;/td&gt; &lt;td&gt;est.ship date(input textbox)&lt;/td&gt; &lt;td&gt;price&lt;/td&gt; &lt;td&gt;qty&lt;/td&gt; &lt;td&gt;subtotal&lt;/td&gt; &lt;/td&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I'm trying to grab the values from the Product column and the QTY column to pass to webservice and populate the EST. Ship Date column with whats returned from the web service</p> <p>In code, I've tried something like</p> <pre><code>$(function() { var partID; var qty; $("table[id*=grdItems] tbody tr").each(function() {}) ) </code></pre> <p>However, I'm drawing a blank on getting the actual quantity and product to pass to my webservice. I've tried different variations of code and throwing an alert box to see whats getting returned but I'm seeing headers, pieces of the table data, the full table data, etc. Any help would be GREATLY appreciated.</p>
javascript jquery
[3, 5]
757,895
757,896
Importing an external Application to run in Visual Studio
<p>I'm trying to run this application my asp.net site in visual studio:</p> <p><a href="http://www.ezreserve.com/Appt.aspx?action=overview#" rel="nofollow">http://www.ezreserve.com/Appt.aspx?action=overview#</a></p> <p>but I'm not quite sure how to do it. Is this even possible? I'd also like to modify some of the ASP.NET server pages, but I'm not sure if that's doable. When I downloaded the application it came with a "Site" folder, with a a bunch of subfolders like "Consumer", "Admin" with ASP.NET server files, since this is a scheduling application. How do I get this thing running?</p>
c# asp.net
[0, 9]
378,430
378,431
Dynamically add/remove function while calling one single function using parameters
<p>I have a function called f0 having some parameters. When i call it, it calls some other functions with some parameters(for example the same parameters). The problem is, can i add somehow these functions dynamically?</p> <p>A simple solution would be something like this:</p> <pre><code>var callf1=true; var callf2=true; var callf3=true; function f1(params){ //some code } function f2(params){ //some other code } function f3(params){ //some code } function f0(params){ if(callf1){ f1(); } if(callf2){ f1(); } if(callf3){ f1(); } } function mymain(){ f0(params); } setInterval("mymain()",5000); </code></pre> <p>This option is much time consuming because every time it has to check the variables. Could i use somehow the trigger option in JQuery using runtime and giving parameters?</p> <p>I would be glad if you can recommend me an easier and simpler solution.</p>
javascript jquery
[3, 5]
5,473,817
5,473,818
How to modify/recreate Html.fromHtml()?
<p>I am not that good to understand all the possibility of Java, especially if it's not my code.</p> <p>So, <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/text/Html.java#Html.fromHtml%28java.lang.String%29" rel="nofollow">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/text/Html.java#Html.fromHtml%28java.lang.String%29</a> , is it all I need to modify Html.fromHtml() ?</p> <p>But I don't understand how it's works : Is it a good way to create a new class like Html2 and copy/paste all the code ? When I do that I have some errors that I don't understand :</p> <pre><code>private static class HtmlParser { private static final HTMLSchema schema = new HTMLSchema(); } </code></pre> <p>He tells my Htmlschema cannot be resolved to a type, and to add the class HtmlSchema... but where can i find it ?</p> <p>And this : </p> <pre><code>return XmlUtils.convertValueToInt(color, -1); </code></pre> <blockquote> <p>XmlUtils cannot be resolved.</p> </blockquote> <p>The rest of the errors have been solved with the help of Eclipse</p>
java android
[1, 4]
3,962,738
3,962,739
How do I extract a background= value from a string containing HTML in JavaScript?
<p>I have a string containing HTML loaded from another page, how do I extract the background property from it's body tag using Javascript?</p> <p>The body tag in the string looks like this:</p> <pre><code>&lt;body onload='init();' background='storage/images/jsb_background.jpg' link='#000000' vlink='#000000' alink='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'&gt; </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
5,528,984
5,528,985
jQuery ScrollTo Skips and is Notchy
<p>I have an issue with jQuery ScrollTo.<br> It skips and there is a lag when applied to my page.</p> <p><a href="http://jsfiddle.net/UyH56/8/" rel="nofollow">Here's a link</a> to the jsFiddle example that works and <a href="http://tinyurl.com/d5smxls" rel="nofollow">here</a> is the same code applied to my page that does not work. </p> <p>It might function correctly on some machines but all the machines I have tested this on don't!<br> Might there be an issue with the amount of images I am using?<br> Is there anything I can do to overcome this?</p>
javascript jquery
[3, 5]
5,718,472
5,718,473
JQuery/JavaScript plugin for highlight text
<p>I am looking for a jquery plugin for multiple highlighting text in a element. I found very popular plugin for that: <a href="http://bartaz.github.com/sandbox.js/jquery.highlight.html">http://bartaz.github.com/sandbox.js/jquery.highlight.html</a> and also many others. </p> <p>They work fine, but in the case when I want to highlight the text which overlaps on eralier highlighted text - it does not work.</p> <p>Has anyone know a jquery or javascript plugin to multiply highlight texts which correctly highlights overlaped texts?</p>
javascript jquery
[3, 5]
76,546
76,547
echo javascript funtion with php variables as arguments
<p>In test.php:</p> <pre><code>&lt;?php $result = "test"; echo '&lt;script type="text/javascript"&gt;parent.showThanksDiv(\"&lt;?php echo $result;?&gt;\");&lt;/script&gt;'; ?&gt; </code></pre> <p>and in test.html</p> <pre><code> &lt;script type="text/javascript"&gt; function showThanksDiv(text){ document.getElementById("myThanksDivtext").value = text; } &lt;/script&gt; </code></pre> <p>That's not working. It seams Im not passing php variables correctly. Any ideas?</p>
php javascript
[2, 3]
1,035,755
1,035,756
Trying to write a jQuery function that shows content and hides the rest
<p>Im trying to write a complicated (for me) function on my website. I had 3 rows, each containing an image. On hover I want this image background position to change, thats it. When the user then clicks this image, I want the parent div to expand in height, and the image to expand in height as well as change the background position of that. </p> <p>After this function is complete and you click another image, Id like the previous one to scale back down to size, This is hard to explain so ive made a jsfiddle demo that I hope gives you all an idea. </p> <p>Also as im new to jqwuery im a bit concerned my function looks bloated, is this bad practice or does it appear okay? </p> <pre><code>// On work showcase click, expand area to show information $('.work-showcase').click(function(){ if ( !$(this).hasClass('active') ){ $(this).addClass('active'); $('.work-showcase').animate({height:'135px'}, 500); $(this).find('ul li').animate({height:'350px'}, 500); $(this).find('ul li').css({ 'background-position':'bottom left', 'background-size' : 'auto auto' }); $(this).find('ul li img').animate({height:'350px'}, 500); $(this).animate({height:'400px'}, 500,function() { $("html, body").animate({ scrollTop: $(this).offset().top }); }); } else { return false;}; }); </code></pre> <p><strong>Demo</strong></p> <p><a href="http://jsfiddle.net/mx4HJ/2/" rel="nofollow">http://jsfiddle.net/mx4HJ/2/</a></p>
javascript jquery
[3, 5]
84,991
84,992
php gets stringified object as null
<p>I'm trying to pass a some information to a php page with jquery ajax. I really can't understand why the php page keeps echoing back that the strinified JSON i'm sending is null</p> <pre><code>//php if ($type == "new" || $type == "update"){ $new_address = json_decode($_REQUEST['address'], true); echo json_encode($new_address); //Null } //js var string_encoded_address = JSON.stringify(address_obj.address); string_encoded_address = encodeURIComponent(string_encoded_address); console.log(string_encoded_address); $.ajax({ type: "post", url: "order_queries_templates/queries/address.php", data: "type=new&amp;user_id=" + user_id + "&amp;address=" + string_encoded_address, dataType: "json", success: function (returnedData) { console.log(returnedData); } }); </code></pre> <p>this gives me a string for my <code>data</code> property:</p> <pre><code>type=new&amp;user_id=8244&amp;address=%7B%22companyName%22%3A%22test%20company%22%2C%22address1%22%3A%222420%20sample%20Road%22%2C%22city%22%3A%22SIOUX%20CITY%22%2C%22state%22%3A%22IA%22%2C%22zip%22%3A%2251106%22%2C%22cityStateZip%22%3A%22SIOUX%20CITY%2C%20IA%2051106%22%7D </code></pre> <p>What could be wrong with it? Thanks!</p>
php javascript jquery
[2, 3, 5]
2,531,724
2,531,725
Jquery help repeated ajax call
<p>When I submit my form, a repeated ajax call is made it never stop.</p> <p>Here is my Jquery for the ajax call on form submit:</p> <pre><code>$('form#formgo').submit(function(e) { e.preventDefault(); $('#comparecontent').empty().html( '&lt;p style="text-align:center;"&gt;' + '&lt;img src="../images/ajax.gif" /&gt;&lt;/p&gt;'); var form = $(this).closest('form'); $.ajax({ type: form.attr('method'), url: form.attr('action'), data: form.serialize(), success: function(msg){ $('#comparecontent').html(msg); } }); return false; }); </code></pre>
javascript jquery
[3, 5]
5,243,215
5,243,216
Javascript RegExp Object
<p>I use this function below to quickly find an item in a table<br> My problem is that this function only searches for text that contains the search string in the given table<br> I have been trying my best to modify it to match only the text that begins with the search string but not working.</p> <pre><code>function searchTable(inputVal) { var table = $('#supplier_table_body'); table.find('tr').each(function(index, row) { var allCells = $(row).find('td'); if(allCells.length &gt; 0) { var found = false; allCells.each(function(index, td) { var regExp = new RegExp(inputVal, '^i'); if(regExp.test($(td).text())) { found = true; return false; } }); if(found == true)$(row).show();else $(row).hide(); } }); } </code></pre> <p>Here is my jquery</p> <pre><code> $('#itemname').keyup(function() { searchTable($(this).val()); }); </code></pre>
javascript jquery
[3, 5]
918,042
918,043
Writing in files ASP.NET C# and NOT locking them afterwards
<p>I am getting this error: The process cannot access the file (...) because it is being used by another process. I have tried to use <code>File.WriteAllText</code>; </p> <pre><code>StreamWriter sw = new StreamWriter(myfilepath); sw.Write(mystring); sw.Close(); sw.Dispose(); </code></pre> <p>;</p> <pre><code>using (FileStream fstr = File.Create(myfilepath)) { StreamWriter sw = new StreamWriter(myfilepath); sw.Write(mystring); sw.Close(); sw.Dispose(); fstr.Close(); } </code></pre> <p>All I am trying to do is to access a file, write on it, then close it. I might be making a silly mistake but I would like to understand what I am doing wrong and why. How to make sure that the file is closed and not to cause this error again.</p> <p>Helped by the answers so far I did this:</p> <pre><code>using (FileStream fstr = File.Open(myfilepath,FileMode.OpenOrCreate,FileAccess.ReadWrite)) { StreamWriter sw = new StreamWriter(fstr); sw.Write(mystring); sw.Close(); } </code></pre> <p>It seems to be better because it seems to close/stop the process of my file if I try to access another file on the second time I access the page. But if I try to access the same file on a second time, it gives me the error again.</p>
c# asp.net
[0, 9]
2,686,236
2,686,237
Just a simple thing about windowsTitle change background in Java
<p>i wan't to do a simple thing, my background's windowTitle must change in my application. But how i can access to my background's windowTitle ? </p> <p>My style.xml :</p> <pre><code>&lt;resources&gt; &lt;style name="CustomWindowTitleBackground"&gt; &lt;item name="android:background"&gt;@drawable/fond&lt;/item&gt; &lt;/style&gt; &lt;style name="CustomTheme" parent="android:Theme.Light"&gt; &lt;item name="android:windowTitleSize"&gt;40dip&lt;/item&gt; &lt;item name="android:windowTitleBackgroundStyle"&gt;@style/CustomWindowTitleBackground&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>And in my Activity :</p> <pre><code>super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.page_doc); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title); </code></pre> <p>How i can do this ?</p>
java android
[1, 4]
1,022,601
1,022,602
UI design suggestions for Display and Switching between Multiple Layouts
<p>I'm trying to create an app that offers the user 3 different kinds of layouts. The only common portion for all 3 would be the TextView (located at the top) that would display information specific to the currently displayed layout and 3 buttons to select the required layouts.</p> <p>Is there some way we can create this UI in XML to keep only one constant part(the upper TextView) and dynamically display any one of the 3 layouts below it? Would it be better to create separate XML's for each of the layouts (each including the upper TextView in them)? OR would doing this via code be better?</p> <p>Fast switching between the 3 layouts is important.</p> <p>Appreciate any insights on this.</p> <p>TIA</p> <p>[EDIT 1] Actually they are 3 different layouts, with several "child" layouts and views within each of them. Could a ViewFlipper be used for switching between these? I was thinking that a ViewFlipper was only for switching between View elements?</p> <p>I do have them in individual XML's right now but am looking for some way to load and unload them fast. Not sure how to do the hiding thing, will try reading up on that. [/EDIT 1]</p>
java android
[1, 4]
4,008,283
4,008,284
how to declare variable in javascript
<pre><code>$("#btnsub").click(function () { var add = $("#txtname").val(); var obj; var geo = new google.maps.Geocoder; geo.geocode({ 'address': add }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { obj = results[0].geometry.location; obj = convert(obj); alert(obj); } else { alert("Geocode was not successful for the following reason: " + status); } }); alert(obj); // why this alert run first instead of the upper alert() }); </code></pre>
javascript jquery
[3, 5]
5,209,365
5,209,366
Why use Async HTTP post Android
<p>I currently have this running in my app. The use of this is for users to send me simple messages. A dialog is opened where they can type then when they click send button I want another dialog opened saying processing and finally one opened saying thanks if successful.</p> <p>Is the only / best way to do this by using asyncTask? And is there a good example/walkthrough anywhere for implementing this as I understand the theory, but not really implementation.</p> <pre><code>public void postData() { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); HttpClient httpclient = new DefaultHttpClient(params); HttpPost httppost = new HttpPost("http://www.mysite.com/script.php"); try { List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair("id", "12345")); nameValuePairs.add(new BasicNameValuePair("stringdata", messageval)); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); responseBody = EntityUtils.toString(response.getEntity()); } catch (ClientProtocolException e) { // TODO Auto-generated catch block } catch (IOException e) { // TODO Auto-generated catch block } } </code></pre>
java android
[1, 4]
3,908,109
3,908,110
do not refresh page upon form submit
<p>I am trying to submit this form without refreshing the page. I'm using jquery; upon submit the page still refreshes.</p> <pre><code>$(function(){ $('#submit').click(function(){ $('#container').append('loading'); var sthis = $('#sthis').val(); $.ajax({ url: 'f.php' , type: 'POST', data: 'sthis: ' + sthis, success: function(result){ $('#container').append('&lt;p&gt;' + result + '&lt;/p&gt;') } }); return false; }); }); </code></pre> <p>html page (f.php)</p> <pre><code>&lt;div id="container"&gt; &lt;form method="post" action="f.php"&gt; something&lt;input name="sthis" type="text" /&gt; &lt;input type="submit" value="submit" id="#submit" /&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>php page</p> <pre><code>&lt;?php if(isset($_POST['sthis'])){ $sthis = $_POST['sthis']; if(empty($sthis)) { echo 'put something in this box'; } else echo 'ready'; } ?&gt; </code></pre>
php jquery
[2, 5]
5,387,121
5,387,122
Click object by classname
<p>I am trying <code>document.getElementsByClassName('classname').click();</code>, but it doesn't fire the click on the class. Why is that?</p>
javascript jquery
[3, 5]
333,385
333,386
jQuery DataTable - few questions
<p>I have few questions about jQuery DataTables:</p> <ol> <li><p>How can i do that arrow next and arrow previus in pagination will be active all time?</p></li> <li><p>I use Ajax, and i pass only 10 results, but all results is more for example 300, so how can i set this value to all results?</p></li> <li><p>When I choose options rows per page from drop down menu I want call my javascript function, how can I do that?</p></li> </ol> <p>My function:</p> <pre><code> function prepareDataTable(){$("#displayData").dataTable( {aaData:listCustomer.rows, bSort:false, aoColumns: [{mDataProp:"name"}]})}; </code></pre>
javascript jquery
[3, 5]
1,187,866
1,187,867
handing data returned from jquery get request
<p>I have a simple jquery script as follows:</p> <pre><code>$('a').click(function() { //get the id of the song we want to play var song_id = $(this).attr("id"); //do a get request to get the information about the song $.get("http://www.site.com/v4/ajax/get_song_info.php", { id: song_id, }, function(data) { alert("Data Loaded: " + data); }); //alert( song_id ); }); </code></pre> <p>I have gotten it to work and it returns several bits of data 'artist' 'title' 'song duration' and so on.</p> <p>How do I process my 'data' so I can then update my page with each bit. In this case I want to set a series of '' to hold each of the values returned.</p> <p>Thanks.</p>
php jquery
[2, 5]
2,679,764
2,679,765
How to know if a node intersects another node?
<p>I want to know if a node intersects another node like this schema: <img src="http://i.stack.imgur.com/iAECO.png" alt="schema"></p>
javascript jquery
[3, 5]
2,692,803
2,692,804
Javascript: fake a touchdown event?
<p>If I have a x,y coordinate onscreen is there a way to 'fake' a touchdown event?</p>
javascript iphone
[3, 8]
2,878,307
2,878,308
Php echo in javascript - not working
<p>I try to use PHP code in Javascript. Unfortunatelly something wrong. </p> <p>Try on localhost, wampserver.</p> <p>This is a part of the jquery validation:</p> <pre><code> "onlyNumber":{ "regex":"/^[0-9\ ]+$/", "alertText":"&lt;?php echo 'This is the message' ?&gt;"}, </code></pre> <p>Any idea why this give me blank message window?</p> <p>Thank you</p> <p>File extension is PHP. The Js file is included end of my php (before ).</p> <pre><code>&lt;script type="text/javascript" src="js/all.js"&gt;&lt;/script&gt; </code></pre> <p>Tried to close the echo command with ;</p>
php javascript jquery
[2, 3, 5]
464,205
464,206
.fadein not working on server (working locally)
<p>FadeIn is not working when I upload it to my server, yet it is working on my local machine?</p> <pre><code>&lt;script&gt; $("qfade").click(function () { $("h2").fadeIn(1000); }) &lt;/script&gt; </code></pre> <p>called here</p> <pre><code>&lt;li class="sup"&gt; &lt;qfade&gt;&lt;a href="#stuff"&gt;things&lt;/a&gt;&lt;/qfade&gt; &lt;/li&gt; </code></pre> <p>You can view the whole code here: <a href="http://williamhockey.com" rel="nofollow">http://williamhockey.com</a></p>
javascript jquery
[3, 5]
2,066,587
2,066,588
"Request.Cookies ("iduser"). Value" equivalent in C#
<p>I have an application in VB.net and I'm doing a new one in C# (ASP.NET 4). Users has just one username to login in both app.</p> <p>The point is... how can I get the cookie's value in C#???</p> <p>This is how I get it in VB...</p> <pre><code>IdUser = Request.Cookies("iduser").value </code></pre> <p>Thks</p>
c# asp.net
[0, 9]
5,728,309
5,728,310
How do you generate a preview of html code in other window fetched from a table
<p>I have a page which generates a html code in a text box. </p> <p>When code generation happens parallel I am inserting the same code in a table. </p> <p>All this is in between asp controllers.</p> <p>Under that text box I have button called preview. </p> <p>All I need is when I click on the button it should fetch the code and preview it like html file in other window. </p> <p>If saving that code in not a good idea than help to give another alternate. </p> <p>All I need is preview of that code in html format in other window.</p>
c# asp.net
[0, 9]
4,091,098
4,091,099
Select multiple contacts Android
<p>I need to select multiple contacts from my cell phone for my android application. I have searched at many websites but there nobody has proposed a built in solution. The URI allows me to select a single contact but I want to open a view of contacts with check boxes. Any help would be highly appreciated in this regard.</p>
java android
[1, 4]
2,834,883
2,834,884
Global variable not set value in $.getJSON properly
<p>I have declared global variable named counter=0 on my index.html page inside head section </p> <pre><code>&lt;script&gt; var counter=0; &lt;/script&gt; </code></pre> <p>now in my one of function i am setting its value as</p> <pre><code> function getCounter(param) { $.getJSON("somewebserviceURL&amp;format=json&amp;callback=?", function(data) { $.each(data, function(i, item) { counter++; }); }); //I am not able to get the latest value here &amp; in upcoming functions which use this variable alert(counter); } </code></pre>
javascript jquery
[3, 5]
1,426,145
1,426,146
Using ThreadPoolExecutor and AsyncTask
<p>When using ThreadPoolExecutor can I use AsyncTask as the Runnable in my queue? Or does this defeat the purpose?</p> <pre><code>//A holder for various tasks private final LinkedBlockingQueue&lt;Runnable&gt; queue = new LinkedBlockingQueue&lt;Runnable&gt;(5); //Thread Pool Executor private final ThreadPoolExecutor tpe = new ThreadPoolExecutor(3, 3, 10, TimeUnit.SECONDS, queue); </code></pre>
java android
[1, 4]
5,234,375
5,234,376
How to invoke browser without losing browsing state?
<p>I have written an activity that has 2 image buttons (1 for messaging and another for browser). On click on each will start messaging and browser android activities respectively.</p> <p>My question is: whenever I start my app and click on any of the buttons say browser button for example, and after it starts the android browser app, and it allows me whatever to browse in this time if I press the home button on android emulator and again if I start my app and select the browser button in my activity as usual the browser get started from the beginning rather than starting form where I left previously.</p> <p>Should I start a service to call browser activity or should I set some flags while calling android browser activity?</p>
java android
[1, 4]
5,979,242
5,979,243
jQuery toggle element style but pausing briefly inbetween
<p>I have an element which I am toggling the style of (like an on/off button). If it's currently 'on', change the style to 'off' and vice versa.</p> <p>However, in some scenarios, I want to perform the above, but then revert to it's original state (cancelling out the toggle), but I want this to be reflected to the user by it's very brief change in style (so for 1/2 a second, it looks like it has changed style but then reverts back to it's original state.</p> <p>I'm currently toggling the state of my button with the below code:</p> <pre><code>myButton.toggleClass('button-off').toggleClass('button-on'); </code></pre> <p>I've tried chaining a <code>delay(500)</code> between the above and a 'flip' of the above line, but that doesn't work.</p>
javascript jquery
[3, 5]
1,442,580
1,442,581
How can i make a disabled control back to enable using Javascript
<p>I have done a code to disable a control when user clicks on a control. On my form i am having a <code>TextBox</code> and a <code>DropDown</code>. When user clicks on a <code>TextBox</code> i will <code>disable</code> the <code>DropDown</code> like that when click on <code>DropDown</code> i will disable the <code>TextBox</code> which works fine.</p> <p>But when the user clicks on <code>Disabled</code> control i would like to enable that control. Means if i click on <code>TextBox</code> which was disabled i would like to <code>Enable</code> it like that for <code>dropdown</code> too..</p> <p>My sample Script is as follows</p> <pre><code>&lt;script type="text/javascript"&gt; function toggleDropDownList1() { var d=document.getElementById("&lt;%= DropDownList4.ClientID %&gt;"); if(d.disabled) { d.disabled=false; } else { document.getElementById("&lt;%= TextBox1.ClientID %&gt;").disabled = true; } } function toggleDropDownList2() { document.getElementById("&lt;%= DropDownList4.ClientID %&gt;").disabled = true; } &lt;/script&gt; </code></pre> <p>Design</p> <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" onclick="toggleDropDownList2();"&gt;&lt;/asp:TextBox&gt; &lt;asp:DropDownList ID="DropDownList4" runat="server" onclick="toggleDropDownList1();"&gt; &lt;asp:ListItem Text="One" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="One" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
4,517,941
4,517,942
Get closest element by traversing DOM backwards
<p>I want to get a DOM element with jQuery but i want to only look backwards in the DOM.</p> <p>So suppose i have the following HTML structure:</p> <pre><code>&lt;div id="content"&gt; &lt;div id="first-module" class="module"&gt; &lt;h3&gt;Some Module&lt;/h3&gt; &lt;p&gt;Lorem ipsum... &lt;/p&gt; &lt;div id="some-other-content"&gt; &lt;div id="second-module" class="module"&gt; &lt;h3&gt;Some other module&lt;/h3&gt; &lt;p&gt;Dolor sit amet...&lt;/p&gt; &lt;button class="trigger"&gt;Trigger 1&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;button class="trigger"&gt;Trigger 2&lt;/button&gt; &lt;div id="third-module" class="module"&gt; &lt;h3&gt;Another module&lt;/h3&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; $('.trigger').click(function() { // Traverse DOM to find closest .module class }); </code></pre> <p>So when i click on the <code>Trigger 1</code> button i want it to find the <code>div</code> with ID <code>second-module</code>.</p> <p>When i click on <code>Trigger 2</code> i want it to find the <code>div</code> with ID <code>first-module</code> and <strong>not</strong> <code>second-module</code>, because it's nested deeper than the <code>Trigger 2</code> button is.</p> <p>Is there a jQuery function for this?</p>
javascript jquery
[3, 5]
2,291,862
2,291,863
how to read character behind some text
<p>this one a code for read two character behind text "KD-R411ED"</p> <pre><code>var code = data[0].substr(data[0].length - 2); </code></pre> <p>how to read ED character if text like KD-R411H2EDT? i want a new code can combine with code above..please help!!</p> <p>look this:</p> <pre><code> &lt;script type="text/javascript"&gt; $("#tags1").change(function() { var barcode; barCode=$("#tags1").val(); var data=barCode.split(" "); $("#tags1").val(data[0]); $("#tags2").val(data[1]); var code = data[0].substr(data[0].length - 2); // suggested by Jan Willem B if (code == 'UD') { $('#check1').attr('checked','checked'); } else { if (code == 'ED') { $('#check2').attr('checked','checked'); } } &lt;/script&gt; </code></pre> <p>and this one</p> <pre><code>&lt;input id="check1" type="radio" class="check" name="check" onclick="addtext()" value="U" /&gt;U &lt;input id="check2" type="radio" class="check" name="check" onclick="addtext_1()" value="E" /&gt;E </code></pre>
javascript jquery
[3, 5]
3,568,582
3,568,583
POST array through PHP and get in Python
<p>I am posting a array </p> <pre><code>$name[0] = "anurag"; $name[1] = "abhishek"; $ch = curl_init('http://localhost:8000/v0/url-generator'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "name=$name"); curl_exec ($ch); curl_close ($ch); </code></pre> <p>In python I got name = array .</p> <pre><code>if request.method == 'POST': name = request.POST["name"] print name </code></pre> <p>output = array.</p> <p>I would like to output this in python:</p> <pre><code>name = ['anurag','abhishek'] </code></pre>
php python
[2, 7]
1,405,566
1,405,567
No value is still true in javascript
<p>I need to check some data given by a dataset attribute, it can happen that the dataset is empty, if so I still need to skip with a if statement, but an empty dataset is still true, I have tried...null, undefined and they dont work.</p> <p>So if there's no value present it should be false.</p> <pre><code>// false &lt;div data-value=""&gt;&lt;/div&gt; if($('div').data('value') !== ""){ alert('hello ...world?') } //true &lt;div data-value=" "&gt;&lt;/div&gt; if($('div').data('value') !== ""){ alert('hello ...world?') } </code></pre>
javascript jquery
[3, 5]
3,766,705
3,766,706
what is the difference between .last() and :last?
<p>Can someone explain the difference between .last() and :last ? I can't seem to find a definitive explanation.</p> <p>Why Exactly does this <code>$('td.cellsOfSpecificClass:last', '.table tr')</code> return the last td in each tr instead of the last td in the whole table?</p>
javascript jquery
[3, 5]
4,976,981
4,976,982
How to convert JavaScript date object into ticks
<p>How should i convert JavaScript date object into ticks? as i want to use this ticks to get the exact date for my c# application after synchronization of data.</p>
c# javascript
[0, 3]
3,981,655
3,981,656
Download .EXE file via JQuery
<p>How can I do a function, that allow do the download of a file in C: ?</p> <p>For example, when the link is clicked, trigger a javascript function that will open the file or made download.</p> <p>I'm trying this, </p> <p>But it execute the program, I need that execute a download! </p> <pre><code> if (url == "Supremo") { var oShell = new ActiveXObject("WScript.Shell"); var prog = "C:\\inetpub\\wwwroot\\admin.redenetimoveis.com\\San\\up\\arquivos\\Supremo.exe"; oShell.run('"' + prog + '"', 1); return false; } </code></pre>
javascript jquery
[3, 5]
5,696,480
5,696,481
Android: Odd behaviour when screen is turned off?
<p>I'm working on a game and use a WakeLock to keep the screen from going to sleep while the user is playing. However, I'm encountering some weird behavior when the screen is manually put to sleep..</p> <p>My current approach is to store away the game info in OnPause() and load them back up when OnCreate() is called. This works fine if I hit the home button and start my app back up. However, turning the screen off seems to call OnPause() a couple times..in addition to some other funky behavior. Can anyone offer an explanation of why turning the screen off is different than hitting home?</p> <p>According to Logcat, here's the sequence of events.</p> <p>When Screen is turned off-OnPause is called; OnCreate is called; OnResume is called; OnPause is called again</p> <p>When screen is turned back on- OnResume is called (before phone is even unlocked)</p>
java android
[1, 4]
5,559,047
5,559,048
select multiple items in asp.net listbox from code
<p>I have two databound listboxes. The first only shows items that have been assigned to my product. The second listbox shows all available items. What I want to do is select all of the items in listbox 2 that list box one contains.</p> <p>For example:<br /> ListBox1-<br /> Item 1<br /> Item 3<br/><br /> ListBox2-<br /> Item 1 (Selected)<br /> Item 2<br /> Item 3 (Selected)<br /></p> <p>Code I have:</p> <pre><code>List&lt;string&gt; myList = new List&lt;string&gt;(); foreach(ListItem f in ListBoxSourceDetail.Items) { myList.Add(f.Value); } myList.ForEach(delegate(string n) { ListBoxSourceEdit.SelectedValue = n; }); </code></pre>
c# asp.net
[0, 9]
5,831,602
5,831,603
Making Subids And Postback Tracking Work
<p>I am coding a Bounty Script in Php. (Reward Script),using open source code from Prosper202.Trying to track leads with Subids and Postbacks.I am not able to get this stuff to work. Example.</p> <p>I would like to append Unique id at end of url. Like <code>http://google.com/c3={unique_id}</code></p> <p>Here Unique id needs to be generated randomly atleast vaild for 15 minutes and needs to be stored in Mysql database.</p> <p>When Successful third party server sends postback in format.</p> <pre><code>http://watever.com/c3={unique_id} </code></pre> <p>We then need to compare both in real time. (this needs to be as fast as possible to avoid delays to end user.)</p> <p>What should we use in this Case?</p> <p>JavaScript to use for Postback or php?</p> <p>And how to manipulate the postback in php script.</p> <p>As i mentioned. This Script Prosper202 also have same feature of tracking postbacks. But i am not able to extract useful code from it.</p> <p><strong>Resources:-</strong></p> <pre><code>http://prosper.tracking202.com/apps/ http://prosper.tracking202.com/forum/6/21/tracking-subids#7848 </code></pre>
php javascript jquery
[2, 3, 5]
2,551,460
2,551,461
How do I unbind "hover" in jQuery?
<p>How do I unbind "hover" in jQuery?</p> <p>This does not work:</p> <pre><code>$(this).unbind('hover'); </code></pre>
javascript jquery
[3, 5]
4,633,536
4,633,537
Understanding a factorial function in python
<p>I'm trying to understand if the following Python function:</p> <pre><code>def factorial(i): if not hasattr(factorial, 'lstFactorial'): factorial.lstFactorial = [None] * 1000 if factorial.lstFactorial[i] is None: iProduct = 1 for iFactor in xrange(1, i+1): iProduct *= iFactor factorial.lstFactorial[i] = iProduct return factorial.lstFactorial[i] </code></pre> <p>would produce the same results as the equivalent in C#:</p> <pre><code>long factorial(long n) { return n &lt;= 1 ? 1 : n * factorial(n-1); } </code></pre> <p>for a value of 12 or less.</p> <p>I know nothing about Python but have just converted some Python code to C#. This was the only function that I didn't fully understand.</p>
c# python
[0, 7]
2,031,786
2,031,787
Which quotation marks to use and when?
<p>for example here in documentation <a href="http://api.jquery.com/attribute-contains-selector/" rel="nofollow">http://api.jquery.com/attribute-contains-selector/</a> it says</p> <pre><code>$('input[name*="man"]') </code></pre> <p>I would write instead</p> <pre><code>$("input[name*='man']") </code></pre> <p>is there any reason to use single or double quotation marks on inside or outside ?? is it just a matter of taste?</p>
javascript jquery
[3, 5]
96,075
96,076
How would I write this split with php instead of javascript
<p>I was manipulating a string with javascript to split numbers that i need in a pattern like this :</p> <pre><code>150952-0535 </code></pre> <p>generated from a number like this :</p> <pre><code>15095205350008 </code></pre> <p>The javascript is like this and it does the trick :</p> <pre><code>var s7img = '15095205350008'; s7img = '&lt;img src="http://site.com/images/' + s7img.substring(0, 6) + "-0" + s7img.substring(7, s7img.length - 4) + '?$product_stamp$"&gt;'; </code></pre> <p>How could I accomplish the same thing just using php? I started poking around with something like :</p> <pre><code>$sku = "15095205350008"; $s7img = substr($sku, 0,6); </code></pre> <p>But I am not sure... </p>
php javascript
[2, 3]
1,596,390
1,596,391
jquery fire event when element is shown
<p>I need to fire an event on the following conditions for an image:</p> <p>1) The image has been loaded (the following function takes care of that) 2) The image is shown. (if the image has not been shown yet, height() and width() return zero, meaning I cannot resize the image.</p> <p>The main problem here is that my image has been loaded into the child of a hidden div. Since it is a child of the hidden div, change() will not work.</p> <p>Here is the function I am currently using:</p> <pre><code> //Takes the number of pixesl to resize the x-axis of the image to $.fn.resizeImage = function(newX) { return this.each(function() { $this = $(this); //The load event is defined via plugin and takes care of the problem of the load event //not firing for elements that have been cached by the browser. $this.bind('load', function(){ var y = $this.height(); var x = $this.width(); //return if image does not for some reason if(x == 0 || y == 0){return;} //alert('y: ' + y + ' x: ' + x); var ratio = y / x; var newY = Math.floor(newX * ratio); $this.height(newY); $this.width(newX); }); }); }; </code></pre>
javascript jquery
[3, 5]
4,641,300
4,641,301
Jquery scroller causing horizontal scrolling issue on all browsers
<p>I'm having horizontal scrolling issues and i'm thinking my jquery for the slider is causing the issue. Go to and you'll see the issue. It is difficult to show the code since I have no idea what to fix. Thanks :)</p>
c# jquery
[0, 5]
4,263,475
4,263,476
Is it possible to reveal the contents of a div from right to left
<p>I created a fiddle</p> <p><a href="http://jsfiddle.net/gifcy/bJJ5s/5/" rel="nofollow">http://jsfiddle.net/gifcy/bJJ5s/5/</a></p> <p>On DOM ready I hide the image. </p> <p>I could successfully reveal the image from left to right using animate function.</p> <p>Can someone show how to reveal from right to left. What additional parameters need to used. </p>
javascript jquery
[3, 5]
4,818,328
4,818,329
Need help comparing an array against a var
<p>Hi I can't seem to get this right. Basically if the value of a select list is either "USA", "CAN", or "MEX" it should return true. any other value should return false. This only returns true if the value is "USA"</p> <pre><code>$.validator.addMethod( "ReutersNA", function(value, element) { var selectedCountry = $("#Country").val(); var NorthAmerica = new Array("USA","CAN","MEX"); if($.inArray(selectedCountry,NorthAmerica)) { return false; } else return true; }, "Cannot select Reuters News outside of North America." ); </code></pre>
javascript jquery
[3, 5]
5,182,995
5,182,996
find the height of a div and change the current div height to match
<p>I'm trying to make a div the same height as the parent (if the parent is larger) or make the parent the same height as the current div (if the current div is larger)</p> <p>Here's what i've got so far</p> <pre><code>$(this).parents().find('.address').slideToggle(function() { $(this).parent().height($(this).parent().find('.address').height()) }) </code></pre> <p>It makes the parent the height of the current div (but in my current case the parent is larger than the current div</p> <p>Any ideas?</p> <p>Thanks</p> <p>Jamie</p>
javascript jquery
[3, 5]
2,958,810
2,958,811
Tutorial for porting php app to Android?
<p>Does anyone know a tutorial or book that gives a good step-by-step for porting a web browser based PHP application to an Android app? I've seen some stuff for the various steps that are required but nothing that ties it all together. Basically, I have a PHP app that works fine in my browser on my PC, but I want to create an app for Android phones. Here's what it does in Chrome:</p> <ol> <li>User logs in (if not yet logged in), hosted (remote) database looks up UserID and sets a cookie on the client. If a user doesn't have an account, they can register an email address and password to create an account.</li> <li>UserID is used to pull n rows of data and display them on a page, ie 3 rows with 3 columns in each row. This is dynamic and could be 12 rows of 3 columns.</li> <li>User can click on any row to get a detail view of that row information.</li> <li>Android camera using QR Reader app (can I build this into my app?) can snapshot a QR code, which leads to a URL that updates a row in the remote database, returns updated row information to the client (ie row 5 column 3 gets set to a value of +1 or -10)</li> <li>It would be handy to store the database values locally on the Android device, but it's absolutely required to be updated in the remote database. Therefore a local sqlLite db isn't really needed.</li> </ol> <p>That's pretty much it. Also, I assume the trickiest part here is working with the QR code. I've tried running the app through the Android browser but it always caches and I can't add anything to the URL string because the QR code is set to a specific URL, so I need to totally refresh the browser activity each time for the database change to take effect. I'd also like to keep the URL stuff hidden so that people can't update the data without the QR code (by just refreshing the browser).</p> <p>If anyone knows on online example/tutorial of this or even a book that deals with porting PHP stuff (or any server-side scripting) to Android, I'd appreciate it.</p> <p>Thanks in advance!</p>
php android
[2, 4]
180,533
180,534
Why this very simple javascript/jquery code won't work correctly
<p>I have a very simple JavaScript/jquery code which won't just work correctly. The problem seems to be that positioning of the div with id 'circle' does not seem to get calculated when the loop is run. Just need to know why the problem is occurring and if any fixes available.</p> <p>Here is the link <a href="http://jsfiddle.net/TDRyS/" rel="nofollow">http://jsfiddle.net/TDRyS/</a> Basically what I am trying to do is trying to move the ball up once it is at a distance of 500px from the top.</p> <p><strong>The code:</strong></p> <pre><code>var maxa = document.width; var maxb = document.height; $(document).ready(function() { dothis(); }); function dothis() { var left = parseInt(document.getElementById('circle').style.left); var top = parseInt(document.getElementById('circle').style.top); if (top &gt;= 500) { $("#circle").animate({ top: "-=" + Math.floor(Math.random() * 100 + 1) + "px", left: "-=" + Math.floor(Math.random() * 100 + 1) + "px" }, 1000); } else { $("#circle").animate({ top: "+=" + Math.floor(Math.random() * 100 + 1) + "px", left: "+=" + Math.floor(Math.random() * 100 + 1) + "px" }, 1000); } dothis(); }​ </code></pre>
javascript jquery
[3, 5]
2,540,329
2,540,330
How to only show input fields if checkbox is checked?
<p>Basically, I want to only show these fields if checkbox is selected, if it becomes unselected, disappear.</p> <pre><code>&lt;input type="checkbox" name="supplied" value="supplied" class="aboveage2" /&gt; &lt;ul id="date"&gt; &lt;li&gt;&lt;input id="start" name="start" size="5" type="text" class="small" value="1" /&gt;&lt;/li&gt; &lt;li&gt;&lt;input id="end" name="end" size="5" type="text" class="small" value="2" /&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I've tried something like:</p> <pre><code>$('#supplied').live('change', function(){ if ( $(this).val() === 'supplied' ) { $('.date').show(); } else { $('.date').hide(); } }); </code></pre> <p>Any advice would be greatly appreciated =)</p>
javascript jquery
[3, 5]
2,792,588
2,792,589
Resume timer with jQuery
<p>I am using the plugin from <a href="http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/" rel="nofollow">http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/</a></p> <p>I want to Resume the timer. I wrote this, as I also want to get the data from server. But <strong>onResume</strong> is not working (Means the timer is not resetting).</p> <pre><code>$.get("test1.php?data="+message, function(result){ // $("div").html(result); $('#idletimeout').html(result)._onResume(); }); </code></pre>
javascript jquery
[3, 5]
2,575,577
2,575,578
System.UnauthorizedAccessException on a simple ASP.Net File.IO operations
<p>In ASP.NET (hosted) I need a simple file IO operation to read data out of a file and then force a download. Its really that simple.</p> <p>I keep getting a <code>System.UnauthorizedAccessException</code> when executing the following code:</p> <pre><code>System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Open); </code></pre> <p>Locally it works fine, but when i upload to the shared hosting account i get the above exception.</p> <p>Whats strange is that in the browser if i enter the full path to the file, i can see and use the file.</p>
c# asp.net
[0, 9]
992,192
992,193
Jquery - More than 1 "$(document).ready" = dirty code?
<p>is it OK to use the </p> <pre><code>$(document).ready(function () { // some code }); </code></pre> <p>more than 1 time in the javascript code?</p> <p>Thanks in advance! Peter</p>
javascript jquery
[3, 5]
5,582,310
5,582,311
Images will not upload on web server but ok on local
<p>I have some images on server i want to upload it on another server i make code to upload all images on server but it is OK to upload on local but i didn't know what is wrong in that it can't be upload on server </p> <pre><code> try { byte[] content; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); using (BinaryReader br = new BinaryReader(stream)) { content = br.ReadBytes(500000); br.Close(); } response.Close(); string CompleteDPath = "ftp path"; string UName = "abc"; string PWD = "123"; WebRequest reqObj = WebRequest.Create(CompleteDPath + file_name); reqObj.Method = WebRequestMethods.Ftp.UploadFile; reqObj.Credentials = new NetworkCredential(UName, PWD); reqObj.GetRequestStream().Write(content, 0, content.Length); reqObj = null; //FileStream fs = new FileStream(file_name, FileMode.Create); //BinaryWriter bw = new BinaryWriter(fs); //bw.Write(content); //fs.Close(); //bw.Close(); } catch (Exception ex) { Response.Write(ex.Message); } </code></pre>
c# asp.net
[0, 9]
510,175
510,176
Argument not getting passed into function
<p>I am trying to simply pass a variable from a click event to an outside function. I keep getting my console.log string when testing for undefined.</p> <p>Here is my click event.</p> <pre><code> $("#previous, #next").click(function() { if ((this).id == 'next') { slideID++ } else { slideID-- } clearInterval($('#slides').data('interval')); $("ul.pagination li").removeClass("current"); portfolioSwitch(slideID); }); </code></pre> <p>I call the portfolioSwitch function with the argument of slideID. I have tested with my console to see if the slideID exists. It comes back with the id I want.</p> <p>On my function I have this code.</p> <pre><code>if (portfolioSwitch.slideID === undefined) { console.log('Its undefined!'); } </code></pre> <p>It comes back as undefined still. So I did a console.log on the actual argument from the function.</p> <pre><code>console.log(portfolioSwitch.slideID); </code></pre> <p>It still is undefined. Why isn't it being passed?</p>
javascript jquery
[3, 5]
4,549,170
4,549,171
Why can't change the value from inside Jquery $.post function (JavaScript)
<p>I am trying to get the response from ajax call and save it in another value but wont work this is my code</p> <pre><code>x='go' $.post("someurl",function(data){ x=data; }) alert(x)//go </code></pre> <p>or this <a href="http://jsfiddle.net/8vF3K/1/" rel="nofollow">jsFiddle</a></p> <p>I am looking for a solution for this problem without storing the value in any HTML container</p>
javascript jquery
[3, 5]
1,726,070
1,726,071
Rewrite URL to a more meaningful URL - C#
<p>I am pulling in some URLs from following SQL table with following columns:</p> <ul> <li>Name - Contains the Name of site</li> <li>URL - Contains the URL of site</li> </ul> <p>I am then generating dynamic HyperLinks and attaching them to a gridview column:</p> <pre><code>protected void grdReport_Bnd(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[1].Visible = false; e.Row.Cells[2].Visible = false; string qry = e.Row.Cells[2].Text; // Pulling the URL string username = (string)Session[Constants.AssociateID]; // Pulling associate ID frpm session. string qry1 = qry + "?ID=" + username; // Passing the associate ID to the URL string txt = e.Row.Cells[1].Text.ToString(); // Pulling the text to display on hyperlink. HyperLink lnk = new HyperLink(); lnk.Text = txt; lnk.NavigateUrl = qry1; lnk.Attributes.Add("Border", "0"); lnk.Attributes.Add("Target", "_blank"); e.Row.Cells[3].Controls.Add(lnk); } } </code></pre> <p>Now I need to hide this resultant URL. For example the URL at the hyperlink may be: <code>http://1.20.40.40:8050/?ID=123456</code> which should be displayed as <code>http://mysite.com/ABC</code> where <code>abc</code> is the text from hyperlink and <code>mysite.com</code> is the site where this hyperlink is getting displayed.</p> <p>I have seen various examples but could not understand them.</p>
c# asp.net
[0, 9]
4,233,358
4,233,359
android-java: check boolean value checking for null
<p>I am trying for null check like below </p> <pre><code>if (isTrue == null) </code></pre> <p>compile error says : "The operator == is undefined for the argument type(s) boolean"</p> <p>Please help, how to do null check.</p> <p>Thanks </p>
java android
[1, 4]
2,694,728
2,694,729
how to get checkbox bulk value in javascript
<p>i want to get all the details of youtube,so if the user tick the checkbox i want to get the full details of video in javascript,i have done but only i can get first word from the you tube name, you tube name,example $name="Geet - Episode 456 - Clip 1 [24th November 2011] <em>HQ</em>" so alert(name) is showing only Geet .why? i need full name. this is my code:where i have do the mistake.</p> <pre><code> &lt;?php $watch="youtubelink"; $thumbnail="youyubeimage"; $val="somevalue"; $name="youtubename"; //eg:$name="Geet - Episode 456 - Clip 1 [24th November 2011] *HQ*"; $results=$watch.",".$thumbnail.",".$val.",".$name; ?&gt; &lt;input type="checkbox" name="checkbox[]" id="checkbox[]" class="addbtn" value=&lt;?php echo $results;?&gt; /&gt; </code></pre> <p>this is my js:</p> <pre><code> function chkbox() { $('[name^=checkbox]:checked').each(function() { var ckballvalue=($(this).val()); var fields = ckballvalue.split(/,/); var link = fields[0]; var thumbnail = fields[1]; var name = fields[3]; //var description = fields[4]; var categ = fields[2]; alert(name); var data = { action: 'my_action', link:link, thumbnail:thumbnail, name:name, categ:categ }; </code></pre>
php javascript
[2, 3]
495,892
495,893
Dialog box inside tab group not firing
<p>I am having a great difficulty on these part. I cannot call my dialog when I put my class inside Tab Group. Is there anyway I could do this?</p> <p>This is my dialog creator @Override protected Dialog onCreateDialog(int id) {</p> <pre><code> switch (id) { case 1: return createDialog(); default: return null; } } @Override protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case 1: // Clear the input box. EditText text = (EditText) dialog.findViewById(TEXT_ID); text.setText(textme); text.setKeyListener(null); break; } } private Dialog createDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(SpecialofMonth.this); final EditText input = new EditText(this); input.setId(TEXT_ID); builder.setView(input); builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); return builder.create(); } </code></pre> <p>Calling it on button click</p> <pre><code> View.OnClickListener handlesReadme = new View.OnClickListener() { public void onClick(View v) { showDialog(1); } }; </code></pre> <p>This one works when it is outside the tab group. But in vice versa or when it is inside, it is not working..</p> <p>Can you help me out?</p>
java android
[1, 4]
3,552,945
3,552,946
Call a function after a bunch of other functions are complete
<p>So I've got these functions:</p> <pre><code>function UrlExists(url){ $.ajax({ url: url, success: function(data){ alert('exists'); }, error: function(data){ alert('fail'); } }); } function addScript(filepath, callback){ if (filepath) { var fileref = document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", filepath); if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref); } if (callback) { callback(); } } </code></pre> <p>And then in my <code>$(document).ready()</code> I've got a bunch of these:</p> <pre><code>addScript(roofPathMrtu.js); addScript(roofPathTrtu.js); addScript(lowerPathMrtu.js); etc... </code></pre> <p>Which I then need to check if they were successfully loaded or not, so I call:</p> <pre><code>UrlExists('roofPathMrtu.js'); </code></pre> <p>The problem is that this UrlExists function is not working, and I think it's because it is running before all the addScript functions are done.</p> <p>How can I have my UrlExists function run only after all the addScript functions are done? I was going to use the callback parameter of the addScript function on the last one, but I don't think that is gonna work.</p>
javascript jquery
[3, 5]
4,301,797
4,301,798
GetAsynchKeyState for Ctrl+B? How?
<p>I am using</p> <pre><code>public static bool IsKeyPushedDown(Keys vKey) { return 0 != (GetAsyncKeyState((int)vKey) &amp; 0x8000); } </code></pre> <p>but I don't know how to combine 2 keys.</p>
c# c++
[0, 6]
5,008,580
5,008,581
Using javascript to insert id into list elements
<p>I am messing around with a deck of cards that I made.I have it set up so that there is a method that spits out cards by suit into a list, so if I want spades I get a <code>&lt;ol&gt;</code> of all of the spades cards. I am now trying to give each <code>&lt;li&gt;</code> element an id depending on what card it is. ace will be <code>&lt;li id="ace"&gt;&lt;img src="ace_spades.gif"/&gt;&lt;/li&gt;</code> king will be <code>&lt;li id="king"&gt;&lt;img src="king_spades.gif"/&gt;&lt;/li&gt;</code> for example.The list is in order from top to bottom akqj1098765432 . I tried doing this:</p> <pre><code>var card_id=["ace","king","queen","jack","ten","nine","eight","seven","six","five","four", "three","two"]; var counter=0; while (counter&lt;=12) { $(document).ready(function(){ $("li").eq(counter).attr("id", card_id[counter]) }); counter++; } </code></pre> <p>but it doesn't work. I have not really done anything with javascript before besides simple jquery stuff. What am I getting wrong here?</p>
javascript jquery
[3, 5]
167,508
167,509
Detect total time the user is logged-in asp.net
<p>I have asp.net web site in which user can login and also do logout Now i need to capture the total time duration for which user was logged-in to the site. So to do this i need to know two things 1. Login time 2. Logout time</p> <p>At the time of login i can get the first thing which is "Login time", thats fairly easy Now the second thing is more complicated. How do i update the Logout time? I know i can update it on the logout button but what if user directly close the browser? I have setup the global.asax file but i dont think "Session_End" event will fire on closing the browser. I have seen some of the website in which where you close the browser window it shows on dialog saying something like "press Ok to stay on the page OR press "Cancel" to stay on the current page". I am thinking i can use the UpdatePanel's PageMethods to do my task here. Is this possible? If yes then how?</p> <p>Do you guys have any other idea to find out the total logged-in time for the user? </p> <p>Thank you.</p>
javascript asp.net
[3, 9]
898,545
898,546
What is the best and easiest-to-use 5 star rating script for JQuery?
<p>5 star rating plugin? AJAX.</p>
javascript jquery
[3, 5]
2,174,644
2,174,645
asp.net web application goes to login page after about 15 minutes
<p>I have a web application, and for some reason which I cannot figure out, It goes to the login page every 15 minutes (I believe the session is idle). I have no where web config file that specify a timeout even close to that. Has anyone ever had an issue like this or know where I could look to try and fix the problem? thanks for any help.</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/Login.aspx" timeout="90" defaultUrl="~/" name="" protection="All" /&gt; &lt;/authentication&gt; </code></pre>
c# asp.net
[0, 9]
456,372
456,373
Variable cannot be resolved
<p>I am trying to create an item list, diffrent for each i and j variable. My code is:</p> <pre><code>if (i == 0) { if (j == 0) { final CharSequence[] items = {"4:45", "5:00"} } else if (j == 1) { final CharSequence[] items = {"4:43", "4:58"} } else if (j == 2) { final CharSequence[] items = {"4:41", "4:56"} } else { final CharSequence[] items = {"4:38", "4:53"} } </code></pre> <p>...</p> <pre><code>new AlertDialog.Builder(this) .setTitle("Hours") .setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialoginterface, int i) { // getStation(i); } }) .show(); } </code></pre> <p>I get an error in the line <code>.setItems(items,</code>:</p> <pre><code>items cannot be resolved </code></pre> <p>I think that the compiler thinks that the <code>CharSequence[] items</code> may not be initialised or something... How can I make this programme run?</p>
java android
[1, 4]
3,459,063
3,459,064
Access value of listbox assigned through jquery
<p>I am assgining values to the listbox through jquery. After assgining the values on button click event, i am not able to get the items in the list box. It shows empty item list. I am able to get the values through hidden field, but is there any better way around? </p> <p>Thanks</p> <p><strong>Update</strong></p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(function() { $("#imgbtnRight,#imgbtnLeft").click(function(event) { var id = $(event.target).attr("id"); var selectFrom = id == "imgbtnRight" ? "[id*=lbAllStores]" : "[id*=lbIncludedStores]"; var moveTo = id == "imgbtnRight" ? "[id*=lbIncludedStores]" : "[id*=lbAllStores]"; var selectedItems = $(selectFrom + " option:selected").toArray(); $(moveTo).append(selectedItems); }); }); </code></pre> <p></p>
jquery asp.net
[5, 9]
5,881,133
5,881,134
Internet request works the first time, but not on subsequent requests
<p>On the first request it goes to the internet and retrieves the data. When I try it again, it just gives me the data that is already in the inputstream. How do I clear the cached data, so that it does a new request each time?</p> <p>This is my code:</p> <pre><code>InputStreamReader in = null; in = new InputStreamReader(url.openStream()); response = readFully(in); url.openStream().close(); </code></pre>
java android
[1, 4]
4,493,509
4,493,510
form data email
<p>How would I send e-mail to any specified e-mail address in asp.net C#.</p>
c# asp.net
[0, 9]
3,024,886
3,024,887
jQuery.data('itemname') not working but jQuery.attr('data-itemname') is working
<p>This is weird behavior but when I am trying to access some data attribute using jQuery data() function, it is returning me undefined but attr() is returning me the actual value. I know data works differently as it caches for the first time and then it retrieves from cache. I am using jQuery 1.4.2 and then tried looking with jQuery 1.7.1 and it did work. But I can't upgrade to 1.7.1 at the moment. Any thoughts on it?? </p> <p>I will appreciate any kind of suggestion or help provided</p>
javascript jquery
[3, 5]
2,000,758
2,000,759
jquery permanently alter html
<p>How would I go about permanently add a class to a html element using jQuery.</p> <p>I am planning on building a image gallery that is sorted into types/categories using the <a href="http://www.jscodes.com/jquery-sorting-product-pictures/" rel="nofollow">jQuery sorting plugin</a>. I want to add a dropdown box below each image that allows the user to change the type (add/remove class) which permanently changes the HTML for next load. How would I go about this?</p> <p>EDIT: Ok so from what I can put together I should use this approach:</p> <ol> <li>Jquery add/removes class.</li> <li>Send full HTML of source via AJAX request.</li> <li>PHP writes full HTML to file or is there a way to replace only a particular part of a file in PHP?</li> </ol>
php jquery
[2, 5]
3,354,887
3,354,888
capture outgoing packet sent by google chat in my application
<p>I am familiar in using xmpp library,for android i'm using asmack library.In Google chat also asmack is used.i can write an application to send/receive messages using xmpp.But now i want to track google chat messages in my application.what ever the user do in google chat the same sholud be happening in my application.Suppose that user logged in google chat,in my appication also he is logged in.Sent messages /Incomming messages also should be in sync.i m able to do every thing except synchronizing outgoing sms.How to capture the packet when user is send a message from google chat into my application. ?</p>
java android
[1, 4]
5,660,992
5,660,993
How to notify user of progress
<p>I am currently planning a web based application, which needs to do long calculations on the server upon request. Now I would like to display a notification to the user, that the calculation is in progress, and then redirect that page as soon as the calculation is done.</p> <p>There is no need to notify the user of the progress or display a progress bar, I simply want to exchange the site as soon as the calculation is done.</p> <p>I am trying to stay clear of any additional webkits besides plain javascript, so <a href="http://stackoverflow.com/questions/2441935/how-to-create-server-side-progress-indicator-in-javascript">this solution</a> is much to complicated.</p> <p>One idea I have is to just start a http query from javascript in the waiting page and not return anything on the server side until the calculation is done. This way I would keep the query blocked until the connection is finished. Once it is done, I return something and close the connection, so the blocked call can continue and redirect the user. However I am afraid that this might give me a timeout on the network if there is nothing going through that connection.</p> <p>How is something like this normally handled?</p>
php javascript
[2, 3]