Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
2,042,880
2,042,881
Represent numbers as shorten like SO does (13500 => 13.5k)?
<p>Ok I write my own JS code for this bug I'm sure there's something more comprehensive out there I can use. My Google mojo isn't working though - any help finding open source code that'll help me represent numbers like how SO does for high numbers (102500 => 102.5K, 18601 => 18.6K, etc)?</p> <p>JS or PHP would be awesome, otherwise I can translate.</p> <p>Thanks!</p>
php javascript
[2, 3]
5,360,788
5,360,789
confirm box in javascript while inserting record
<p>i am inserting an record in database, while inserting i have to check if that value is already in the db. If it found then there will be a confirm box showing that 'Record is already in database. Do you want to add?'.<br> while doing this, if the record found then i have given a confirm message in javascript and in that i wrote the insert query and then complete the script. It works, but if the user click on the Cancel button, then also record is inserted. Why this happen? I use this code - </p> <pre><code>&lt;script type="text/javascript"&gt; if(confirm('Record already exist. Do you want to add?')) { &lt;? $insert = mysql_query("insert into user ----------"); ?&gt; } &lt;/script&gt; </code></pre> <p>thanks.</p>
php javascript
[2, 3]
5,273,806
5,273,807
javascript not executing on page load?
<p>in my html:</p> <pre><code>&lt;head&gt; &lt;link href="/prop-view.css" media="screen" rel="stylesheet" type="text/css"&gt; &lt;script src="/javascripts/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var $j = jQuery.noConflict(); &lt;/script&gt; &lt;script src="/prop-view.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>in my prop-view.js file:</p> <pre><code>$j("&lt;div class='dk-logo'&gt;&lt;/div&gt;").appendTo("body"); </code></pre> <p>The inspector shows no errors. But the image doesn't show up. It does, however, when I copy and paste that line into the console. So... my guess is the js file is running before the document is fully loaded?</p>
javascript jquery
[3, 5]
953,621
953,622
android tabs are too big
<h2>Rephrasing an old question as suggested by a group of mods.</h2> <p>Why are android tabs too big ,specially on a device that small? Eg. <a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p> <p>I am converting a java Swing application to android and tabs are giving me the most trouble. Besides looking ugly, each page seem to require a separate activity too. I mean with a JtabbedPane all I did was to put whatever components on a separate JPanel and add them to the host pane. </p> <h2>Thanks</h2> <p>First I believe both of my questions are stated clearly in the above post but i will rephrase anyway</p> <p>a) Why are the default android tabs so big compared to other components. It takes up a lot of space of the limited available space. If it is to make it comfortable for the user why aren't the other components equally big ?</p> <p>b) [ANSWERED]Why does each page requires starting a separate activity. In my app for example I just need to display some chats. This is already answered i.e use of Fragments.</p> <p>Hope it is clear enough now</p>
java android
[1, 4]
5,970,355
5,970,356
how to change the value of a Div according to whats typed into a form input
<p>I know if I want to change the value of an input on a form according to what a user types into another input using:</p> <pre><code>$('#inputName').change(function() { $('#inputURL').val($('#inputName').val()); }); </code></pre> <p>But I'd like to have it so when someone types into the input it updates a Div with the text instead. IE they type into #inputName and this happens:</p> <pre><code>&lt;div id="personsName"&gt; text appears here as they type&lt;/div&gt; </code></pre> <p>How'd I go about doing that? I doesn't work when I change #inputURL into #personsName :(</p>
javascript jquery
[3, 5]
4,530,010
4,530,011
JavaScript confirm box not working in php
<pre><code>echo"&lt;td&gt; &lt;a href ='del.php?id=$id' onclick='return confirm('Are you sure?');'&gt;&lt;center&gt;Delete&lt;/center&gt;&lt;/a&gt;&lt;/td&gt;"; </code></pre> <p>i want a prompt msg as the user will click on "delete" if he/she will press "ok" then it will redirect to a page where the data will get deleted and if he/she will press "cancel" then nothing will happen. by using the above code i m not able to get my prompt box nd data is directly getting deleted.</p>
php javascript
[2, 3]
2,778,561
2,778,562
Waiting for a script object to load
<p>I'm trying to create a jquery script that will be run from the console of google chrome and will analyze a page. My problem is that when I run the following code:</p> <pre><code>var jq = document.createElement('script'); jq.src = "http://code.jquery.com/jquery-latest.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); alert($('a')); </code></pre> <p>I get a message box with null (bad result) But if I separate it to to executions like this:</p> <p>step1:</p> <pre><code>var jq = document.createElement('script'); jq.src = "http://code.jquery.com/jquery-latest.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); </code></pre> <p>step2:</p> <pre><code>alert($('a')); </code></pre> <p>It works great and I get [object] that is my desired result.</p> <p>The question is what can I do to run this in a single batch?</p>
javascript jquery
[3, 5]
1,228,296
1,228,297
Registering a script multiple times
<p>In the code behind, I register a startup script as below:</p> <pre><code> string strFunctionName = "ShouldAdd"; sb.Append(strFunctionName + @"((blnShouldAdd ? "true" : "false") + ", true);"); ScriptManager.RegisterStartupScript(this, this.GetType(), "shouldAdd", sb.ToString(), true); </code></pre> <p>This piece of code is called twice, once in Page Load when <code>blnShouldAdd</code> evaluates to <code>false</code> and in the event handler of a button when <code>blnShouldAdd</code> evaluates to <code>true</code>.</p> <p>Strangely, when I debug the code and step into the ShouldAdd JS function, the value is always false. I would assume it to be true as the second call in the event handler overrides the first one.</p> <p>Any ideas?</p>
c# asp.net
[0, 9]
4,525,334
4,525,335
How to find out which javascript library owns $
<p>I am new with javascript still, but I would like to know how to check if a library is supposed to be using $ and then do an if statement off of it. Sorry if I have a hard time asking this!</p>
javascript jquery
[3, 5]
3,597,194
3,597,195
Start a phone call from a service
<p>I am trying to write an android service, to amongst other things, start a phone call. I have got the service to do other things: listen on network, accept a connection, process text and respond with text. I am now trying to set up a call.</p> <p>So far I have, the bit to set up the call is it the extra unnecessary {}, when I paste the code in the extra {} in to the activity that starts this service, the call is set up. The only thing I see different is the context. So what am I doing wrong?</p> <pre><code>public class Service extends android.app.Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { { android.content.Intent intent2 = new android.content.Intent( android.content.Intent.ACTION_CALL, android.net.Uri.parse("tel:012345556789")); this.startActivity(intent2); } return Service.START_NOT_STICKY; } </code></pre> <p>stack</p> <pre><code> Thread [&lt;1&gt; main] (Suspended (exception RuntimeException)) ActivityThread.handleServiceArgs(ActivityThread$ServiceArgsData) line: 2673 ActivityThread.access$1900(ActivityThread, ActivityThread$ServiceArgsData) line: 141 ActivityThread$H.handleMessage(Message) line: 1331 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 137 ActivityThread.main(String[]) line: 5039 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 511 ZygoteInit$MethodAndArgsCaller.run() line: 793 ZygoteInit.main(String[]) line: 560 NativeStart.main(String[]) line: not available [native method] </code></pre>
java android
[1, 4]
3,019,250
3,019,251
Allow certain characters to pass through $_GET?
<p>I wrote a script that when you enter a textbox, it will open an invisible iframe to a .php file with $_GET of what they wrote into the textbox.</p> <p>However, for example, if I type: '&lt;3' in it, this is what happens.</p> <p><img src="http://i.stack.imgur.com/oPMbs.png" alt="Image 1"></p> <p>PHP determins that the $_GET[s] is blank! Users cant put a simple &lt;3 symbol without getting that error.</p> <p>Another problem is quotes, if I write any quotes, it will end the entire SRC property.</p> <p><img src="http://i.stack.imgur.com/0EbIa.png" alt="Image 2"></p> <p>What should I do? Should I do something with javascript, or even PHP? Please let me know!</p> <p>Thanks!</p>
php javascript
[2, 3]
4,606,620
4,606,621
javascript dialogbox not showing Top data
<p>I have following javascript function</p> <pre><code>function getPopup1(redirectString) { window.showModalDialog(redirectString , null, 'status:no;dialogWidth:700px;dialogHeight:900px;dialogHide:true;help:no;scroll:1;edge:sunken'); } </code></pre> <p>The redirect string is redirecting to an .aspx page. The page has a lot of contant so I enabled the scroll bars, but I am getting the page scrolled to end on pageload. How can I show the data from top.</p>
javascript asp.net
[3, 9]
1,682,748
1,682,749
why null (login pop up)
<p>Probably it's something small i do not see... I have a UserControls_LoginPopUp with one of the properties as:</p> <pre><code>public string urlForRedirecting {get; set;} </code></pre> <p>This user control contains a modalpopupextender and a method for login:</p> <pre><code> public void Login_Click(object sender, EventArgs e) { string user = txtUser.Text; string passwordMD5 = UtilsStatic.GetMD5Hash(txtPassword.Text); int id = checkUserAtLogin(user, passwordMD5); if (id != -1) { //MySession.Current.userId = id; lblStatus.Text = "Autentificare reusita!"; loginPopUp.Hide(); //The user will be redirected Response.Redirect(this.urlForRedirecting); this.urlForRedirecting = ""; } else { MySession.Current.userId = -1; lblStatus.Text = "Autentificare esuata!"; loginPopUp.Show(); } } </code></pre> <p>Now, from another page, a user clicks a link, and a method is fired where the modal extender is shown so he can login. Please notice that i fill up the urlForRedirecting property:</p> <pre><code> public void redirectToWishList(object sender, EventArgs e) { if (UtilsStatic.getUserLoggedInId() == -1) { ASP.usercontrols_loginpopup_ascx loginUserControl = (ASP.usercontrols_loginpopup_ascx)UtilsStatic.FindControlRecursive(Page, "loginPopUp"); ModalPopupExtender modal = (ModalPopupExtender)loginUserControl.FindControl("loginPopUp"); modal.Show(); //put the link to which the redirect will be done if the user will succesfully login in loginUserControl.urlForRedirecting = getWishListLink(); } else Response.Redirect(getWishListLink()); } </code></pre> <p>The problem is that, after the userr logs in succesfully, the url is null (but i've completed it already!!!)</p> <pre><code>Response.Redirect(this.urlForRedirecting); </code></pre> <p>Do you see why?</p>
c# asp.net
[0, 9]
1,231,205
1,231,206
document.onkeyup ported to jQuery
<p>I'm porting some old Javascript to jQuery:</p> <pre><code>document.onkeyup = function (event) { if (!event) window.event; ... } </code></pre> <p>this code works on all major browsers. My jQuery code looks like:</p> <pre><code>$(document).keyup = function (event) { ... } </code></pre> <p>however this code is not working (the function is never triggered at least in IE7/8). Why? How to fix? </p>
javascript jquery
[3, 5]
4,035,512
4,035,513
OnClick not working when i use both Onclick & OnClientClick
<p>With this code, i try to Close a Window (the way i'm doing it works) but i have also an Onclick event which is ignored!</p> <pre><code>&lt;script type="text/javascript"&gt; function GetRadWindow() { var oWindow = null; if (window.radWindow) oWindow = window.radWindow; else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; return oWindow; } function CloseDialog() { GetRadWindow().close(); } </code></pre> <p></p> <p>ASPX page:</p> <pre><code> &lt;asp:Button ID="Button1" runat="server" Text="Soumettre ce ticket" onclick="Button1_Click" OnClientClick="CloseDialog();return false;"/&gt; </code></pre> <p>My application never enters Button1_click event, can anyone help me to find out why ? thanks in advance</p> <p>EDIT: HTML GENERATED FOR THE BUTTON</p> <pre><code>&lt;input type="submit" id="Button1" onclick="CloseDialog();" value="Soumettre ce ticket" name="Button1"/&gt; </code></pre>
javascript asp.net
[3, 9]
1,240,128
1,240,129
how to read file, split record line by line and save them to database
<p>A.O.A</p> <p>I want to split the following code and save it into database:</p> <pre><code>31201011281853000100000000710003 </code></pre> <p>The format of splitting is</p> <pre><code>31 (2010-11-28,18 53) yyyy-mm-dd,hr-min 0001 0000000071 0003 </code></pre> <p>first I have to upload a file containing these codes and then read each record line by line, split each line in the format I mentioned above, and then save it to database.</p>
c# asp.net
[0, 9]
3,132,807
3,132,808
URL of current script in JavaScript
<p>How can I find out the URL of the JS file that was called?</p> <p>Let's say the JS file (which is part of a library) and the HTML file (which is the application) are on a different server. To find out the URL of the HTML file is easy. But how can I find out the server name and path of the JS files' server within the JS file itself? (Edit: There is a loader which invokes other JS files of thsi library in the same directory structure)</p> <p>Preferably a JQuery or pure JS solution.</p> <p><strong>Edit:</strong></p> <p>After I learned from your answers and comments I decided it would be cleaner to actually move the loader code to the first server, where also the html lives, which avoids the problem. </p>
javascript jquery
[3, 5]
5,026,508
5,026,509
Setting a greeting based on user's time (Good morning, good afternoon…)
<p>I'm sort of lost. Can anyone extrapolate on how to implement a basic "good evening" or "good morning" based on the user's time setting? </p> <p>Perhaps PHP will fetch the server time, but I'm looking to greet the site visitor with a time-based appropriate greeting that considers their time of day. </p> <p><strong>E.G.:</strong> good morning, good night, good afternoon. </p> <p>Thanks folks :)</p>
php javascript jquery
[2, 3, 5]
1,820,434
1,820,435
Jquery and Captcha on same page can't get it working
<p>I warn you now very little experience at jquery. My question is this. I have a username and password form. I have Jquery that accesses a php page looks into the database matches the password and user name then echos "yes" or no based off if the input is right then takes me to the next page. Now since this Jquery works on submit I can't figure out how to add a javascript captcha correctly to the page because it wont verify the word. So I'm wondering how to alter or add to this code so that I can first verify the word using javascript then the jquery below. Any help would be appreciated thanks.</p> <pre><code>&lt;script language="javascript"&gt; $(document).ready(function() { $("#login_form").submit(function() { //remove all the class add the messagebox classes and start fading $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000); //check the username exists or not from ajax $.post("ajax_login.php",{ user_name:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data) { if(data=='yes') //if correct login detail { $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Logging in.....').addClass('messageboxok').fadeTo(900,1, function() { //redirect to secure page document.location='edujob.php'; }); }); } else { $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('incorrect').addClass('messageboxerror').fadeTo(900,1); }); } }); return false; //not to post the form physically }); //now call the ajax also focus move from }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,186,266
4,186,267
Call JQuery function From Controller
<p>I am populating dropdown list using JQuery. whenever i selected any item from that dropdown (i.e Drop down selected index change) i want to run an another JQuery Function... Here is my controller..</p> <pre><code> public ActionResult PopulateTest(string Id) { // Here i want to call the JQuery function return PartialView("Details"); } </code></pre> <p>and my JQuery Function...</p> <pre><code> $(function () { var a = document.getElementById("HidStatus").value; var b = parseInt(a); $("#progressbar").progressbar({ value: b, max: 100 }); }); </code></pre>
javascript jquery
[3, 5]
3,165,906
3,165,907
Stop Textbox firing OnClientClick event
<p>The combination of pressing enter on a textbox with a page that has an image button with both a client and server click event is causing the client side event to fire when I press enter in the textbox.</p> <p>I want to prevent this, am happy to use Jquery or whatever is best. From the Jquery side am struggling to capture the enter key</p> <pre><code>&lt;asp:TextBox ID="tbName" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:ImageButton ID="CancelImageButton" ImageUrl="Cancel.gif" runat="server" OnClientClick="alert(); return false;" onclick="Cancel_Click"/&gt; </code></pre>
jquery asp.net
[5, 9]
389,128
389,129
Google Maps add Location
<p>How can I get the location that the user has clicked on the map via js?</p>
php javascript
[2, 3]
4,366,646
4,366,647
how to add dropdown button with list of items to ckeditor nightly
<p>Can anyone help me in adding dropdown button with list of items. </p> <p>So if I click on item that item should add to the cursor position on instance.</p> <p><img src="http://i.stack.imgur.com/U5Kon.jpg" alt=""></p>
php jquery
[2, 5]
153,485
153,486
Return value of next span
<p>I'm trying to return the value of the next/closet span with a certain class ID. I am super close but I am confused how to use <code>next()</code> and <code>closest()</code> any help would be awesome </p> <p>HTML:</p> <pre><code> &lt;table width="80%" cellspacing="0" cellpadding="0" &gt; &lt;th scope="col"&gt;Data&lt;/th&gt; &lt;tr&gt; &lt;td width="20%"&gt;&lt;a href="#" class ="show_data_link"&gt;Show Data&lt;/a&gt; &lt;span class="data"&gt;1 &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;&lt;a href="#" class ="show_data_link"&gt;Show Data&lt;/a&gt; &lt;span class="data"&gt;2 &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="20%"&gt;&lt;a href="#" class ="show_data_link"&gt;Show Data&lt;/a&gt; &lt;span class="data"&gt;3 &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>JAVASCRIPT</p> <pre><code>$('.show_data_link').bind('click', function(){ //returns the first class alert($('.data').html()); //returns null //alert($('.data').next().html()); //returns null // alert($('.data').closest().html()); return false; }); </code></pre> <p>If I use <code>$('.data').html()</code> i can get the value of the first span just not sure how to get the value of the span that is the closet so the link clicked <a href="http://jsfiddle.net/BandonRandon/nW4DJ/" rel="nofollow">JSFiddle</a></p>
javascript jquery
[3, 5]
5,610,145
5,610,146
How I can convert UTC date to my time-zone?
<p>I need to convert time to "UTC+03:30 Time Zone" in my web application here is UTC date :</p> <pre><code>DateTime dt = DateTime.UtcNow; </code></pre> <p>Is there any function to convert UTC to my time zone or not ? I don't want to involve myself writing a new function in my application if there is a function in ASP.NET.</p> <p>The application might be hosted in different server in the world and that's exactly why I have used UTC date.</p> <p>I need a function to add 3:30 to the current UTC time.</p>
c# asp.net
[0, 9]
4,535,803
4,535,804
How to store database values as comma separated?
<p>here am trying to take the set of database values as comma separated and store it in a javascript variable. I tried doing it. but i couldnt make them comma separated as the output comes all together. Please correct me where am doing mistake.</p> <p>Notes : If the value of assignedto is empty. the staff names with flag 1 will get fetched from database. but in the script below it comes all together where i require them to be comma separated.</p> <pre><code> if(assignedto == "") { '&lt;?php $val = mysql_query("select * from staff where flag='1'"); $arr=''; while ($row = mysql_fetch_array($val)) { $arr = array($row['name']); $assign .= implode(',',$arr); ?&gt;' assignedto = '&lt;?php echo $assign; }?&gt;'; } </code></pre>
php javascript
[2, 3]
1,399,126
1,399,127
How else can I check the user for a program?
<p>Currently, my friend has a program that checks the users Windows CD-Key and then it goes through a one way encryption. He, then, adds that new generated number to the program for checking purposes and then he compiles it and then he sends it off to the client. Is there a better way to keep the program from being shared utilizing PHP somehow instead of his current method while not using a login system of any kind.</p>
php c++
[2, 6]
1,275,747
1,275,748
Changing last li hover in javascript
<p>I'm putting together a nav bar and found a nice script to allow a li to keep in its 'hover' state while a 2nd level menu is displayed. In my last li I have a search bar and would like to remove the hover. Code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("ul#topnav li").hover(function() { //Hover over event on list item $(this).css({ 'background' : '#7bbdc2 '}); //Add background color + image on hovered list item $(this).find("span").show(); //Show the subnav } , function() { //on hover out... $(this).css({ 'background' : 'none'}); //Ditch the background $(this).find("span").hide(); //Hide the subnav }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
564,551
564,552
android and 3rd party jars
<p>I have a jar file I use it to use TOC protocol (AOL servers).That jar file works fine totaly fine with my java application but when I use it in my android app,it never runs.I don't know the problem at all and I ma newbie to android development.plz help and guide me on how to debug android app or get console prints from android app IF YOU PLEASE. Best regards</p>
java android
[1, 4]
1,145,340
1,145,341
Make text bigger
<p>How can you make text bigger or the text inside the div ?</p> <p>i really dont know, help me out guys</p> <p>something like:</p> <pre><code>$('div.text'), { FontSize: '40px' }); // &lt;--- this is not real code, just to show what i need </code></pre>
javascript jquery
[3, 5]
1,685,814
1,685,815
Setting active link dynamically on static navigation
<p>I have "navigation.html" (static coded navigtaion ) file loaded on multiple pages, using jQuery .load() Now I need to dynamically set active <code>&lt;li&gt;</code> for each page user clicking on. I can not use body id for specific reasons. Any other ways to do this?</p>
javascript jquery
[3, 5]
644,673
644,674
How to open multiple external URLs in one button click but not get blocked by browsers popup blocker?
<p>How to open multiple external URLs in one button click but not get blocked by browsers popup blocker? [specially Chrome]</p>
javascript jquery asp.net
[3, 5, 9]
4,289,388
4,289,389
passing variables from php to javascript
<p>I am trying to create a site where someone can create an "item" and the database will store an id and php generates a url for that id. So next time when the person comes back with that url it will remember the person's settings (variables). Now the problem is that in my site javascript need to know these variables.</p> <p>So what is the best solution for this? passing the variables in the superglobal "GET" or maybe cookies? Or is there a better way to pass these variables to javascript? </p>
php javascript
[2, 3]
1,795,469
1,795,470
How to fire the same function when user presses enter or makes a click
<p>I have my own edit in place function for jquery which looks like this</p> <pre><code> $('.editRow').live('click', function() { var row = $(this).parent('td').parent('tr'); row.find('.1u').slideUp('fast'); row.find('.1p').slideUp('fast'); row.find('.inputTxt').slideDown('fast'); $(this).parent('td').empty().append('&lt;a href=# class=cancel&gt;Cancel&lt;/a&gt; / &lt;a href=# class=save&gt;Save&lt;/a&gt;'); }); $('.cancel').live('click', function () { var row = $(this).parent('td').parent('tr'); row.find('.1u').slideDown('fast'); row.find('.1p').slideDown('fast'); row.find('.inputTxt').slideUp('fast'); $(this).parent('td').empty().append('&lt;a href=# class=editRow&gt;Edit&lt;/a&gt;'); }); $('.save').live('click', function () { var thisParam = $(this); var row = $(this).parent('td').parent('tr'); var id = row.attr('id'); var userid = row.find('#1ui').val(); var pass = row.find('#1pi').val(); $.ajax({ type: 'post', url: 'filefetch_update.php', data: 'action=updateUser&amp;pass=' + pass + '&amp;id=' + id + '&amp;userid=' + userid, success: function(response) { $('#response').fadeOut('500').empty().fadeIn('500').append(response); var row = thisParam.parent('td').parent('tr'); row.find('.1u').text(userid).slideDown('fast'); row.find('.1p').text(pass).slideDown('fast'); row.find('.inputTxt').slideUp('fast'); thisParam.parent('td').empty().append('&lt;a href=# class=editRow&gt;Edit&lt;/a&gt;'); } }); }); </code></pre> <p>Now i want to run the <strong>save</strong> function when the user clicks Save and also when enter is pressed on keyboard.</p>
javascript jquery
[3, 5]
2,850,426
2,850,427
Android Dev : NO EC/IO?
<p>Wondering how to get the <code>EC/IO</code> value on the Android Nexus One phone.</p> <p>Actual methods given by Android class <code>android.telephony.SignalStrength</code> are:</p> <pre><code>/* Get the CDMA Ec/Io value in dB*10 */ int getCdmaEcio() /* Get the EVDO Ec/Io value in dB*10 */ int getEvdoEcio() </code></pre> <p>The problem is: I am on an UMTS / WCDMA Network, so, there is no way for me to actual get the value.</p> <p>Any updates from Android? Or workaround?</p>
java android
[1, 4]
1,619,397
1,619,398
Display Text when Delete button is clicked in GridView
<p>I have a Gridview., usually, when the delete command button is clicked then the row will be deleted., But what should I do if I want a alert message like "Are you sure......." to be displayed..... Any Ideas please</p> <p>Thanks</p>
c# javascript asp.net
[0, 3, 9]
592,416
592,417
how can an create a dotnet desktop application to access SMS.db on IPhone without Jailbreak?
<p>i want to create a desktop application using c#, by which i can access the iphone device and able to read SMS.db to read the SMSs</p>
c# iphone
[0, 8]
3,760,719
3,760,720
Problem in entering multiple E-Mail ID in A Single Field
<p><em>Hi</em> I had A field In Than i am enter the multiple e mail id using the automated dropdown . I refer this link "http://wick.sourceforge.net/wick_sample/" U get the Full view about my program in this link. In This all e-mail id's are stored in the variable collection. My problem is if i declare the E-mail id directly in the variable like This</p> <p>var data = ['[email protected]','[email protected]','[email protected]','[email protected]'];</p> <p>collection = data; Its Working properly but i am retrieve the e-mail Id from the Database . so i am using below mentioned code but it does not work how i solve this issue .</p> <pre><code>function show_alert() { var id1 = document.getElementById('collection').value; var data = [id1]; collection = data; alert(collection); } &lt;?php $table = "am_users"; $query = "select distinct(`user_email`) from $table"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); while ($data1 = mysql_fetch_array($result)) { $data[] = $data1['user_email']; } foreach($data as $search_term) { $js_data[] = "/'".$search_term."/'"; } $collection = implode($js_data, ","); ?&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="collection" name="collection" rows="5" cols="30" value="&lt;?php echo $collection; ?&gt;" onChange="show_alert()" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Please Guide me,have a nice day to every one</p>
php javascript
[2, 3]
3,185,347
3,185,348
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'CityNameHotel_Name'
<p>I am getting this error when ever i try to bind two database table columns to single dropdown list.</p> <p>here is code that i used :</p> <pre><code>GetHotelNames.DataSource = bh.GetHotelNamess(); GetHotelNames.DataTextField = "CityName"+"Hotel_Name"; GetHotelNames.DataBind(); </code></pre> <p>It works fine if i try to get single column values but when i want to concatenate two columns with DataTextField it shows error.</p> <p>i have searched this from different stack questions and found only one relevant <a href="http://stackoverflow.com/questions/3827757/how-to-bind-the-data-from-database-to-the-dropdown">link</a> but i did not get any success with this. What should i do if i want to get two database table column values to one single dropdown?</p>
c# asp.net
[0, 9]
5,245,471
5,245,472
Javascript passing variable to Jquery
<pre><code>&lt;script type="text/javascript"&gt; function DoThings() { var txt = txtbox.value; txt = /* passed info from code behind */ } $(function() { var Tags=[ txt ]; $( "txtbox2").autocomplete({source: Tags});}); &lt;/script&gt; </code></pre> <p>but i want to move it to the page. im unsure how i send the variable "txt" to my jquery function</p>
javascript jquery asp.net
[3, 5, 9]
781,281
781,282
Python module installed or not installed?
<p>How can I check if my Python module is successfully installed.</p> <p>I did:</p> <pre><code>python setup.py install </code></pre> <p>inside the folder where my module was downloaded.</p> <p>Now, I can see that this resulted in a folder inside this location:</p> <pre><code>/usr/lib/python2.4/site-packages (I can see my module folder is inside here) </code></pre> <p>Now I am using PHP to execute a script from this module:</p> <pre><code>exec("/usr/bin/python /usr/lib/python2.4/site-packages/MyModule/myModule script.py -v pixfx.xml 2&gt;&amp;1", $output, $return); </code></pre> <p>This runs the script.py file but does not load modules which this script requires. This script has code like this:</p> <pre><code>#! /usr/bin/env python import sys import os import getopt import re from myModule.ttLib import TTFont // this is line60 as I have removed comments </code></pre> <p>I get this error:</p> <pre><code>Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/MyModule/myModule/script.py", line 60, in ? from myModule.ttLib import TTFont ImportError: No module named myModule.ttLib </code></pre> <p>Does this mean there could be some problem with the way my module was installed. or How do I check if the module is installed correctly....</p> <p>I also tried to do this in SSH terminal:</p> <pre><code>help('modules') </code></pre> <p>This listed a load of modules but my module name was missing.</p> <p>Any help?</p> <p><em><strong></em></strong> EDIT {Solved} <strong>**</strong> Reinstalling the module solved it. Its funny that what I used online SSH tool provided by Mediatemple, it didnt install the module correctly. Later when I installed using Terminal from my Mac computer, everything worked.</p> <p>Just thought I will add this for other who might face similar problem.</p> <p>Thanks</p>
php python
[2, 7]
340,180
340,181
Calendar control to display next month
<p>Added a Standard <code>Calendar</code> control, and now i need to click on the arrow so it shows the next month.</p> <p>How can i implement this ?</p> <p>For now, when i click on the arrow to display the next month it doesn't change. How can i implement this ?</p>
c# asp.net
[0, 9]
5,838,162
5,838,163
Trying to pass an int between two classes on Android platform
<p>I'm trying to pass an int between two classes using a bundle. I have looked online and it seems like it should be easy to do, its just not working for me :( any help is much appreciated! I am trying to pass the int life from one page to another in a simple game.</p> <p>here is the code for the first page where I am passing it from </p> <pre><code>int life = 5; .... if(input.equalsIgnoreCase(teststr)) { Intent i = new Intent("com.name.PAGETWO"); i.putExtra("com.name.PAGETWO.life", life); startActivity(i); mpButtonClick.stop(); } </code></pre> <p>And on the second page, trying to receive the int </p> <pre><code>Intent i = new Intent("com.name.PAGETWO"); Bundle extras = i.getExtras(); int temp2 = extras.getInt("life"); int life = temp2; </code></pre> <p>when i try to run it, it tries to go on to the second page and then just says the application has unexpectedly stopped, but when i comment out the code it continues running as normal, so i know i am definitely putting in the code here wrong somewhere. thanks in advance!</p>
java android
[1, 4]
463,534
463,535
Is there a way to retrieve the pixel width of the browser window with jQuery?
<p>I want to be able to move objects on my web page with javascript depending on the screen size. Is there a way to retrieve the pixel width of the browser window?</p>
javascript jquery
[3, 5]
1,056,584
1,056,585
change this to jquery
<p>How would I change the below to jquery? It works in IE but not Firefox so I am hoping if I change it to jquery it will work for both.</p> <p>THIS</p> <pre><code>function subform() { if (parent.option_view.document.vform_.dispatchEvent('onsubmit') != false) { parent.option_view.document.vform_.submit(); } } </code></pre> <p>AND THIS</p> <pre><code>img class="save_bttn" src="/images/save.gif" height="16" width="16" border="0" onclick="subform()" </code></pre> <p>IS INSIDE ONE CHILD FRAME</p> <p>and</p> <p>It is trying to init in another child frame that is why its going to parent option_view.</p> <p>*note: I was not trying to scream with the caps I was just trying to show where talking was and where the javascript is</p>
javascript jquery
[3, 5]
1,380,131
1,380,132
Adding a help popup
<p>I want to add "help" information about some of the items on my web application. User will take cursor to that item and help will show up in popup box or a small window. Does anyone have a good example to show in jquery or javascript?</p>
javascript jquery
[3, 5]
814,028
814,029
jQuery : how to apply effect on a child element
<p>instead of re-writing the same function, I want to optimise my code :</p> <pre><code>&lt;div class="header"&gt; &lt;h3&gt;How to use the widget&lt;/h3&gt; &lt;span id="idwidget" &gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="content" id="widget"&gt; </code></pre> <p>the JS :</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { var showText="Show"; var hideText="Hide"; $("#idwidget").before( "&lt;a href='#' class='button' id='toggle_link'&gt;"+showText+"&lt;/a&gt;" ); $('#widget').hide(); $('a#toggle_link').click(function() { if ($('a#toggle_link').text()==showText) { $('a#toggle_link').text(hideText); } else { $('a#toggle_link').text(showText); } $('#widget').toggle('slow'); return false; }); }); &lt;/script&gt; </code></pre> <p>This is working just with the div which is called widget and the button called idwidget.</p> <p>But on this page i have also :</p> <pre><code>&lt;div class="header"&gt; &lt;h3&gt;How to eat APPLES&lt;/h3&gt; &lt;span id="IDsomethingelse" &gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="content" id="somethingelse"&gt; </code></pre> <p>And I want it to be compatible with the code.</p> <p>I heard about children attribute, do you have an idea how to do that please ?</p> <p>Thank you</p>
javascript jquery
[3, 5]
901,301
901,302
How to open editor in click
<p>I have page with 5 divs and i want to open editor on click of selected div .</p> <p>And div content will come into the editor what i will do for this.</p> <p>is there any j query for this.</p>
asp.net jquery
[9, 5]
3,917,657
3,917,658
how to get wrap text using div tag?
<p>I need to get the "wrap text" in div tag, here is what I'm using: </p> <pre class="lang-html prettyprint-override"><code>&lt;div style="width:650px;height:200px;overflow-y:scroll;display: inline-block; writing-mode:lr-tb; word-wrap:break-word;white-space:normal;"&gt; &lt;asp:Label ID="bodyLabel" runat="server" Text=""&gt;&lt;/asp:Label&gt; &lt;/div&gt; </code></pre> <p>Can any one please suggest me how to implement this.</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
3,424,555
3,424,556
redirect to another page
<p>&lt; type="button" value="PRINT" onClick="window.open('print.php?id=&amp;sec=&amp;subj=&amp;type=viewrec2&amp;Year=&amp;faci= ','mywindow','width=800,height=800,left=0,top=100,screenX=0,screenY=100')"> </p> <p>when i click this button im being redirected into a new window. the problem is that on the main page where this button is located i want it also to redirect it to the previous page on that the same window how can i do that im using php and javascript?</p>
php javascript
[2, 3]
1,993,516
1,993,517
Validating user role's page level access
<p>My question is almost similar to this <a href="http://stackoverflow.com/questions/2804572/asp-net-roles-page-level-security-question">ASP.Net Roles: Page-Level Security Question</a> except for the fact that I'm not using asp.net membership, What I have done is I have created roles and assigned pages to roles, menus are also populating according to the user's role. I want to restrict user to access pages by simply typing the <code>PageName.aspx</code> , One solution might be checking on every page load, but I don't think it's efficient. I have googled but only found solutions for adding <code>&lt;location path="Logon.aspx"&gt;</code> to restrict, I have to add this for every page in <code>web.config</code>, which defeats the whole purpose of keeping this thing dynamic, I am <strong>using Form Authentication</strong>, Some are suggesting creating a <strong>Base Class</strong> and derive other pages from that class, I think there may be some <code>global.asax</code> way to acheive this, but have no idea. Please suggest me best approach to achieve this !</p> <p>P.S : I am <strong>not using ASP.NET Membership</strong> </p>
c# asp.net
[0, 9]
863,641
863,642
Jquery .get and .push into an array gives an empty string
<p>Can anyone tell me why the below gives me an empty string?? When I console.log(contentArray) in the .get callback function it spits out the data but when I try to do it where it is in the code below it wont work.</p> <pre><code>sectionArray = []; contentArray = []; $(function(){ if (index == 1){ $('menu:eq('+ (section - 1) +') li a').each(function(){ sectionArray.push($(this).attr('href')); }); var len=sectionArray.length; for(var i=0; i&lt;len; i++) { href2 = sectionArray[i]; $.get(href2, function(data){ string = data.toString(); contentArray.push(string); }); } content = contentArray.toString(); console.log(content); } </code></pre>
javascript jquery
[3, 5]
5,975,013
5,975,014
Fadeout on hover effect in iPad
<p>I tried to use the fadeIn and fadeOut effect as you can see in this page: <a href="http://www.lifetime-watches.com/gal-w.html" rel="nofollow">http://www.lifetime-watches.com/gal-w.html</a></p> <pre><code>var titleString = $(this).find('a').attr("title"); $("#title").html(titleString).fadeIn(100); ; </code></pre> <p>So when they run the script the title of the image would fade in in a div. </p> <p>But the problem is when this page is opened in iPads, the hover function doesn't work (because obviously they don't have hover) and the div wouldn't fade out. </p> <p>What are the alternatives to this? Any help is appreciated. Thank you.</p>
javascript jquery
[3, 5]
3,829,317
3,829,318
Assigning value to tooltip of an ASP.net Custom Validator using javascript
<pre><code> I would like to provide a message as tooltip of a custom Validator based on some condition in Javascript. </code></pre> <p>Can any one please help me out?</p> <p>Thanks in Advance</p>
c# asp.net
[0, 9]
22,209
22,210
Is it a security risk setting EnableEventValidation="false" in this situation?
<p>I have a page that contains a user control, when the user clicks an image button to take them to another page that displays details of the table row item they clicked an error occurs:</p> <pre><code>System.ArgumentException: Invalid postback or callback argument </code></pre> <p>I can stop this error from occurring if I set EnableEventValidation="false". Is this a security risk? If so, why?</p>
c# asp.net
[0, 9]
5,824,871
5,824,872
How to pass the parameter to same page using java script in Asp.net
<p>How to pass the parameter to same page using java script in Asp.net</p> <p><code>top.location.href = '/IFGE/DeleteAllPrice/' + id;</code></p> <p>is working fine for redirecting to other pages but not working for redirecting to same page </p>
javascript asp.net
[3, 9]
2,161,188
2,161,189
Speed/expensive of SQLite query vs. List.contains() for "in-set" icon on list rows
<p>An application I'm developing requires that the app main a local list of things, let's say books, in a local "library." Users can access their local library of books and search for books using a remote web service. The app will be aware of other users of the app through this web service, and users can browse other users' lists of books in their library. Each book is identified by a unique <code>bookId</code> (represented as an <code>int</code>).</p> <p>When viewing books returned through a search result or when viewing another user's book library, the individual list row cells need to visually represent if the book is in the user's local library or not. A user can have at most 5,000 books in the library, stored in SQLite on the device (and synchronized with the remote web service).</p> <p>My question is, to determine if the book shown in the list row is in the user's library, would it be better to directly ask SQLite (via <code>SELECT COUNT(*)...</code>) or to maintain, in-memory, a <code>List</code> or <code>int[]</code> array of some sort containing the unique <code>bookId</code>s.</p> <p>So, on each row display do I query SQLite or check if the <code>List</code> or <code>int[]</code> array contains the unique <code>bookId</code>? Because the user can have at most 5,000 books, each <code>bookId</code> occupies 4 bytes so at most this would use ~ 20kB.</p> <p>In thinking about this, and in typing this out, it seems obvious to me that it would be far better for performance if I maintained a list or int[] array of in-library <code>bookId</code>s vs. querying SQLite (the only caveat to maintaining an int[] array is that if books are added or removed I'll need to grow or shrink the array by hand, so with this option I'll most likely use an <code>ArrayList</code> or <code>Vector</code>, though I'm not sure of the additional memory overhead of using <code>Integer</code> objects as opposed to primitives).</p> <p>Opinions, thoughts, suggestions?</p>
java android
[1, 4]
5,926,902
5,926,903
jquery custom controlled scrolling navigation
<p>i need to create a jquery-menu for my website so when you click in a menu item it will slide vertically to a target div (only div not whole page) in fixed 400*400 div </p> <p>please suggest if there is any good plug-in available </p> <p>eg.</p> <p>left div- home about contact</p> <p>right div-(needed to scroll according to click on the menu ) home container : visible about container : hide contact container :hide </p>
javascript jquery
[3, 5]
392,885
392,886
Python PHP Integration
<p>I am facing a problem here which I could not find a good solution for it. I am developing a mobile web app using php and I need a rule based inference engine (open source) - expert system. The only one I could find was Pyke in Python. So I need to integrate Pykes' source code with my php implementation. My service provider is not allowing any commands such as exec for security reasons. I tried PiP (Python to PHP module) but it has a lot of bugs.</p>
php python
[2, 7]
3,922,222
3,922,223
how can i use pageLoad function in multiple usercontrols
<p>i have 3 usercontrols who in each i used pageLoad function in javascript and those usercontrols are in a page and page has himself pageLoad function. but only pageLoad function of last usercontrol who i registered in page is fired and others not fired</p> <pre><code>&lt;script type="text/javascript"&gt; ... function pageLoad() { alert('page load - uc1'); ..... } ... </code></pre> <p>please help me how to fire all functions</p> <p>thanks</p>
javascript asp.net
[3, 9]
2,552,587
2,552,588
Jquery functions more than once on the same page
<p>I'm new self learning to used Jquery functions and i have no ideas how to do the following.</p> <p>How do i used the following script to apply to more that one div id on the same page?</p> <pre><code>&lt;script type="text/javascript" src="/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/jquery.form.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/jquery.validate.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $('document').ready(function() { $('#memberslinkupform').ajaxForm( { target: '#memberslinkup', success: function() { $('#formbox').slideUp('fast'); } }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,029,690
3,029,691
How to detect selection outside textarea and input
<p>jQuery select event is limited to <code>textarea</code> and <code>input:text</code> only. Is there a way to handle a selection in ordinary elements such as <code>&lt;div&gt;</code>?</p>
javascript jquery
[3, 5]
1,367,445
1,367,446
jQuery fadeIn fadeOut background problem
<p>When I fadeIn a div, and this animation finished, the background suddenly disappears (this time only in Firefox). I have a container, with two nested elements in it. The second element has a negative margin, so it appears on top of the first.</p> <p>My script:</p> <pre><code>jQuery(document).ready(function($) { $(".second_element").hide(); $(".container").each(function () { $(this).mouseover(function () { $(this).children(".second_element").stop(true, true); $(this).children(".second_element").fadeIn(250, 'linear'); }); $(this).mouseout(function () { $(this).children(".second_element").stop(true, true); $(this).children(".second_element").fadeOut(100, 'linear'); }); }); }); </code></pre> <p>CSS:</p> <pre><code>.container{ width: 221px; height: 202px; display: block; float: left; position: relative; } .first_element { height: 200px; width: 219px; } .second_element { display:none; background: #fff !important; margin-top: -51px; width: 219px; height: 50px; } </code></pre> <p>And for clarity, this a HTML example</p> <pre><code>&lt;td class="container"&gt; &lt;div id="first_element"&gt;...&lt;/div&gt; &lt;div id="second_element"&gt;...&lt;/div&gt; &lt;/td&gt; </code></pre> <p>My second problem is, that when my mouse is hovering above the second element, the function is executed again (so the second element fades out and in). While the second element is just IN the container</p>
javascript jquery
[3, 5]
619,909
619,910
Using HttpApplicationState outside ASP.NET session
<p>I have following problem. I am trying to use web services wrote in ASP.NET in application as intermediate layer, stored inside WCF service layer. So I am instancing some WebService classes and I call web methods like normal C# methods. Unfortunately some of them are using asp.net specific solutions like using HttpContext and Application object(of type <strong>HttpApplicationState</strong>). I am trying to add items to this collection before webservice call, but nothing happens! Items are not there after using <strong>Add method</strong>. No exception, nothing. I thought that there is some functionality inside implemenatation of HttpApplicationState class, that prevents this operation in certain cases, but I insepcted code in reflector and everything should be fine... Am I missing something?</p>
c# asp.net
[0, 9]
3,435,310
3,435,311
Android - Load application level data at startup using a LoaderManager
<p>I would like to load application level data -singleton- to be available to all activities and services.</p> <p>I extended the Application object to fetch a model from DB and load it in memory to make accessible to every application component.</p> <pre><code>public class MyApplication extends Application implements LoaderCallbacks&lt;Cursor&gt; { @Override public void onCreate() { super.onCreate(); getSupportLoaderManager().initLoader(0, null, this); } </code></pre> <p><strong>What I am asking for is:</strong></p> <p>1- How to call <strong><em>getSupportLoaderManager()</em></strong> from the Application context?</p> <p>2- Is there a way to display a particular fragment -Splash Screen- while the application object is being created?</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,024,584
2,024,585
How do you unbind only some events?
<p>I have a few things like this...</p> <p><code>$('body').on('keyup', function(e){if(e.which === 32){//do stuff}})</code></p> <p>I need to disable some of these events at times but not all of them. </p> <p><code>$('body').off('keyup')</code> just turns them all off. </p>
javascript jquery
[3, 5]
4,263,030
4,263,031
Added class using javascript not working
<p>I am adding two classes using javascript on my table, the css for the classes is:</p> <pre><code>//using less .fade-table { background-color: #fff; opacity: 0.5; &amp;:hover { opacity: 1; } } .selected { opacity: 1; } </code></pre> <p>what i am trying to achieve here is that, my table fades at the <code>opacity: 0.5</code> and the selected cell is applied with the <code>selected</code> class which highlights the selected cell.</p> <p>The javascript being used is:</p> <pre><code>$("#pending_states table tr").live("click",function(){ $("#pending_states table").css({width: "140px"}); $("#pending_states td:nth-child(1), #pending_states th:nth-child(1)").addClass("fade-table"); $("#pending_states td:nth-child(1), #pending_states th:nth-child(1)").css({width: "140px"}); $("#pending_states").animate({ marginLeft: "4px"}, 200); $(this).addClass("selected"); }); </code></pre> <p>However for some reason after adding the <code>fade-table</code> class the script doesn't apply the <code>selected</code> class to the <code>td</code>. The obvious reason that i can think of is that this doesn't represent the td so o also tried <code>$(this).closest("td").addClass("selected");</code>. However this doesn't seem to work either.</p> <p>Any suggestions on how this might work?</p>
javascript jquery
[3, 5]
3,082,496
3,082,497
Error with taking spinner data from database
<p>Booking.java</p> <pre><code>package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; public class Booking extends Activity { private DBAdapter db; private Spinner colourSpinner; private String txtArrival; /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); db = new DBAdapter(this); db.open(); setContentView(R.layout.booking); Cursor c = db.getSpinnerData(); startManagingCursor(c); String[] from = new String[]{DBAdapter.KEY_ARRIVAL}; int[] to = new int[]{R.id.txtArrival}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, c, from, to ); adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item ); Spinner colourSpinner = (Spinner) findViewById(R.id.myspinner); colourSpinner.setAdapter(adapter); } </code></pre> <p>Where would i declare my {KEY_ARRIVAL} as i already have my KEY_ARRIVAL declared in my DBAdapter.java. But there is an error stating KEY_ARRIVAL cannot be resolved?</p>
java android
[1, 4]
1,653,899
1,653,900
how to "refresh" UL after adding new LI with jQuery?
<p>I think it's similar to <a href="http://stackoverflow.com/questions/5925810">this question</a>, but my problem is about jQuery and HTML5. I'm adding a <code>&lt;LI&gt;</code> element to <code>&lt;UL&gt;</code> and links (<code>&lt;a href=".."&gt;</code>) added inside apears as plain text, not clickable. Besides that, images are not visible, while <code>&lt;img src=".."&gt;</code> elements are being added propertly. </p> <p>Looks like I need some "refresh" trick to do after using <code>append()</code>. Which one?</p> <p>This is my code, just in case:</p> <pre><code>$('ul').append($('&lt;li/&gt;').append($('&lt;img/&gt;').attr('src', 'http://example.com'))); </code></pre> <p>The image is not visible, while HTML is being build correctly. I'm trying in Safari 5.1 on Mac.</p> <p>BTW, everything works perfectly fine in Firefox 10.0. Maybe the actual problem is that I'm using XML+XSL formatting in Safari and plain HTML5 in Firefox..</p>
javascript jquery
[3, 5]
2,539,201
2,539,202
Adding JSON results to a drop down list with JQUERY
<p>I'm making a call to a page method via AJAX in my ASP.NET application via JQUERY's AJAX method e.g.</p> <pre><code> $.ajax({ type: "POST", url: "page.aspx/GetDropDowns", data: "{'aId':'1'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert(msg.d); }, error: function() { alert('Error getting page'); } </code></pre> <p>I'll be returning the results in JSON format, whereby I will be populating a drop down. I could do this part myself but I want to know if there is any built in magic in JQuery for processing JSON results or if there are any good utility scripts for this sort of thing. </p>
asp.net jquery
[9, 5]
4,361,289
4,361,290
Call and receive output from Python script in Java?
<p>What's the easiest way to execute a Python script from java, and receive the output of that script? I've looked for different libraries like Jepp or Jython, but most seem to be very out of date. Another problem with the libraries is that, because this is a school assignment, I need to be able to easily include a library with the source code (though I don't need to source for the library itself) if I use a library. </p> <p>Because of this, would the easiest/most effective way be to simply do something like call the script with runtime.exec, and then somehow capture printed output? Or, even though it would be very painful for me, I could also just have the python script output to a temporary text file, then read the file in Java.</p> <p>Note: the actual communication between Java and Python is not a requirement of the aforementioned assignment, so this isn't doing my homework for me. This is, however, the only way I can think of to easily perform what needs to be done. </p>
java python
[1, 7]
2,980,354
2,980,355
How to Access Array response of AJAX
<p>This is my AJAX call response which is in array format </p> <p>[1,2,3,4,5,6] </p> <pre><code>success: function(outputfromserver) { $.each(outputfromserver, function(index, el) { }); </code></pre> <p>How can we access outputfromserver all values ??</p> <p>Means outputfromserver Zeroth value is 1 , 2nd element is 2 , -----so on </p>
javascript jquery
[3, 5]
3,187,493
3,187,494
405 error not allowed whereas I have javascript error
<p>I have a really strange problem and I want to know how it's possible...</p> <p>I develop an app with ASP on the server side and some JS/Ajax on the client. And for several times already, when I have a JS error, the page change and I get a 405 error instead of seeing the error in the Chrome console...</p> <p>For example, my current error is to try to access a property on a null object... After this code, I'm sending a request but I have placed a lot of alert() to trace the execution of my code and the Ajax request code isn't reached...</p> <p>Any idea?</p>
javascript asp.net
[3, 9]
668,576
668,577
how to determine that an element is button or text box
<p>How I can determine that an element is a <code>input</code> is a <code>button</code> type or is a <code>text</code> type in jquery?</p> <p>thanks</p>
javascript jquery
[3, 5]
3,111,868
3,111,869
Jquery ui tabs are wrapping to another line
<p>I have jquery tabs on my website but on smaller screens the tabs wrap to another line is there a way to keep the tabs from doing this?</p>
javascript jquery
[3, 5]
1,640,843
1,640,844
Need help writing js function that changes the class of the button that calls it
<p>I'm not very good with js, but basically I have a button </p> <pre><code>&lt;%=button_to_function "✓", checkButton(), :class =&gt; "buttonGrey"%&gt; </code></pre> <p>that is calling a js function I made. However I am getting errors in my syntax for the function.</p> <pre><code>function checkButton() { if (this.className="buttonGrey") { this.removeClass('buttonGrey'); this.addClass('buttonGreen'); } if (this.className="buttonGreen") { this.removeClass('buttonGreen'); this.addClass('buttonGrey'); } } </code></pre>
javascript jquery
[3, 5]
2,007,452
2,007,453
Printing commands from the Server
<p>I am building an application that will list all the restaurant that are available in a certain area or country if possible, the user/visitor will then be able to log in and view the menu of each restaurant and add what ever he wants in the basket.</p> <p>Now the problem that i am facing is trying to develop an engine that when a user selects food from a certain restaurant menu and submit the order, the order should automatically print on that restaurant printer that we will provide. could someone tell me where should i start, and what language will be more suitable PHP, or JAVA. your support will be highly appreciated. </p>
java php
[1, 2]
2,144,478
2,144,479
Problem with Generate Local Resource and My simple custom control
<p>I have created simple controls that are based on dot net controls . For example there is a simple GridView control that is based on dot net GridView control , I just set some setting in my control to use it in my .aspx pages , for example I set the Width of GridView in the constructor method : </p> <pre><code>// constructor of my custom class public GridView(): base() { this.Width = new Unit(100, UnitType.Percentage); } </code></pre> <p>and also I've added some custom properties :</p> <pre><code> public int SelectedID { get { if (ViewState["SelectedID" + this.ID] == null) ViewState["SelectedID" + this.ID] = "-1"; return Convert.ToInt32(ViewState["SelectedID" + this.ID]); } set { ViewState["SelectedID" + this.ID] = value; } } </code></pre> <p>The <strong>*<em>Problem</em>*</strong> : when I use Tools>Generate Local Resource in VS2010</p> <p>the aspx markup before I use this tool is like this : </p> <pre><code>&lt;RPC:GridView ID="grdData" runat="server" onrowcommand="grdData_RowCommand"&gt; </code></pre> <p>but this tool adds any public property or any setting to my aspx markup , like this :</p> <pre><code>&lt;RPC:GridView ID="grdData" runat="server" onrowcommand="grdData_RowCommand" meta:resourcekey="grdDataResource1" SelectedID="-1" Width="100%"&gt; </code></pre> <p>I don't like VS2010 add my settings (like width) and my custom properties (like SelectedID) to aspx markup , this prevent me having the ability of changing my custom control code and reflect changes in all aspx pages that include this control , for example if</p> <p>I change the width of my control to 50% , it doesn't reflect to any pages</p> <p>Please tell me what should I do to fix my problem</p> <p>Thank you very much for your feedbacks </p>
c# asp.net
[0, 9]
1,615,885
1,615,886
How to handle JS serialized item in PHP?
<p>Hey guys! I am having a bit of trouble handling the data from a submitted form that is serialized with JS. In the form there a textarea fields which users can input any text they want but when they enter &amp; like "apples &amp; oranges", I have trouble handling that. As we know that JS serializes &amp; to %26 and spaces with a "+" sign.</p> <p>So now back in PHP, I am trying to put this data into the database and call it back out elsewhere but for the life of me don't know how to handle the special characters properly.</p> <p>Note that I am also php exploding the data at the "&amp;" sign to make it into an array, then is put into the database as an array. I tried several methods like urldecode, htmlentities but those don't help because remember I need to explode at "&amp;".</p> <p>I am serializing in JS because its an AJAX submitting form.</p>
php javascript
[2, 3]
1,367,640
1,367,641
Can i add rows and cells to a table dynamically?
<p>i want the user to submit a message, and that message will be added as a table row, automatically.. is it possible?</p> <p>i want to do this: Table table=new Table. table.Rows.Add(row).. then i want to be able to insert a label into that row. e.g. row.Add(table)..but i cant find a way to do that!?!?</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.table.aspx</a></p> <p>i want the table to grow one row bigger than it used to be with a label of the users newly added message.</p> <p>i know that forums use tables .. but their table seems to be growing with every message submitted..</p> <p>How can i achieve the same effect? with c#</p>
c# asp.net
[0, 9]
4,817,072
4,817,073
Is there a C# equivalent to C++'s std::set_difference?
<p>If so, what is it?</p> <p>EDIT: In response to comment below:</p> <pre><code>var tabulatedOutputErrors = from error in outputErrors group error by error into errorGroup select new { error = errorGroup.Key, number = errorGroup.Count() }; var tabulatedInputErrors = from error in inputErrors group error by error into errorGroup select new { error = errorGroup.Key, number = errorGroup.Count() }; var problems = tabulatedOutputErrors.Except(tabulatedInputErrors); </code></pre> <p>You can expand out the counts if you need to.</p>
c# c++
[0, 6]
4,803,301
4,803,302
Making a value submission form for a jquery graph
<p>How can I make a page that has 4 or so text boxes for input and then on submission generates a jquery <strong>HightCharts</strong> graph?</p> <p>Any starting point would be awesome</p>
php jquery
[2, 5]
3,012,746
3,012,747
JQuery: how to name click functions?
<p>I have a script and I need to be able to name some of my anonymous click functions. For instance, here is some code:</p> <p>Document ready:</p> <pre><code>$(function(){ $('#map').imagemap([ {top_x: 1,top_y: 2,bottom_x: 290,bottom_y:380,callback: #id1 anonymous function}, {top_x: 275,top_y: 2,bottom_x: 470,bottom_y:380,callback: #id2 anonymous function}, {top_x: 460,top_y: 2,bottom_x: 701,bottom_y:380,callback: #id3 anonymous function} ]); $('#id1').click(function() { .... }); $('#id2').click(function() { .... }); $('#id3').click(function() { .... }); ... }); </code></pre> <p>How do I write my callbacks so that I don't have to duplicate the code outside the <code>document.ready</code>? I tried putting it all inline, following the <code>callback:</code>, but it didn't work. So what do I put in place of my anonymous function callback calls?</p>
javascript jquery
[3, 5]
4,539,197
4,539,198
Resetting function in javascript?
<p>I made a simple javascript translator using google API. Instead of using a button to translate the text i made <strong>onKeyUp="doTheFunction()"</strong> so that it translates once you type. At the bottom I have a button which clears the textareas. Once you clear the textareas and start typing again I get nothing. It seems that something like reset is missing ?</p> <p>Here is a working fiddle: <a href="http://jsfiddle.net/5eC49/" rel="nofollow">http://jsfiddle.net/5eC49/</a></p> <p>Try to type Hello, press the button and type hello again? </p> <p>Thanks alot</p>
javascript jquery
[3, 5]
4,509,044
4,509,045
If I learn PHP first, will it be difficult to learn C# next?
<p>I want to be a .net developer for the web. However, I see most freelanc developer tend to provide PHP development more than ASP.NET. The question now, is it OK if I learn PHP first and after that I go with C# or will this learn me bad habits that can lead to difficulty in learning C# or maybe I can't pick it up the right way as if I start with it?</p> <p>Please give me some facts about learning both and where I should go first and why?</p>
php c#
[2, 0]
2,060,368
2,060,369
Show/Hide image before filtering a table isn't working
<p>I have web page with some really large tables that I'm filtering using some jquery routines I wrote. Anyway, when these tables get really large and the filtering functions can take some time to complete. So I figured I'd unhide a animated gif so the user had some feedback. However, the gif never appears when I call: </p> <pre><code>$('#loadingimg').show(); </code></pre> <p>Unless I put an alert statement in front of it. I apologize for the ugly code, I'm not an experienced jquery/javascript programmer.</p> <pre><code>function filter() { var eles = ["mtmprogram","rate","stage"]; var tag; var classes=''; $('#loadingimg').show(); //alert('hi'); $('.report').hide(); for (var i in eles) { tag = '#' + eles[i] + ' option:selected'; if ($(tag).val()) { //$('.'+ $(tag).val()).show(); classes = classes + '.' + $(tag).val(); } } if (classes == '') $('tr.report').show(); else $(classes).show(); filterSubtables('Loan Number'); $('#loadingimg').hide(); } </code></pre> <p>Many thanks!</p>
javascript jquery
[3, 5]
4,960,051
4,960,052
Android data storage for plotting graph
<p>In my android application, i need to plot a graph showing the last 2 hours of data updated in 30 second interval. </p> <p>Also I would like to update the data on the file. At any time, the data file should contain only the most recent 2 hours of data. What is the best way for it since after two hours, every second a data element has to be removed from the top of the file and new data added to the bottom of the file and the file data should start from the first line.</p> <p>Can someone suggest me, the best way to store data. So that i can read simultaneously from it and plot it at the same time.</p>
java android
[1, 4]
4,790,500
4,790,501
appending and removing an image on toggle
<p>I am appending which is positioned correctly when a li is clicked. My code works nicely although it keeps adding images to the page because i am not removing them when the li is toggled. Any ideas?</p> <pre><code>$("#offering li").click(function() { $(this).find("ul").animate({height: "toggle"}, 500); $(this).append('&lt;img width="286" height="15" class="offeringselected" alt="Selected" src="images/bg-offering-li-selected.png"&gt;'); $(this).toggleClass('current'); }); </code></pre>
javascript jquery
[3, 5]
4,325,571
4,325,572
Show values in another document controls
<p>I want to show some JavaScript array values in another document Input Boxes. Previously, I was using:</p> <pre><code>document.getElementByID('....').value = .... </code></pre> <p>Now I want to know how to replace the 'document' with another page.</p> <p><strong>Edited:</strong></p> <p>My page opens two tables side-by-side. First table contains controls and the second contains and IFrame and inside that frame is enclosed a data-grid. When the user clicks on a row in the grid, results are fetched and I want to show in the controls of table1.</p>
javascript jquery
[3, 5]
465,646
465,647
Play audio when user exits my website
<p>I am wondering if there's a way to play audio when user exit my website?</p> <p>for example. "thanks for visiting etc."</p>
javascript jquery
[3, 5]
3,724,318
3,724,319
What's the difference between Admob and Adwhirl?
<p>I'm trying to figure what the difference is and which one would be more profitable for my app?</p>
android iphone
[4, 8]
3,775,249
3,775,250
JQuery JCrop Api to Pre-define image box size
<p>I am using JCrop plugin to crop image, things are working good with following code. i.e. User can able to select area of image to crop.</p> <p>But my question is how can i pre-define image size box so that user can move the box to select image and when they click on corp button thumbnail of that selected area is crop.</p> <p>For example: Visit this link <a href="http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced" rel="nofollow">http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced</a> Now Select a part of image and only check "Selection can be moved", deselect all other checkbox.</p> <p>I want to know how can i generate JCrop JQuery code for only "Selection can be moved" option, so that i can select only that part of image to generate thumbnail.</p> <p>Thank you.</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(document).ready(function() { jQuery('#imgCrop').Jcrop({ onSelect: storeCoords }); }); function storeCoords(c) { jQuery('#X').val(c.x); jQuery('#Y').val(c.y); jQuery('#W').val(c.w); jQuery('#H').val(c.h); }; &lt;/script&gt; </code></pre>
jquery asp.net
[5, 9]
5,398,682
5,398,683
Apply timezone to Date object
<pre><code> Date now = new Date(); Date then = new Date((long)obj.timestamp*1000); TimeZone tz = TimeZone.getDefault(); </code></pre> <p>Not very familiar with java, but is there any way to apply a timezone to a <code>Date</code> object? I found <a href="http://stackoverflow.com/questions/230126/how-to-handle-calendar-timezones-using-java">this</a> thread, but this is about Calendar timezones, which i believe is something different?</p>
java android
[1, 4]
3,136,692
3,136,693
How can android interact with C# code?
<p>I want to develope an Android app that interacts with C# (just sending strings back and forth at first). However I have nou experience with listening to ports and getting data from them in either language. The PC and device will be on the same network. What "basic code" do I need to begin sending string values between Android and C#?</p>
c# android
[0, 4]
5,878,380
5,878,381
webforms ajax file upload
<pre><code>&lt;form id="Form1" method="post" runat="server"&gt; &lt;uc1:PageHeaderDisplay id="pageHeaderDisplay1" runat="server"&gt;&lt;/uc1:PageHeaderDisplay&gt; &lt;asp:HiddenField runat="server" ID="postedFormData" /&gt; &lt;div style="display: none;" class="uploadxmlcontainer"&gt; Upload XML: &lt;asp:FileUpload runat="server" ID="fileUpload" onChange="$('.uploadFile').click();" /&gt;&lt;asp:Button runat="server" CssClass="uploadFile" Text="Upload" OnClick="UploadFile" style="display: none;" /&gt; &lt;/div&gt; </code></pre> <p>I have a fileupload control inside the original asp.net webforms form. What would be the easiest way to implement a non-postback solution? My problem is that when the user, for example, add some table rows using jquery -> uploads a file = the rows dissapear because of the postback.</p> <p>Can i use a plugin like ajaxforms for asp.net webforms? Or can you make an iframe that posts to the main page? Im looking for a simple solution, if possible :-)</p> <p>Any help is much appreciated! Thanks</p>
jquery asp.net
[5, 9]
5,511,363
5,511,364
How to write js file using php?
<p>How can I edit a javascript file using php. I want to change the file path dynamiacally is it possible to do with php. Please help me?</p> <p>test.js is my file. this is for display images on frontend</p> <p>from admin panel me create one folder named flower. then I will create one flower named folder and copy this test.js to that folder. after that I have to edit the file path of test.js file. how can I do that?</p>
php javascript
[2, 3]
185,938
185,939
Different popup for textbox change?
<p>I have 10 textboxes in Company page. 5 of them are common in Location page. My goal is to ask user if he wants to update just company page or even location page. If the user changes 5 textboxes that are common in Location Page, the popup shows as "Do you want to update Location Page as well" or if the user changes the other 5, then popup shows "Do you want to save?"</p> <p>How do we determine what textboxs are changed and which popup should be shown?? Could someone help me out. Thanks all :)</p>
c# asp.net
[0, 9]
4,836,092
4,836,093
Detect if user has scrolled to the bottom of a div
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6271237/detecting-when-user-scrolls-to-bottom-of-div-with-jquery">Detecting when user scrolls to bottom of div with jQuery</a> </p> </blockquote> <p>I have a page where I have a header, left menu, content, right menu and a footer. Inside my content I have a div (say id-foo) where I have some data. When user scrolls the page and reaches the bottom of div I have to make an ajax call and bring more data to fill the content there. How can I detect that user has scrolled(page scroll, there is no scroll in div) to bottom of div (foo) .</p>
javascript jquery
[3, 5]
5,588,479
5,588,480
Why does the whole page refresh when I use jQuery to increase or decrease the font size?
<p>I have a HTML page where I want one button to increase the font size and the same button to decrease the font size when clicked.</p> <p>I am using jQuery like so:</p> <pre><code>$("p").css("font-size","20") </code></pre> <p>However, when I do that the font size increases for maybe 2 seconds and then goes back to normal. It appears that the page is refreshing after I click the button... Why is that?</p>
javascript jquery
[3, 5]
4,644,138
4,644,139
activate readonly back after editing the input jquery
<p>how can i activate the readonly back after finishing the edit of the input ?</p> <p>this is my code for now :</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $("input").bind('click focus', function(){ $('input').each(function(){ $(this).attr("readonly", false); }); }); }); &lt;/script&gt; </code></pre> <p>an input like this :</p> <pre><code>&lt;input type="text" class="m" readonly="readonly" id="anchor_text"&gt; </code></pre> <p>i think something with focusout, i need to put readonly back when i go to the next input, so the edited input can't be change unless i hit again click on it.</p>
javascript jquery
[3, 5]