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
713,617
713,618
How to check the existance of a value from asp designer page?
<p>I'm getting a list of string from db like:</p> <pre><code>AddCustomer, AddUser, ListCustomer, ListUser </code></pre> <p>These are the prefix of asp pages. I need to hide and show certain pages in the page. Following is the html snippet:</p> <pre><code>&lt;li&gt;Customer Management &lt;ul&gt; &lt;%if (AddCustomer) //how to check whether my string is present or not, is it possible? { %&gt;&lt;li&gt;&lt;a href="AddCustomer.aspx"&gt;Add Customer&lt;/a&gt;&lt;/li&gt;&lt;%} %&gt; &lt;li&gt;&lt;a href="ListCustomer.aspx"&gt;List Customer&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre>
c# asp.net
[0, 9]
1,185,743
1,185,744
Unexpected Identifier in Javascript
<p>I am adding content to a list dynamically and I want to be able to prevent adding duplicates. So before content is added I am selecting all the list, make an array and check that the data I am adding is not already contained in the list. However I get a unexpected identifier in my code. This is my code:</p> <pre><code>$(".autocomp_centers").autocomplete({ var ids = new Array(); $("#sister-centers-list &gt; li").each(function(index, value){ ids.push($(value).attr('class')); console.log($(value).attr('class')); }); serviceUrl:'/suggest_centers', maxHeight:400, width:252, params: {country: $("#country").val() }, minChars:2, onSelect: function(value, data){ if ($.inArray(data, ids) == -1){ alert("Sister center has already been added."); }else{ $("#hidden-ids").append('&lt;input type="hidden" name="center_ids[]" value="' + data +'" class="center-' + data + '"/&gt;'); $('#sister-centers-list').append('&lt;li class="center-' + data + '"&gt;' + value + ' &lt;a href="#sister-center" class="remove-center-before-save" id="' + data + '"&gt;Remove&lt;/a&gt;&lt;/li&gt;'); } $("#sister-search").val(""); } }); </code></pre> <p>When the person starts typing and this method is called, I get the list values and store them in an array. When they select a value, I check if the value is already in the array. This is the line that causes the error: <code>var ids = new Array();</code></p>
javascript jquery
[3, 5]
3,281,076
3,281,077
Where can I find a good and concise Android development tutorial for an intermediate Java Developer?
<p>I am an intermediate level Java programmer (with more experience in C# and PHP), and I am interested in learning the basics of Android Development. My problem currently is that I have a long commute to work which means that I effectively have only 2 or 3 hours a week I can spend on "for fun" programming.</p> <p>Given my circumstance, what I could really use is a tutorial that is descriptive enough to help me understand the different components of an Android App, while still being concise enough to allow me to read and attempt to implement some ideas of my own in small chunks.</p> <p>Normally I would just invest the time in Google, but I figure that I will get much better results from a community of those who have been through a similar search. Thanks all!</p>
java android
[1, 4]
3,838,770
3,838,771
What are the different keyboard types in Android?
<p>I have seen these:</p> <pre><code>InputType.TYPE_CLASS_PHONE InputType.TYPE_CLASS_TEXT </code></pre> <p>Are there more? What are they and what specifically do they display differently than the others?</p>
java android
[1, 4]
5,454,892
5,454,893
Can onclick take a function in a function?
<p>THis is what I want.</p> <p>onclick="pager(function2();)</p> <p>but it doesn't seem to work.</p>
javascript jquery
[3, 5]
4,325,848
4,325,849
Multiple functions in for loop
<p>Can i create multiples functions inside for loop?</p> <pre><code>var mySound1 = new buzz.sound( "laser-01", { formats: [ "ogg", "mp3", "acc" ]}); var mySound2 = new buzz.sound( "alien-noise-01", {formats: [ "ogg", "mp3", "acc" ]}); var sound = [mySound1, mySound2] // additional sounds var $i; for ( $i = 0; $i&lt; sound.length; $i++){ function playsound[$i](){ a[$i].play().fadeIn().loop(); } } playsound1(); </code></pre>
javascript jquery
[3, 5]
3,260,883
3,260,884
How to create a div with jQuery accordion
<p>Im using this: </p> <pre><code>&lt;script&gt; $(function() { $( "#accordion" ).accordion(); }); &lt;/script&gt; </code></pre> <p>To get the effect of expand/collapse. (If you know a better plugin or method, pls notice me)</p> <p>I have this div: <code>&lt;div id ="accordion"&gt;&lt;/div&gt;</code></p> <p>And this code to create a button inside that div. (dont worry about the content of button)</p> <pre><code>$('#button_submit').click(function() { $("#accordion").append( $("&lt;button id=saved"+j+"&gt;").click(function() { drawChart.apply(null, myArray); }).html("&lt;b&gt;Start date:&lt;/b&gt;"+""+myArray[0]+"\n&lt;b&gt;End date:&lt;/b&gt;"+myArray[1]+"\n&lt;b&gt;Chart type:&lt;/b&gt;"+myArray[2]+"") ); </code></pre> <p>My question is, how to create/format div accordion to have this effect <a href="http://jqueryui.com/accordion/" rel="nofollow">accordion effect jquery</a> . </p> <p>being that the <code>&lt;button id=saved"+j+"&gt;</code> should appear inside the <code>sections</code>.</p> <p>Cheers</p>
javascript jquery
[3, 5]
1,184,744
1,184,745
How to embed a new line in innertext
<p>How will I be able to force a newline(or a line break) in innertext</p> <pre><code>HtmlGenericControl li; li = new HtmlGenericControl("li"); li.InnerText = sdr.GetValue(0).ToString()+"\n"+sdr.GetValue(1).ToString(); myList.Controls.Add(li); </code></pre>
c# asp.net
[0, 9]
3,277,887
3,277,888
JavaScript Knobs
<p>I came across <a href="http://builtbybuffalo.com/" rel="nofollow">this site</a> and half way down there is a section that says few stars and there are 5 circles. I want similar kind of stuff. I am not a very hard core JS or JQ coder, but i can just play around with the code. So i downloaded anthonyterrien.com/knob/</p> <p>I modified the code to generate something like <a href="http://test.eduvative.in/js/" rel="nofollow">this</a>. (Not using the readOnly=true; but removing the JS code and using disabled in the input field.)</p> <p>How do i add the flow to the radius that appears similar to the one i mentioned in the starting, some glow on the radius when it starts to appear and a % sign just next to the values that are there.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,664,235
2,664,236
Pasing the selected checkbox integer values in gridview in a single list
<p>I ve a gridview with checkbox, wherein if I select the checkboxes, the respective values are got using datakeys.How do I pass the values in a list as a whole instead of loopin with foreach? I need to pass it in asingle variable. Any help is appreciated</p> <pre><code> foreach (GridViewRow row in gvAll.Rows) { string status =row.Cells[4].Text; CheckBox chkb = (CheckBox)row.FindControl("chk"); //Rows[i].Cells[0].FindControl("CheckBox1"); if (chkb.Checked) { int id = Convert.ToInt32(gvAll.DataKeys[row.RowIndex].Values[0]); //int id =int.Parse(a); if (!(id.Equals(System.DBNull.Value))) { if (String.Equals(a, status)) { SC.Mark(id); } if (String.Equals(b, status)) { SC.Mark_next(id); } } } </code></pre>
c# asp.net
[0, 9]
1,826,160
1,826,161
VoiceRecognition.java - No Internet connection or Airplane mode
<p>I'm looking to allow my <code>VoiceRecognition.java</code> code to start another activity if it sees that the Phone does not have a signal/internet connection/etc. Here is the code (adopted from Google).</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Inflate our UI from its XML layout description. setContentView(R.layout.voice_recognition); // Get display items for later interaction Button speakButton = (Button) findViewById(R.id.btn_speak); View exitButton = findViewById(R.id.exit_button); exitButton.setOnClickListener(this); mList = (ListView) findViewById(R.id.list); // Check to see if a recognition activity is present PackageManager pm = getPackageManager(); List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (activities.size() != 0) { speakButton.setOnClickListener(this); } else { speakButton.setEnabled(false); Intent b = new Intent(this, ReminderEditActivity.class); startActivity(b);; } } </code></pre> <p>I tried to add the intent with the <code>ReminderEditActivity.class</code>. Furthermore, I tried to flip the If statement around to say that if (<code>activitysize = 0</code>) then go to the <code>ReminderEditActivity.class</code>. I got an error there.</p>
java android
[1, 4]
1,399,144
1,399,145
jquery animate help needed
<p>I am using animate in jQuery. I am getting problem to execute animate. It executes after test function I want to run this before test function </p> <pre><code> $('.next').live('click',function() { $('.ac_bgimage').animate({ left:"-100em" }, 15000 ); test(); }); </code></pre> <p>but now when i click on next class my test function execute first , i want to execute later after execution of animate. </p>
php javascript jquery
[2, 3, 5]
1,733,760
1,733,761
test onclick in a function
<p><strong>Quick question</strong>: How do i check if a submit button is clicked in a function.</p> <p><strong>explained question</strong>: ok, so I have a validate script for my sign-up page. The validate function is run onblur of every input (after the submit button has been clicked first). </p> <p>However, the validate script not only gives the inputs a red background if the correct information hasn't been entered, but it also displays an alert message. </p> <p>My problem is: I only want to display the alert message if the submit button is clicked, otherwise i just want to do change the background color. So how do I check if a submit buttons is clicked, in a function. I could just have two different functions, one to be run for all the inputs. and one to be run for the submit button. </p>
javascript jquery
[3, 5]
1,360,019
1,360,020
how can i catch the browser has gone to exit now
<p>how can I catch that the browser has gone to exit now using javascript.</p>
javascript jquery
[3, 5]
5,295,140
5,295,141
How check whitespaces?
<p>Want to check white spaces in a form. If somebody inserted some text without spaces, what to do? How validate this</p>
php javascript
[2, 3]
1,392,045
1,392,046
Can I remove just the last added class from an element with jQuery
<p>Hey guys, the question pretty much asks itself... however, for more clarity:</p> <p>I have an element called "chuckPalahniuk" and it has classes named "choke", "fightclub" and "haunted".</p> <p>How could I get it so when I click on the "chuckPalahniuk" element, it removes "haunted" first, then "fightclub" on the second click and "choke" on the third?</p> <p><strong>also</strong>: be aware that the class names are dynamically added.</p> <p>Cheers. peeeps!</p> <p>psy.example:</p> <pre><code>$('#chuckPalahniuk').click(function() { $(this).removeLastClassAdded(); //except this function doesn't exist... }); </code></pre>
javascript jquery
[3, 5]
5,532,520
5,532,521
Finding tags within tags in jquery and replacing content
<p>I have four <code>article</code> tags in my html page with the class <code>col</code>. Inside each article I have a <code>div</code> with the class <code>heading</code>. Inside of that I have an <code>img</code> tag.</p> <p>I'm trying to iterate through each artcle and remove that image tag and replace with some different html.</p> <p>This in Wordpress, hence the funky jquery function wrapper.</p> <p>Right now im just trying to get the finding and replacing working (below) - I haven't attempted the different code for each article bit yet. I can't figure out why the below doesn't work.</p> <pre><code>(function ($) { $(document).ready(function() { $('article.col').each(function(el) { $((el).find('heading img').replaceWith('&lt;newtag&gt;somecode&lt;/newtag&gt;')); }); }); }(jQuery)); </code></pre>
javascript jquery
[3, 5]
287,648
287,649
I am trying to hide text in a ASPX page that is tied to a textbox
<p>So there is a a table and a text box in one of the cells</p> <pre><code>&lt;td&gt; &lt;asp:TextBox ID="tbSomeTextBox" Columns="5" runat="server"&gt; % &lt;/td&gt; </code></pre> <p>This textbox gets shown if a certain selection is made in a drop down. The problem is that I would like the "%" character to also be hidden or shown with the textbox.</p> <p>I have tried putting the whole textbox control inside a DIVand in my JQuery hiding the DIV at the same time I hid the textbox. </p> <pre><code>&lt;td&gt; &lt;div id="divSomeDIV"&gt;&lt;asp:TextBox ID="tbSomeTextBox" Columns="5" runat="server"&gt; % &lt;/div &lt;/td&gt; </code></pre> <p>But I get an error in my java script that id="divSomeDIV" doesn't exist in the current context. </p> <pre><code>$("#&lt;%=divSomeDiv.ClientID%&gt;").hide(); </code></pre> <p>Wrapping that single character in a asp:Label seems like overkill. </p> <p>Any suggestions?</p>
c# asp.net jquery
[0, 9, 5]
183,548
183,549
HttpModule to catch all extensions
<p>I've created HttpModule in ASP.NET, and configured it successfully. My problem is, the module is called only when I give the URL extension (i.e. aspx), if i dont put any extension, the module won't be called.</p> <p>How can I solve this?</p> <p>thanks</p>
c# asp.net
[0, 9]
1,359,305
1,359,306
Make jquery toggle work with dynamic content
<p>I've the following code on my website: <a href="http://jsfiddle.net/dJLK3/1/" rel="nofollow">http://jsfiddle.net/dJLK3/1/</a> As you can see, it works just fine.</p> <p>The problem is: those divs and link triggers come from a database. Today I have 1, tomorrow it can be 10...</p> <p>I can not figure out how to convert it and make it work without needing to right lot's of codes like link1, link2, link3, link4, link5 and so on...</p> <p>Anyone? :)</p>
javascript jquery
[3, 5]
5,752,841
5,752,842
Android: assets alternative
<p>I'm using <strong>assets</strong> as standard <strong>icons storage</strong> but now I have request that these icons should be <strong>updated</strong> for some cases. I know that I can't touch assets, so do you have any suggestions where to store them?? These files should be <strong>pre-installed</strong> and <strong>updated</strong> for some cases. From start I've been thinking about <strong>Internal Storage</strong> but now I have some doubts. What do you think???</p>
java android
[1, 4]
232,683
232,684
Divide the image into 4 equal parts by clicking on the button
<p>How to divide the single image into 4 equal parts when user clicks on the button.</p>
java android
[1, 4]
3,703,776
3,703,777
Android vs. Java updates
<p>I couldn't find this question asked, so I gotta ask: how closely does Android tie it's OS updates to Java's updates? I am currently developing on the latest version of Java (sometimes I'll work out the Java side and then stick it into Android) and I don't want to worry about Android's JVM.</p>
java android
[1, 4]
1,574,004
1,574,005
Stop Android Notification Bar From Appearing on Touch Events
<p>I need help removing or modifying the correct motion or touch events from the services.jar that call the notification bar to appear. I have a full screen application that keeps getting interrupted by the appearance of the notification bar. I understand I won't be able to do this at the application level but need to decompile the services.jar and edit the code directly.</p>
java android
[1, 4]
3,436,032
3,436,033
PHP + Jquery - page move on top after an ajax call
<p>I make this code that, after 9 seconds, it call an ajax function, and print the result elaborated from the server to the client.</p> <p>This is the JS code :</p> <pre><code>function changeSponsor() { $.ajax({ type: 'POST', cache: false, url: './auth/ajax.php', data: 'id=changespon', success: function(msg) { $('.menusponsor').hide().fadeIn(1000).html(msg); } }); } $(document).ready(function() { x=window.setInterval("changeSponsor()", 9000); }); </code></pre> <p>the result is printed on a div at the top of the page. when the result is printed to the client (after, as said, 9 seconds), and I am at the bottom of the page, the page go automatically at the top. I don't want this. </p> <p>You can see an exemple at this <a href="http://www.cabigolino.it/" rel="nofollow">link</a> : open this page, go to the bottom (is not so long this page) and after few seconds (9). You will se the page scroll at the top.</p> <p>How can resolve this problem? Cheers</p>
php jquery
[2, 5]
1,837,809
1,837,810
How do I build a specialized JQuery Timer
<p>I have an asp.net page where two grid views are available showing current stock market price updates. I need to update these two grid views every 20 seconds. So I was thinking of using JQuery to do this job.</p> <p>What I need is a timer which will fire every 20 seconds, send an ajax request to the servers, bring the order lists from the server using json and then update those two grid views. If a request to the server is still being served 20 seconds after it is fired, then I want the old one to be aborted without causing any trouble.</p> <p>I already know how to bring objects using json. I just need to figure out how to send a request every 20 seconds and cancel a request if it is still being server for 20 seconds.</p>
asp.net jquery
[9, 5]
1,611,123
1,611,124
Convert DataRow to TableRow
<p>Simple enough. Cant find a simple solution. Not sure if their is a simple solution? :/</p> <p>I have a dataTable. I essentially want to achieve this...</p> <pre><code>DataTable dt = new DataTable(); dataAdapter.Fill(dt); TableRow tr = new TableRow(); tr = dt.Rows[0]; </code></pre> <p>but i cant convert from DataRow to a TableRow! </p> <p>Help!</p> <p>Alex</p>
c# asp.net
[0, 9]
5,517,481
5,517,482
how to call javascript function from another domain?
<p>working with a asp.net 3.5 solution with various projects. I have a javascript file called MyScript which sits in WebprojectA. What I would like to do is refer to this scriptfile in my WebProjectB? example some code in aspx page in WebProjectB:</p> <pre><code>//this script sits in WebProjectA: &lt;script src="../Scripts/Myscript.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
2,726,307
2,726,308
How to pass the date and time from one layout to another
<p>First layout has a button to pick date,another button to pick time. After picking date &amp; time from popups, a next button is clicked. On this click , the second layout that contains date and time picker. In this we have to set the previously fetched date and time...</p>
java android
[1, 4]
3,698,042
3,698,043
JQuery and Variables in Multiple JS files
<p>I am having variables that reference html ID's like</p> <pre><code>&lt;div data-role="footer" id="ftrPaxFlight"&gt; &lt;h4&gt;&amp;#169; 2012, BT&lt;/h4&gt; &lt;/div&gt; </code></pre> <p>and I am having a javascript embedded in html using jQuerry which is like</p> <pre><code>&lt;script&gt; $(document).ready(function() { var ftrPaxFlight = $('#ftrPaxFlight'); var butMainLogin = $('#butMainLogin'); var butMainSetup = $('#butMainSetup'); ..... butMainLogin.bind("click", function() { getChangeFtr(); }); </code></pre> <p>Where getChangeFtr is a function located in an external .js file. I want to seperate the logic from UI. This file is also included under tags </p> <pre><code>function getChangeFtr(){ alert("Ftr will be changed " + ftrPaxFlight); } </code></pre> <p>When the button is clicked .. the method getChangeFtr() is called, I am getting an error - TypeError - ftrPaxFlight is undefined.</p> <p>Can someone guide me to the right way of passing variables to multiple javascript files using jQuery..? thanks D</p>
javascript jquery
[3, 5]
5,783,853
5,783,854
pass optional function as parameter to another function
<p>Options of how I want to call a function:</p> <pre><code>myAjax("http://ajaxurl.com", { prop: val }, function(resp) { alert(resp); }); </code></pre> <p>or</p> <pre><code>function handleSuccess(resp) { alert(resp); } myAjax("http://ajaxurl.com", { prop: val }, handleSuccess); </code></pre> <p>or</p> <pre><code>myAjax("http://ajaxurl.com", { prop: val }, null); </code></pre> <p>or</p> <pre><code>myAjax("http://ajaxurl.com", { prop: val }); // param not even provided </code></pre> <p>How can I handle this on the myAjax function definition? Something like this...?</p> <pre><code>function myAjax(url, jsonData, successFunc) { $.ajax({ ... all the necessary ajax stuff that normally goes here , success: function(response) { // custom myAjax success handling goes here. this must happen before optionally-passed-in successFunc gets executed // what goes here? this? if (typeof successFunc != 'undefined' &amp;&amp; successFunc != null) { successFunc(response); } } }); } </code></pre> <p>I tried something like the above, but, it did not call the success function. Do I need to check if successFunc is a function?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,068,423
3,068,424
Accurate time on Android
<p>Is there an way to get a time very precisely in Android . I found ntp is the best way to do this ..is there any existing library is there in android for taking ntp time .? Any help is appreciated. Thanks in advance </p>
java android
[1, 4]
1,234,134
1,234,135
No highlight on mouse Select?
<p>I just need to find a solution to not authorized my user to highlight anything from my website on mouse select ?</p> <p>Is this possible ?</p>
javascript jquery
[3, 5]
386,974
386,975
How to use ajax with asp.net webforms
<p>Is there any way to use ajax I'm using Jquery for this) with asp.net webforms without having to run through the pages life cycle? </p>
jquery asp.net
[5, 9]
2,901,382
2,901,383
Invoking a method when the back button is pushed on Android
<p>I am programming an Android application. I would like to invoke a certain method once the user pushes the "back" button. I want the program to work on all versions of Android, so I cannot use onBackPressed(). I tried the following piece of code (in the class MyView extends View):</p> <pre><code>@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) { // do something on back. return true; } return super.onKeyDown(keyCode, event); } </code></pre> <p>But when I run it and press the back button, the program exits. Is there a different way to treat the back button?</p> <p>Thank you in advance.</p>
java android
[1, 4]
388,107
388,108
How would I make a playlist editor for mp3 flash object?
<p>I have an mp3 player embedded into my site and would like to have a box on my site where they can edit playlist. I need to know, How would I begin to make a playlist editor in php for an mp3 flash object? ..So they may add songs/edit songs/delete song if posted , etc</p> <pre><code> &lt;object style="position:absolute;top:1px;left:400px;z-index:12;" type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3.swf" width="200" height="20"&gt; &lt;param name="movie" value="http://flash-mp3-player.net/medias/player_mp3.swf" /&gt; &lt;param name="bgcolor" value="#94C0DF" /&gt; &lt;param name="FlashVars" value="mp3=http%3A//flash-mp3-player.net/medias/another_world.mp3&amp;amp;volume=50&amp;amp;showinfo=1&amp;amp;bgcolor=94C0DF&amp;amp;bgcolor1=B4E8FB&amp;amp;bgcolor2=B4E8FB&amp;amp;buttoncolor=330026&amp;amp;slidercolor1=888888&amp;amp;sliderovercolor=00d600" /&gt; &lt;/object&gt; </code></pre>
php javascript
[2, 3]
526,243
526,244
How to create a tracking script with js and php?
<p>I want to create a simple tracking script to give to my clients. Something similar with GA but very basic.</p> <p>The requirements are <li> give the clients a single and simple js script like google Analytics does <li> make most of the logic inside the js file loaded by 3th party sites from the main site <li> collect in PHP the information and store it</p> <p>What I can't figure yet is what are the ways to do this? Google from what I see is loading a gif file, stores the information and parses the logs. If I do something similar sending the data to a php file Ajax cross site policy will stop me, from what I remember.</p> <p>So what is a clean way to do this ? ( I don't need code just the logic behind it )</p>
php javascript
[2, 3]
4,437,734
4,437,735
Writing UTF-8 string to socket in Java
<p>At the moment I use</p> <pre><code>serverOutput = new DataOutputStream(socketCliente.getOutputStream()); </code></pre> <p>and then</p> <pre><code>serverOutput.write(data.getBytes()); </code></pre> <p>and it works fine UNTIL I add any non standard characters (for example ñ) and then as many characters I add, that number of characters are cut from the end of the file and don't arrive.</p> <p>Full source code is available here in PandroidAgentTentacle.java</p> <p><a href="http://pandora.svn.sourceforge.net/viewvc/pandora/trunk/pandora_agents/android/src/pandroid/agent/" rel="nofollow">http://pandora.svn.sourceforge.net/viewvc/pandora/trunk/pandora_agents/android/src/pandroid/agent/</a></p>
java android
[1, 4]
473,294
473,295
How to get the installed application list that uses gps in android?
<p>I have this code which returns a list of all installed application of a device:</p> <pre><code>PackageManager pm = this.getPackageManager(); Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); List&lt;ResolveInfo&gt; list =pm.queryIntentActivities(intent,PackageManager.PERMISSION_GRANTED); for (ResolveInfo rInfo : list) { results.add(rInfo.activityInfo.applicationInfo.loadLabel(pm) .toString()); Log.w("Installed Applications", rInfo.activityInfo.applicationInfo .loadLabel(pm).toString()); } </code></pre> <p>But now I want to get only those application in my list which uses gps service, as far as i learned that if I can filter the permission being taken in those apps then I can solve it, but dont know how to do this.</p>
java android
[1, 4]
2,610,783
2,610,784
Need assistance with implementing the iOS folder on the Android
<p>I was working on an android application, where I need to implement the iOS folder in the application. So guys can you suggest some way for me to implement this. The image below is what I want to implement. Thanks in advance.</p> <p><img src="http://images.anandtech.com/reviews/gadgets/apple/iOS4/folder.jpg" alt="folder"></p>
java android
[1, 4]
4,561,409
4,561,410
Insert record using jQuery after ajax call doesn't work
<p>I have an insert and load record (jQuery &amp; PHP) script working fine without using AJAX. but after the AJAX call, insert (jQuery) doesn't work.</p> <p>This is my code:-</p> <pre> $(".insert").live("click",function() { var boxval = $("#content").val(); var dataString = 'content='+ boxval; if(boxval==''){ alert("Please Enter Some Text"); } else{ $.ajax({ type: "POST", url: "demo.php", data: dataString, cache: false, success: function(html){ $("table#update tbody").prepend(html); $("table#update tbody tr").slideDown("slow"); document.getElementById('content').value=''; } }); } return false; }); $(".load").live("click",function() { $.ajax({ type: "POST", url: "test.php", success: function(msg){ $("#container").ajaxComplete(function(event, request, settings){ $("#container").html(msg); }); } }); }); }); </pre>
php jquery
[2, 5]
4,061,066
4,061,067
jquery .show() .hide() puzzle
<p>I'm writing a simple jquery animation to show/hide a block of stuff when the title is clicked. The markup looks like this:</p> <pre><code>&lt;section class="infoblock off"&gt; &lt;h2&gt;&lt;span class="sectiontitle rounded-right"&gt;TITLE (click to show/hide)&lt;/span&gt;&lt;/h2&gt; &lt;div class="info"&gt;&lt;/div&gt;&lt;!--info--&gt; &lt;/section&gt; </code></pre> <p>My javascript looks like this:</p> <pre><code> $(".infoblock h2").click( function(event) { //console.log('show info'); if ( $(this).parent( $('.infoblock') ).hasClass('off') ) { $(this).parent( $('.infoblock') ).removeClass('off'); $(this).parent( $('.infoblock') ).addClass('on').children( $('.info') ).show(300); console.log( 'On function. Parent class= '+$(this).parent( $('.infoblock') ).attr('class') ); } else if ( $(this).parent( $('.infoblock') ).hasClass('on') ) { $(this).parent( $('.infoblock') ).removeClass('on'); $(this).parent( $('.infoblock') ).addClass('off'); $(this).parent( $('.infoblock') ).children( $('.info') ).hide(300); console.log( 'Off function. Parent class= '+$(this).parent( $('.infoblock') ).attr('class') ); } }); </code></pre> <p>This works <strong>BUT</strong> when I click the title the second time to hide the <code>.info &lt;div&gt;</code> the title gets hidden as well. WHY?!</p>
javascript jquery
[3, 5]
884,991
884,992
Video converting into mp3 on Java, Android
<p>I need to convert mp4/flv files info mp3 in my Android application, but I don't know C/C++ and Android NDK. Do you know libraries/methods for easy converting on Java? Thank you for anyway. </p>
java android
[1, 4]
5,596,677
5,596,678
How can I convert this working JAVASCRIPT code to JQUERY
<pre><code> &lt;script language="javascript" type="text/javascript"&gt; function hasPasswordChanged(value) { if(value == '1') { var container = document.getElementById("sNav"); if(document.getElementsByTagName) { var hyperLinkList = container.getElementsByTagName("a"); for(var currentLink in hyperLinkList) { hyperLinkList[currentLink].disabled = true; hyperLinkList[currentLink].onclick =function () { return false;} } } } } window.onload = function () { hasPasswordChanged('&lt;% = HasPasswordAlreadyChanged %&gt;'); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,805,582
1,805,583
How do you make animations not fire unless previous is done (withtout using callback)
<p>I have a function called: </p> <pre><code>this.makeStuffHappen() </code></pre> <p>Which makes different animations according to a switch statement and a couple of variables. Is it possible to make a function not fire unless all previous are done resolving.</p> <p>I want to write something like </p> <pre><code>$('button').click(function(){ a.makeStuffHappen(); b.makeStuffHappen(); c.makeStuffHappen(); d.makeStuffHappen(); }); </code></pre> <p>And then it should only run b after a is done, c after b is done and d after c is done. Is it only possible to make animations wait for the previous by chaining them? Is it possible to chain any function? </p> <p>Edit: makeStuffHappen() is animating different elements so a.makeStuffHappen() will animate a different element than b.makeStuffHappen and so on.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,597,521
4,597,522
Passing data between webpages
<p>I have a webpage with a form on it. The heading of the form is this: </p> <pre><code> &lt;form name="sw" METHOD ="POST" ACTION="logger1.php"&gt; </code></pre> <p>After some event has happened, a javascript function submits the form like this: </p> <pre><code> document.forms["sw"].submit(); </code></pre> <p>The php file logs the data from the form in a text file on the server, and then redirects the browser to another page. My issue is that I want to examine one of the values in the form from the previous page on the page that the browser is redirected to. I am completely lost. help!</p>
php javascript
[2, 3]
2,622,978
2,622,979
How to increase the height of combo box in asp.net
<p>I have a drop down list in asp.net. I want to increase its height. please suggest, how to icrease it.</p>
c# asp.net
[0, 9]
3,246,058
3,246,059
Check if Facebook is blocked then redirect
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4814752/whats-the-best-way-to-check-if-a-website-is-up-or-not-via-javascript">What’s the best way to check if a website is up or not via JavaScript</a> </p> </blockquote> <p>We're about to run a campaign through our Facebook page. Ideally we'd like to have the url we're using for this campaign (eg. www.oursite.com/campaign) redirect all traffic to our Facebook url (eg. www.facebook.com/example). However, many workplace networks block social media sites, so before automatically redirecting I'd like to first check if the user's network allows Facebook: if yes, redirect to Facebook; if no, continue through to our url (www.oursite.com/campaign). </p> <p>Any help would be greatly appreciated, </p> <p>Ryan (I'm ok with PHP, newb to javascript )</p>
php javascript
[2, 3]
1,537,614
1,537,615
Escaping Javascript in PHP
<p>I'm looking for the best way to escape some Javascript text in PHP, and <code>json_encode</code> is the wrong tool for the job.</p> <p>The problem comes from this line: <code><pre> echo " onclick=\"SwitchDiv('" . $option . "')\""; </pre></code> If there's an apostrophe in <code>$option</code>, this is a juicy ball of client-side fail. But doing a straight <code>json_encode</code> (which works perfectly well in other contexts) doesn't help: <code><pre> echo " onclick=\"SwitchDiv(" . json_encode($option) . ")\""; </pre></code> That creates an output string of <code>onclick="SwitchDiv("athlete's foot")"</code>, resulting in premature termination of the <code>onclick</code> value. (Which also happens if I enclose the <code>onclick</code> value in single quotes.)</p> <p>Is there an elegant way around this? Should I just funnel the <code>json_encode</code> output through a regex that will escape the single quotes?</p>
php javascript
[2, 3]
4,388,348
4,388,349
loop to get the href attr and put as a variable as text in html
<p>I am getting myself confused with the DOM.</p> <p>I have this HTML:</p> <pre><code>&lt;div class="my-list"&gt; &lt;div class="name"&gt;&lt;/div&gt; &lt;div class="title"&gt;&lt;a href="some_url"&gt;&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="my-list"&gt; &lt;div class="name"&gt;&lt;/div&gt; &lt;div class="title"&gt;&lt;a href="some_url"&gt;&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And this JavaScript:</p> <pre><code>var myList = $(".my-list"); for (var i=0; i &lt; myList.length; i++) { // what I want is at myList[i] to get the // $(".title a").attr("href") as a variable // and then put this variable as text // into the html of the $(".name") html } </code></pre> <p>What is a good way to construct this?</p>
javascript jquery
[3, 5]
557,610
557,611
how to get the javascript function value in textbox?
<p>i am write the javascript function like this, my problem is i can pass the values (quantity and price ) retrive amount, print the amount in lable and textbox(same values), but label is working and textbox value after select another operation first value will come , what is the problem in the code or any modification (i am using OnChange event) and some time working with IE browser (but add the master page doesnot work any browser)</p> <pre><code>function Total(Quantity,Price,Amt) { var Quan=document.getElementById(Quantity).value; var Pric=document.getElementById(Price).value; var tt=document.getElementById('lblTotal').innerHTML; //var h=document.getElementById('h1').value; //tt=h; if(tt=='') { tt=0; } if(Quan=='') { } else { var cc1=document.getElementById(Amt).value; if(cc1!='') { tt=parseFloat(tt)-parseFloat(cc1); } document.getElementById(Amt).value=(parseFloat(Quan)*parseFloat(Pric)).toFixed(2); var cc=document.getElementById(Amt).value; //document.getElementById(Amt).value=cc.toFixed(2); document.getElementById('lblTotal').innerHTML = (parseFloat(tt)+parseFloat(cc)).toFixed(2); document.getElementById('h1').value=document.getElementById('lblTotal').innerHTML; document.getElementById("&lt;%= TextBox1.ClientID %&gt;").innerText =document.getElementById('lblTotal').innerHTML; } </code></pre>
javascript asp.net
[3, 9]
3,150,413
3,150,414
jquery help is required for z-index
<p>at following link i've placed some jquery script. <a href="http://www.onemileaway.com/test3/cirle.html" rel="nofollow">www.onemileaway.com/test3/cirle.html</a> i've added pie.htc to make circles.</p> <p>what i'm doing here is to rollover 5 circle to change background color and upon click it keep the color of rollover effect.</p> <p>when i click on first circle and now rollover on second one its not applying z-index:1000. as i've applied it in .hover effect.</p> <p>please understand and hlep me.</p> <p>code can be viewed by viewsource.</p> <p>thank you</p>
php javascript jquery
[2, 3, 5]
2,649,996
2,649,997
jQuery load div then when link is clicked pass variables
<p>I'm trying to load a php inside a <code>div1</code> using jquery. The code I have so far below works fine for loading the initial <code>div1</code>.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#div1").load('load.php'); }); &lt;/script&gt; &lt;div id="div1"&gt;&lt;/div&gt; </code></pre> <p>Inside <code>load.php</code> I will have links like this below</p> <pre><code>&lt;a href="load.php?id=123456"&gt;Link 1&lt;/a&gt; &lt;a href="load.php?id=1234567"&gt;Link 2&lt;/a&gt; &lt;a href="load.php?id=12345678"&gt;Link 3&lt;/a&gt; </code></pre> <p>What I'm trying to do is on the page the <code>div1</code> is loaded, when the links load inside the <code>div1</code> I want to be able to click on the links and it will pass the <code>?id=</code> var inside the <code>div1</code> and re-load <code>load.php?id= var here</code>.</p> <p>How would I go about doing this?</p>
php jquery
[2, 5]
910,710
910,711
How to disable particular cell or control in DataGrid?
<p>How to disable particular cell or control in <code>DataGrid</code>?</p>
c# asp.net
[0, 9]
2,530,221
2,530,222
android countdown timer continues to run in background
<p>I want to make a 30 second countdown to run in my activity and continue to run until it hits 0. Is there any method? </p> <p>Basically I want it to run and update its value in a textview.</p>
java android
[1, 4]
425,355
425,356
how to create a list of span for a given array
<p>Let's say I have an object which looks like that:</p> <pre><code>var users = ['user1', 'user2']; </code></pre> <p>For this object I would like to create a list of span like that:</p> <pre><code>"&lt;span&gt;user1&lt;/span&gt;&lt;span&gt;user2&lt;/span&gt;" </code></pre> <p>I did try the following code</p> <pre><code>$('&lt;span/&gt;').text(users); </code></pre> <p>but it does not work properly, any ideas?</p>
javascript jquery
[3, 5]
2,239,771
2,239,772
Why must I define a variable outside a javascript function definition? (jQuery / #anchor question)
<p>I am writing a jQuery function that relies on knowing the current #anchor of the page. I am using the jQuery URL Parser plugin to get the anchor.</p> <pre><code> $.fn.vtabs = function() { alert("Your anchor is "+$.url.attr('anchor')); } </code></pre> <p>This code gives me the anchor "#nav" endlessly (I use #nav in some of the my links). I can type in "#newanchor" into the browser bar endless times, and click url's to this page that use different anchors, but always this code gives me "#nav".</p> <p>I fixed my problem by changing the code to:</p> <pre><code> var current_anchor = $.url.attr('anchor'); $.fn.vtabs = function() { alert("Your anchor is "+current_anchor); } </code></pre> <p>Now it always gives me the correct anchor. But I don't know why, and it appears messy to have that variable defined outside of the function.</p>
javascript jquery
[3, 5]
5,450,159
5,450,160
Jquery Toggle Hide / Show Nav Element
<p>After some great help from Josh Mein with a Javascript Hide/Show menu, the menu is working 100%, though I would like it when the page loads, that the menu is in it's "Hide state". Here is the jsFiddle link: <a href="http://jsfiddle.net/8y7Sr/3/" rel="nofollow">http://jsfiddle.net/8y7Sr/3/</a> ...when you load the page, the menu is showing and when you clicking on "Toggle Menu", it will HIDE the nav. That's perfect BUT How can I make it so that when you load the page, the menu is in it's hide state already and when you click on "Toggle Menu", the nav slides up? Josh mentioned that, to get this right, I must comment <code>$("#stickyfooter").show();</code> out and add <code>class="show_hide"</code> to the div ID stickyfooter . I've been fiddling around but I can't seem to get it working. I've most likely done something wrong but can anyone clarify what Josh mean't? Thanks in advance :)</p>
javascript jquery
[3, 5]
1,070,591
1,070,592
Why does my Android Calculator crash?
<p>Why is my app crashing? I'm using eclipse. I don't see why it would crash. Everything seems fine to me. No missing semi-colins that I see.</p> <pre><code>package rechee.cool; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class HelloAndroidActivity extends Activity { /** Called when the activity is first created. */ public EditText display; double total1=0; double total2=0; char theOperator; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); display= (EditText) findViewById(R.id.editText1); } String display1= display.getText().toString(); public void getOperator(String btnText){ theOperator = btnText.charAt(0); double displayValue= Double.parseDouble(display1); total1+=displayValue; display.setText(""); } public void onClick(View v) { switch(v.getId()){ case R.id.bOne: display.append("1"); break; case R.id.bTwo: display.append("2"); break; case R.id.bThree: display.append("3"); break; case R.id.bFour: display.append("4"); break; case R.id.bFive: display.append("5"); break; case R.id.bSix: display.append("6"); break; case R.id.bSeven: display.append("7"); break; case R.id.bEight: display.append("8"); break; case R.id.bNine: display.append("9"); break; case R.id.bZero: display.append("0"); break; case R.id.bPoint: display.append("."); break; case R.id.bClear: display.setText(""); break; case R.id.bAdd: String btn_text= (String) getText(R.id.bAdd); display.setText(btn_text); //getOperator(display1); break; //case R.id.bEqual: } } } </code></pre>
java android
[1, 4]
3,699,204
3,699,205
Write File as Response in C# in ASP.NET
<p>I have an ASP.NET Web Forms app written in C#. On one of the screens, the user can click a button. When that button is clicked, I need to generate some XML and open it in a custom app. I'm trying to understand how I can take the XML that I have generated, and automatically open the app that can understand it.</p> <p>The app that uses this XML is a custom app. This app uses a proprietary file format. The file is really just XML. But, I've noticed that the file extension is .ctm. </p> <p>Is there a way for me to just open this XML in the custom app when someone presses the button in my ASP.NET web form?</p> <p>Thank you!</p>
c# asp.net
[0, 9]
1,535
1,536
how do I strip white space when grabbing text with jQuery?
<p>I'm wanting to use jQuery to wrap a mailto: anchor around an email address, but it's also grabbing the whitepace that the CMS is generating.</p> <p>Here's the HTML I have to work with, the script as I have it and a copy of the output.</p> <p>html</p> <pre><code>&lt;div class="field field-type-text field-field-email"&gt; &lt;div class="field-item"&gt; [email protected] &lt;/div&gt; &lt;/div&gt; </code></pre> <p>jQuery JavaScript</p> <pre><code>$(document).ready(function(){ $('div.field-field-email .field-item').each(function(){ var emailAdd = $(this).text(); $(this).wrapInner('&lt;a href="mailto:' + emailAdd + '"&gt;&lt;/a&gt;'); }); }); </code></pre> <p>Generated HTML</p> <pre><code>&lt;div class="field field-type-text field-field-email"&gt; &lt;div class="field-items"&gt;&lt;a href="mailto:%0A%20%20%20%[email protected]%20%20%20%20"&gt; [email protected] &lt;/a&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Though I suspect that others reading this question might want to just strip the leading and tailing whitespace, I'm quite happy to lose all the whitespace considering it's an email address I'm wrapping.</p> <p>Cheers,<br /> Steve</p>
javascript jquery
[3, 5]
2,851,436
2,851,437
show decimal places on client side division
<p>I am populating a template field using the following code</p> <pre><code>&lt;%# ((ListData)Container.DataItem).TotalMinutes / 60.00 %&gt; </code></pre> <p>However, sometimes the returned value shows up like 40.5 or 29 or 34.75.</p> <p>I would like it to always show the 2 decimal places whether it is 40.50 or 29.00 or 34.75. The 2 decimal places should always show.</p> <p>I also tried</p> <pre><code>&lt;%# string.Format("{0:###.##}", (double)((PendingApprovalListData)Container.DataItem).TotalMinutes / 60D)%&gt; </code></pre>
c# asp.net
[0, 9]
718,916
718,917
Code convention for jQuery function chaining/nesting
<p>As jQuery devs know, jQuery allows easy dynamic HTML creation like this</p> <pre><code>var d = $('&lt;div/&gt;') .append('some text') .append( $('&lt;ul/&gt;').append( $('&lt;li/&gt;').text('list item') .css("color", "blue") .click(function() { // do something }) ) ); </code></pre> <p>What's a good coding convention for creating dynamic HTML like this that can go down an arbitrary number of levels, while still being able to identify where I am in the element hierarchy and can spot if I've closed all the parentheses/braces properly?</p> <p>Please don't direct me to a templating library.</p>
javascript jquery
[3, 5]
950,661
950,662
Change HTML table contents to image format
<p>I want to get some idea's about my task. i want to change My HTML table content code to a image format. i did get any idea . can any one please give me an idea..</p>
c# asp.net
[0, 9]
1,637,948
1,637,949
Java or C++, for game development
<p>Honestly, learning a programming language is not really that hard for me, the problem lies in choosing the one I want to work with. After a lot of evaluation i narrowed my list down to Java or C++. Anyways, I have now come to the point of where I have to master the advanced parts of one of these two languages, and then begin creating a indie game together with my freinds. So I ask all you experienced programmers out there what you would recommend? Personaly I love coding in java more than in c++, but as I am planning on creating a kind of big and complex game, I fear that memory management could become a huge problem, so wouldn't c++ be better? I am aiming toward programming a game that has similar gameplay style to the yet to be released Wasteland 2. (<a href="http://vimeo.com/59292662" rel="nofollow">http://vimeo.com/59292662</a>). So how should I choose? Java or C++? By the way, could any experienced programmers include they past experiences with the two languages? Successes/failures. Oh and, I remember reading somewhere that different languages like java and c++ are combined sometimes when making games, anyone know why this is necessary? Can't you do everything you can in java, in c++ and the other way around?</p>
java c++
[1, 6]
3,593,922
3,593,923
Does a php like checkdate() function exist in JavaScript?
<p>In php there is a checkdate (month, day, year) function which helps in checking whether the date is a proper date or not. Does a similar function exist in JavaScript or jQuery?</p>
javascript jquery
[3, 5]
245,833
245,834
Is there a way to add Apple remote support to a website using Javascript?
<p>I like how you can use the Apple remote in front row and i know other apps on the mac support it. I am wondering if Web Apps could support it via Javascript? I had a idea for a tv type interface. I would have it understand the Apple remote and also understand up down left right enter back. I know from working on a slideshow app before that left and right keys have a number that is passed when pressed. Does the Apple Remote pass anything or how could i make web apps understand it?</p>
javascript jquery
[3, 5]
5,250,818
5,250,819
How to stop SharePoint from writing JavaScript code over and over?
<p>I'm using PIE.js to force IE7 to use CSS3 styles. However, whenever an element on my SharePoint page contains the class that PIE is supposed to style, it actually inserts the code into the html when rendered. Then upon editing the page, the code is added again on top of the old code. So at first I start with a simple tag with a class, then I end up with 200+ lines of code. </p> <p>The question: How can I prevent SharePoint from literally writing the rendered code from the javascript?</p> <p>I know this is a larger issue than just PIE.js...any javascript append or prepend actually prints the code in SharePoint. </p>
javascript jquery
[3, 5]
3,627,537
3,627,538
Do I need a loop if I am only returning one row using SQLite? (Android Dev)
<p>I have been using the following metod using a for loop but it occurred to me that I am only returning one row- so is it necessary to have a loop? </p> <p>i.e my code resembles this: </p> <pre><code>public String topSwimmerSponsor() { Cursor c = ourDatabase.rawQuery("SELECT " + KEY_SWIMMERLAPS + " * " + KEY_SPONSOR + " AS result, " + KEY_NAME + " FROM " + DATABASE_TABLE + " ORDER BY result DESC limit 1", null); String result = ""; for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) { result = result + c.getString(1) + "\n"; } return result; } </code></pre> <p>However I am attempting to change it to the following: </p> <pre><code>public String topSwimmerSponsor() { Cursor c = ourDatabase.rawQuery("SELECT " + KEY_SWIMMERLAPS + " * " + KEY_SPONSOR + " AS result, " + KEY_NAME + " FROM " + DATABASE_TABLE + " ORDER BY result DESC limit 1", null); String result = ""; result = result + c.getString(1) + "\n"; return result; } </code></pre> <p>However my app crashes. What is the correct way to implement this? Thanks. </p>
java android
[1, 4]
5,147,739
5,147,740
onSubmit javascript form event swap out image?
<p>I have the following input button code. How do I alter this code to use a greyed out version of the button called <code>btn_nxt.png_hold.gif</code> once the submit occurs?</p> <pre><code>&lt;input onsubmit="this.disabled=true;return true;" type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="images/btn_nxt.png" /&gt; </code></pre>
php javascript jquery
[2, 3, 5]
5,147,830
5,147,831
setInterval started with a button or started alone
<p>How can i active/fire/trigger the setInterval with a button? and if the button is not clicked how to make it auto fire on 3 second, but if i click on the button it fire it on 0.1 second and restart evrything. please help me out guys</p> <pre><code>$('button').click(function(){ setInterval(function(){ updateStats("updateStats"); }, 100); }); else setInterval(function(){ updateStats("updateStats"); }, 3000); </code></pre> <p><em>Edit</em></p> <p>Only everytime the button is clicked 100ms, if not clicked then it most do it auto on 3000ms, unless you click it ofc</p> <p>Part :</p> <pre><code>function updateStats(stat) { var stat = ["GAME","USERS"]; var url = "NET.php"; $.each(stat, function(i, key){ $.post(url, {stats: key}, function(data) { // stats to stat $("#" + key).html(data); $('.s').emoticonize({ //delay: 800, //animate: false }); }); }); } </code></pre>
javascript jquery
[3, 5]
842,736
842,737
Height of the block after deleting a product
<p>Here is the link - <a href="http://layot.prestatrend.com/" rel="nofollow">http://layot.prestatrend.com/</a> After deleting a product from shopping cart the block #cart_block_slide_content does not change its height while not hovering on it one more time. Here is the code, you can find it at ajax-cart-top.js:</p> <pre><code>$('#cart_block_top').hover(function() { var h = parseInt($('#cart_block_top_list').height())+ 'px'; $("#cart_block_slide_content").stop().animate({height: h}, {queue:false, duration: 500, easing: "easeOutBounce"}); }, function() { $("#cart_block_slide_content").stop().animate({height: 0}, {queue:false, duration: 300}); }); </code></pre> <p>So is there a way to make a block's height animating after deleting a product from shopping cart?</p>
javascript jquery
[3, 5]
200,926
200,927
Resizing Targeted Window
<p>I would like to resize the targeted window after my hyper link is clicked is this possible?</p> <pre><code> &lt;asp:HyperLinkField DataNavigateUrlFields="myID" DataNavigateUrlFormatString="../names /view.aspx?myID={0}" DataTextField="name" HeaderText="Name" SortExpression="Name" ItemStyle-Width="100px" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" Target="_blank" /&gt; </code></pre>
c# asp.net
[0, 9]
5,108,171
5,108,172
How make object for POST request
<p>I need to make especial javascript object for AJAX request from <code>&lt;ul&gt;&lt;/ul&gt;</code>. I hope for your help</p> <p>My particul worked code</p> <p>link to JSfiddle <a href="http://jsfiddle.net/mbarinov/Qwd6T/19/" rel="nofollow">http://jsfiddle.net/mbarinov/Qwd6T/19/</a></p> <pre><code> $('button').click(function() { var info = new Object(); var client = $(this).parent().find("ul li").each(function(index) { var name = $(this).attr("rel"); var value = $(this).text().trim(); info.Order = { name : value }; console.log(info); }); }); </code></pre> <p>list</p> <pre><code>&lt;ul&gt; &lt;li rel="address"&gt;address&lt;/li&gt; &lt;li rel="phone"&gt;phone&lt;/li&gt; &lt;li rel="name"&gt;name&lt;/li&gt; &lt;li rel="summ"&gt;summ&lt;/li&gt; &lt;li rel="description"&gt;description&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>necessary post request</p> <pre><code>Array ( [Order] =&gt; Array ( [address] =&gt; address [phone] =&gt; phone [name] =&gt; name [summ] =&gt; summ [description] =&gt; description ) ) </code></pre>
javascript jquery
[3, 5]
972,619
972,620
how to deal with '&', '(', ')' in javascript
<p>from my code behind i am passing this to client side script</p> <p><strong>C# code behind</strong> *<em>note if i comment the below line than <strong>i dont get js error</strong>.</em>*</p> <pre><code> if (btnDelete != null) { btnDelete.Attributes["onclick"] = String.Format("return DeleteRow('{0}', '{1}', '{2}', '{3}');", e.Row.ClientID, e.Row.RowIndex, DataBinder.Eval(e.Row.DataItem, "Id"), DataBinder.Eval(e.Row.DataItem, "Name")); } </code></pre> <p></p> <pre><code>//javascript function DeleteRow(rowId, rowIdx, Id, Name) { var result = confirm('Are you sure you want to delete this record? \n\n Id: ' + Id + "\n Name: " + Name); if (!result) HighlightRow(rowId, rowIdx % 2 ? "#DEEEE9" : "#FFFFFF"); return result; } </code></pre> <p>error message:</p> <pre><code>Message: Unterminated string constant Line: 1280 Char: 180 Code: 0 URI: http://localhost:4964/admin/default.aspx Message: Unterminated string constant Line: 1341 Char: 178 Code: 0 URI: http://localhost:4964/default.aspx Message: Expected ')' Line: 1401 Char: 152 Code: 0 URI: http://localhost:4964/default.aspx </code></pre>
javascript asp.net
[3, 9]
2,714,796
2,714,797
How can I execute a Java program within a php script?
<p>I am writing a simple web upload script. The goal is to upload a file using php, and then calling a java program to process this file. I have done the work for uploading the file, but I cannot get a java program to be successfully run from within the php script. I have tried exec(), shell_exec(), and system() with no results. For the command, I have used "java Test", "java &lt; directory >/Test", "/usr/bin/java &lt; directory >/Test", I have even set up the application as a jar file with no results. The actual line of code I have used is:</p> <p>echo shell_exec("java Test");</p> <p>Usually there is no output. However, if I have just shell_exec("java"), then the last line of the help from java ("show splash screen with specified image") is displayed, which shows that the command has been executed. If I use, for example, shell_exec("whoami") I get "nobody" returned, which is correct. The only thing the java file does is create a file so that I can see that the application has been successfully run (the application runs successfully if I run it on the command line). I have set the permissions for the java file to 777 to rule out any possibility of permission errors. I have been struggling with this for a while trying all sorts of options with no results - the file is never created (the file is created with an absolute path so it's not being created and I just can't find the file). Does anyone have any ideas?</p> <p>Thanks.</p>
java php
[1, 2]
180,599
180,600
How can I calculate the width of individual li with varying widths within a ul
<p>Say I have this list below. Each image has a varying width and the a tag has a margin right of 15px which extends the list item a little more to give it some space from the next image.</p> <pre><code>&lt;div id="otherproducts"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alight-slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/eclider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/aluer.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alucr.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>How can I get jquery to give me the correct width of the items in my calculation below so I can give the UL the correct total width because currently the total is coming out much greater than it should...</p> <pre><code>var obj = $(this); var s = $("li", obj).length; var w = $("li", obj).width(); var h = $("li", obj).height(); obj.width(w); obj.height(h); $("ul", obj).css('width',s*w); </code></pre>
javascript jquery
[3, 5]
5,545,381
5,545,382
Using jQuery or ASP.NET, how to download page and then asynchrously download images on page?
<p>Using jQuery or ASP.NET, how to download page and then asynchrously download images on page? Let's say on the page you have a gallery of multiple images grabbed from your database and you want to download page first, and then wait for the images to download asynchrously while displaying some sort of ajax-loader.gif sign. I wonder how it's done?</p>
jquery asp.net
[5, 9]
4,293,277
4,293,278
Hide the same values after a click
<p>i want values that there is in class <code>.hello</code> and they are similar to some of values in class <code>hi</code> (like: <code>hi_2</code> &amp; <code>hi_4</code>), after click on button will are hide they in class <code>.hello</code>. how is it?<p> <strong>EXAMPLE:</strong> <a href="http://jsfiddle.net/yyTH8/3/" rel="nofollow">http://jsfiddle.net/yyTH8/3/</a></p> <pre><code>$('.click').live('click', function () { var val_sp = $(".hi b").map(function () { return $(this).text(); }).toArray(); //if (.hello == val_sp) { $('.hello').text(val_sp).hide() //}; }); </code></pre> <p>html:</p> <pre><code>&lt;button class="click"&gt;Click&lt;/button&gt;&lt;p&gt; &lt;span class="hi"&gt; &lt;b&gt;hi_1&lt;/b&gt; &lt;b&gt;hi_2&lt;/b&gt; &lt;b&gt;hi_3&lt;/b&gt; &lt;b&gt;hi_4&lt;/b&gt; &lt;/span&gt; &lt;span class="hello"&gt; &lt;b&gt;hello_1&lt;/b&gt; &lt;b&gt;hi_2&lt;/b&gt; &lt;b&gt;hello_3&lt;/b&gt; &lt;b&gt;hi_4&lt;/b&gt; &lt;/span&gt; </code></pre>
javascript jquery
[3, 5]
5,815,970
5,815,971
jQuery 'not' function giving spurious results
<p>Made a fiddle: <a href="http://jsfiddle.net/n6ub3/" rel="nofollow">http://jsfiddle.net/n6ub3/</a></p> <p>I'm aware that the code has a LOT of repeating in it, its on the list to refactor once functionality is correct.</p> <p>The behaviour i'm trying to achieve is if there is no selectedTab on page load, set the first tab in each group to selectedTab. If there is a selectedTab present, then use this as the default shown div.</p> <p>However, as you can see from the fiddle its not working as planned!</p> <p>If anyone has any ideas how to refactor this code down that'd be great also!</p>
javascript jquery
[3, 5]
5,270,999
5,271,000
get root URL in javascript
<p>is there a really easy way to turn document.location.href=="http://aaa.bbb.ccc.ddd.com/asdf/sadf/asdf/asdf/asdf/sadf.aspx?blah" into 'aaa.bbb.ccc.ddd.com'?</p> <p>There's gotta be a JS function that does this reliably, but I can't find it.</p>
javascript jquery
[3, 5]
5,413,326
5,413,327
Encryption python/ Decryption android
<p>I made 2 codes one in python and the other in android (eclipse) for encryption and decryption. Now I want to encrypt my data using python and sending it to the android to decrypt it.</p> <p>How to make two different platforms to encrypt/decrypt the data?! Each platform has its own way to do the encryption and decryption , so how can i make them talk to each other and sending data and android extract the exact information which was transmitted?</p> <p>Help is needed!!</p>
android python
[4, 7]
5,640,334
5,640,335
what is a good idea for manage and check pages permission?
<p>i have built a crm with asp.net.I want to set and check </p> <ul> <li>some permission for some pages,</li> <li>some user controls,</li> <li>some panel ,</li> <li>some records in database .</li> </ul> <p>please get me a good idea for manage and check this permission easily.</p>
c# asp.net
[0, 9]
3,037,366
3,037,367
JS Drag slider stops to work when container position is adjusted via jQuery
<p>I am using JS based Drag Slider <a href="http://code.ovidiu.ch/dragdealer/" rel="nofollow">DragDealer</a>. The slider div is placed in a content slider that runs using jQuery. The Drag Slider works as long as its parent div is not animated to move to left by 200px.</p> <p>Fiddle: <a href="http://jsfiddle.net/gentrobot/9b5Xg/3/" rel="nofollow">http://jsfiddle.net/gentrobot/9b5Xg/3/</a></p> <p><strong>HTML:</strong></p> <pre><code>&lt;div style="position:relative;width:400px;height:100px;overflow:hidden;"&gt; &lt;div id="1" style="width:200px;float:left;position:absolute;left:0px;"&gt; Test &lt;/div&gt; &lt;div id="2" style="width:200px;float:left;position:absolute;left:200px;"&gt; &lt;!-- Drag Slider div starts --&gt; &lt;div id="my-slider" class="dragdealer"&gt; &lt;div class="red-bar handle"&gt;drag me&lt;/div&gt; &lt;/div&gt; &lt;!-- Drag Slider div ends --&gt; &lt;/div&gt; &lt;/div&gt; &lt;a href="#" id="clk"&gt;Click to slide&lt;/a&gt; </code></pre> <p><strong>jQuery</strong>(other than JS for Dragdealer):</p> <pre><code>$('#clk').click(function(){ $('#1').animate({left:'-200px'}); $('#2').animate({left:'0px'}); });​ </code></pre>
javascript jquery
[3, 5]
5,675,628
5,675,629
What is the use of creating properties for a variable?
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/1277572/should-i-use-public-properties-and-private-fields-or-public-fields-for-data">Should I use public properties and private fields or public fields for data?</a><br> <a href="http://stackoverflow.com/questions/1180860/c-public-fields-versus-automatic-properties">C#: Public Fields versus Automatic Properties</a> </p> </blockquote> <p>I have the following code:</p> <pre><code>namespace Test { class My1 { private int intMark; //private public int intAge; public int Mark { get { return intMark; } set { intMark = value; } } } class mainClass { static void Main() { My1 obj = new My1(); obj.Mark = 100; obj.intAge = 34; // what is the difference between these statements.. } } } </code></pre> <p>In the above example we can declare intMark as public variable then we can handle with the object. Instead of that why Properties?</p>
c# asp.net
[0, 9]
4,268,005
4,268,006
Event fire again and again when use response method for export gridview to excel
<p>hello everybody i am using c# .net in my webapplication. i have a method for export gridview data to excel name ExportToExcel(). in this method i use response.contenttype, response.clear(),response.write(),stringwriter,htmltextwriter methods. this method work fine and export data correctly. but when i write button1.visible = false above that method call then button does not unvisible. Means i write the following</p> <p>button1.visible = false; // both not work on runtime panel1.visible = false; // ExportToExcel()</p> <p>another problem is that after call ExportToExcel() method if i click on any button on my webpage then ExportToExcel() again call and shows dialog box to save and open excel file.</p> <p>so please help me how to solve this problem I m unable to send code due to company rules so please help me</p> <p>Thank to all in advance</p>
c# asp.net
[0, 9]
1,424,501
1,424,502
calling javascript function from .net codebehind with a value
<p>I am trying to call a javascript function from asp.net codebehind using onclientclick for a linkbutton. Code is like this:</p> <pre><code>string x = "redirecttoimagepage"+"("+ y+")";//y has an int value i need and it varies lnkimagepage.OnClientClick = x; </code></pre> <p>i need to use the value y in the javascript function for using. </p> <pre><code> function redirecttoimagepage(variable) { var strURL = "Subpages.aspx?tabID="+variable; window.open(strURL,"_blank"); return true; } </code></pre> <p>Right now, with the code i have shared, it doesnt do anything. After the link is clicked, it stays in the same page. What am i doing wrong? Appreciate all your help guys. Thanks a lot!</p>
c# javascript asp.net
[0, 3, 9]
560,264
560,265
browser event for window.focus()
<p>Is there a way that when i click on my browser, and give it focus, to run a method once? And then when the browser loses focus and then get focus back to again run that method only once, again.</p> <p>Thanks,</p> <p>rod.</p>
javascript jquery
[3, 5]
543,860
543,861
keep track of parent class from member imageview
<p>I have Class A with an instance variable ImageView. Currently I use setTag() to get from the ImageView back to the instance of Class A. Could that present circular loop? I also heard of mention of weak references. What is the best way to get at the parent Class A of the ImageView? </p> <p>My usage scenario is I am dragging the ImageView around the screen and I need to access class A for information about the ImageView being dragged.</p>
java android
[1, 4]
136,543
136,544
why cant the php function wait for the click instead
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8239891/function-running-automatically-instead-of-a-click">function running automatically instead of a click</a> </p> </blockquote> <p>Hi Guys I am trying so many ways of accomplishing something, I would like the php code run when the js finds that click event instead it runs on page load is there anyway of doing this please help:</p> <pre><code>&lt;script&gt; jQuery('#next').click(function(){ $(this).data('clicked', true); }); if(jQuery('#next').data('clicked')) { function stop() { var stop_record = "&lt;?=$test-&gt;stoprec;?&gt;"; } } &lt;/script&gt; </code></pre>
php javascript jquery
[2, 3, 5]
3,938,734
3,938,735
How to store data in an attribute and then parse on click?
<p>My end goal is to be able to send:</p> <pre><code>$('[data-track]').live('click', function () { mpmetrics.track("Share", {'method': 'twitter'}); }); </code></pre> <p>My question is how I can store the Share, method, twitter in the data-bind attribute so that they are dynamic and I can change the variables on any data-track attribute in my app.</p> <pre><code>&lt;a data-track="XXXXXX" href="#"&gt;Tweet&lt;/a&gt; </code></pre> <p>For XXXXXX, how can I set the 3 variables and then parse them in the data-track binding?</p> <p>Thanks</p>
javascript jquery
[3, 5]
688,468
688,469
GridViewRowCommand keep fire
<p>by right my label1.text will be display by each clicks, however my label was fire during page load, and this is not what i want, so any idea can perform fire event per clicks?</p> <p><strong>gridview property</strong></p> <p>asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnRowDataBound="abcde"</p> <p><strong>link button that inside gridview</strong></p> <p>asp:LinkButton ID="lnkname" runat="server" Text='&lt;%#Eval("movieTitle") %>' Width=500 CommandName="cmdLink"> <p><strong>code behind for link button</strong></p> <p>protected void abcde(object sender, GridViewRowEventArgs e)</p> <pre><code>{ Label1.Text = ((LinkButton)e.Row.FindControl("lnkname")).Text; } </code></pre>
c# asp.net
[0, 9]
5,121,568
5,121,569
invoking javascript on a click of label
<p>I have a gridview and inside the gridview, I have a label and when the user clicks on that label, I invoke a javascript function. I passw few values from that label to javascript function. If the values has apsotrphe in it. It generates an error and does not invke javascript function. Below is my code.</p> <pre><code>&lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;label style="text-decoration: underline" onclick="javascript:GetSelectedRow('&lt;%# Eval("ID") %&gt;','&lt;%# Eval("systempath") %&gt;','','',1);"&gt;&lt;%#Eval("ID") %&gt;&lt;/label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>and the javascript function is</p> <pre><code>function GetSelectedRow(id, systempath, x, x, rowIndex) { debugger; var label = document.getElementById('&lt;%=lbl_ID.ClientID %&gt;'); label.innerText = mclid + "|" + systempath; document.getElementById('&lt;%=hdnlblID.ClientID %&gt;').value = id + "|" + systempath; return false; } </code></pre>
javascript asp.net
[3, 9]
3,401,630
3,401,631
keyup only works one time
<pre><code>$("#hi").keypress(function() { $(".hi").html("Writing..."); }); $('#hi').keyup(function() { $(".hi").delay(1000).queue(function() { $(this).html(""); }); }); </code></pre> <p>When I type like "Hello" in a textbox (#hi) the keyup only works for the first letter and then it won't disappear.</p>
javascript jquery
[3, 5]
3,034,423
3,034,424
Array or someother collection where i can store multiple types
<p>I have a set of information that I need to store in some kind of collection, the problem is that i am not allowed to create a separate class for it because they say "i could mess up the structure and design of other things" so I have an integer and a string and what I want to do is to be able to store them like this</p> <pre><code> index or similar int string index[0] | 1 | "Bear, Person, Bird"| index[1] | 2 | "Pear, Apples, Lime"| </code></pre> <p>The question is, is there a collection of some type for which I can store data like this without the need of a class so that i can reference it like this</p> <pre><code>myWeirdList.add(2,"Test, test, Test, test"); </code></pre> <p>or</p> <pre><code>myWeirdArray.add(3,"roco,paco"); </code></pre> <p>I hope the questions is clear if not I will keep an eye to better clarify..</p>
c# asp.net
[0, 9]
116,563
116,564
delay ajax request
<p>What is the best way to set timeout that will force my page not to set more than one ajax request per minute</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
1,846,330
1,846,331
I iterate a loop within another loop, based on the same array, what's the best way to ignore duplicates?
<p>I want to save all combinations of an array. So for [a, b, c] I want to save [ab, ac, ba, bc, ca, cb]</p> <p>I currently use this method:</p> <pre><code>for (coordinate in coordinates){ for (coordinate2 in coordinates){ if (coordinate != coordinate2){ newposts.push([fbposts[fbpost].id, coordinates[coordinate], coordinates[coordinate2]]); } } } </code></pre> <p>but it generates a bunch of duplicates. What's the smoothest way to solve this?</p>
javascript jquery
[3, 5]
5,362,717
5,362,718
Looking for advice on what approach to take for multiple image swaps
<p>I'm working on designing an interactive university campus map and need some direction with what I am looking to do.</p> <p>Link to page: <a href="http://www.torontoclassfind.com/startpage.html" rel="nofollow">http://www.torontoclassfind.com/startpage.html</a></p> <p>I want to be able to click on the links in the top menu (only one link is active so far and it loads and Ajax page in lower left div) and have it swap the building image with a different image to show that it's been selected.</p> <p>I could do that with the following: </p> <pre><code>$("#buildinglink1").click(function () { $("#buildingimg1").attr("src","highlightedimage.gif") }) </code></pre> <p>Problem is I need to change back the image to it's default image once another menu link is clicked and a new building is selected.</p> <p>The building images are located at www.torontoclassdfind.com/building/ and the highlighted images are located at www.torontoclassdfind.com/buildingc/ and the names for the buildings are the same in both locations.</p> <p>I am thinking of using JQuery's .replace element to do this (ex: <a href="http://stackoverflow.com/questions/6955933/jquery-remove-part-of-url">jquery remove part of url</a>) which would remove or add the 'c' to the url, but I'm kind of lost from here.</p> <p>Any tips? I think I need to make a function that would indicated a link is selected and somehow merge it with the .replace element.</p>
javascript jquery
[3, 5]
724,813
724,814
JavaScript / JQuery variable need to change.. on click. Delete old number add new one
<p>Basically I'm trying to get the random number generated to change to another random number once clicked on a button. I also cannot figure out how to unselect the form selected I'm trying how to below with jQuery.</p> <pre><code>var randomNum1 = Math.ceil(Math.random(20)*10000); var randomNum2 = Math.ceil(Math.random(20)*10000); var randomNum3 = Math.ceil(Math.random(20)*10000); var randomNum4 = Math.ceil(Math.random(20)*10000); $( "#race-again" ).click(function() { $( ".one" ).css( { marginLeft: "0" }); $( ".two" ).css({ marginLeft: "0" }); $( ".three" ).css( { marginLeft: "0" }); $( ".four" ).css( { marginLeft: "0" }); $( "#slide2" ).animate( { marginTop: "0" }, { duration: 1000 }); $( "#slide3" ).animate( { marginTop: "0" }, { duration: 1000 }); $( "#slide4" ).animate( { marginTop: "0" }, { duration: 1000 }); $( "#slide5" ).animate( { marginTop: "0" }, { duration: 1000 }); $( "#betting-money" ).val("0"); $( "#results" ).hide(""); $( "#winner" ).hide(""); $( "#next-end" ).hide(""); //trying to unselect the form input selection $("#race input option:selected").attr("selected", ""); //new random number generated... which doesn't work var randomNum1 = Math.ceil(Math.random(20)*10000); var randomNum2 = Math.ceil(Math.random(20)*10000); var randomNum3 = Math.ceil(Math.random(20)*10000); var randomNum4 = Math.ceil(Math.random(20)*10000); }); </code></pre>
javascript jquery
[3, 5]
469,532
469,533
Calling a function , when element is Live
<p>How can i call a function when element is live, i think we just raise a function by raising an event by live..</p> <pre><code>$('#a').live('click',function(){ //some code }); </code></pre> <p>but i need a function to be called when element is lived,Any Idea.</p> <p>The context is </p> <blockquote> <p>initially i dont have a select box , if i got a particular select box then i want call a function that pushes result into it..</p> </blockquote>
javascript jquery
[3, 5]