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
5,698,811
5,698,812
how to copy the content of a div to another div
<p>I'm trying to copy the single element inside a selected div to another div with jquery. But with my code copies entire division to another division..</p> <p>My code is :</p> <pre><code>$('#image').html($('#selected').html()); //which copies entire content of #selected division </code></pre> <p>And the division is:</p> <pre><code>&lt;div class="imgs" id="selected"&gt; &lt;img width="100%" height="100%" data-id="1" data-alid="1" src="data:image/jpeg;base64,"&gt; &lt;div class="xyz"&gt;&lt;a href="#"&gt;Xyz&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I need to copy only the <code>img</code> from the <code>div</code> <code>imgs</code></p> <p>Please anyone help me ... Thanks....</p>
javascript jquery
[3, 5]
4,346,078
4,346,079
problem to visible false of button when export data to excel
<p>Hello Everybody I am using c#.net to make webapplication. I am making a webpage that export gridview data to excel. My code is as follow</p> <pre><code> protected void btnexport_Click(object sender, EventArgs e) { btnsubmit.Visible = false; exporttoexcel(); expToExcel(); } public override void VerifyRenderingInServerForm(Control control) { //base.VerifyRenderingInServerForm(control); } public void exporttoexcel() { Context.Response.Clear(); Context.Response.AddHeader("content-disposition", "attachment;filename=FileName.xls"); Context.Response.Charset = ""; Context.Response.Cache.SetCacheability(HttpCacheability.NoCache); Context.Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); GridView1.RenderControl(htmlWrite); Context.Response.Write(stringWrite.ToString()); Context.Response.End(); } </code></pre> <p>My gridview data is export to excel successfully but on EXPORTTOEXCEL button click event i am trying to false the visible property of another button submit, but i am successful to do it so please tell me how i set the visible property to false on EXPORTTOEXCEL button click event</p> <p>Please give me reply soon my work is in midway </p> <p>thank u to all in advance</p>
c# asp.net
[0, 9]
1,413,086
1,413,087
Html mouseup caching an element more than once
<p>I've written a jquery script which works fine, but now I'm trying to make it into a plugin. Once it's in the plugin though, the mouseup function on the html appears to increase the cache of the same element by one every time, and I can't figure out why.</p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="box"&gt;Box 1&lt;/div&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ $(function(){ (function($) { $.fn.myPlugin = function() { return this.each(function(){ var $this = $(this); $('html').mouseup(function(){ console.log('cached +1: ' + $this);//this ouput increases by one every mouseup });//html mouseup console.log('cached once: ' + $this);// this output displays once per mouseup });// return this each } //fn myPlugin })(jQuery); $('.box').mousedown(function(){ $(this).myPlugin(); });//.box mousedown });//document ready //]]&gt; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If someone could explain why this is happening (in as much layman's terms as possible), I'd be very grateful.</p> <p>Thanks</p>
javascript jquery
[3, 5]
892,159
892,160
Create list html from selected text in Textarea
<p>I have found various examples of using jquery to wrap selected text from a textarea in html tags, but I would like to adapt this slightly to create a list when multiple lines of text are selected.</p> <p>Currently the code below wraps the whole selection in the list tags but I would also like to replace all the carriage returns with the closing and opening tags for list items - so each line in the text area is a new list item.</p> <p>I think one of the problems might be that the .val function reads the text area as a single line.</p> <p>jquery:</p> <pre><code>function listText(elementID, openTag, closeTag) { var textArea = $('#' + elementID); var len = textArea.val().length; var start = textArea[0].selectionStart; var end = textArea[0].selectionEnd; var selectedText = textArea.val().substring(start, end); var replacement = openTag + selectedText + closeTag; textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); } $(document).ready(function () { $("#BoldIt").click( function() { listText("markItUp", "&lt;ul&gt;&lt;li&gt;", "&lt;/li&gt;&lt;/ul&gt;"); }); }); </code></pre> <p>body:</p> <pre><code>&lt;textarea id="markItUp" cols="80" rows="20"&gt;&lt;/textarea&gt; &lt;br /&gt; &lt;input type="button" value="Bold" id="BoldIt" /&gt; </code></pre>
javascript jquery
[3, 5]
5,524,201
5,524,202
Code coming back from script not detected by jquery
<p>I basically have a div container which i am reusing to fill with different data, depending on the link that is clicked.</p> <p>This div container has a class name of "test_bed" and the anchors used to populate it have class names of "linkA", "linkb" etc.</p> <pre><code>$(document).ready(function(){ $("a.link").click(function(e) { //prevent default behaviour: e.preventDefault(); var a = "a"; var b = "b"; //pass vars to script: $.post('00_php_script_.php', { x:a , y:b }, function(output){ //Replace div content with script output: $('div#test_bed"').html(output).show(); }); }); }); </code></pre> <p>This is one of the "linkA" anchors as mentioned above:</p> <pre><code>&lt;a href="" id="linkA" name="linkA" class="linkA"&gt;LinkA&lt;/a&gt; </code></pre> <p>All the php script does is echo the vars back along with a link:</p> <pre><code>echo $_POST['x'] . " " . $_POST['y'] . " " . '&lt;a href="" id="linkA" name="linkA" class="linkA"&gt;LinkA&lt;/a&gt;'; </code></pre> <p>Everything works fine, except for the fact that the link, which is returned from the php script into the test_bed div does not seem to be detected by the above jquery code.</p> <p>QUESTION:</p> <p>How do I make the code which is returned from the php script be detected by the above jquery code??</p> <p>Any assistance appreciated guys....</p>
php jquery
[2, 5]
3,830,986
3,830,987
How to prepend a string to a string variable in a for loop without changing the loop structure?
<p>If i have a for loop like this:</p> <pre><code>var rows; var len = z[0].length; for ( var i = len; i--; ) { rows += "&lt;tr&gt;&lt;td&gt;" + z[0].Marketer + "&lt;/td&gt;&lt;td&gt;"; } </code></pre> <p>How can i prepend instead of append the current row to this string WithOUT changing the for loop structure?</p> <pre><code>var rows; var len = z[0].length; for ( var i = len; i--; ) { rows (prepend) "&lt;tr&gt;&lt;td&gt;" + z[0].Marketer + "&lt;/td&gt;&lt;td&gt;"; } </code></pre>
javascript jquery
[3, 5]
1,680,815
1,680,816
How to save textbox data to file using javascript
<p>I have a web page containing a textbox. This textbox shows result of processing. There is a button "Save Result" to save contents of textbox to file. I know it can be easily done with FileStream. But I want the same functionality to save file using Javascript so that there is no need for server postback.</p> <p>Do anybody have solution to this?</p> <p>Thanks for sharing your time.</p>
c# javascript asp.net
[0, 3, 9]
106,657
106,658
How to update main activity to know that prefs are changed?
<p>I have</p> <pre><code>SharedPreferences myPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); </code></pre> <p>and </p> <pre><code>myPreferences.getBoolean("checkbox", true) </code></pre> <p>So, how can my main activity know when user change preferences state? For example if user don't wont to get notifications any more. Thanks.</p>
java android
[1, 4]
5,759,940
5,759,941
jquery imgareaselect and facebox
<p>I am trying to integrate imgareaselect (http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/) and facebox (http://defunkt.io/facebox/) however I am having no luck at all and hoping someone can help.</p> <p>imgareaselect calls a</p> <pre><code> header("location:"); </code></pre> <p>command after the image is uploaded but this actually reloads the entire page not just the facebox component. I am quite stuck with this as I have never used the imgareaselect plugin before.</p> <p>Any help is appreciated.</p>
php jquery
[2, 5]
4,776,870
4,776,871
Editing links inline with jquery - preventing them from being clicked while editing
<p>I am attempting to edit sections of a site inline with jQuery, everything is working fine so far, expect that some of the editable items are links. When attempting to edit the fields, it's clicking through on the href.</p> <p>here is the jQuery:</p> <pre><code>$(".button-edit").click(function(){ $(".edit").each(function() { $(this).html('&lt;input type="text" value="' + $(this).html() + '" /&gt;'); }); }); </code></pre> <p>and the html snippet:</p> <pre><code>&lt;li class="list-item" id="list-item-229"&gt;&lt;a href="http://test.com/" class="edit"&gt;My site&lt;/a&gt; &lt;p class="edit"&gt;lorum ipsum description&lt;/p&gt;&lt;/li&gt; </code></pre> <p>after the edit button is clicked:</p> <pre><code>&lt;li class="list-item" id="list-item-229"&gt;&lt;a href="http://test.com/" class="edit"&gt;&lt;input type="text" value="My Site"&gt;&lt;/a&gt; &lt;p class="edit"&gt;&lt;input type="text" value="lorum ipsum description"/&gt;&lt;/p&gt;&lt;/li&gt; </code></pre> <p>I've tried using something like:</p> <pre><code>$('.edit &gt; a').bind("click", function(){ return false; }); </code></pre> <p>however it prevents the input fields from being edited. Is there a way to prevent clicks on the href, but keep the input editable?</p>
javascript jquery
[3, 5]
3,355,859
3,355,860
getting the content from textbox in asp.net using c#
<p>hai i have created two dynamic textboxes. like this...</p> <p>protected void Button2_Click(object sender, EventArgs e) { TextBox1 = new TextBox(); TextBox1.ID = "TextBox1"; TextBox1.Style["Position"] = "Absolute"; TextBox1.Style["Top"] = "25px"; TextBox1.Style["Left"] = "100px";</p> <pre><code> Panel1.Controls.Add(TextBox1); TextBox2 = new TextBox(); TextBox2.ID = "TextBox2"; TextBox2.Style["Position"] = "Absolute"; TextBox2.Style["Top"] = "60px"; TextBox2.Style["Left"] = "100px"; Panel1.Controls.Add(TextBox2); //this.TextBox1.TextChanged += new System.EventHandler(this.TextBox_TextChanged); //this.TextBox2.TextChanged += new System.EventHandler(this.TextBox_TextChanged); } </code></pre> <p>now, i want to retrieve the content from the textboxes. please tell immediately how to do this .</p>
c# asp.net
[0, 9]
2,777,638
2,777,639
Android SDK-Get specific contacts from contact list
<p>I'm trying to query the contacts table to get all the contacts of a specific name, for example all the contacts with first name "George"</p> <p>At the moment I get all the contacts with this</p> <p>Cursor contactsCursor = managedQuery(contactData, null, null, null, null);</p> <p>Any help is appriciated :)</p>
java android
[1, 4]
463,680
463,681
Android and calling JavaScript. Partial execution :)
<p>There is a problem that may be you can help me with.</p> <p><strong>What I used to have:</strong></p> <p>1) A web page with &lt; div >, javascript array with content, 2 images representing forth and back buttons. When user presses on a button a simple function is executed: increment/decrement a counter, find div by id, assign a content from array. Very easy, always worked </p> <p>2) And app which just a webview to load the webpage from 1)</p> <p><strong>What I wanted to make</strong></p> <p>1) Add gesture recongnition to my app and on fling - directly call javasctipt functions from my webpage (functions used to be called from a button press)</p> <p>2) hide buttons on a webpage</p> <p><strong>What I got</strong></p> <p>1) Fling always worked</p> <p>2) Javascript always called</p> <p>3) the counter in the functions always increased/decresed</p> <p>4) BUT: the content of div not always updated. in 90% it works, but in 10% it seems like fling did not work. If you keep flinging - then div will be update but there will be a jump. Just with the correct number of "failed" flings performed.</p> <p>I was trying to add "debug facility": add callback from webpage to my app at the bottom fo the functions - it works. I am sure that the functions are being executed completely.</p> <p>But why the hell div is not always updated?!</p> <p>Known issue? </p>
javascript android
[3, 4]
5,587,965
5,587,966
Load a external URL into a div using jquery
<p>I want to load a whole site into a div... When i use </p> <pre><code>$(document).ready(function(){ $('#result').load('http://www.yahoo.com'); }); </code></pre> <p>its not working...plz help</p>
javascript jquery
[3, 5]
1,269,252
1,269,253
how to use try catch on <object> attribute?
<p>if i have declared <code>&lt;object&gt;</code> under my .aspx page named MyPage.aspx as shown below. for example, this class will receive two parameter for performing a division.</p> <pre><code>&lt;object classid="clsid:XXXXXX-XXXX-XXXX-XXXX-XXXXXX" name="MyControl1" id="Object1"&gt; &lt;PARAM name="param1" VALUE="&lt;%=value1 %&gt;" /&gt; &lt;PARAM name="param2" VALUE="&lt;%=value2 %&gt;" /&gt; &lt;/object&gt; </code></pre> <p>and the value1 and value2 come from public int value1 and public int value2. for example;</p> <pre><code>public class MyPage { public int value1 = 6; public int value2 = 2; } </code></pre> <p>i want to know that is there a way for me to check whether my external class in <code>&lt;object&gt;</code> is really being called or not? and can i use try catch to check about error that can be happened?</p> <p>Thank you</p> <p>vcha</p>
c# asp.net
[0, 9]
2,393,551
2,393,552
Pass PHP variable to Javascript code
<p>I obtained a value in PHP and wanna use it in javascript.</p> <p>Is there any way to do so ??</p> <p>Here is the code i am using which is not working</p> <pre><code>$var = "abc"; document.getElementById(&lt;?php echo $act;?&gt;).class="active"; </code></pre> <p>I am using <code>echo $var</code> inside the <code>getElementById</code> method..</p>
php javascript
[2, 3]
4,183,438
4,183,439
How to update database from other site periodically using php?
<p>Say my site lists items from other sites, for example, I listed ebay items, what I want to do is when the ebay items be sold out the corresponding item info on my site can be updated, how can we do this using php?</p> <p>Of course we can start a scheduled process on the hosting server, however we don't have privilege to do that for we only have spaces to host php and mysql.</p> <p>Any help is highly appreciated!</p>
php jquery
[2, 5]
449,291
449,292
ASP.Net Pagination
<p>I have a web based student admission application, i have different pages to take inputs from a student, like one page for personal detail another page for academia history and so on.</p> <p>it can be done by ASP.Net Pagination to navigate between different pages? what will be the steps for this approach</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,275,420
4,275,421
How I turn label in asp red
<p>Hi I would like to turn label red in .aspx when user enters wrong answer into textbox.</p> <p>but not know how, hw I can do this?</p>
c# asp.net
[0, 9]
527,417
527,418
Value cannot be null. Parameter name: type : ASPnet Error after deploy
<p>Working local when deployed fails.</p> <p>Error :</p> <blockquote> <p>MESSAGE: Value cannot be null. Parameter name: type</p> <p>SOURCE: mscorlib</p> <p>TARGET SITE: CreateInstance</p> <p>STACK TRACE: System.Activator.CreateInstance(Type type, Boolean nonPublic) System.Activator.CreateInstance(Type type) ClientPortal.WebPages.Details.imgToDOC_Click(Object sender, ImageClickEventArgs e) System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</p> </blockquote>
c# asp.net
[0, 9]
5,588,375
5,588,376
Change Text on click
<p>Ok so if I was doing a form, I could use:</p> <pre><code>&lt;form method="get" action=""&gt; &lt;label for="textinput"&gt;Text:&lt;/label&gt; &lt;input type="text" value="" name="textinput" id="textinput" /&gt; &lt;input type="submit" id="submitbutton" value="Search" onclick="return changeText('submitbutton');" /&gt; &lt;/form&gt; </code></pre> <p>Then add this js:</p> <pre><code>function changeText(submitId){ var submit = document.getElementById(submitId); submit.value = 'Working...'; return false; }; </code></pre> <p>BUT my issue is my link is this:</p> <pre><code>&lt;a id="sharelink" href=""&gt;Post to Here&lt;/a&gt; </code></pre> <p>So wondering if ONCLICK of link ID > sharelink</p> <p>I could show > working...</p> <p>Any suggestions ?</p>
javascript jquery
[3, 5]
3,494,016
3,494,017
How to tell connection timeout and socket timeout from exception trace stack?
<p>I used apache http client lib in my program. I set both connection timeout and socket timeout for network calls. My understanding is that, if there is connection timeout, the client didn't reach the backend server; if there is socket timeout, the client reached the backend server but the server was not responding or very slow.</p> <p>I log the following exception trace stack. How can I tell which timeout (connection or socket) caused the exception? Thanks!</p> <pre><code>java.net.SocketException: The operation timed out at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(NativeMethod) at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocket(OSNetworkSystem.java:130) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:247) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:534) at java.net.Socket.connect(Socket.java:1056) at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) </code></pre>
java android
[1, 4]
2,991,911
2,991,912
How can I insert javascript in php?
<p>I'm trying to insert javascript into a div. All of this is within a php document.</p> <p>I am trying to get a div to fade into view when it's child div is loaded. Parent div had id of 'subemail' (this is hidden) Child div with id 'error' is shown then it should fade in the above div.</p> <p>Following is the script I'm trying to load but get error unexpected T_STRING, expecting ',' or ';'.</p> <pre><code>&lt;script type="text/javascript"&gt; $(function(){$('div#subemail').fadeIn('slow');}); &lt;/script&gt; </code></pre> <p>The PHP document:</p> <p> <pre><code> if (empty($_POST['sub_name'])) { $errors[] = 'Please type in your name'; } else { $sub_name = strip_tags($_POST['sub_name']); } if (filter_input(INPUT_POST, 'sub_email', FILTER_VALIDATE_EMAIL)) { $sub_email = $_POST['sub_email']; } else { $errors[] = 'Please type in a valid email'; } if ($errors) { echo '&lt;div class="errors"&gt;'; echo '&lt;script type="text/javascript"&gt;'; echo '$(function(){$('div#subemail').fadeIn('slow');});'; echo '&lt;/script&gt;'; foreach ($errors as $error) { echo '&lt;p class="error"&gt;- ' . $error . '&lt;/p&gt;'; } echo '&lt;/div&gt;'; } </code></pre>
php javascript
[2, 3]
562,873
562,874
How to automatically execute a Javascript function whenever width or height of a div changes?
<p>How to automatically execute a Javascript function whenever width or height of a div changes? I don't want to trigger an event manually. I am using jQuery.</p>
javascript jquery
[3, 5]
535,096
535,097
How to get address from latiude and longitude?
<p>I'm getting the latitude and longitude on touch event in map in android.</p> <p>I want to getting address on particular touch in map.</p> <p>How do I do this?</p>
java android
[1, 4]
2,615,695
2,615,696
reslove timer logic
<p>i did fastforward in music player by getting current time of the player (30 sec forward)</p> <pre><code>if(sec&gt;=maxsec &amp;&amp; min&gt;=maxmin &amp;&amp; hour&gt;=maxhour) { next_buttonclick(null); } else { sec=sec+30; if(sec&gt;=60) { sec=sec%60; min=min+1; if(min&gt;=60) { min=min%60; hour=hour+1; } } </code></pre> <p>max is the time duration of media..</p> <p>when i run this, it not working properly.. plz fix bug free..</p> <p>also reverse</p> <pre><code>if(sec&lt;=0 &amp;&amp; min&lt;=0 &amp;&amp; hour&lt;=0) { back_buttonclick(null); } else { gettimeduration(); sec=sec-30; if(sec&lt;0) { sec=60+sec; min=min-1; if(min&lt;0) { min=60+sec; hour=hour-1; } } </code></pre> <p>thanks in advance..</p>
java android
[1, 4]
5,893,162
5,893,163
how to write javascript in asp.net in code behind using C#
<p>Greetings, how can I write JavaScript code in asp.net in code behind using C#. For example, I have click button event when I click the button I want to invoke this java script code:</p> <pre><code>alert("You pressed Me!"); </code></pre> <p>I want to know how to use java script from code behind.</p> <p>Thank you;</p>
c# asp.net javascript
[0, 9, 3]
3,696,688
3,696,689
Killing session value in Browser Close
<p>I am working in C#.Net. I want to kill the session values when the browser is closed. (i.e) In my application, i want to display online visitors count. If the user clicks logout button means, it works fine. rather than if he close the browser, the session value not cleared.</p> <p>if the browser close is done, the session value should be killed.... </p> <p>My Global.ascx code...</p> <pre><code>void Application_Start(object sender, EventArgs e) { // Code that runs on application startup Application["OnlineUsers"] = 0; } void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown } void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs } void Session_Start(object sender, EventArgs e) { Application.Lock(); Application["OnlineUsers"] = (int)Application["OnlineUsers"] + 1; Application.UnLock(); } void Session_End(object sender, EventArgs e) { Application.Lock(); Application["OnlineUsers"] = (int)Application["OnlineUsers"] - 1; Application.UnLock(); } </code></pre> <p>My Home.aspx code...</p> <pre><code> Visitors online: &lt;%= Application["OnlineUsers"].ToString() %&gt; </code></pre> <p>If i run my application in IE, the online count will be 1. If i runs in Firefox, the online count should be incresed to 2. If i close the Firefox browser, the count in IE should be changed to 1.</p> <p>This is my Requirement....</p>
c# javascript
[0, 3]
2,828,838
2,828,839
Accessing javascript array from function
<p>Okay, so in my <code>&lt;head&gt;</code> section i have the following:</p> <pre><code>&lt;script&gt; var userDefaultInfo = '&lt;?=$userInfo;?&gt;'; var jGets = new Array (); &lt;? if(isset($_GET)) { foreach($_GET as $key =&gt; $val) echo "jGets[\"$key\"]=\"$val\";\n"; } ?&gt; &lt;/script&gt; </code></pre> <p>Now In my external .JS file, In the $(document).ready() section I can access userDefaultInfo fine, however, I am trying to access jGets, but not directly from there.</p> <p>in the external .JS file, outside of $(document).ready(); I have the following function:</p> <pre><code>var sendGET = function () { var data = $(this).val(); var elementName = $(this).attr("name"); var url = "zephi.php?p=home/support/admin_support.php&amp;"+elementName+"="+data; jQuery.each(jGets, function(i, val) { alert(val); }); alert(url); window.location = url; } </code></pre> <p>When a user changes a box, this function fires and changes the window location using the data. However, I want to add the data in the variable <code>jGets</code>, but I do not seem to be able to reference it at all in there.</p> <p>Why is this?</p>
php jquery
[2, 5]
2,095,875
2,095,876
I want to disabled onClick event for image inside div onClick function?
<p>I want to disable click event for image using image <code>id</code> eg. for <code>id12</code> i want to disabled click event . i tried using unbind but it seems it only works if event is binded using j query?</p>
javascript jquery
[3, 5]
5,472,109
5,472,110
Pause/Suspend Process object
<p>I have a line like this:</p> <pre><code>Process process = Runtime.getRuntime().exec(cmd); </code></pre> <p>And at some point I want to pause the process. For 3 seconds. Thread.wait() or Object lock; lock.wait() does not help since, the process is going in the background, not pausing. </p> <p>I know it's not safe and dumb do to this, I just need to pause the execution of longer-output command.</p>
java android
[1, 4]
5,246,848
5,246,849
how to test whether grid is empty or not in jquery
<p>i have a grid and adding elements to is in jquery like below:</p> <pre><code>$('#MyGrid tbody').append('&lt;tr&gt;&lt;td&gt;&lt;a href="#" &gt;' + htmlString.ID+ '&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;'); </code></pre> <p>before that i need to test whether this MYgrid is empty or not. how to do that with jquery.</p> <p>thanks,</p> <p>michaeld</p>
javascript jquery
[3, 5]
2,264,739
2,264,740
C++ version of java this. in classes
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6905598/c-equivalent-to-java-this">C++ equivalent to Java this</a> </p> </blockquote> <p>What is the c++ version of java's this. :</p> <pre><code>class javaObj{ private String name; public void setName(String name) { this.name = name; } } </code></pre> <p>Only thing i have found that works in c++ is:</p> <pre><code>class cppObj { private: string name; public: void setName(string name); }; void cppObj::setName(string name) { cppObj::name = name; } </code></pre> <p>must I use cppObj:: or is there a this. equivalent for c++?</p>
java c++
[1, 6]
5,675,353
5,675,354
Hide the same values after a click
<p>i want values that there is in class <code>.hello</code> and they are similar to some of values in class <code>hi</code> (like: <code>hi_2</code> &amp; <code>hi_4</code>), after click on button will are hide they in class <code>.hello</code>. how is it?<p> <strong>EXAMPLE:</strong> <a href="http://jsfiddle.net/yyTH8/3/" rel="nofollow">http://jsfiddle.net/yyTH8/3/</a></p> <pre><code>$('.click').live('click', function () { var val_sp = $(".hi b").map(function () { return $(this).text(); }).toArray(); //if (.hello == val_sp) { $('.hello').text(val_sp).hide() //}; }); </code></pre> <p>html:</p> <pre><code>&lt;button class="click"&gt;Click&lt;/button&gt;&lt;p&gt; &lt;span class="hi"&gt; &lt;b&gt;hi_1&lt;/b&gt; &lt;b&gt;hi_2&lt;/b&gt; &lt;b&gt;hi_3&lt;/b&gt; &lt;b&gt;hi_4&lt;/b&gt; &lt;/span&gt; &lt;span class="hello"&gt; &lt;b&gt;hello_1&lt;/b&gt; &lt;b&gt;hi_2&lt;/b&gt; &lt;b&gt;hello_3&lt;/b&gt; &lt;b&gt;hi_4&lt;/b&gt; &lt;/span&gt; </code></pre>
javascript jquery
[3, 5]
214,440
214,441
How to get whole number when dividing 2 numbers in JavaScript
<p>I am implementing paging in JavaScript,</p> <p>Now if I have <code>total_item_count = 69</code> and I want 10 records per page then it should show 7 pages but it is showing 6 pages. </p> <p>What I am doing: </p> <pre><code>var totalpages = 69/10 ; // it should give 7 but its giving 6 </code></pre> <p>Thanks in advance. </p>
javascript jquery
[3, 5]
1,754,723
1,754,724
JQuery, add two handlers for the same event
<p>I have several text inputs in my page. They have different classes added to them. Depending on the class they each have, I add an onchange event handler. Everything worked OK, until they all shared one common class, then I add common onchange handler again. The first oen gets overwritten. </p> <p>Is there a way to add another handler and not overwrite the precious one?</p>
javascript jquery
[3, 5]
5,635,502
5,635,503
jQuery hide() works, but show() does not
<p>I'm having trouble getting this script to work.</p> <pre><code> &lt;asp:DropDownList CssClass="workUnit" Width=80 ID="dropdownWorkUnit" runat="server" Visible="false" _clientId="comboboxWorkUnit" /&gt; </code></pre> <p>For some reason, the combobox will not become visible when I run this JavaScript.</p> <pre><code>onPhaseChange: function(dropdown, row) { var combobox = $(dropdown); comboboxWorkUnit = row.find("select.workUnit"); comboboxWorkUnit.show(); }, </code></pre> <p>But when I do this, it works:</p> <pre><code>onPhaseChange: function(dropdown, row) { var combobox = $(dropdown); comboboxWorkUnit = row.find("select.workUnit"); comboboxWorkUnit.hide(); }, </code></pre>
jquery asp.net
[5, 9]
1,852,754
1,852,755
How to rotate an image clockwise or counterclockwise, whichever is shorter?
<p>I'm making a web page that includes a clock with an arrow in the center. When the user clicks on an hour, the arrow rotates to point to what he/she has clicked.</p> <p>I'm using a jQuery image rotate plugin (jQueryRotate) to rotate the arrow.</p> <p>Here is the current code to compute the number of degrees to rotate:</p> <pre><code>var numTiles = $("ul li").size(); // Number of tiles is however many are listed in the UL, which is 12 var sel = 0; // Default hour selection var rot = 0; // Default rotation is at the top (0 degrees) var gap = 360 / numTiles; // Degrees between each tile function rotateArrow(num) { rot = num * gap; $("#arrow").rotateAnimation(rot); sel = num; } </code></pre> <p>When the user clicks one of the hours, it passes num as a value of 1 through 12.</p> <p>It works fine, but the problem is that if the arrow is pointing to 1 o'clock, and the user clicks 11 o'clock, the arrow rotates clockwise 300 degrees, when it would make more sense to rotate 60 degrees counterclockwise.</p> <p>So, how can I write an equation to take the current hour (num) and the hour clicked (sel), and output a value as a positive or negative number, which equals the number of degrees to rotate that is most efficient, rather than just rotate only in one direction?</p> <p>Any advice is appreciated. Let me know if you have any questions. Thanks!</p>
javascript jquery
[3, 5]
4,010,030
4,010,031
Make checkboxes select-able one at a time like radio-buttons
<p>I am looking for some help making checkboxes behave like radio-buttons in that one in a group can only be selected at a time with jQuery.</p> <p>First, why not use radio-buttons ? Because I want these forms of input to also be un-select-able / un-check-able so that the potential exists that none of them can be checked.</p> <p>So I have 9 input type checkbox that are grouped in 3 groups of 3, not in forms, just grouped by the fact that those 3 have the same value to the name attribute.</p> <p>All 9 checkboxes have the class of .secondary-input but only 3 have the name of one, then the next 3 a name of two, and the last three a name of three.</p> <p>What I am trying to accomplish is that only one of the group is checked at a time and that one can be unchecked so that none in the group are checked.</p> <p>I would greatly appreciate all and any help in achieving this.</p> <p>I found a JSFiddle like this, but the jQuery didn't work with my system of groups by the name attribute.</p>
javascript jquery
[3, 5]
4,212,326
4,212,327
notifydatasetchanged from within listener not working
<p>I am trying to update my Activity's ListView from within the onLocationChanged function of a Location Listener using notifyDatasetChanged() but it doesnt work. I can however use setListAdapter from the same point in my code and this will work.</p> <p>Here is my code:</p> <pre><code>public class TestListeners extends ListActivity { ArrayAdapter adapter; private final LocationListener networkLocationListener = new LocationListener() { @Override public void onStatusChanged(String provider, int status, Bundle extras) { switch (status) { case LocationProvider.AVAILABLE: break; case LocationProvider.OUT_OF_SERVICE: break; case LocationProvider.TEMPORARILY_UNAVAILABLE: break; } } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void onLocationChanged(Location location) { checkProximity(location.getLatitude(), location.getLongitude(), cx); } }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //get a list here venueNamesArray //etc adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, android.R.id.text1, venueNamesArray); setListAdapter(adapter); } private void checkProximity(double curLat, double curLon, Context cx) { //get a different list here venueNamesArray //etc adapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, android.R.id.text1, venueNamesArray); adapter.notifyDataSetChanged();//this doesnt work and no error is thrown setListAdapter(adapter);//this works } } </code></pre> <p>The reason I want to use notifyDatasetChanged() instead of setListAdapter is because the listview scrolls back to the top upon setting it. No error is throw when I use notifyDatasetChanged() so it is hard for me to see why this isnt working. </p> <p>I have tried using a normal ListView for this instead of extending ListActivity and ran into the same problem.</p>
java android
[1, 4]
2,455,746
2,455,747
Add JavaScript reference from code behind (C#)
<p>Is it possible to add javascript reference dynamically from code behind aspx.cs?</p> <p>Like this:</p> <pre><code>private void AddScriptReference(string path) { //Add reference to &lt;head&gt;&lt;/head&gt; } </code></pre> <p>Should result in a script reference being added to the head of the page, like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="path-to-script.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;/html&gt; </code></pre> <p>Is this possible?</p>
c# javascript asp.net
[0, 3, 9]
2,574,988
2,574,989
How to select for something that begins with a string but doesn't end with a different string in jQuery?
<p>I am new to jQuery, exploring its syntax a bit. </p> <p>My page has elements like this:</p> <pre><code>&lt;area id="SA" ... /&gt; &lt;area id="AF" ... /&gt; &lt;area id="EU" ... /&gt; &lt;area id="NA" ... /&gt; </code></pre> <p>I am trying to show and hide <code>div</code> sections based on click events off the <code>area</code> tags, which have matching ending ID's, coded like this:</p> <pre><code>&lt;div id="div_SA" ... /&gt; &lt;div id="div_AF" ... /&gt; &lt;div id="div_EU" ... /&gt; &lt;div id="div_NA" ... /&gt; </code></pre> <p>So, to show the exact match, but hide all the <code>div</code> sections which have id's that start with "div_" but don't otherwise match, without hiding every other <code>div</code> on the page, I tried this:</p> <pre><code> var q = 'div[id="div_' + event.target.id + '"]'; var r = 'div[id^="div_"],div:not[id$=' + event.target.id + '"]'; $(q).show(); $(r).hide(); </code></pre> <p><code>$(r).hide();</code> is not working. What am I doing wrong? (I know I could assign CSS classes and get at them with class names, but I'm still curious about how to construct a query that will work this way.)</p>
javascript jquery
[3, 5]
1,080,365
1,080,366
Is it possible to add an OR to a selector in jQuery?
<p>I current have a jQuery delegate that does something to all of the <code>input</code> selectors that are not <code>submit input</code> selectors. How do you add an <strong>OR</strong> so that it also handles another type like <code>select</code>? </p> <p>Current function:</p> <pre><code>$('#test_form').delegate("input:not([id*='_submit'])", 'blur', function(event) { // Does something }); </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
257,855
257,856
page loading message appears when going back to the previous page
<p>The following works fine, except when I click the back button on the browser (to go back to my previous start page), the loading... message appear again. What should I do to get rid of it?<br> Many thanks in advance.</p> <pre><code>$("#form").submit(function(){ $("#loading").show(); }); &lt;div id="loading"&gt;loading...&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,070,488
5,070,489
Check USB tethering status on android 2.2
<p>I am familiar with the usage of java reflections to find out the current status of wifi tethering on android 2.2, however does anybody know of a similar or any other solution to check for USB tethering status (on/off) on android 2.2?</p>
java android
[1, 4]
2,981,246
2,981,247
Getting inner HTML of a specific div in a different page
<p>I want to have a web page where I'll put lots of divs and inside each of those divs there will be be different content. Based upon a condition I want to display the content of a specific div inside a JQuery dialog. Is it possible to get the html content of a particular div in a web page? </p>
jquery asp.net
[5, 9]
1,516,428
1,516,429
Javascript command/variable based on Webpage Domain/Site
<p>I'm using the following code for fetching a latest tweet but I would like the TWITTERUSERNAME to be different depending on the domain it is on as it's a template that is being called from one place but used across multiple domains.</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery('document').ready(function() { jQuery.getJSON('http://twitter.com/statuses/user_timeline/TWITTERUSERNAME.json?callback=?', function(data) { jQuery('#tweet').html(data[0].text); }); }); &lt;/script&gt; </code></pre> <p>I'm guessing just some kind of if statement in php to replace the TWITTERUSERNAME value in the script?</p> <p>Any pointers on this would be great</p>
php javascript jquery
[2, 3, 5]
3,663,942
3,663,943
How to make double click & single click event for link button of Asp.net control?
<p>Consider the following:</p> <pre><code>protected void dgTask_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton btn = (LinkButton)e.Row.Cells[4].FindControl("lnkBtnEdit"); btn.Attributes.Add("onclick", "return Test();"); } } </code></pre> <p>Instead of a single click, how can I make it double click while clicking on the link button?</p> <p><strong>Edited</strong></p> <p>I have tried with the solution presented by *competent_tech* but the problem is that in that case it will intercept the single click.</p> <p>I need to do some operation on single click and something else on double click. Please help me.</p> <p>Thanks</p>
c# javascript asp.net
[0, 3, 9]
4,995,757
4,995,758
How to display Arabic characters using unicodes in android?
<p>I am new to android.i am prepared one app, it support multiple languages.I want to display <code>Arabic</code> characters.i found one site for Unicode's,</p> <pre><code>http://www.unics.uni-hannover.de/nhtcapri/arabic-alphabet.html </code></pre> <p>I used following code for display Arabic letters,</p> <pre><code>StringBuilder sb = new StringBuilder(); sb.append("\u0649"); tv.setText(sb.toString()); </code></pre> <p>It is working fine,but showing square box.Please help me.</p>
java android
[1, 4]
5,046,537
5,046,538
cycle three divs on page refresh
<p>I have three divs and I want to show a different div on each page refresh. So first div1 than div2 and than div3 and back to div1 etc.</p> <p>I have googled but all I can find is the exact opposite, which is refresh div after a period of time(eg 10 sec.) WITHOUT page refresh.</p> <p>(I use Jquery by the way,but plain javascript is also good)</p>
javascript jquery
[3, 5]
4,363,538
4,363,539
Launching JAR with Process.Start: javaw.exe runs but "nothing happens"?
<p>Given the code. when the button is clicked nothing happens , i get no debug message etc in visual studio. However if i were to double click the .jar file in its folder i am able to run it. Anyone have any idea why? Looking at Task manager when the button is clicked. javaw.exe is created but nothing happens.</p> <pre><code>private void btnKinderPuzzle_Click(object sender, RoutedEventArgs e) { // Check if this program is opened if (IsProcessOpen("MTPuzzle")) { MessageBox.Show("KinderPuzzle is already running", "Kinder Package", MessageBoxButton.OK, MessageBoxImage.Information); } else { Process.Start(Directory.GetCurrentDirectory() + "\\Puzzle\\PuzzleGame\\MTPuzzle.jar"); } } </code></pre>
c# java
[0, 1]
6,018,359
6,018,360
What is the difference between jQuery live() and liveQuery plugin?
<p>The question says it all. Which one is better and when to use what, I never use jQuery live() as I am using liveQuery plugin for a couple of years, I am used to it and still continue using it. But I want to know the subtle differences between the two and when to use each of it?</p>
javascript jquery
[3, 5]
2,412,723
2,412,724
Translate KeyDown keycode to string (jQuery)
<p>I am looking for a way to translate a keypress into the string corresponding to the chracter. Something like this:</p> <pre><code>$(document).keydown(function(event) { console.log(String.fromCharCode(event.which)); }); </code></pre> <p>except that this code does not take into account capitalization and does not work for special character, e.g. ",". This:</p> <pre><code>$(document).keypress(function(event) { console.log(String.fromCharCode(event.which)); }); </code></pre> <p>seems to the trick, but it can not prevent default browser actions (such as go back on backspace) and there seem to be browser compatibly issues.</p> <p>Is there any better way, that works across browsers and keyboard layouts ?</p>
javascript jquery
[3, 5]
5,013,167
5,013,168
Android adb unable connect with ip address
<p>I have installed android operating system in Oracle Virtual box successfully. </p> <p>but I am facing one problem ,</p> <p>I tried many options, but I couldn't solve this problem .</p> <p>My problem is - <strong>I am not able to adb connect to virtual box android os.</strong></p> <p><img src="http://i.stack.imgur.com/uXGcy.png" alt="enter image description here"></p> <p>When i am selecting <strong>host-only Adapter</strong> option ,easy to connect with adb but <strong>no internet</strong> connection in android virtual box os.</p> <p><img src="http://i.stack.imgur.com/ToLCH.png" alt="enter image description here"> When i am selecting <strong>NAT</strong> ,Internet connection fine but not connect with adb . <img src="http://i.stack.imgur.com/oeclm.png" alt="enter image description here"></p> <p>Please help me how to solve my problem ..</p>
java android
[1, 4]
3,186,020
3,186,021
How to display string with maximum of 200 characters & trim the last few charaters till whitespace
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1613896/truncate-string-on-whole-words-in-net-c-sharp">Truncate string on whole words in .Net C#</a> </p> </blockquote> <p>I have to display brief description of the news let us say maximum of 200 characters &amp; trim the last few characters till white-space, I am not sure how i can trip this kind on string </p> <p>Sample text </p> <p><code>sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news.</code></p> <p><strong>OUTPUT with code below</strong></p> <p><code>sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample n</code></p> <pre><code> if (sDesc.Length &gt; 200) { sDesc = sDesc.Substring(0, 200); // sDesc = sDesc + "..."; } </code></pre> <p>how can i trim last few characters so that it doesn't show part of word. I hope you have understood what i am trying to say.</p> <p><strong>Desired OUTPUT</strong></p> <p>sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample news description of news sample</p>
c# asp.net
[0, 9]
2,026,746
2,026,747
Unable to set GridView row widths on RowDataBound
<p>My current code to attempt to set widths for the rows on a gridview is:</p> <pre><code>protected void RowDataBound(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { foreach (DataControlFieldHeaderCell dcfhc in e.Row.Cells) { dcfhc.Width = 100; } } else { foreach (DataControlFieldCell dcfc in e.Row.Cells) { dcfc.Width = 100; } } } </code></pre> <p>But that just keep all of the widths default! What am I doing wrong?</p> <p>EDIT: I have already tried thise code as well!</p> <pre><code>PoolToDBHeaders.DataSource = new DataView(headerTable); PoolToDBHeaders.DataBind(); foreach (DataControlField dcf in PoolToDBHeaders.Columns) { dcf.ItemStyle.Width = 100; } PoolToDBHeaders.DataBind(); </code></pre>
c# asp.net
[0, 9]
2,592,996
2,592,997
How to bind a List<DateTime> to a GridView
<p>I already read Stack&nbsp;Overflow question <em><a href="http://stackoverflow.com/questions/515464/how-to-bind-a-listint-to-a-gridview">How to bind a List to a gridview?</a></em>.</p> <p>But I need to bind a List&lt;DateTime> to a gridview, but MAINLY I also want be able to access the DateTime value from within a ItemTemplate. How do I do that? When I was working with a DataTable, I used to do it like that:</p> <pre><code>&lt;%# Eval("SDIndex") %&gt; </code></pre> <p>How would I do it linking it directly to the List&lt;DateTime>?</p>
c# asp.net
[0, 9]
5,640,175
5,640,176
Setting up the default value in a new textbox
<p>I am trying to make a form in which there will be a button, when clicking on it a Javascript function will be called and a new row with a textbox will be added. In simple words, when clicking on the button, new text will be added. Here is the function:</p> <pre><code>function addRowToTable() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow; var row = tbl.insertRow(lastRow); // left cell var cellLeft = row.insertCell(0); var textNode = document.createTextNode(iteration); cellLeft.appendChild(textNode); // right cell var cellRight = row.insertCell(1); var el = document.createElement('input'); el.type = 'text'; el.name = 'txtRow' + iteration; el.id = 'txtRow' + iteration; el.size = 40; cellRight.appendChild(el); // select cell var cellRightSel = row.insertCell(2); var sel = document.createElement('select'); sel.name = 'selRow' + iteration; sel.options[0] = new Option('text zero', 'value0'); sel.options[1] = new Option('text one', 'value1'); cellRightSel.appendChild(sel); } </code></pre> <p>Now please guide me: how can I set the default value of the text box and drop down box? I mean in this code where should I put <code>&lt;?php echo $data['pno'];?&gt;</code></p> <p>I have tried putting in the HTML form; for the first row it works but for the second row it doesn't work. Thanks.</p>
php javascript
[2, 3]
4,710,573
4,710,574
How do I change an element (e.g. h1 -> h2) using jQuery / plain old javascript?
<p>Of course, there are a whole range of possible errors relating to document validity, but my immediate stumbling block occurs when changing a paragraph (<code>p</code>) into an <code>address</code> element. My current method is (more-or-less):</p> <pre><code>var p = $('p#test'); p.replaceWith('&lt;address&gt;' + p.html() + '&lt;/address&gt;'); </code></pre> <p>but that fails for this specific case; it works perfectly for p -> blockquote or h2 -> h3. Firebug suggests that a self-closing element (<code>&lt;address/&gt;</code>) has been added to the document, for some reason.</p> <p>Can anyone spot the bug or suggest an alternative method?</p>
javascript jquery
[3, 5]
113,164
113,165
remove from double linked list
<p>I am to java and I am trying to implement a remove from double linked list method but I am struggling and not sure how to advance. The method removes data stored at the given node in the list. I have read that I need to account for cases where the the element being removed is the start or end but I am not sure how to go about. In general I am not sure if this is the right way to do it. My code/progress is posted below. If any could help, it would be appreciated. Thanks</p> <p>P.S. I have a start and an end reference within the class and a size reference </p> <pre><code> public type removeAtTheIndex(int index) { type theData = null; Node &lt;type&gt; current= start; Node temp= new Node(); if (index &gt;= 0 &amp;&amp; index &lt; size &amp;&amp; start !=null) { for (int i=0; i &lt; index &amp;&amp; current.getNext()!= null; i++) { current=current.getNext(); } if (current != null) { if (current == start) { } else if (current == end) { } else { theData= current.getData(); temp= current.getPrev(); temp.setNext(current.getNext()); current.getNext().setPrev(temp); current.setData(null); size--; } } return theData; } </code></pre>
java android
[1, 4]
4,090,799
4,090,800
Android based application development in c#
<p>I want to develop android based application in c#.Can anyone tell me where can i find the sample code and other useful material.</p>
c# android
[0, 4]
771,460
771,461
jQuery jCorner Plugin is not working - What am I missing
<p>Hiya, I am attempting to use the jCorner plugin for jQuery, but falling down at the majority of the hurdles. See <a href="http://www.malsup.com/jquery/corner/" rel="nofollow">http://www.malsup.com/jquery/corner/</a> for the plugin, but I do not understand the concepts behind jQuery.</p> <p>The code is at <a href="http://ghostworksinc.com/new" rel="nofollow">http://ghostworksinc.com/new</a>, then hit view source to see the hash I've made.</p> <p>The code is compiled with a sinatra app running at Heroku.</p> <p>The div I want to corner-ify has an id of cornered and a class of cornerdiv, and given that I know no javascript whatsoever I'm stabbing in the dark.</p> <p>Does anybody have any working code for using jCorner?</p> <p>Thanks, Luke</p> $(function(){ $('div.cornerdiv').each(function() { $(this).corner(); }); });
javascript jquery
[3, 5]
4,458,504
4,458,505
javascript: $(window).height is not a function
<p>I have some javascript that I am using to resize my background image to fit my window. There are some confusing things going on that I just don't get.</p> <ol> <li><p>Firebug and I assume my page doesn't recognize my <code>resizeFrame</code> function unless I place it below the body block. Why?</p></li> <li><p>Why am I getting the error: <code>$(window).height is not a function</code>?</p></li> </ol> <p>Any suggestions or insights would be helpful.</p> <pre><code>&lt;!-- This this placed in &lt;head&gt; block --&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; &lt;!-- This placed below body block --&gt; jQuery.event.add(window, "load", resizeFrame); jQuery.event.add(window, "resize", resizeFrame); function resizeFrame() { var h = $(window).height(); var w = $(window).width(); $('body').css('background-size', w + 'px ' + h + 'px' ); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,651,502
4,651,503
Avoid jQuery (pre)loading images
<p>I have a string of HTML that I use as jQuery input document.</p> <pre><code>// the variable html contains the HTML code jQuery( html ).find( 'p' ).each( function( index, element ) { // do stuff }); </code></pre> <p>Though, I keep getting errors that the images doesn't exist (in my variable <code>html</code>). The images in the HTML have relative URL's which doesn't correspond to images on my host, so naturally, they can't be found so I get 404 errors in my console.</p> <p><strong>Is there a jQuery-way to avoid jQuery loading the images?</strong> If not, I'll have to find all images and replace the src using non-jQuery which is a bit sad because that's exactly where jQuery comes in handy :p</p> <hr> <p>Edit:</p> <p>I'll explain step by step.</p> <p>I have a variable, <code>html</code>, that contains some HTML code from another site. I put that variable in the jQuery constructor, because I want to perform actions on that HTML.</p> <p><code>jQuery( html );</code></p> <p>At this point I get 404 errors because the images in the HTML source are relative; they don't correspond to the images I have on my host.</p> <ul> <li>I can't use jQuery to remove the src tag, because I still get errors</li> <li>Writing a bit of javascript to modify the src value is plain silly; this is why I use jQuery</li> </ul> <p>So, again, <strong>all I'm asking is if there's a setting or whatever that avoids jQuery from loading the images in the supplied source.</strong></p> <p>Thank you.</p>
javascript jquery
[3, 5]
1,033,320
1,033,321
Assigning and using jquery with variables
<p>I have two peices of code. One produces the desired result the other one doesnt.</p> <p>Works: </p> <pre><code>$("#inBox" + mesh.id).html(mesh.text); </code></pre> <p>Doesn't work:</p> <pre><code>var inbox = $("#inBox" + mesh.id); inbox.html(mesh.text); </code></pre> <p>Could someone please explain to me why one produces the desired result and the other one doesn't do anything?</p> <p>edit: removed typo quote mark.</p> <p>edit2: heres the fiddle. <a href="http://jsfiddle.net/ntkachov/zXGjb/" rel="nofollow">http://jsfiddle.net/ntkachov/zXGjb/</a></p> <p>edit3: Hmmm.... It works inside the fiddle but not inside my code. Ill take a look at what else might be affecting this.</p>
javascript jquery
[3, 5]
3,129,330
3,129,331
Not set css attributes to child elements. Jquery
<p>I have <code>div</code> with a <code>table</code> inside. Inside the <code>td</code> elements of the table, I have text and some links that have 'actionLink' class assign.</p> <p>Using JQuery, I change some attribute values to the <code>td</code> and <code>p</code> elements inside the parent <code>div</code>. All works fine, but that the attribute values for a links also change.</p> <p>Is there a way to change this attributes without affecting the <code>a</code> elements.</p> <p>This is what I have</p> <p>JavaScript</p> <pre><code> $('.sectionContent').css("color", $('#ParagraphForegroundColor').val()); $('.sectionContent').css("background-color", $('#ParagraphBackgroundColor').val()); $('.sectionContent p, .sectionContent td').not(".addColumn").css("font-family", $('#ParagraphFontFamily').val()); $('.sectionContent p, .sectionContent td').not(".addColumn").css("font-size", $('#ParagraphFontSize').val()); $('.sectionContent p, .sectionContent td').not(".addColumn").css("font-style", $('#ParagraphFontStyle').val()); $('.sectionContent p, .sectionContent td').not(".addColumn").css("font-weight", $('#ParagraphFontWeight').val()); $('.sectionContent p, .sectionContent td').not(".addColumn").css("text-decoration", $('#ParagraphTextDecoration').val()); </code></pre>
javascript jquery
[3, 5]
1,097,685
1,097,686
Trying to bind on change even to file select input doesnt seem to work
<p>I am trying to bind on change to file input i read around and the following suppose to work but doesn't:</p> <pre><code> &lt;input type="file" name="uploadfile" id="Uploadthisfile" /&gt; </code></pre> <p>This is my file input</p> <pre><code>$("#Uploadthisfile").change(function() { alert('some message'); }); </code></pre> <p>This is how i am trying to bind it.</p> <p>Am i doing something wrong ?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,803,470
4,803,471
C# java script code for checkexistring file in a folder code using uploadify
<p>I am able to upload file(s) from system to server using uploadify control(www.uploadify.com). Everything is working fine but thing is that I am not getting how to check the file existing or not in the server. I need help from you that how to check existing file(s) using java script or C# before uploading file(s) to server. I have code for checkexisting in php but I want in C# or java script so kindly please kindly do needful. </p> <p>Thanks PBN</p>
c# javascript asp.net
[0, 3, 9]
2,150,096
2,150,097
jquery: i have to use parseInt() even when deal with numbers, why?
<p>i have the following script</p> <pre><code>&lt;select id="select1"&gt; &lt;option value="1"&gt;1day&lt;/option&gt; &lt;option value="2"&gt;2day&lt;/option&gt; &lt;option value="3"&gt;3day&lt;/option&gt; &lt;/select&gt; &lt;select id="select2"&gt; &lt;option value="1"&gt;1day&lt;/option&gt; &lt;option value="2"&gt;2day&lt;/option&gt; &lt;option value="3"&gt;3day&lt;/option&gt; &lt;/select&gt; </code></pre> <p>and jquery</p> <pre><code>$("#select2").change(function() { var max_value = parseInt($("#select2 :selected").val()); var min_value = parseInt($("#select1 :selected").val()); if(max_value &lt; min_value) { $("#select1").val($(this).val()); } }); </code></pre> <p>and now, what i can't understand anyway - if values of option elements are integer numbers, why i have to use parseInt()? in some cases it doesn't work without parseInt().</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,963,761
2,963,762
Android:how to iterate an ArrayList<String> in different thread
<p>I need to iterate an ArrayList of String in a different thread, I don't need to add or delete items, just to iterate.</p> <p>How can I do it?</p>
java android
[1, 4]
18,790
18,791
Text box in td losing value when div is disabled
<p>I have a JavaScript function DisableDuedate() that disables a td tag based on the logged in user. The td tag contains a text box that is populated on Page_load (vb code behind page). The DisableDueDate() function is called in the HTML page</p> <pre><code>&lt;body onload='scrollBar(null,null,"red");' onload='DisableDueDate();'&gt; </code></pre> <p>The function is defined in the head tag</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function DisableDueDate() { var udisable = '&lt;%=dueDateDisabled %&gt;'; if (udisable == "true") document.getElementById("divduedate").setAttribute('disabled',true); else document.getElementById("divduedate").setAttribute('disabled',false); } &lt;/script&gt; </code></pre> <p>This works fine but the value of the textbox that is in the td tag is displaying 0 when the div tag is disabled. How to retain the text box value when the enclosing div tag is disabled ?</p>
javascript asp.net
[3, 9]
1,732,386
1,732,387
how to resolve jquery class conflicts when i am using marquee and thick box plugins?
<p>I am trying to <code>marquee</code> continuously scrolling images and added external links, where it has to popup using <code>thickbox</code> mechanism. I am facing <code>jquery</code> class conflict issue. Please provide solution for this.</p> <p>In <code>thickbox</code> JavaScript ,starts with </p> <pre><code>$(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); </code></pre> <p>and in marquee JavaScript, starts with </p> <pre><code>(function ($) { $.fn.marquee = function (class) { var newMarquee = [], .... } }); </code></pre> <p>What do I have to do to resolve the conflict issue with <code>thickbox</code>?</p>
javascript jquery
[3, 5]
3,474,366
3,474,367
How to create array in jquery
<p>I want to create the width array of each children of selected element. I tried :</p> <pre><code>var width = $(element).children().map(function () { return this.style.width; }); </code></pre> <p>But this is not working. When i <code>alert(width[0])</code> then instead of showing width it shows <code>objectHtmlElement</code>. What i am doing wrong ?</p>
javascript jquery
[3, 5]
318,903
318,904
Writing for iphone and android... are any of the js api worth it?
<p>as we're all aware, there is a a stinking iphone so what is the best way to go about making a cross-phone app as long as those are the only two phones you care about no one buys bb anymore</p> <p>p.s. I don't want to argue phone sales... just what js lib works REALLY well for both and more than just links... tell me your experience.</p>
javascript iphone android
[3, 8, 4]
3,086,516
3,086,517
HTTP POST via JQuery
<p>i am working on API, The API supports both HTTPS POST and HTTPS GET methods. </p> <p>Moreover, it is a security risk to expose Web Registration credentials on a public web site. Instead, use a background HTTP POST (server side) to initiate the web registration. </p> <p>how can i http post (aspx) via jquery?</p>
jquery asp.net
[5, 9]
2,854,176
2,854,177
How to integer-divide round negative numbers *down*?
<p>Seems like whenever I divide a negative int by a positive int, I need it to round <em>down</em> (toward -inf), not toward 0. But both C# and C++ round toward 0.</p> <p>So I guess I need a DivideDownward() method. I can write it in a few lines with a test for negative and so on, but my ideas seem klugey. So I'm wondering if I'm missing something and if you have an "elegant" way to round negative division downward.</p>
c# c++
[0, 6]
4,269,837
4,269,838
Simulate Hover in jQuery
<p>Currently, I have some jQuery/Javascript code that toggles the css class 'ui-state-hovered' when a user hovers the mouse over certain elements, and I want to write a test in konacha to test this piece of code. </p> <p>How would I write this function in Javascript with the help of jQuery?</p> <p>Return true if when a user hovers over an element $('.someClass li:first'), the class 'ui-state-hovered' exists. Else return false.</p> <p>How would I simulate a user hovering their mouse over that element?</p>
javascript jquery
[3, 5]
871,147
871,148
Best IDE for Java Script also JQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/209126/good-javascript-ide-with-jquery-support">Good JavaScript IDE with JQuery support ?</a> </p> </blockquote> <p>I am a Web Developer, working on Javascript and Jquery. Right now I am using EditPlus for development process. Faceing lots of difficulties. </p> <p>Please let me know Best IDE for Javascript / Jquery.</p>
javascript jquery
[3, 5]
957,116
957,117
Converting my php array to string
<p>I have an array $tagsdata that looks like this when i print it out</p> <pre><code>Array ( [1] =&gt; Laravel [2] =&gt; Volta [3] =&gt; Web [4] =&gt; Design [5] =&gt; Development ) </code></pre> <p>Now i wan't to convert this array to a string that has to look like this</p> <pre><code>data: [{id: 1, text: 'Laravel'},{id: 2, text: 'Volta'},{id: 3, text: 'Web'},...], </code></pre> <p>for in my javascript i have no clue how to do this</p>
php javascript
[2, 3]
5,452,587
5,452,588
how to show popup box in windows mobile application?
<p>I am developing a windows mobile application in which i want to show popup box containing datagrid control of showing particular details when user clicks on a button in a form.</p> <p>i am using ShowDialog() method but it is working.</p> <p>can anyone suggest me how to implement this.</p> <p>thanks in advance.</p>
c# asp.net
[0, 9]
1,281,006
1,281,007
java code to receive GCM push notification and save them in SQLite DB on android phone
<p>I am a beginner in PHP, JAVA and GCM Service.</p> <p>I built an app that has two parts:</p> <p>1)PHP Server side </p> <p>2)Java android client side</p> <p>I set the GCM and registered the phone and I got an ID.</p> <p>I set the server to sent Data to GCM server successfully. </p> <p>My question is:</p> <p>what is the Java code I have to write to receive the push notification from the GCM server and save it on the SQLite DB i built in the android app?</p> <p>Thanks in advance!</p>
java android
[1, 4]
3,831,140
3,831,141
JSON.parse() not working on jQuery data object
<p>I get a JSON file via jQuery $.getJSON(url, function(data) { ... and want to parse it with either</p> <p>var obj = JSON.parse(data);</p> <p>or</p> <p>var obj = jQuery.parseJSON(data);</p> <p>alert(obj.center);</p> <p>The first line gives me "syntax error" (using IE8, should support JSON.parse), the second gives me "'center' is null or not an object".</p> <p>This is the valid JSON file I'm using:</p> <pre><code>{ "center":{"lat":"51.99637","lon":"13.07520"}, "locations": [ { "name":"a string","info":"another string" }, ... some more here ... ] } </code></pre> <p>I'm not too familiar with Javascript. What am I doing wrong?</p> <p>If I use a simple JSON array (= just the content of locations) I get valid data with $.each. Do I have to do something with data before I can use JSON.parse on it?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
5,874,723
5,874,724
Is jQuery.change("callBackFunction") better than jQuery.on("change","callBackFunction")
<p>Is jQuery.change("callBackFunction") better than jQuery.on("change","callBackFunction") or is it the other way around? If so why is that so?</p> <p><strong>Edit</strong> I now know that <a href="http://api.jquery.com/change/" rel="nofollow">http://api.jquery.com/change/</a> says both are same, courtesy to Alexeyss. I was wondering if there is a difference in performance, or browser related issues etc.,</p>
javascript jquery
[3, 5]
4,383,290
4,383,291
Why do you have to re-select a JQuery element from a collection?
<p>I have a number of check-boxes on my page, each has a name attribute for its useful value.</p> <p>I want to get a list of values for the checked items only. I can get a collection of elements like so...</p> <pre><code>var checkedItems = $(".checkbox:checked"); </code></pre> <p>Now I want to create the list (string) so I create a loop...</p> <pre><code>var list = ""; for (var i = 0; i &lt; checkedItems.length; i++) { list += $(checkedItems[i]).attr("name") + "\n"; } </code></pre> <p>This works and gives me my list. But the question is, why do I have to apply the JQuery object thingy i.e. <code>$(...)</code> to use the attr property?</p> <p>if I had the following instead it would not work...</p> <pre><code>list += checkedItems[i].attr("name") + "\n"; </code></pre> <p>But surely the array should be a collection of JQuery elements already? Why re-cast?</p> <p><a href="http://jsfiddle.net/dGeNR/" rel="nofollow">Here is a JSFiddle</a> of the working example if anybody wants to try it</p> <p>EDIT: Why does this work...</p> <pre><code>var item = $("#item"); var name = item.attr("name"); </code></pre>
javascript jquery
[3, 5]
4,944,450
4,944,451
How to send long strings to a php file without a form?
<p>I have a textarea inside a form (form action=post) and a link under this textarea, the user should fill this textarea and click the button to transfer the text written in the texarea to another file, I'm using jQuery to grab the textarea content and append them to the href of the link, this was working fine until I was testing the textarea with long strings.</p> <p>so what is the alternative for sending very long strings to another php files ?</p> <p>and thanks.</p>
php javascript jquery
[2, 3, 5]
4,405,310
4,405,311
Thread Calling in Android
<p>I am working on an Android Application where I need to work on thread which is a well known concept of Java. I am having a thread named "thrd" in my application and I want to call it in the else part of the IF...Else loop.</p> <p>Can anyone please tell me how can I call that thread in my loop, Sorry I am totally new as far as working with Java or Android is concerned.</p> <p>Thanks for the help in Advance, david</p>
java android
[1, 4]
1,986,158
1,986,159
How to set time for AlarmManager correctly?
<p>I have the following code:</p> <pre><code> PendingIntent pi=PendingIntent.getBroadcast(getActivity(), id, i, 0); manager.setRepeating(AlarmManager.RTC_WAKEUP, date.getTime(), 5000, pi); </code></pre> <p>This code works correctly, but there is one problem - for example, I set time as "15 october 2012", and it will show notification for me 15 october, but it also show me notification after executing this code at once! How can I disable it? </p>
java android
[1, 4]
954,676
954,677
Code formatting for webpages in php and java
<p>When ever i develop some webpage i will write code in <strong>non format</strong> way and then after completing my page i will format my code by giving 3 to 5 spaces for line to line . Now my question is is there any tool to do auto format the code. So that i can minimize the code format <strong>Time</strong>.</p> <p>Thanks in advance....</p>
java php
[1, 2]
928,632
928,633
jQuery string manipulation performance vs. PHP
<p>Im building a custom jquery modal box that loads an external html template file that contains variables that need to be replaced. For instance: [user-name]</p> <p><strong>I know I have 2 options for modifying the template file:</strong></p> <ul> <li>use find and replace in jquery</li> <li>process the template server side and simply send the result to jquery</li> </ul> <p>From a user performance stand point, which would be faster?</p>
php javascript jquery
[2, 3, 5]
3,694,872
3,694,873
Display a php form in colorbox
<p>I'm using the colorbox jquery plugin and I'd like to display a PHP form in the colorbox.</p> <pre><code>&lt;?php if( is_array($pages_created) ){ ?&gt; &lt;form id="link_page_form" method="post" action="my_url" &gt; &lt;select id="page_from_link" name="page_from_id" &gt; &lt;OPTION VALUE="" &gt;Associate with:&lt;/OPTION&gt; &lt;?php foreach($pages_created as $k) { ?&gt; &lt;OPTION id="&lt;?php echo $k[3] ?&gt;" VALUE="&lt;?php echo $k[0]; ?&gt;" &gt;&lt;?php echo $k[1]; ?&gt;&lt;/OPTION&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;button type="submit" &gt;OK&lt;/button&gt; &lt;/form&gt; &lt;?php } ?&gt; </code></pre> <p>What should I do to make that possible ? ( $("#link_page_form").colorbox(); doesn't work )</p>
php jquery
[2, 5]
5,011,843
5,011,844
Seeing if a checkbox is checked by default
<p>I have a javascript function that sets a variable everytime a checkbox is clicked:</p> <pre><code> function handleClick(cb) { alert('entered function'); setTimeout(function () { if (cb.checked ) { $("#IsChecked").val('true'); } else $("#IsChecked").val('false'); alert('now my value is: '+ $("#IsChecked").val()); }, 0); } </code></pre> <p>Heres my checkbox:</p> <pre><code> &lt;input id="MyCheckBox" type="checkbox" value="true" onclick="handleClick(this);" name="MyCheckBox" checked="checked"&gt; </code></pre> <p>This works great everytime the checkbox is checked. But now i need to know if the checkbox is checked when the user clicks a button and has never touched the checkbox before. So i do this:</p> <pre><code> $(document).ready(function () { $("#IsChecked").val('default'); $('#btnCheck').click(function (e) { var isComplete = $("#IsChecked").val(); if (isComplete == 'default') { var cb = $('#MyCheckBox'); handleClick(cb); alert('after handleClick ischecked is: ' + $("#IsChecked").val()); } }); </code></pre> <p>});</p> <p>When i click my button and the checkbox is checked by default, i get these alerts in this order:</p> <pre><code> entered function after handleClick ischecked is: default now my value is: false </code></pre> <p>If i check the checkbox to toggle it, i get these alerts as expected:</p> <pre><code> entered function now my value is: false </code></pre> <p>In my handleClick event, the setTimeout is there because of IE so i cant get rid of it. How can i check to see if a checkbox is checked without having to click the checkbox itself? Thanks</p>
javascript jquery
[3, 5]
1,979,752
1,979,753
my Namespace does not allow Directory.GetFiles
<p>i have the following code:</p> <p>using System; using System.IO;</p> <pre><code>namespace Project { public partial class Documentation : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string[] filePaths = Directory.GetFiles(@"c:\MyDir\"); } } } </code></pre> <p>for some reason, i get the error "Project.Directory does not contain a definition for 'GetFiles'". If i change the namespace to anything else, the error goes away. Is there a way to find out what exactly I am doing in my current namespace that disallows the usage of the directory function?</p>
c# asp.net
[0, 9]
175,448
175,449
unable to convert string to date in asp.net correctly
<p>I unable to convert string to date, my string like 17/12/2012 Code written for this is shown below</p> <pre><code>public string Date_Convert(string dt1) { string strdate = string.Empty; Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB"); DateTime dt = Convert.ToDateTime(dt1); strdate = dt.Month.ToString() + "/" + dt.Day.ToString() + "/" + dt.Year.ToString(); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); return strdate; } </code></pre> <p>It is working fine in my local system. And not working in my server(which is located at Australia)of course I tried with different culture settings in the above code,</p> <p>I'm using this date string in sql query in where condition.</p> <p>please help me, It killed my one day time, and thanks in advance.</p>
c# asp.net
[0, 9]
152,300
152,301
jQuery .size() question
<p>When you click the "Add Div" button, why doesn't the number increment?</p> <p><a href="http://jsfiddle.net/cN2zR/" rel="nofollow">http://jsfiddle.net/cN2zR/</a></p>
javascript jquery
[3, 5]
788,338
788,339
Repeating Information in a Web Form - Asp.Net
<p>I am building an employment application form that submits data to a database for my business. </p> <p>In creating this form, one of the things that captured my attention is that when I created the section for employment history, I thought to myself that most applicants are going to have a variety of information to put in here, and making a required set of 3 past employers is far to rigid for the target prospect base. Some may have just 1 prior job, others may have 10 or more. Plus, making a large amount of fields for this information not only looks bad to the eye, but it is also is a bad practice in the world of database development. SO...</p> <p>What I would like to do, is something similar as I have done in an Access Database is the theory behind a Subform, where when a user begins to add input data, the form replicates itself making another set of datafields available for as many times as the user needs. This way, only data is being stored - not empty space. </p> <p>While this is rather a straightforward practice in Microsoft Access, I have discovered that Asp.Net web forms and SQL handle this process in an entirely different manner to accomplish the same goal. </p> <p>I have done some research on this topic and have discovered that there are many ways to go about this, and most things I found are very vague as to how to go about this. So, I reach out to you. </p> <p>How would I add a set of repeating fields to handle input of prior work experience? For simplicity sake, lets say we have three fields: Employer, Supervisor, and Job. Lets also assume that the addition of these three fields would take place after the user clicks and add button. What would I need to do to in order to get those three fields to repeat as many times as necessary on my asp.net web form?</p>
c# asp.net
[0, 9]
1,331,803
1,331,804
How would you tackle this php/mysql
<p>I am building a dynamic (food) menu system for a website. Users will be able to add and remove menu items as they like and alter price etc. If the menus were static then I would have a static form for example </p> <pre><code>&lt;form id="order_form" action="order.php" method="POST" class="form"&gt; &lt;ul&gt; &lt;li&gt;cheese burger&lt;input type="text" name="cheese_burger_items" /&gt;&lt;/li&gt; &lt;li&gt;bacon burger&lt;input type="text" name="bacon_burger_items" /&gt;&lt;/li&gt; &lt;li&gt;steak burger&lt;input type="text" name="steak_burger_items" /&gt;&lt;/li&gt; &lt;li&gt;fish burger&lt;input type="text" name="fish_burger_items" /&gt;&lt;/li&gt; &lt;li&gt;lamb burger&lt;input type="text" name="lamb_burger_items" /&gt;&lt;/li&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre> <p>Then the order.php would start out like</p> <pre><code>&lt;?php $cheese_burger_items = $_POST['cheese_burger_items']; $bacon_burger_items = $_POST['bacon_burger_items']; $steak_burger_items = $_POST['steak_burger_items']; $fish_burger_items = $_POST['fish_burger_items']; $lamb_burger_items = $_POST['lamb_burger_items']; ?&gt; </code></pre> <p>This is obviously a grossly simplistic view of it.</p> <p>The amount of items would vary also. What would be the dynamic approach to doing this? I guess for the input 'name' I could use the index name in the database but that doesn't really help me in order.php as I will need to have a POST for each uniqe item. </p>
php javascript
[2, 3]
2,271,550
2,271,551
how to read values from a price range slider(jquery)
<pre><code>$( "#minValue" ).val($( "#slider-range" ).slider( "values", 0 )); $( "#maxValue" ).val( $( "#slider-range" ).slider( "values", 1 ) ); </code></pre> <p>How to read values when slider sliding ?</p> <p><code>minValue-&gt;minimum</code> value of slider when slider sliding</p> <p><code>maxValue-&gt;maximum</code> value of slider when slider sliding </p>
javascript jquery
[3, 5]
1,549,206
1,549,207
if statement within jQuery timepicker
<p>I'm pretty new to javascript and jQuery, but I managed to get Trent Richardson's jQuery Timepicker, <a href="http://trentrichardson.com/examples/timepicker/" rel="nofollow">http://trentrichardson.com/examples/timepicker/</a>.</p> <p>I added constraints for limiting dates the user can select, but I now need to change those limits based on the current time. Adding a day if the current time is before 3pm, and adding 2 days if it's after 3pm.</p> <p>I have it working, but I feel that the code is a little bulky and poorly thought out. Does anyone know if there's a more elegant way of achieving this? Thank in advance :)</p> <pre><code>var currentTime = new Date() var hours = currentTime.getHours() var minutes = currentTime.getMinutes() if(hours &gt; 15){ //document.write("too late buster!") $('#datepicker').datetimepicker({ minDate: +2, maxDate: +30, dateFormat: "d/M", timeFormat: 'hh:mm', hourMin: 11, hourMax: 19, hourGrid: 4, minuteGrid: 10, stepMinute: 5, separator: ' @ '}); } else { $('#datepicker').datetimepicker({ minDate: +1, maxDate: +30, dateFormat: "d/M", timeFormat: 'hh:mm', hourMin: 11, hourMax: 19, hourGrid: 4, minuteGrid: 10, stepMinute: 5, separator: ' @ '}); } </code></pre>
javascript jquery
[3, 5]
1,277,175
1,277,176
Executing programs on mobile phone
<p>Hi I was wandering how do we execute programs on mobile phone...Not developing them!</p> <p>Like I write a program to solve a particular problem. Now I need to install it on my mobile phone so that I can run the program on my phone anytime I need to do it. I am familiar with C#.NET (Windows Forms Application) and Java(Basic Console Applications). So anything that can be is good enough to run programs in these languages on mobile phone will help. My target mobile OS is primarily Android. But I also have an I-Phone. I am inclined more towards the C#.NET Windows form applications coz it is empowered with well-versed GUI</p> <p>Can anyone please help?</p>
java iphone android
[1, 8, 4]
1,225,353
1,225,354
Tab within a text area without changing focus, jQuery
<p>Given a textarea, is there any way to use jQuery to enable the ability for people to use the "tab" key that actually ..inserts a tab, instead of jumping focus to the next form element on the page?</p> <p>I've followed <a href="http://stackoverflow.com/questions/3362/capturing-tab-key-in-text-box">Capturing TAB key in text box</a> and while this does work, I'm looking to try and wrap this into a jQuery plugin to make a specific textbox tabbable. The problem is, I'm not entirely understanding how to apply the concept of these 'listeners' to objects that corrospond to jQuery.</p> <p>Does anyone have some leads on where I could start? </p>
javascript jquery
[3, 5]