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
4,616,894
4,616,895
How to know if return data is Json or String in jQuery and PHP?
<p>I want to check in client side(jQuery) whether return data from a PHP function is Json object or String to assign different function.</p>
php jquery
[2, 5]
261,682
261,683
Sliding list of DIVs with Prev & Next button
<p>I would like to have next and previous buttons on a group of divs</p> <pre><code>&lt;div&gt;&lt;img src="img/car.jpg" /&gt;&lt;/div&gt; &lt;div&gt;&lt;img src="img/boat.jpg" /&gt;&lt;/div&gt; &lt;div&gt;&lt;img src="img/truck.jpg" /&gt;&lt;/div&gt; </code></pre> <p>I have about 20 div's all floating left. Is there away to slide them back and forward with next and previous buttons?</p>
javascript jquery
[3, 5]
3,137,665
3,137,666
How do I assign different style to Insert and Cancel buttons of a DetailsView?
<p>I have a DetailsView in Insert mode:</p> <pre><code>&lt;asp:CommandField ShowInsertButton="True" ButtonType="Button" ControlStyle-CssClass="myButton" InsertText="My Insert text" /&gt; </code></pre> <p>Both buttons Insert/Cancel get the same style, of course.</p> <p><strong>Is it possible to style these two separately to be one Blue and one Yellow?</strong></p> <p>In FormView you can define the buttons separately like this:</p> <pre><code>&lt;asp:Button CommandName="Insert" Text="Insert" class="myButtonStyle1" ID="myButtonID1" runat="server" CausesValidation="True" /&gt; &lt;asp:Button CommandName="Cancel" Text="Cancel" class="myButtonStyle2" ID="myButtonID2" runat="server" CausesValidation="False" /&gt; </code></pre> <p>Is there anything similar for DetailsView?</p>
c# asp.net
[0, 9]
2,123,944
2,123,945
How do I create an ASMX web service page without a code behind file
<p>I have been able to create ASPX pages without the code behind, but I can't for the life of me figure out the magic combination to get an ASMX page to work without a code behind. Is this even possible?</p>
c# asp.net
[0, 9]
4,492,227
4,492,228
Java Abstract Class (this keyword)
<p>I think I'm misunderstanding something, and if so, I need help..</p> <p>Let's say I have the following two classes:</p> <pre><code>public abstract class Abstraction() { protected int number = 0; public void printNumber() { System.out.println(this.number); System.out.println(getNumber()); } public int getNumber() { return this.number(); } } public class Reality extends Abstraction { int number = 1; public Reality() { this.printNumber(); } } // some other class new Reality(); </code></pre> <p>What should the output be? I'm getting 0, 0 (the code here is a bit more complicated but still the same issue). How can I get the output to be 1,1?</p>
java android
[1, 4]
3,121,910
3,121,911
Load more results like on facebook/twitter
<p>Maybe you've seen on Facebook/Twitter this effect. I want to load more results and append them to the existent ones. No problem so far. How can I keep track of how many results I have yet, to know from where on to query next time?</p> <p>I have a number of answers:</p> <ol> <li><p>Wrap the results into a div with an id, results1, results 2 ...and then get the last id and multiply it by how many results are in a container</p></li> <li><p>Keep the number in a variable, reset it every time the list is requested after you come from another page. </p></li> </ol>
php javascript jquery
[2, 3, 5]
3,040,893
3,040,894
Span element change event
<p>My question is:</p> <p>Does have a span element the inner html change event? I think about I have a span and when the span inner html is changing it will throw an event that I can reach?</p> <p>I would like to use Jquery to bind to this event of span.</p> <p>l.</p>
javascript jquery
[3, 5]
1,149,388
1,149,389
Flow analysis for android
<p>Is there a control flow graph generator for Android applications. (preferrably open source) I wish to do some flow analysis on applications. But I could not find any such static analyzer.</p> <p>If there is no such software, can <strong>soot</strong> be extended to do the static analysis for Android app. Some pointers on how to do so (especially handling multiple entry points and asynchronous calls to onPause, onDestroy etc. while making Control Flow Graph) will be very helpful.</p> <p>Thanks</p>
java android
[1, 4]
3,561,052
3,561,053
How to assign the javascript variable value to php variable
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1917576/how-to-pass-javascript-variables-to-php">How to pass JavaScript variables to PHP?</a> </p> </blockquote> <p>I want to assign the javascript variable to php variable </p> <pre><code>$msg = "&lt;script&gt;document.write(message)&lt;/script&gt;"; $f = new FacebookPost; $f-&gt;message = $msg; </code></pre> <p>But it is not working......</p>
php javascript
[2, 3]
3,216,506
3,216,507
Access Objective-C variable from C++ function
<p>I'm working on a project that just needs to be rewritten but that is not an option at this point.</p> <p>I have a C++ function that is called and does all kinds of stuff. I need it to read a variable from the App Delegate class.</p> <p>For example I have:</p> <pre><code>@interface MyAppDelegate : NSObject &lt;UIApplicationDelegate&gt; { UIWindow *window; MyViewController *viewController; int mToleranceLevel; } </code></pre> <p>I then have a function that needs to access the mToleranceLevel:</p> <pre><code>bool FindExtrinsics(...) { float maxError = mainDelegate.mMaxError; ... } </code></pre> <p>The problem is that this was declared like so:</p> <pre><code>@interface MyClass : UIViewController { ... } @properties ... bool FindExtrinsics(...); @end </code></pre> <p>So how would I get a value from the AppDelegate class. I do know how to get the current delegate:</p> <pre><code>mainDelegate = (RedStripeARAppDelegate *)[[UIApplication sharedApplication] delegate]; </code></pre> <p>But how do I use this info to get the value in my C++ function. Is there a way to make a static variable so I can call MyAppDelegate.mToleranceValue;??</p>
c++ iphone
[6, 8]
382,378
382,379
Settings Selector Dynamically in JQuery
<p>I have a table whose values are being generated dynamically with PHP, including the id and name attributes (e.g. id="question_".</p> <p>How can I set an element attribute with this in mind? For example, I have a div whose text will change after a successful ajax call, but the id is dynamic. </p> <p>I have tried making the following test function, and calling it on an onclick event:</p> <pre><code>function approve(question_id) { var div = 'suggestion_status_' + question_id; $('#div').html('test'); } </code></pre> <p>But that does not work. How can make the value of variable 'div' the selector?</p>
php jquery
[2, 5]
1,797,937
1,797,938
Pass form variables on to second postback...asp.net
<p>Is it possible to postback to the server, perform a function, and then continue that postback on to an external place? (ie, to a payment system)</p> <p>(the scenario is clicking a button to place an order, mark it as sent, then send them off to the payment page (there are form variables that needs to be sent to the payment screen as well))</p>
c# asp.net
[0, 9]
4,778,005
4,778,006
Substrings in Javascript with substr()
<p>I need to use Substring in Javascript. But despite my searches, i have an error : substr seems to be unknown...</p> <pre><code>function confirm_ticket(idAgir,TempsEstime) { var str = TempsEstime; var strConcatenate = TempsEstime.substr(0, 2) + ":" + TempsEstime.substr(2, 2); alert("confirmer le temps de maintenance de " + strConcatenate + " min pour le ticket " + idAgir); } </code></pre> <p>Is there anything wrong in this ? thanks in advance</p>
javascript asp.net
[3, 9]
4,842,953
4,842,954
How to use an anchor link and scroll at the same time?
<p>Here for some help again :)</p> <p>I've got this site: sharemyplaylists.com</p> <p>that uses this scrolling plugin to smoothly bring the user to an anchor when clicked, here is the code:</p> <pre><code>// Smooth anchor link script $(document).ready(function() { $('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &amp;&amp; location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length &amp;&amp; $target || $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); // open panel on click script $(".btn-slide").click(function() { $("#panel").slideToggle("slow"); $(this).toggleClass("active"); return false; }); </code></pre> <p>Anyway, I also have a button "Submit your playlist" that opens the top panel to reveal a form in the sidebar and when I click this, it just opens the panel (meaning I am not brought up to the top anchor also). It's like the 2 bits of code are conflicting and only one script will work. Any ideas on how to Click the "Submit your playlist" in the sidebar, bring the user to the top header anchor and open the panel also in one click?</p> <p>Cheers, Keith</p>
javascript jquery
[3, 5]
6,012,295
6,012,296
Add two numbers in asp.net page using Javascript
<p>Given Two text Boxes. (TextBox1 &amp; TextBox2), I want add two numbers (using the two text boxes) and show the result in the thrid textbox (TextBox3) <em>instantly</em> i.e without pressing a asp.net button. This is to be done using Javascript. I'm new to javascript so dont have much idea.</p> <p>This is the asp.net page.</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; Box1 &lt;br /&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; Box2&lt;br /&gt; &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; Box3&lt;br /&gt; &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript asp.net
[3, 9]
5,752,794
5,752,795
Jquery calling PHP function on jquery ajax success
<p>Is it possible to call a php function on jquery ajax call.When i tried to do this i get function not defined error on php function</p> <pre><code> $.ajax({ type:"POST", url:"x.php?z=" + id, cache:false, success: function(data) { &lt;?php xcz(); ?&gt; } }); </code></pre>
php jquery
[2, 5]
3,744,471
3,744,472
OnNewIntent does not show Toast
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11304267/displaying-a-toast-notification-in-android-framework">Displaying a Toast notification in Android framework</a> </p> </blockquote> <p>I have an activity and in onResume there is the following Code:</p> <pre><code>super.onResume(); Intent intent = new Intent(this, this.getClass()); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); nfcAdapter.enableForegroundDispatch(this, pendingIntent, null,null); </code></pre> <p>In the onNewIntent(Intent intent) function I have:</p> <pre><code>super.onNewIntent(intent); setIntent(intent) .. ... Toast.makeText.... </code></pre> <p>But the Toast does not show up - does someone have a solution for this problem?</p>
java android
[1, 4]
3,421,775
3,421,776
JQuery Truncate Text and insert
<p>I am using some Jquery to insert a element before another element as below:</p> <pre><code>$(document).ready(function(){ $('a[href*="FolderCTID"]').each(function(){ $(this).closest('tr').find('div[class^="ExternalClass"]').before(this); } ); }); </code></pre> <p>I am able successfully insert before the element </p> <p>But, <strong>.find('div[class^="ExternalClass"]')</strong> in the script above is the element i want to truncate before inserting on runtime.</p> <p>Please help me, how i can truncate the text before i actually insert </p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
1,881,254
1,881,255
jQuery focus on Alert box with clicking on button
<p>I have a form, after submitting form when button is clicked using jQuery like this.</p> <pre><code>function validate(){ if($('#firstname').val() =="") alert("Please enter your first name"); else if($('#lastname').val() == "") alert("Please enter your last name"); else if( $('#association').val() == "") alert("Choose your association"); else if($('#association_no').val() == "") alert("Please enter your association number"); else $('#register').submit(); } $(function(){ $(".enter_submit").keyup(function(event) { if(event.keyCode === 13) validate(); }) }) </code></pre> <p>The alert box is displaying fine but my issue that When I press enter after alert box is displayed, it gives another alert box instead of getting rid of the alert(Works fine when I click OK with mouse). In FF, it gives #prevent more alerts from this page. So I believe its still focusing on the form even after alert is displayed. </p>
javascript jquery
[3, 5]
3,813,603
3,813,604
Refresh parent window from child window using javascript
<p>I am opening new pop-up page in new window. Now When I am pressing a html input button from child window, I want to close this child window then I want to refresh the parent window. How I can do using javascript?</p> <p>Can you anyone suggest me the solution?</p>
javascript jquery
[3, 5]
4,328,141
4,328,142
How to convert the Username column in the GridView an email hyperlink (mailto) and to be clickable using GridView1_DataBound?
<p>I developed a web-based training matrix that shows the training record for each employee in each division in my department in the company. The matrix will show many columns such as the employee name, username, job title... etc. what I want now is to make the username for each employee to be clickable which means when the admin clicks on it, the outlook will be opened with his email and the admin will be able to send him a message. In my company, this is possible because each employee email is mainly as: [email protected] so how to do that?</p> <p>By the way, the username of the employee will be retrieved from the database using a storedprocedure, so how I will be able to convert the username to an email and to be clickable at the same time using the Code-Behind?</p> <p>The user column is the 4th column in the GridView</p> <p><em><strong>Code-Behind:</em></strong></p> <pre><code>protected void GridView1_DataBound(object sender, GridViewRowEventArgs e) { HyperLinkField hlink = GridView1.Columns[3] as HyperLink; hLink.DataNavigateUrlFormatString = } </code></pre>
c# asp.net
[0, 9]
1,030,644
1,030,645
jquery - Finding the href attribute of a jquery multiple selector
<p>so I was wondering, assuming you have a multiple selector as below:</p> <pre><code>$('.BOO li', '.FOO li a').click(function() { }); </code></pre> <p>and you want to find the <code>href</code> value of both classes, using the <code>this</code> keyword, how do you achieve that? </p> <p>Because if you go ahead and do it like below,</p> <pre><code>$('.BOO li', '.FOO li a').click(function() { $(this).attr("href"); //do stuff }); </code></pre> <p><code>.BOO li</code> is obviously left out.</p> <p>Is there a way to target the <code>this</code> of only the <code>.BOO1 li</code> and find it's <code>a</code>?</p> <p>Additional info:- of course, an alternative would've been selecting the <code>.BOO1 li a</code> directly</p>
javascript jquery
[3, 5]
1,279,436
1,279,437
Cannot get Textboxes in dynamically added usercontrol to maintain state
<p>I have tried what seems like everything - I've done similiar things many times before, but I'm obviously missing something.</p> <p>I have a UserControl (ucA) - on ucA is a LinkButton that loads a different UserControl (ucB) programatically into a panel on ucA. ucB has TextBoxes, etc. </p> <p>Could someone please help me be sane again? :-)</p> <p>Why isn't my control maintaining it's state? ie: The textboxes are loosing thier value on postback - the control tree shows the name of the control and the Form values show the value (in trace.axd)</p> <p>Here is the code for ucA (basically)</p> <pre><code>public int SlideCount { get { return Convert.ToInt32(ViewState["SlideCount"]); } set { ViewState["SlideCount"] = value; } } protected void LinkButton1_Click(object sender, EventArgs e) { SlideCount += 1; LoadSlideControls(); } protected override void OnInit(EventArgs e) { base.OnInit(e); LoadSlideControls(); } private void LoadSlideControls() { this.pnlAnnouncementHolder.Controls.Clear(); for (int i = 0; i &lt; SlideCount; i++) { this.pnlAnnouncementHolder.Controls.Add( LoadControl("AnnouncementSlide.ascx")); } } </code></pre> <p>Heres a full example of what im trying to do: Thank you Vyrotek for looking at it :-) <a href="http://keithsblogs.com/ControlTest2.zip" rel="nofollow">http://keithsblogs.com/ControlTest2.zip</a></p> <p>The problem Vyrotek points out is that the control is added a little to late to the lifecycle on the click event - anyone have any ideas?</p>
c# asp.net
[0, 9]
5,575,478
5,575,479
loading a element of same file through jquery
<p>I have a file <em>data.php</em>, when a user clicks update the database is updated in background with jquery but in response i want to reload the particular table whose data was updated.</p> <p>my html:</p> <pre><code>&lt;div id="divContainer"&gt; &lt;table id="tableContainer" cellspacing='0' cellpadding='5' border='0'&gt; &lt;tr&gt; &lt;td&gt;No.&lt;/td&gt; &lt;td&gt;Username&lt;/td&gt; &lt;td&gt;Password&lt;/td&gt; &lt;td&gt;Usage Left&lt;/td&gt; &lt;td&gt;%&lt;/td&gt; &lt;/tr&gt;&lt;!-- Multiple rows with different data (This is head of table) --&gt; </code></pre> <p> </p> <p>my jquery:</p> <pre><code>$('#UpdateAll').click(function() { $.ajax({ type: 'post', url: 'update.php', data: 'action=updateAll', success: function(response) { $('#response').fadeOut('500').empty().fadeIn('500').append(response); $('&lt;div id="divContainer" /&gt;').slideUp('500').empty().load('data.php #tableContainer', function() { $(this).hide().appendTo('#divContainer').slideDown('1000'); }); } }); }); </code></pre> <p>Everything is working fine the database is getting updated and in success <code>#response</code> is getting loaded with success message but the table is not refreshing.</p>
javascript jquery
[3, 5]
4,424,959
4,424,960
JQuery - Serialize() a object that isn't a form but it's inside and part of a form
<p>I'm trying to serialize some contents inside of a form:</p> <pre><code>&lt;form&gt; &lt;input ...&gt; &lt;input ...&gt; &lt;div id=div1&gt; &lt;input name=input1 ...&gt; &lt;input name=input2 ...&gt; &lt;/div&gt; &lt;/form&gt; &lt;script&gt; jQuery("#div1").serialize(); &lt;/script&gt; </code></pre> <p>In this code serialize() function doesn't serialize the input1 and input2. Even I tried </p> <pre><code>jQuery("&lt;form&gt;" + jQuery("div1").html() + "&lt;/form&gt;").serialize() </code></pre> <p>And it does serialize the inputs but all the values are Empty! it's like it doesn't assign values that user entered: <code>input1=&amp;input2=</code></p> <p>Is there any solutions out there? <em>(The reason I need to do this is that this page is a ASP.NET page since ASP.NET standard is a single form based so I have to deal with this situation)</em></p>
javascript jquery
[3, 5]
477,162
477,163
size or length of a Document object
<p>How can i get the size of an Document object?</p> <pre><code> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputStream iStr = urlConnection.getInputStream(); doc = db.parse(iStr); ???? --&gt; Log.i("Bytes",String.valueOf(doc.get????)); </code></pre>
java android
[1, 4]
5,370,765
5,370,766
Inject javascript in existing asp.net webforms app
<p>I am currently working on a website which has a lot of javascript . How can i make sure that my javascript has the best chance of running properly? By adding another script section in the page or through asp.net registering the script?</p>
javascript asp.net
[3, 9]
461,840
461,841
jQuery: Any way to "refresh" event handlers?
<p>I have two divs, one that holds some stuff and the other with all possible stuff. Clicking on one of the divs will transfer items to the other div. The code I came up with is:</p> <pre><code>$("#holder &gt; *").each(function() { $(this).click(function(e) { $(this).remove(); $("#bucket").append(this); }); }); $("#bucket &gt; *").each(function() { $(this).click(function(e) { $(this).remove(); $("#holder").append(this); }); }); </code></pre> <p>This one works perfectly, except that the event handlers need to be refreshed once I append or remove elements. What I mean is, if I first click on an element, it gets added to the other div, but if I click on this element again, nothing happens. I can do this manually but is there a better way to achieve this?</p>
javascript jquery
[3, 5]
4,561,137
4,561,138
Best tool for Code-Analyzement or Code-Review
<p>Which code-Analyzer or Code-Review tool do you suggest ,</p> <p>For Analyzing <strong>DotNet 2.0 &amp; 3.5</strong> code and getting</p> <p><em>All classes , Methods , Properties , Instances , Definition , Databases &amp; and their relation to code ,</em></p> <p>I want to <strong>get print-ready Information</strong> about codes &amp; projects ,</p> <p>( <em>here I dont mean a tool for testing the code &amp; structures</em> )</p> <p>Is there anyone with similar specifications ?</p>
c# asp.net
[0, 9]
5,005,528
5,005,529
Manipulating HTML from the asp.net code-behind
<p>I am able to get the HTML from the code-behind, like this one:</p> <pre><code>protected override void OnPreRenderComplete(EventArgs e) { StringWriter sw = new StringWriter(); base.Render(new HtmlTextWriter(sw)); sbHtml = sw.GetStringBuilder(); Response.Write(sbHtml + "&lt;!-- processed by code-behind --&gt;"); } </code></pre> <p>But I need to remove the HTML from the Page, any help?</p>
c# asp.net
[0, 9]
3,206,028
3,206,029
From a input field to a auto-suggest created div with (keyboard) down button
<p>There is an input field, and upon entering some characters in it, jquery shows div with search results (as an auto-suggest type made by jquery core only keyup()). Shortly, this search is absolutely similar as one on FB. </p> <p>Now, any clue how can I apply down button (on keyboard) to land on that div with results via jquery after div show up and user presses down button - as well to navigate throughout div with up and down keys if possible?</p> <pre><code>&lt;input id="target"&gt; //inp field &lt;div id ="search"&gt; //div that show search results </code></pre> <p>Thx.</p>
php jquery
[2, 5]
5,838,821
5,838,822
Split array into two arrays
<pre><code>var arr = ['a', 'b', 'c', 'd', 'e', 'f']; var point = 'c'; </code></pre> <p>How can I split the "arr" into two arrays based on the "point" variable, like:</p> <pre><code>['a', 'b'] </code></pre> <p>and</p> <pre><code>['d', 'e', 'f'] </code></pre>
javascript jquery
[3, 5]
2,836,357
2,836,358
Download file: ACCESS DENIED
<p>I keep on having "ACCESS DENIED" after hitting my download button. I already have full control on the specified folder.</p> <p>I use this in jquery.</p> <pre><code>function DownloadFile(ProductNumber, File) { var windowSizeArray = ["width=400,height=400", "width=500,height=600,scrollbars=yes"]; File = "C:/Documents and Settings/My PC/My Documents/" + File; if (File != "") { var windowName = "popUp"; var windowSize = windowSizeArray[$(this).attr("rel")]; var exist = isExists(File); if (exist) { window.open(File, windowName, windowSize); } else { ShowAlertMessage("The file for Product no. &lt;a href='" + File + "' target='blank'&gt;" + ProductNumber+ "&lt;/a&gt; does not exist."); } } else { ShowAlertMessage("No PDF file for Product no: " + ProductNumber+ "."); } } </code></pre>
javascript jquery
[3, 5]
2,734,533
2,734,534
what ?android:attr/listPreferredItemHeight is doing and how?
<ul> <li>public static final int listPreferredItemHeight</li> </ul> <p>Ok, ofcourse i understand this part of the expression...listPreferredItemHeight is the preferred list item height.</p> <p>But i really dont get these stuff...and google didnt help. Anyone can point me to the right direction where i can read about that? </p> <blockquote> <p>This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.</p> </blockquote> <p>the example where i find this code is here <a href="http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html">http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html</a></p> <p>thnx in advanced</p> <p>EDIT : in the example at the link the code is *android:layout_height="?android:attr/listPreferredItemHeight"* . What exactly it means?</p>
java android
[1, 4]
4,408,684
4,408,685
I need to know the value of a dropdownlist that is in a popup, with jquery
<p>I am using <a href="http://www.jtable.org/" rel="nofollow">jtable</a> for my grids and when create a new record it raises a popup in there. I have a dropdownlist so I need to get the value of that dropdownlist. How can I achieve this?</p> <p>This is the html: </p> <pre><code> &lt;div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" style="display: block; z-index: 1002; outline: 0px none; position: absolute; height: auto; width: auto; top: 78px; left: 828px;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-2"&gt; &lt;div class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 30px; height: auto;" scrolltop="0" scrollleft="0"&gt; &lt;form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" method="POST" action="/Item/Insertar"&gt; &lt;div class="jtable-input-field-container"&gt; &lt;div class="jtable-input-label"&gt;Producto&lt;/div&gt; &lt;div class="jtable-input jtable-dropdown-input"&gt; &lt;select id="Edit-Producto" class="" name="Producto"&gt; &lt;option value="1"&gt;Burn 1 L&lt;/option&gt; &lt;option value="2"&gt;Burn 1.5 L&lt;/option&gt; &lt;option value="3"&gt;Burn 1/2 L&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <pre><code> $('#Edit-Producto').change(function () { var t = $('#Edit-Producto').val(); alert(t); alert('Handler for .change() called.'); }); $("select[name='Producto']").change(function () { alert('Handler for .change() called.'); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,234,177
1,234,178
Resetting a form with JavaScript
<p>i am resetting my form with the following:</p> <pre><code>&lt;script type="text/javascript"&gt; window.onload = function () { document.getElementsByName("email_address")[0].value = ""; document.getElementsByName("remove")[0].value = "off"; } &lt;/script&gt; </code></pre> <p>the problem is that the checkbox "remove" seems to get reset before the server side script can run. So in effect what ever the user selected on the checkbox is overridden and set to off before the php script can be run. Yet, the input box "email_address" is fine...</p> <p>the test...</p> <pre><code>//this is already set to OFF by the time we get here....even if the user may have ticked the checkbox to ON echo $HTTP_GET_VARS['remove']; //this is fine, the email_address input is read and not reset... echo $HTTP_GET_VARS['email_address']; </code></pre> <p>can any one explain this? I obviously want the form to be reset AFTER my server side script is done processing , yet for some reason it resets the checkbox early, yet the input box is ok...</p> <p>thank you!</p>
php javascript
[2, 3]
1,334,049
1,334,050
Determine if one node is overlapping another
<p>Is it possible to know, in jQuery, if a node is overlapping another?</p>
javascript jquery
[3, 5]
5,341,360
5,341,361
Need help implementing two android activities?
<p>I am trying two initiate two different activities using two buttons and the on click listener I am receiving the following error <em>Multiple markers at this line - Syntax error, insert "}" to complete ClassBody - Syntax error, insert ";" to complete FieldDeclaration</em></p> <pre><code> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.safaricom); Button button1 = (Button)findViewById(R.id.button1); Button button2 = (Button)findViewById(R.id.button2); button1.setOnClickListener(buttonClickListener); button2.setOnClickListener(buttonClickListener); } private OnClickListener buttonClickListener = new View.OnClickListener() { @Override public void onClick(View v) { switch(v.getId()){ case R.id.button1: Intent intent = new Intent(this, Second.class); this.startActivity(intent); break; case R.id.button2: Intent intent = new Intent(this, SignUp.class); this.startActivity(intent); break; } } } </code></pre>
java android
[1, 4]
1,745,542
1,745,543
Onclick refresh only div content, Not all aspx page
<p>I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation is on master page. If I am on first.aspx page &amp; want to go to second.aspx onClick. I just want to load My contentplaceholder, not refresh all of the page. Is this possible or not?How do I do this if it is possible?</p> <p>I have tried using:</p> <pre><code>$(function() { $("#btn").click(function() { $("#Content").load("Second.aspx"); }); }); </code></pre> <p>I have also tried using this:</p> <pre><code>function SelectRol() { window.location = 'Second.aspx'; return false; } </code></pre>
javascript jquery asp.net
[3, 5, 9]
145,592
145,593
flowplayer with rssfeeds
<p>I have rssfeed website on which I have put some video/audio podcasts . How can I embedded flowplayer so that it can show small icon for video to play with each link of podcast rssfeed. If any one know this Please help me. Regards, lnj.</p>
php javascript
[2, 3]
715,578
715,579
How can I play sound in jquery when click a button
<p>i trying to play a sound file when i click the button, but it's not working, my html code is :</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="container"&gt; &lt;button id="play"&gt;Play Music&lt;/button&gt; &lt;div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>my script is :</p> <pre><code> $('document').ready(function () { $('#play').click(function(){ var audio = {}; audio["walk"] = new Audio(); audio["walk"].src = "http://www.rangde.org/static/bell-ring-01.mp3" audio["walk"].addEventListener('load', function() { audio["walk"].play(); }); }); }); </code></pre> <p><a href="http://jsfiddle.net/sureshpattu/gD4Dr/1/">i tried here this is my jsfiddle</a></p>
javascript jquery
[3, 5]
325,395
325,396
How to get the document height using C#?
<p>I am using ASP.NET and C#.I can able to get the document height using javascript with this.</p> <pre><code>var h = document.documentElement.offsetHeight; </code></pre> <p>Now i need this value during pageload. But the javascript will be start exicuting after pageload. So now i need to get it using server side code(C#).</p> <p>Is it possible?</p> <p>EDIT:</p> <p>In pageload i am planning to set the height for all the tags based on the document height. So that the page will fit for all resolution.</p>
c# asp.net
[0, 9]
5,279,125
5,279,126
Fetch input value from certain class and send with jquery
<pre><code>&lt;input id="u1" class="username"&gt; &lt;input id="u2" class="username"&gt; &lt;input id="u3" class="username"&gt; ... </code></pre> <p>How to fetch input value with "username" class and send with ajax jquery to php page.</p> <p>i want to recive data like simple array or simple json. (i need INPUT values and not ids)</p>
php jquery
[2, 5]
4,912,359
4,912,360
Javascript array or Google Charts view.setColumns?
<p>I dont know the topic Sorry for title. anybody who understand my question could edit my question title.</p> <p>Script:</p> <pre><code>// I get checkboxes values with using this function var myValues = $(".filter:checked").map(function () { return this.value; }).get(); alert("[0," + myValues + "]"); var view = new google.visualization.DataView(new google.visualization.DataTable(evalledData, 0.5)); view.setColumns([0, myValues]); // I pass the checked values. </code></pre> <p>When I write above code I got this error: <code>"type" must be specified</code></p> <p>If I wrote <code>view.setColumns([0, 1,2,3,4]);</code> It works.</p> <p>alert output : <code>[0,1,2,3,4]</code> so there is no difference between two usage.</p> <p>Why I got this error.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
5,276,989
5,276,990
Get a list of installed applications in android
<p>I'm trying to develop an application launcher application for android. I'm in the very beginning but I have a problem here: How do I get a list of all installed applications in android?</p>
java android
[1, 4]
606,075
606,076
Editing an Xml file
<p>What are the different ways for editing an Xml file in .Net without using LINQ.</p> <p>The following activity needs to be done.</p> <ol> <li><p>Changing an InnerText of an element.</p></li> <li><p>Changing an Attribute in Xml.</p></li> </ol> <p>Regards,</p> <p>Sachin K</p>
c# asp.net
[0, 9]
3,187,366
3,187,367
Why and When we need to create inner class in android
<p>I am new in android world. I am trying to learn it. I have a question about inner classes in android code. Why and when do we need to creat inner class. We can create an individual class and by creating its object we can access its methods. So why do we need to create inner class and when it is necessary to create as inner class. </p> <p>One advantage which i know is that we cant extend more than one class. So by creating inner classes we can extend more classes. What else ??</p> <p>//Shan</p>
java android
[1, 4]
4,883,299
4,883,300
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]
3,076,880
3,076,881
how to check if a checkbox exists
<p>The check box's exist for each row. the table is created by PHP and I need a way to check if the check box exists. when they are created they are given the ID of checkbox_(an incrementing number).</p> <p>This is what I have so far, but it does not work on checking if the element exists.</p> <pre><code>var check = true; var todelete = ""; var counter = 0; //check if box exisits and record id and post while(check) { if ($("#Checkbox_"+counter).length &gt; 0) { todelete = todelete + $("#Checkbox_"+counter).value; counter = counter + 1; } else { check = false; } } </code></pre> <p>I have also tried</p> <pre><code> if ($("Checkbox_"+counter)) if (document.getElementById("tbody").value == null) </code></pre> <p>Update:</p> <p>Even with the # symbol or if i do it by javascripts element ID - when I debug the DOM, it hits the while, then the if, adds the value to todelete, adds 1 to the counter, then it goes back to the while, then hits the if</p> <p>Then bounces back up to the while without even going into the if or the else???</p> <p>this I do not understand, then it just bounces up and down between the two lines and crash's the browser?</p> <p>Update2:</p> <p>I needed to .tostring() the counter when adding it to the string for an element id. problem solved</p>
javascript jquery
[3, 5]
1,548,416
1,548,417
How to store SharedPreferences into file?
<p>I have been developing Android application which should have following function: it should store some data between Application executings; also if I delete application and re-install it app should restore values of data. I knew that I can store data into SharedPreferences (for working with data in my program) and serialize into file in onDestroy() event. But SharedPreferences is Non-Serializable class and I can't use it. Please, suggest me another way for my task, or tell me how I can serialize SharedPreferences. I know that I can just write important data into simple file but may be there is another means for my problem? Thank you</p>
java android
[1, 4]
3,724,216
3,724,217
Parsing a String for Special characters in C#
<p>I am getting a string in the following format in the query string:</p> <p>"Arnstung%20Chew(20)" </p> <p>I want to convert it to just "Arnstung Chew". How do I do it?</p> <p>Also how do I make sure that the user is not passing a script or anything harmful in the query string?</p>
c# asp.net
[0, 9]
1,792,292
1,792,293
JavaScript not firing in ASP.NET
<pre><code> function isGoodEmail() { var email = document.getElementById("&lt;%=txtComapnyEmail.ClientID%&gt;").value; if (email == "Email") { if (window.isValidEmail(email)) { if (/(aol|gmail|yahoo|hotmail)\.com$/.test(email)) { alert(' valid email, but not for this site. No free service emails!'); return false; } return true; } return false; } </code></pre> <p>Button code: </p> <pre><code>&lt;asp:Button runat="server" class="button-orange" Text="Confirm and start my company page" ID="Companystart" OnClick="CompanystartClick" OnClientClick="isGoodEmail" /&gt; </code></pre> <p>I am calling the above JavaScript from the button, but it is not validating the email. Even if entered <code>gmail</code> it is accepted.</p>
javascript asp.net
[3, 9]
4,815,095
4,815,096
The use of globle in regular expression
<p>I used the regular expression <code>(/\&lt;+\/+\s+/gm,"&lt;/")</code>. If i remove the g the regular expression don't work. Please let me know technical difference between 'g-global and m-multiple'.</p>
php javascript
[2, 3]
3,614,118
3,614,119
How to use JQuery included in the main page in another page being called in the iFrame
<p>I have included JQuery on my main page which is a html page, in the main page there is an iFrame and in the iFrame I am calling another HTML page. I want to use jquery in the html page which is being called in the iFrame, is it possible to use the JQuery which is included in the main page? if it is then please let me know how?</p>
javascript jquery
[3, 5]
879,205
879,206
works with document objsct using JQuery
<p>I have html document with next structure</p> <pre><code>&lt;html&gt; &lt;head&gt;...&lt;/head&gt; &lt;body&gt; Some text &lt;iframe name="frame2" id="frame2"&gt; #document &lt;html&gt; &lt;head&gt;...&lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Inner Text&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How can I select <code>&lt;td&gt;</code> tag from iframe2 using jQuery selectors and get it's inner text? I have no idea how can I select any tag from inner #document construction? Can some one chip in me?</p>
javascript jquery
[3, 5]
993,233
993,234
JQuery : What is the difference between "var test" and "var $test"
<p>what is the difference between these statements? I know that "var $test" declares a jquery variable, but what is the difference of a jquery variable with a general javascript variable ?</p>
javascript jquery
[3, 5]
1,255,850
1,255,851
jQuery: return string as html
<p>I have a "Label" control on my form which is being populated via jquery. My problem however, is I need to return my string with html tags, but my label doesn't seem to recognize html. Here's my control:</p> <pre><code>&lt;label id="comment"&gt;&lt;/label&gt; </code></pre> <p>And here's how I'm working with it in javascript:</p> <pre><code>var comment; comment = $("#comment"); comment.text("&lt;b&gt;Please scan an &lt;br/&gt;item!&lt;/b&gt;"); </code></pre> <p>In the above code, the html in my string is ignored. Is there any way I can get my form to recognize the returned html tags?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,543,892
5,543,893
Wordpress Javascript / jQuery conflicts
<p>I'm really stuck on a problem. I have already searched Google and even asked on twitter but no avail. My problem is with Wordpress, when trying to use thickbox and jQuery slider on the same page my slider becomes static.</p> <p>(Without the jQuery script) If I remove the jQuery script for {Nivo slider} then my lightbox works.</p> <p>(Without thickbox javascript) When I don't use the thickbox javascript my slider works.</p> <p>(The Problem) When using both scripts thickbox overwrites the slider causing it to show the images below one another (not hidden) and the slider stops working all together.</p> <p>However I have tested using the two scripts on Drupal on my local host and they work fine together however on Wordpress it does not work.</p>
php javascript jquery
[2, 3, 5]
3,077,279
3,077,280
Android. 4.1 - 4 = 0.09999999999999964. Why?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11065397/android-number-format-is-wrong-somehow-instead-of-3-5-i-get-3-499999999-why">Android number format is wrong somehow, instead of 3.5 I get 3.499999999, why?</a> </p> </blockquote> <p>Does any one know why Android platform gives such strange result? </p> <p><strong>4.1 - 4 = 0.09999999999999964</strong></p> <p>It's only 4 that gives such strange rounding. </p> <p>Actually I need to get mantissa from 4.1 so I need 0.1 as result but not 0.09999999999999964.</p> <p>Any ideas? </p>
java android
[1, 4]
4,931,179
4,931,180
Getting selected value from multiple dropdowns
<p>If user change the entry from any dropdowns in the <code>SalePlugin</code> div then it will need to get all the selected value and pass it into POST.</p> <p>How it should be done?</p> <pre><code>$('.SalePlugin &gt; *').live('change', function(){ var SalePluginData = $(this).closest('.SalePlugin').find('select').serialize(); $.post(host + '/ajax/file.php', { Data: SalePluginData }, function(data){ console.log(data); }); }); </code></pre> <p>HTML</p> <pre><code>&lt;div class='SalePlugin'&gt; &lt;ul&gt; &lt;li&gt; &lt;select name='something[]'&gt; &lt;option value='one'&gt;One&lt;/option&gt; &lt;option value='two'&gt;Two&lt;/option&gt; &lt;/select&gt; &lt;/li&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li&gt; &lt;select name='something[]'&gt; &lt;option value='one'&gt;One&lt;/option&gt; &lt;option value='two'&gt;Two&lt;/option&gt; &lt;/select&gt; &lt;/li&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li&gt; &lt;select name='foo[]'&gt; &lt;option value='one'&gt;One&lt;/option&gt; &lt;option value='two'&gt;Two&lt;/option&gt; &lt;/select&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,764,967
3,764,968
Adding a delay before calling function in .hover() callback
<p>I'm trying to add a small delay in the .hover() callback before running further code. I also need to stop the timer if it exists when you hover another elem that triggers the same .hover() func. I currently have it working but it is not pretty, I'm assigning a timer to a global and sure there must be a better way to do this.</p> <p>Here is what I have:</p> <pre><code>PACKAGES.activity_icons.hover(function() { // If a timer exists kill it here becuase we don't want the // functions in the timer called if we are hovering on another icon if(typeof image_restore_timer != 'undefined') { clearTimeout(image_restore_timer); } // Only swap image if icon has a class if($(this).attr('class') !== '') { $(this).closest('.package').find('.left_wrap &gt; img').hide(); // Show the image with the same class as the icon we hovered $(this).closest('.package').find('.left_wrap img.'+$(this).attr('class')).show(); } }, function() { var this_ref = $(this); // Store timer in a global and restore images after a pause image_restore_timer = setTimeout(function() { (function(el) { el.closest('.package').find('.left_wrap img.'+this_ref.attr('class')).hide(); el.closest('.package').find('.left_wrap &gt; img:eq(0)').fadeIn('slow'); })(this_ref) }, 1000); }); </code></pre>
javascript jquery
[3, 5]
777,688
777,689
control volume by javascript function
<p>I have to play a music file on HTML page which is running on <code>android</code>, also need to control the volume by javascript function. Can someone give me any idea?</p>
javascript android
[3, 4]
1,374,350
1,374,351
strange issue with jQuery
<p>I have a very strange issue with jQuery.</p> <p>The problem:</p> <pre><code>$("#button-prev").attr("disabled", "disabled"); </code></pre> <p>This doesn't work. If I check with Firebug I see disabled="" as element attribute</p> <p>But for example this</p> <pre><code>$("#button-prev").attr("disablea", "disabled"); </code></pre> <p>works as you should expect. Anyone an idea what it could be?</p>
javascript jquery
[3, 5]
5,405,061
5,405,062
which is the best lightest jquery rich text editor
<p>i want a lightest lib,</p> <p>only can change " font-weight color list bold",it is ok for me.</p> <p>thanks</p>
javascript jquery
[3, 5]
414,201
414,202
Attach a return false to jquery bind
<p>I got this code: </p> <pre><code>$('#la_freccia_dx').bind('click', function(){ boutique_next(); }); </code></pre> <p>In my html markup I prevent the page to scroll up using this code:</p> <pre><code>&lt;a id="la_freccia_dx" href="#" onclick="boutique_next(); return false;"&gt; </code></pre> <p>But now it works only for the first time I click the link. I need to attach the return false to my jquery function up above and prevent the default action of the link. Any idea? Thanks!</p> <p><strong>SOLVED: MY FAULT! I left a href="#" in the markup. Thanks everyone!</strong></p>
javascript jquery
[3, 5]
3,304,453
3,304,454
automatic form post data
<p>I have a form with lots of data to be posted, so i was wondering if there is any way to get all the data to be posted automatically.</p> <p>like for example i sent data this way</p> <pre><code>$.ajax({ type: 'post', url: 'http://mymegafiles.com/rapidleech/index.php', data: 'link=' + $('#link').val() + '&amp;yt_fmt' + $('#yt_fmt').val(), }); </code></pre> <p>but there are so many fields that it doesnt look a good idea to me.</p> <p>Thank You.</p>
javascript jquery
[3, 5]
3,282,453
3,282,454
Change CSS class based on bound value?
<p>I have an item template in a grid view:</p> <pre><code> &lt;asp:TemplateField HeaderText="Name" SortExpression="GroupDescription"&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="lblName" CssClass="edit" runat="server" Text='&lt;%# Bind("GroupDescription") %&gt;'&gt;&lt;/asp:Label&gt; &lt;asp:HiddenField ID="lblHidden" EnableViewState="false" runat="server" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>The CssClass is 'edit'. If the GroupDescription is default then there should be no css class. Is there some way to do this?</p> <p>Thanks</p>
c# asp.net
[0, 9]
1,089,479
1,089,480
return; return true and return false - what are the differences?
<p>In languages like javascript/c++, sometimes there are <code>return false;</code> or <code>return 0;</code> being used. However, in languages like PHP, <code>return;</code> stops the script, and <code>return false;</code> returns the (bool) false and continues the script.</p> <p>It is confusing me alot lately.</p> <p>Can anyone explain what are the usages of return?</p> <p>Ps. My questions is mostly PHP/javascript/jQuery related.</p>
php javascript
[2, 3]
4,306,342
4,306,343
Assign input field value from previous page to a session and access with PHP
<p><strong>My Question</strong></p> <p>I have a contact form and it has a input field called </p> <pre><code>&lt;input type="text" name="subject" id="subject" value="Car"&gt; </code></pre> <p>and the second form with a input field called</p> <pre><code>&lt;input type="text" name="subject" id="subject" value="Home"&gt; </code></pre> <p>When someone clicks submit, the user is directed to a generic thank you page with a div in it as follows</p> <pre><code>&lt;div class="lead_form_thankyou"&gt;Thank you message&lt;/div&gt; </code></pre> <p>What I am trying to do is, assign the input field value to a session and access it while on the thank you page to display a customised Thank you message. </p> <p><strong>My Code</strong></p> <p>I have this code now </p> <pre><code>$subjectForThankYouMsg = $("#subject").val(); if($subjectForThankYouMsg == "Home"){ $(".lead_form_thankyou").text("Thank you for choosing our Car."); } else if($subjectForThankYouMsg == "Car"){ $(".lead_form_thankyou").text("Thank you for choosing our Home.'+\n+' We will be in touch with you shortly."); } </code></pre> <p><strong>My Issue</strong></p> <p>Im finding it hard to mix jQuery and PHP and assign <code>$subjectForThankYouMsg</code> value to a session. Can someone please guide me? Let me know if this is not clear. Thanks</p>
php jquery
[2, 5]
3,153,241
3,153,242
How does jquery know which function to run?
<p>I have:</p> <pre><code>&lt;script&gt; $(function() { $( "#datepicker" ).datepicker(); }); &lt;/script&gt; &lt;div class="demo"&gt; &lt;p&gt;Date: &lt;input id="datepicker" type="text"&gt;&lt;/p&gt; &lt;/div&gt; </code></pre> <p>When I click in the datepicker box the datepicker appears, as expected.</p> <p>Question: How does jquery know to run that function when I click on the box and not another function? </p> <p>If I want to add a function for something else, how would jquery know which to refer to? </p> <p>I am used to using php where all functions have a name and you refer to them by the name...</p>
javascript jquery
[3, 5]
1,522,738
1,522,739
inject javascript functions on server asp.net/php
<p>I created a small javascript library that makes making ajax calls using POST and JSON much easier for webmethods. Right now I still have to make a function stub in javascript for each matching webmethod. What I would love to do in asp.net mainly, and if possible in php too, would be that before sending the page to the client, the server examines the exposed webmethods and automatically injects the stubs in the javascript on the page before it sends the page to the client.</p> <p>In ASP.NET I'm sure there is some way to use reflection to find these and then some way to inject javascript to the page before sending. I'm sure I could figure out the reflection part, but not sure how to inject javascript to the page from the server. <strong>Does anyone know how to inject javascript to a page on the server side?</strong></p> <p>Also, does php have a way to sort of reflect on it's functions to also do this? Would be cool if this solution could work on multiple platforms.</p>
php javascript asp.net
[2, 3, 9]
1,375,895
1,375,896
Why do link paths in JavaScript not require a precedding / but paths in PHP includes do?
<p>Sounds nit picky but this had me hung up for about an hour or so.</p> <p>I have a path set like this in JavaScript</p> <pre><code>const JAVASCRIPT = 'host/source/ArcJB.js'; </code></pre> <p>which renders in my document like this:</p> <pre><code>&lt;script type="text/javascript" src="host/source/ArcJ.js"&gt;&lt;/script&gt; </code></pre> <p>If I put in a preceding <code>/</code> it breaks the link.</p> <p>In PHP, for server-side paths I use:</p> <pre><code>&lt;?php include_once getcwd() . "/host/source/class.ControlEntry.php"; </code></pre> <p>If I don't put in the <code>/</code> it breaks things.</p> <p>I guess conceptually how am I suppose to know this so I don't have to pull my hair out with trial and error?</p> <p>Also noted:</p> <p>Paths inside my .js file work with either a <code>/</code> or not a <code>/</code> preceding the path.</p> <p>These are used for image lookup or ajax calls.</p>
php javascript
[2, 3]
4,172,322
4,172,323
How to get a value out of a JavaScript function?
<p>I need to get the row number out of a JavaScript function:</p> <pre><code>function cap_check(){ var row; $('td').change(function(){ row = $(this).parent().parent().children().index($(this).parent()); alert(row); }); alert(row); } </code></pre> <p><em>Within</em> the function, <code>row</code> is correctly alerted. Outside of the function, it is <code>undefined</code>.</p>
javascript jquery
[3, 5]
5,694,474
5,694,475
Calling Javascript on a loaded site
<p>How would I call a function in Javascript on a loaded site in a Windows Form Application web browser? For those that have used Chrome, I'm looking to call Javascript like you can with the Javascript console.</p>
c# javascript
[0, 3]
825,026
825,027
How can I check if a radio button is selected in jQuery and gets his value?
<p>Can you please explain me how I can check in jQuery if a radio button is checked and get the value before inserting the value in a database? </p> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
5,009,038
5,009,039
jquery select option value and refresh current php page
<p>I use the following code to try to get menu value and update the SQL so that the content will be changed.</p> <p>I can obtain the pull down menu value but how can I pass to the CURRENT php page so that the SQL statement can get update and the content reload?</p> <pre><code>if (!empty($_GET['city'])) { $c=$_GET['city']; include("config.php"); // ... enter code here ... var $j = jQuery.noConflict(); $j(document).ready(function() { $j('#country').change(function(){ var city_val= $j(this).find("option:selected").attr('value'); }); }); </code></pre>
php jquery
[2, 5]
2,702,018
2,702,019
How to reliably store complex form data for submit
<p>I am creating an appointment web application where the user chooses a start date and an end for an event along with a global start time and end time. At the last screen I allow the user to edit any day during the duration of the event which I display using the jQuery Full Calendar plugin.</p> <p>Now, I want to keep this on the client side as much as I can until the user finally clicks submit and the whole thing goes at once. Handling the start/end date and the global times is easy enough but how would I go about keeping track of individual days' information in an organized and reliable way? Each day could potentially have different values for a number of fields (different start/end times, description, title, etc...)</p>
php javascript jquery
[2, 3, 5]
850,643
850,644
how to properly insert html with jquery
<p>I am using this bit of PHP to return a chunk of html:</p> <pre><code>if ($action = "update") { connect_db(); $query = mysql_query("SELECT * FROM convo ORDER BY date ASC") or die (mysql_error()); while($row = mysql_fetch_array($query)) { $output = $output . '&lt;p&gt;'; $output = $output . '&lt;b&gt;From:&lt;/b&gt; ' .$row['from']; $output = $output . ' &lt;b&gt;To:&lt;/b&gt; ' .$row['to']; $output = $output . ' &lt;b&gt;Message:&lt;/b&gt; ' .$row['content']; $output = $output . "&lt;br /&gt;"; $output = $output . '&lt;/p&gt;'; } //htmlentities($output); header('Content-Type: application/json'); echo json_encode( $output ); } </code></pre> <p>And then insert it into a <code>&lt;div&gt;</code> with this bit of jQuery:</p> <pre><code>function update(){ $.ajax({ type: "GET", url: "actions.php", data: { 'action': 'update' }, dataType: "json", success: function(data) { console.log('update called'); console.log( data); $('#history').text( data ); //$('#status').text('sent!'); } }); setTimeout(update, 5000); } </code></pre> <p>The ajax call works and returns the correct html however when inserted it is not formatted, I can see all the html code in the browser. See example picture: <img src="http://i.stack.imgur.com/nU1Kz.png" alt="browersoutput"></p> <p>Should be using something other than <code>.text</code>?</p>
php jquery
[2, 5]
6,015,591
6,015,592
load content while scrolling not working
<p>I am writing a code which i scroll to the bottom of the window it loads another data with the help of php code. It loads the load_first.php file but not identifies the load_second.php file What problem in this code see this </p> <pre><code> &lt;?php $_SESSION['first']=1; if($_SESSION['first']==1) { ?&gt; &lt;script type="text/javascript"&gt; $(window).scroll(function(){ if($(window).scrollTop() == $(document).height() - $(window).height()){ $('div#last_msg_loader').html('&lt;img src="loading.gif"&gt;'); var data="cachekey=" + $('.cachekey').val()+"&amp;cachelocation="+ $('.cachelocation').val(); $.ajax({ url: "load_data.php?last_msg_id="+ID, data:data, error:function(error) { alert(error); }, success: function(html){ if(html){ $(".message_box:last").after(data); $('div#last_msg_loader').hide(); }else{ $('div#loadmoreajaxloader').html('&lt;center&gt;No more posts to show.&lt;/center&gt;'); } } }); } }); &lt;/script&gt; &lt;?php include('load_first.php'); ?&gt; &lt;?php } else { include('load_second.php'); } ?&gt; &lt;div id="last_msg_loader"&gt;&lt;/div&gt; </code></pre> <p>Actually this code is used to load the hotel list using xml api of expedia</p>
php jquery
[2, 5]
5,985,287
5,985,288
Passing an ID over an intent
<p>I am trying to pass the ID of the clicked on data from my listview to a new activity in a second class i.e. I click the item on the <code>listview</code>.The <code>onListItemClick</code> method is called and starts a new intent. The id is passed with the object in the <code>i.getExtra</code>. Then the id is stored into a new variable on the second class to be used later.</p> <p>Ive got as far as working out how to pass the id, but I cant seem to work out how I then store it in the new variable on the second class.</p> <p>Heres my code:</p> <pre><code>public void onListItemClick(ListView list, View v, int list_posistion, long item_id) { long id = item_id; Intent i = new Intent("com.example.sqliteexample.SQLView"); i.putExtra(null, id); startActivity(i); } </code></pre> <p>Could anyone tell me how to reference it in the second class? </p>
java android
[1, 4]
3,325,951
3,325,952
Is this possible to convert a million digit number to 1000 digit number by a certain mathematical operation in C++ or C#?
<p>I am working on project and ran into an issue. Now I want to know is there anyway to reduce digits of a big number? For example convert a million digit number to 1000 digit number.</p>
c# c++
[0, 6]
1,628,737
1,628,738
how to determine checkboxlist is checked/selected -
<p>when i execute the code i get 4 checkboxs and i checked/selected all 4 checkbox and when i try to debug the code, it does count that i have 4 checkbox but all 4 checkbox is selected=false.</p> <p>what i am missing in code?</p> <pre><code>&lt;asp:checkboxlist id="chk" runat="server" ondatabinding="chk_DataBinding" ondatabound="chk_DataBound"&gt; &lt;/asp:checkboxlist&gt; List&lt;String&gt; roles = new List&lt;string&gt;(); for (int i = 0; i &lt; chk.Items.Count; i++) { if (chk.Items[i].Selected) { roles.Add(chk.Items[i].Value); } } </code></pre>
c# asp.net
[0, 9]
1,773,330
1,773,331
How to execute javascript in C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/172753/embedding-javascript-engine-into-net-c">Embedding JavaScript engine into .NET (C#)</a> </p> </blockquote> <p>I have a script like this:</p> <pre><code>var myObject=new Object(); myObject="Hello"; </code></pre> <p>If I refer the script in browser, I can make use of myObject just like below:</p> <pre><code>&lt;script src="myObject.js" type="text/javascript"&gt; &lt;script type="text/javascript"&gt; alert(myObject); &lt;/script&gt; </code></pre> <p>Can I execute the script in C# without browser? It should be like below:</p> <pre><code>//These are C# Code string result = ???????? </code></pre>
c# javascript
[0, 3]
1,661,923
1,661,924
Loop through all elements with class name 'blah' in jquery and use the contents of the element in a function
<p>This is what i'm trying to do in pseudo code</p> <pre><code>Find all &lt;td&gt; Elements with Class name 'OSGridRef' For each &lt;td&gt; element pass the text of that &lt;td&gt; element into a function called ConvertToLatLong Update an &lt;td&gt; element in the same table row that has the class name 'LatLong' with the results of the function. </code></pre> <p>I haven't the foggiest how to do this in regular JavaScript or in jQuery.</p> <p>Any Ideas?</p>
javascript jquery
[3, 5]
4,090,091
4,090,092
Re-fire a javascript event from a stored event object
<p>I have the following:</p> <pre><code>&lt;textarea id="text"&gt;&lt;/textarea&gt; &lt;textarea id="simulator"&gt;&lt;/textarea&gt; &lt;br/&gt; &lt;div onclick="simulate()"&gt;Simulate&lt;/div&gt; keyslog = []; $('#text').bind('keyup keydown keypress mousedown mouseup', function(e){ keyslog.push(e); } function simulate(){ for(var i=0;i&lt;keyslog.length;i++){ var e = keyslog[i]; // how to fire "e" event again on #simulator? } } </code></pre> <p><strong>My failed attempts were:</strong></p> <pre><code>document.getElementById('simulator').dispatchEvent(e); </code></pre> <p>And</p> <pre><code>$('#simulator').trigger(e); </code></pre> <p>The question is how to trigger an event based on an already stored event object. It can be a Mouse or Keyboard event.</p> <p>P.S. The example is about running a playback of pressed keys with the support of cursor changing/highlighting using mouse.</p>
javascript jquery
[3, 5]
4,016,717
4,016,718
Works in Firefox but not IE
<p>I make use of the following to find a string in a particular element, if it exists, tick a checkbox. This works great on Firefox but not internet explorer (8). I am having trouble finding why.</p> <pre><code>$.fn.searchString = function(str) { return this.filter('*:contains("' + str + '")'); }; var myID = $('div').searchString(files_array[i].substr(-4)); alert(myID);//[object object] alert(myID.children());//[object object] myID.children().attr('checked', true);//does not tick checkbox alert(myID.children().attr('checked'));//undefined </code></pre> <p>Does IE not like the children() function?</p> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
4,398,256
4,398,257
JQuery retrieving text with val instead of value
<p>I need to get the value from a select list but JQuery is returning the text within the options of the select.</p> <p>I have the following simple code.</p> <pre><code>&lt;select id="myselect"&gt; &lt;option selected="selected"&gt;All&lt;/option&gt; &lt;option value="1"&gt;One&lt;/option&gt; &lt;option value="2"&gt;Two&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I then use the following JQuery which I thought would get me the value</p> <pre><code>var myOption = $('#myselect').val() </code></pre> <p>but when I lokk at myOption I get the text of 'one' or 'two'?</p>
javascript jquery
[3, 5]
3,984,585
3,984,586
Why the Sleep executes first and than the code above it in android?
<p>Why is the try block executed first, i want the colors to change first and then it should sleep fo 5000ms. i mean the system sleeps before the colors changes. private OnClickListener CheckAnswer =new OnClickListener() {</p> <pre><code> public void onClick(View arg0) { // TODO Auto-generated method stub disableButtons(); Button incoming=(Button) arg0; if(incoming.getText().toString().equals(Q.getAnswer())) { incoming.setBackgroundColor(Color.GREEN); correct++; score+=15; } else { incoming.setBackgroundColor(Color.RED); wrong++; if(C1.getText().toString().equals(Q.getAnswer())) C1.setBackgroundColor(Color.GREEN); else if(C2.getText().toString().equals(Q.getAnswer())) C2.setBackgroundColor(Color.GREEN); else if(C3.getText().toString().equals(Q.getAnswer())) C3.setBackgroundColor(Color.GREEN); modifyScore(); } try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } questionGenerator(); } };` </code></pre>
java android
[1, 4]
4,867,505
4,867,506
how to use more element in listview?
<p>i m new to android .</p> <p>i m doing my final yr project in android. </p> <p>Is the any way to use more elements in list view control....</p> <p>for example: fetch more data frm database and add it at runtime. the formate may be</p> <hr> <p>text text</p> <p>text text</p> <hr> <p>text text</p> <p>text text</p> <hr> <p>etc.....</p> <p>refer this page for model <a href="https://play.google.com/store/apps/details?id=app.diaryfree&amp;feature=search_result#?t=W251bGwsMSwxLDEsImFwcC5kaWFyeWZyZWUiXQ" rel="nofollow">https://play.google.com/store/apps/details?id=app.diaryfree&amp;feature=search_result#?t=W251bGwsMSwxLDEsImFwcC5kaWFyeWZyZWUiXQ</a>..</p> <p>(in this page sample image for that application wil be given, like that report i need to display my data.)</p> <p>is any other control there for that??? how to add runtime more assign more than one element value???</p> <p>like this</p> <p>and how to find which row is clicked?</p> <p>thankz in advance</p>
java android
[1, 4]
1,978,616
1,978,617
is there a way to limit db entries in android?
<p>i want to make a free verison of my app and only allow 3 entires to be made into the database hwo would i do this?</p>
java android
[1, 4]
5,031,471
5,031,472
Character encoding error
<p>Using asp.net pages with master page and getting error: </p> <blockquote> <p>The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature</p> </blockquote> <p>If master page is not apply on the content page then page working fine. Please provide some solution for this issue.</p>
c# asp.net
[0, 9]
1,953,656
1,953,657
Deprecation warning message with import android.hardware.SensorListener library
<p>I add to application</p> <pre><code>public class ShakeActivity extends Activity implements SensorListener </code></pre> <p>But I receive deprecation warning from eclipse when I write it. Is there any new library with any new Listener for making ShakeActivity? Thanks.</p>
java android
[1, 4]
4,692,208
4,692,209
how to compare one parameter value from a javascript function and return if false
<p>i have a code that goes like this </p> <pre><code>$('#submitme').click(function(e){ var indentifyForm= $('#submitme').closest('form').attr('id'); var flag =validateForm(validationFlag, indentifyForm); //alert(validateForm(validationFlag)); if(flag){ return false; } else{ dosomething(indentifyForm); } }); </code></pre> <hr> <p>if its true it should return false and the form gets validated , but always remains false. Please help.</p>
javascript jquery
[3, 5]
1,358,776
1,358,777
What is the best way to detect Internet Explorer 6 using JavaScript?
<p>What is the best way to detect Internet Explorer 6 using JavaScript?</p> <pre><code>If browser == IE6 { alert('hi'); } </code></pre>
javascript jquery
[3, 5]
4,573,130
4,573,131
jquery & facebox image issue problem
<p>i am using facebox first time but the problem is facebox dialog is showing but images is not showing for loadingImage and closeImage.</p> <p>i specify the images path like</p> <pre><code>&lt;script language="Javascript" type="text/javascript"&gt; $(document).ready(function () { $.facebox.settings.loadingImage = 'images/loading.gif'; $.facebox.settings.closeImage = 'images/closelabel.gif'; }) $(document).ready(function () { $("#btnFeedback").click(function () { $.facebox.settings.opacity = 0.5 jQuery.facebox('OK, you can close me now'); return false; }) }); </code></pre> <p></p> <p>but why it is not showing. do i need to do anything extra?</p>
jquery asp.net
[5, 9]
141,823
141,824
Cant select ids that I loaded with jQuery
<p>I understand that you need to use ".on" to use code that you loaded with jquery after the page has loaded. (At least I think it works that way)</p> <p>So I tried that but it somehow just doesn't do a thing at all. No errors in the console either.</p> <pre><code>$("#forgot_password").click(function(){ var forgot_password = '&lt;div id="toLogin" style="cursor:pointer;"&gt;Prijava&lt;/div&gt;' $("#loginPopupForm").html(forgot_password); }); $("#toLogin").on("click", function(){ alert("Hello"); }); </code></pre> <p>So when I click on #forgot_password it does execute the first click function. But when I click on #toLogin it doesn't do anything and I think its because its loaded with jquery when I click on #forgot_password</p>
javascript jquery
[3, 5]
5,619,916
5,619,917
If else and href ends in problem JQuery
<p>I'm struggling with the following code. The first if statement is doing what I want, then I need to make sure I don't add a parameter to an href if it ends in .pdf ... the second if statement is not working. I'm sure it is something simple because I know very little! Please help. Thanks!</p> <pre><code>var string2 = "x"; if (document.domain.indexOf(string2)!== -1) { } else { $("#breadcrumb a").each(function(){ this.search = 'lnkid=bc'; }); if ($("#linklist a[href$='.pdf']") &gt; -1 ) { } else { $("#linklist a").each(function(){ this.search = 'lnkid=snav'; }); } </code></pre>
javascript jquery
[3, 5]
2,712,249
2,712,250
How to poll a directory in ASP.NET?
<p>I want to poll a directory to check whether new file is added to the directory in ASP.NET web application (C#). If any new file is added I want to read that file.</p> <p>Can anybody give me an idea how to do that?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
4,552,303
4,552,304
Use HTML variable inside JavaScript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/168214/pass-a-php-string-to-a-javascript-variable-including-escaping-newlines">Pass a PHP string to a Javascript variable (including escaping newlines)</a> </p> </blockquote> <p>Let's say there is some PHP file called as <code>scheduler.php</code>. It contains a script</p> <pre><code>&lt;script&gt; window.setInterval(function(){ find_opt_schedule(); }, 60000); &lt;/script&gt; </code></pre> <p>... and some PHP code:</p> <pre><code>&lt;form action="scheduler.php" method="post"&gt; &lt;select name="refresh" id="refresh"&gt; &lt;option value="30000"&gt;30000&lt;/option&gt; &lt;option value="60000" selected&gt;60000&lt;/option&gt; &lt;option value="120000"&gt;120000&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre> <p>How do I use the value selected by the user from <code>refresh</code> select list inside the script? In particular, I want to replace 60000 by the variable that must be selected by the user from the list. I tried this, but the refresh rate is very high instead of 60000 miliseconds.</p> <pre><code>window.setInterval(function(){ find_opt_schedule(); alert(&lt;?php echo (int)$_POST['refresh']; ?&gt;); }, &lt;?php echo (int)$_POST['refresh']; ?&gt;); </code></pre>
php javascript
[2, 3]
2,327,775
2,327,776
Can we track clients ip address with php or javascript
<p>I don't trust any analytics or statcounter type websites I want to track my visitors by my own coding </p> <p>can we track it by php or javascript if yes then how </p>
php javascript
[2, 3]