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
448,844
448,845
Define multiple buttons
<p>Is there a way to define 31 buttons in one action.. Something like this :</p> <pre><code> Button but[] = new Button[31]; for(int i=1;i&lt;32;i++) { but[i] = (Button) findViewById(R.id.Button0+i ---? ); } </code></pre>
java android
[1, 4]
1,535,028
1,535,029
passing parameters in url to another page
<p>I am going to create two pages.</p> <p>The first page will be www.rentzamm.com?adv=1256&amp;loc=768 ...On this page I am going to have a link which takes you to www.rentzamm.com/result.asp ..... Now when i press the link from page 1 I want the link of page 2 to be like this: www.rentzamm.com/result.asp?adv=1256&amp;loc=768 ... is this possible please?</p>
javascript jquery
[3, 5]
5,520,496
5,520,497
HTTP Post completely exiting thread, no exception caught, or hangs forever
<p>I knew my code was dying somehow because of the other symptoms, but even though I had try/catch around everything, there was never any message. I've now finally narrowed it down by use of successive output statements.</p> <pre><code> String line = null; try { final HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, 30000); DefaultHttpClient httpClient = new DefaultHttpClient(httpParams); HttpPost httpPost = new HttpPost(url); postDebugMessage("GlobalApplication", "Info", "Executing httppost"); HttpResponse httpResponse = httpClient.execute(httpPost); postDebugMessage("GlobalApplication", "Info", "Getting entity"); HttpEntity entity = httpResponse.getEntity(); postDebugMessage("GlobalApplication", "Info", "Converting to line"); line = EntityUtils.toString(entity); //&lt;- the bad one postDebugMessage("GlobalApplication", "Info", "Conversion completed."); } catch (Exception ex) { // Any error occurring here we're going to state is // a network error. postDebugMessage("GlobalApplication", "Exception", ex.getStackTrace()[0].toString()); throw new NetworkNotAvailableException(ex.toString()); } </code></pre> <p>Based on my debug output statements, the line = EntityUtils.toString(entity) never completes, and no statement after that in the entire service thread executes...the whole thing just vanishes.</p> <p>I know that EntityUtils.toString() can throw 2 exceptions, an IOException and a ParseException, and I'm going to try and add those next, but shouldn't an overall Exception catch it?</p>
java android
[1, 4]
505,476
505,477
Adding single click event to multiple linkbuttons
<p>I have looked at other post but nothing explained what I want to do very well.</p> <p>At runtime I have x amount of LinkButtons added to the form by a repeater dependant on the data it retrieves from the database:</p> <pre><code>&lt;asp:Repeater ID="variantRepeat" runat="server" onitemcommand="variantRepeat_ItemCommand"&gt; &lt;HeaderTemplate&gt;&lt;ul&gt;&lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt;&lt;li&gt;&lt;asp:LinkButton ID="varLink" runat="server" CommandName="Click" CommandArgument='&lt;%# Eval("variantID") %&gt;'&gt;&lt;%# Eval ("variant_name") %&gt;&lt;/asp:LinkButton&gt;&lt;/li&gt;&lt;/ItemTemplate&gt; &lt;FooterTemplate&gt;&lt;/ul&gt;&lt;/FooterTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>It is supposed to, when clicked Fire of an event backstage</p> <pre><code> protected void varLink_Click(object sender, EventArgs e) { ViewCollection views = prodView.Views; } </code></pre> <p>Then set up some views. However I need the CommandArgument to go through as that holds the key to look up inside the <code>prodView.Views</code> .</p> <p>It doesn't have to be <code>variantID</code> that is passed but could be and Int depending on which one, just need some indication as to what view to display!</p> <p>I have all the views created at page init and added to the page dynamically at init.</p> <p>I use the entity framework to query the database through a few views! (found that to be easier to get complex data from relational databases!)</p> <p>I don't know how to link up all those LinkButtons so that I can programmatically switch views?</p>
c# asp.net
[0, 9]
5,321,195
5,321,196
how to control which parts the && applies to in an if statement
<p>let say I have this if statement:</p> <pre><code>if($(this).hasClass('rightnav') | $(this).parent() == 'nav' &amp;&amp; $(this).parent().parent() == 'section') </code></pre> <p>How can I tell the script that the &amp;&amp; should apply after the | and not the entire if? Thanks! this is really confusing me :s</p>
javascript jquery
[3, 5]
5,406,971
5,406,972
Call a js function after reloading page
<p>I have js following code. <code>createNote()</code> function is called when I click a "<strong>Crate Note</strong>" button on webpage </p> <pre><code>function createNote() { alert( 'page created' ); // for example note is created here window.location = document.URL; // refresh page to show new added note showEditNotePopup(); } function showEditNotePopup() { alert( 'show note edit page' ); // for example edit note popup shown here } </code></pre> <p>Above code is working and creating note and also refreshing page using <code>window.location = document.URL;</code>. But after reloading page it is not calling <code>showEditNotePopup(</code>) function. Is there any way to achieve this without using AJAX. </p>
javascript jquery
[3, 5]
2,900,067
2,900,068
How to delete only the content of a file in java?
<p>May i please know how can i delete the content of the file in java? Thanks in advance.</p>
java android
[1, 4]
1,819,168
1,819,169
Adding other items in toolbox from dll, do I still need the dll if I give someone the source?
<p>I have AjaxControlToolkit.dll , I've added the dll items into my toolbox and I've worked with some items in my asp.net project.</p> <p>My question is : If I give someone the entire source without the dll located on my desktop , and in my project I used some items from the dll , are they still working(the items) on his pc ?</p> <p>Thanks</p>
c# asp.net
[0, 9]
1,684,168
1,684,169
Valums file uploder plugin shows upload failed message each time
<p>I am using <code>valum file uploader</code>. The js code for initializing plugin is :</p> <pre><code>function Initializer() { var uploader = new qq.FileUploader({ element: document.getElementById('file-uploader'), action: '/_Image/Upload', params: {}, allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], debug: true, onSubmit: function (id, fileName) { }, onProgress: function (id, fileName, loaded, total) { }, onComplete: function (id, fileName, responseJSON) { }, onCancel: function (id, fileName) { }, onError: function (id, fileName, xhr) { }, messages: { typeError: "{file} has invalid extension. Only {extensions} are allowed.", sizeError: "{file} is too large, maximum file size is {sizeLimit}.", minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.", emptyError: "{file} is empty, please select files again without it.", allowedExtensionsError : "{file} is not allowed.", onLeave: "The files are being uploaded, if you leave now the upload will be cancelled." }, showMessage: function (message) { alert(message); } }); } </code></pre> <p>The file is successfully uploded on the server but the plugin is showing the <code>file uplode fail</code> message each time. Can anybody please tell me whats the issue ?</p>
javascript jquery
[3, 5]
1,782,885
1,782,886
Stop floating point operations
<p>I'm displaying a text value and if by coincidence that text value happens to be numeric, then JavaScript displays it with a decimal .0.</p> <p>Q: How do I write:</p> <pre><code>if (X is numeric) { $('#Status').text(+X); } else { $('#Status').text(X); } </code></pre>
javascript jquery
[3, 5]
4,418,203
4,418,204
Use a function to set a variable with Javascript?
<p>I am trying to use javascript and jquery to build an HTML table based on information returned from a database. I have the JSON and the database hit working properly, but I am unable to show the data on my page.</p> <p>This is code to display the data</p> <pre><code>var temp; var init = function() { $(_getMarketInfo()).appendTo(document.body); // Used for logging temp = $(_getMarketInfo()); console.log(temp); }; </code></pre> <p>And then to get and process the data</p> <pre><code>function _getMarketInfo() { $.ajax({ url:'scripts/db_getMarketInfo.cgi', dataType:'json', success:function(data, testStatus) { var html = ''; html +='&lt;div class="marketInfoHolder"&gt;'; html +='&lt;table class="tbl" border=1&gt;'; html +=' &lt;tr&gt;&lt;th&gt;Market Information&lt;/th&gt;&lt;/tr&gt;'; html +=' &lt;tr&gt;&lt;td&gt;Market&lt;/td&gt;&lt;/tr&gt;'; for (var i=0;i&lt; data.marketInfo.length; i++){ html += '&lt;tr&gt;&lt;td&gt;' + data.marketInfo[i].market_name + '&lt;/td&gt;&lt;/tr&gt;'; } html +='&lt;/table&gt;'; html +='&lt;/div&gt;'; //used for logging console.log(html); return html; }, error:function(data, textStatus) { alert('There was an error getting market information.'); } }); }; </code></pre> <p>According to the console logs, the html variable does have proper html code for a table, but then when I look at temp variable, it is logged as []. It appears that, for some reason, the _getMarketInfo() isn't properly returning html to temp.</p>
javascript jquery
[3, 5]
4,089,439
4,089,440
Chain this jquery expression
<p>Is there a way to chain this jQuery expression or improve it? All i really want to do is change "my text" to "new text".</p> <p>HTML:</p> <pre><code>&lt;div id="myDiv"&gt; my text &lt;span&gt;button 1&lt;/span&gt; &lt;span&gt;button 2&lt;/span&gt; &lt;/div&gt; </code></pre> <p>Javascript:</p> <pre><code>var element = $("#myDiv"); var buttons = element.children().detach(); element.text("new Text"); element.append(buttons); </code></pre>
javascript jquery
[3, 5]
555,246
555,247
how to get a variable from a link using jquery and php?
<p>i have this script on <a href="http://jsfiddle.net/patrioticcow/HysJ6/7/" rel="nofollow">jsfiddle</a></p> <p>basically this links:</p> <pre><code> | &lt;a id="mine_click" href="#?test=123"&gt;test&lt;/a&gt; | | &lt;a id="mine_click" href="#?test=123"&gt;test1&lt;/a&gt; | | &lt;a id="mine_click" href="#?test=123"&gt;test2&lt;/a&gt; | | &lt;a id="mine_click" href="#?test=123"&gt;test3&lt;/a&gt; | </code></pre> <p>when i click on one of them i manage to change tabs but i want that <code>test</code> var to fallow and be displayed in the respective tab</p> <p>any ideas?</p>
php javascript jquery
[2, 3, 5]
3,744,139
3,744,140
drop down list checked
<p>I had Drop down list which execute code when specific condition and I tried to check it through selected value but it get error </p> <pre><code> protected void DDLProductFamily_SelectedIndexChanged(object sender, EventArgs e) { if (DDLProductFamily.Items.FindByText("Name").Selected == true) using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } else if (DDLProductFamily.Items.FindByText("ProductFamilly").Selected == true) { using (SqlConnection Con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetListViewByProductFamily", Con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@ProductFamily_Id", DDLProductFamily.SelectedValue.ToString())); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(dt); DataList1.DataSource = dt; DataList1.DataBind(); } } } </code></pre>
c# asp.net
[0, 9]
188,316
188,317
How can i access a js value in post response?
<p>I am making a jquery post request to obtain a part of the html code from server. There is a file on server get_info.php which prints html code for different requirements. I am using following code to do this :</p> <pre><code>function check(inf_type) { $.ajax({ type: 'POST', url: "get_info.php", data: { "sequence_no" : 1 }, success: function(data) { // how can i use value of variable "inf_type" here. // here, the variable "data" contains HTML code. }, dataType: 'text' }); } </code></pre> <p>the function check() accepts a parameter <strong>inf_type</strong> which contains random strings according to which, server recognize the html code to print. Now, i want handle the POST response according to this <strong>inf_type</strong>. How can i access the value of <strong>inf_type</strong> variable in POST response function? The function check() is called more often, thats why i can not put the <strong>inf_type</strong> variable value in any global variable. What can i do to achieve that? Please guide me. thanks in advance.</p>
javascript jquery
[3, 5]
1,780,284
1,780,285
How to submit a textarea using wysiwyg editor and jquery
<p>Ok, because I am such a noob and have no idea how javascript works... My thinking was flawed. I am halfway there now. I have taken one of the poster's suggestions and set up a function and then in the html form tag, I call it. This works. I thought that I needed to have an id selector to have JQuery trigger but that isn't the case. I'm sorry. I know I am not making any sense at all but please bear with me, I'm trying. :)</p> <p>Now that I have the form pointing to the javascript/jquery script. I now need to fix the jquery. Here is the code.</p> <pre><code>function doSave(){ $(function() { $('.error').hide(); $("#dfar").click(function() { $('.error').hide(); var textArea = $('#dfarReport'); if (textArea.val() == "") { alert('sd'); textArea.show(); textArea.focus(); return false; } </code></pre> <p>For some reason, even though I press the submit button and have included the id selector of the text area I cannot see the alert. Can someone please tell me what I am doing wrong?</p>
javascript jquery
[3, 5]
2,832,195
2,832,196
How to create multiple instances of show/hide div in jquery?
<p>I have the following code</p> <pre><code>$(document).ready(function() { $('a#slick-toggle').click(function() { $('#slickbox0').toggle(400); return false; }); }); &lt;a id="slick-toggle" href="#"&gt;Show/Hide&lt;/a&gt; &lt;div id="slickbox" style="display: none;"&gt; hidden content here &lt;/div&gt; </code></pre> <p>The problem is, if there is more than 1 instance of this on the html part of this on the page, it wont work. Im not very good at JS. The div id I gotta make unique.... but how do I make each link toggle the corresponding box?</p>
javascript jquery
[3, 5]
2,462,427
2,462,428
android-php ,response is triggered twice sometimes
<p>I am using json response which connects to <a href="http://example.com/test.php" rel="nofollow">http://example.com/test.php</a> I receive response in the listview and its all good,but sometimes the php is triggered twice , eg: if has mail() function inside it sends once but rarely sends it twice ,I cannot predict when that is happening ,Is it because it does not contain session_start() or is it some other reason? The php has just mail() function.</p> <p>Thanks in advance.</p>
php android
[2, 4]
1,215,955
1,215,956
How can I use keyboard keys to scroll between elements on same page?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2168739/using-arrow-keys-with-jquery-scrollto">Using arrow keys with jQuery scrollTo</a> </p> </blockquote> <p>Is it possible to scroll between similar elements on the same page using jQuery?</p> <p>e.g. When I press N the page scroll to next div... and so on.. when I press the P the page scroll to previous div.. just as example.</p> <p>Is it possible with or without a plugin? Can anyone show me a very little sample so I can follow.</p> <p>Thank you.</p>
javascript jquery
[3, 5]
615,248
615,249
Is it possible to tell if there are any ongoing 'GET' requests with javascript?
<p>Is it possible to tell if there are any ongoing 'GET' requests with javascript?</p> <p>I have a feeling that it is not. Basically I don't want to make a seperate request while the other "more important" requests are going as this one is fairly heavy. So I was curious if it is possible to tell if there are currently 'get' requests going and if so I can tell my function to hold off for this update and do it again in 10-15secs.</p> <p>Any information etc would be appreciated.</p>
javascript jquery
[3, 5]
4,404,292
4,404,293
Changing image source with Jquery
<p>Using Jquery, I've managed to make a dropdown login form triggered by clicking a button. However, I am also trying to change the direction of the arrow next to it by replacing the src image, and it appears to do nothing.</p> <pre><code>$("#login_panel").slideToggle(200).toggle( function() { $("#arrow").attr('src', '/src/east.gif';) }, function() { $("#arrow").attr('src', '/src/south.gif';) } ); </code></pre> <p>This can be seen at:<br> <a href="http://dev.mcmodcenter.net" rel="nofollow">http://dev.mcmodcenter.net</a> (The 'Login' button)</p> <hr> <pre><code>$(document).ready(function() { $("#login_panel").slideToggle(200).toggle( function() { $("#arrow").attr('src', '/src/east.gif';) }, function() { $("#arrow").attr('src', '/src/south.gif';) } ); for (var i = 0; i &lt; 2; i++) { $(".mod").clone().insertAfter(".mod"); } $(".mod").lazyload({ effect: "fadeIn" }); }); </code></pre>
javascript jquery
[3, 5]
498,386
498,387
How can we select the good subclass for the result without using instanceof?
<p>When I try this code, I have 2 possibilities for the result in "tab". But the program choose the result "Null" of "Repository" instead of the ArrayList of "ChooseRepository". How Can I specify that I want the result for "ChooseRepository" and not the result for "Repository" without using "instanceof"? Note that "ChooseRepository" is a subclasse of Repository.</p> <pre><code>ChooseRepository chooseRepository = new ChooseRepository(this); tab = searchTab("H","US",chooseRepository); public ArrayList&lt;String&gt; searchTab(String sexe,String SI,Repository&lt;?&gt; repository){ ArrayList&lt;String&gt; tab; repository.Open(); repository.rechercherspin(sexe); tab= repository.taillesUS; return tab; } </code></pre>
java android
[1, 4]
5,589,473
5,589,474
Slide div with Jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7471382/make-a-div-scroll-when-i-reach-a-certain-point">Make a div scroll when i reach a certain point</a> </p> </blockquote> <p>I have a problem now.I've been working here : <a href="http://jsfiddle.net/Zte6T/3/" rel="nofollow">http://jsfiddle.net/Zte6T/3/</a></p> <p>I don't want the text div to scroll that way.When the pages reaches at the button's level ,I want the txt to show,sliding down and moving along with the button.But,the text needs to be BEFORE the button.The sliding up part is ok.</p>
javascript jquery
[3, 5]
2,894,979
2,894,980
Call webMethod in User control
<p>Is it possible to place WebMethod in ascx.cs file and call it from clientSide jquery ?</p> <p>For some reasons I cant place this code in asmx or aspx file.</p> <p>Thanks for any help, bye</p> <p>in ArticleList.ascx.cs I have code:</p> <pre><code>[WebMethod] public static string HelloWorld() { return "helloWOrld"; } </code></pre> <p>In ArticleList.ascx file part of the script id:</p> <pre><code>$.ajax({ type: "POST", contentType: "application/json; charset=utf-8", data: "{}", dataFilter: function(data)//makes it work with 2.0 or 3.5 .net { var msg; if (typeof (JSON) !== 'undefined' &amp;&amp; typeof (JSON.parse) === 'function') msg = JSON.parse(data); else msg = eval('(' + data + ')'); if (msg.hasOwnProperty('d')) return msg.d; else return msg; }, url: "ArticleList.ascx/HelloWorld", success: function(msg) { alert(msg); } }); </code></pre> <p>and the error from firebug is:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;This type of page is not served.&lt;/title&gt; </code></pre>
c# jquery asp.net
[0, 5, 9]
470,964
470,965
how to write javascript code in <a> tag
<p>I have a javascript variable soucreID and let us say</p> <pre><code>sourceID = 10; </code></pre> <p>sourceID is dynamic value and always changes so i want to pass this to following tag</p> <pre><code>&lt;a href="edit-source.php?source=&lt;script&gt;document.write(sourceID)&lt;/script&gt;"&gt;Edit&lt;/a&gt; </code></pre> <p>But its not working, </p> <p>Can any one tell me how can i write javascript value in <code>&lt;a href=""&gt;</code> tag.</p> <p>Thanks in Advance.</p>
javascript jquery
[3, 5]
5,040,944
5,040,945
Flip counter using jquery in android
<p>I am using jquery to display flipcounter in my android app.But it is not showing the desired output and showing only white balnk screen. </p> <p>Here I am placing java script files in assets folder. </p> <p>below code I am using can anyone helps me.thanks in advance.</p> <p>Code:</p> <pre><code>String str ="&lt;scriptsrc=\"http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js\" type=\"text/javascript\"&gt;&lt;/script&gt;" + "&lt;script src=\"file:///android_asset/js/jquery.easing.1.3.js\" type=\"text/javascript\"&gt;&lt;/script&gt;" + "&lt;script src=\"file:///android_asset/js/jquery.flipCounter.1.2.js\" type=\"text/javascript\"&gt;&lt;/script&gt;" + "&lt;script type=\"text/javascript\"&gt;" + "$(document).ready(function(){" + "var loopvalues = $('#txtval').val();" + "$('#counter').flipCounter('startAnimation', {end_number : loopvalues,duration : 500});" + "});" + "&lt;/script&gt;" + "&lt;div id=\"counter\" style=\"margin-top: 40px; text-align: center\";class=\"65_35_55_black_5\"&gt;" + "&lt;input type=\"hidden\" name=\"counter-value\" value=\"1005\" /&gt;" + "&lt;input id=\"txtval\" type=\"hidden\" name=\"counter-value\" value=\"581\" /&gt;" + "&lt;/div&gt;"; WebView web = (WebView) findViewById(R.id.web); web.getSettings().setJavaScriptEnabled(true); web.loadDataWithBaseURL("", str, "text/html", Encoding.UTF_8.toString(), ""); </code></pre>
javascript android jquery
[3, 4, 5]
1,795,034
1,795,035
Android equivalent of IBActions and IBOutlets
<p>I am thinking of starting with android development. </p> <p>What are the equivalents of IBActions and IBOutlets in android? </p> <p>Is it as easy as Interface Builder to setup connections to code?</p> <p>Is it quick to learn the basics of android development if one knows java?</p>
iphone android
[8, 4]
2,481,627
2,481,628
javascript and PHP problem
<p>i have a problem when trying to include php with javascript</p> <p>i have an:</p> <pre><code>if(document.getElementById(acheckbox).checked==true){ &lt;?php $result=$result."bar-";?&gt; } else{ &lt;?php $result=$result."none";?&gt; } </code></pre> <p>but both are executed... so $result is>>>bar-none how can i solve this problem??? please help!</p>
php javascript
[2, 3]
2,508,932
2,508,933
C# (ASP.Net) Linking selection values to constants in Codebehind
<p><strong>ASPX Code</strong></p> <pre> &lt;asp:RadioButtonList ID="rbServer" runat="server" &gt; &lt;asp:ListItem Value=&lt;%=ServerDeveloper%&gt;&gt; Developer &lt;/asp:ListItemv &lt;asp:ListItem Value="dev.ahsvendor.com"&gt; dev.test.com&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="staging.ahsvendor.com"&gt; staging.test.com&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; </pre> <p><strong>ASPX.CS - Codebehind</strong></p> <pre> const string ServerDeveloper = "developer"; </pre> <p><strong>ASPX Error</strong>: Code blocks are not supported in this context.</p> <p><strong>Question:</strong> So what is the correct way to tie an dropdown/radio buttion/... ASPX value to a constant that is shared with the CodeBehind code?</p> <p>I know that I could do rbServer.Add.Item("developer") [from the CodeBehind], but is there a way to achieve it from the Presentation side of things?</p>
c# asp.net
[0, 9]
4,886,697
4,886,698
How to scroll to bottom of page when postback finish in asp.net?
<p>How to scroll to bottom of page when postback finish in asp.net?</p> <p>I have many details in page when I click "Show Detail" in master detail, this page show many data in my page. So how to to scroll to bottom of page automatically?</p>
asp.net javascript
[9, 3]
1,770,014
1,770,015
Save int into nullable int column
<p>I am trying to save an integer into a nullable int column only if there is a value</p> <pre><code>if (user.AssociationID != 0) { int? AssociationID = user.AssociationID; currentUser.AssociationID == AssociationID; } </code></pre> <p>I have tried casing currentUser into an int <code>(int?)currentUser.AssociationID</code></p> <p>I know this has to be terribly simple. I've googled for the title of the question and am not finding the results I need. Be nice, I'm a noob.</p> <p><strong>Error I'm getting:</strong> Only assignment, call, increment, decrement, and new object expressions can be used as a statement </p>
c# asp.net
[0, 9]
592,295
592,296
asp.net mvc jquery checking size on file upload
<p>Is there any way to check the size of the file when it is about to be uploaded with jquery ?</p>
asp.net jquery
[9, 5]
3,875,655
3,875,656
Beginning Android and Java
<p>I started a job as an appdeveloper for android. After a week they figured that I'm not fast enough getting the apps ready so the fired me and offered me an internship, for free.</p> <p>I'm wondering how I can get better fast. Should I read more (I'm missing architecture stuff I think)? What should I read? should I just start coding stuff, or should I do a course of some sort?</p> <p>I'm reading design patterns from head first. Will Java design patterns help me with Android or are they not applicable on android. Basically I'm at home reading android stuff. The company said they would take me back when I'm good enough so I need to get better quick.</p>
java android
[1, 4]
4,643,847
4,643,848
$.getJSON and PHP file
<p>Is it possible to hide name of *.php file in </p> <pre><code>$(document).ready(function(){ $.getJSON("getdata.php", function(returned_data) { if(returned_data === "1") { $("div#wall").html('user has no subscription'); $("#message_wall").attr("disabled", "disabled"); return false; } }); </code></pre> <p>});</p> <p>Because that jquery code will be visible in source code of the page and I do not want to some malicious visitors try to do something with it.</p>
php jquery
[2, 5]
5,471,578
5,471,579
how to add a value from text box to a table in javascript or jquery?
<p>I have two <code>text_fields</code> and a <code>table</code> with three column. By clicking the button, i want that two <code>text_field</code> value added to the tables in the first two columns. So, the user can change the <code>text_field</code> values again and again and the values added to the next row by clicking the add <code>button</code>.</p> <p>The two <code>text_fields</code> are as follows:</p> <pre><code>&lt;input class="cross-reference-question-value" type="text" style="border: 1px solid gray; "&gt; &lt;input class="cross-reference-answer-value" type="text" style="border: 1px solid gray; "&gt; </code></pre> <p>Here is the <code>table</code></p> <pre><code>&lt;table class="gridView" id="selected_units"&gt; &lt;thead&gt; &lt;tr class="gridViewHeader"&gt; &lt;th&gt;Question&lt;/th&gt; &lt;th&gt;Answer&lt;/th&gt; &lt;th&gt;Action&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr class="&lt;%= cycle('gridViewclickableRowDialog', 'gridViewAltclickableRowDialog') %&gt;"&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="#"&gt;Delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>The <code>button_link</code> is</p> <pre><code>&lt;a href="#" , class="button" &gt;hello&lt;/a&gt; </code></pre> <p>Thanks!!</p>
javascript jquery
[3, 5]
899,846
899,847
Please point out how to complete brackets
<p>I am building an android app but eclipse Is Driving me mad with little bracket errors instead of telling me WHERE THE HECK its supposed to be. Could anybody tell me where the closing brackets need to be? Help would be greatly appreciated I want to complete this little project before May... but May 20th is absolute latest.</p> <pre><code> public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button button = (Button) findViewById(R.id.toggleButton); button.setOnClickListener(new View.OnClickListener() { public void onClick;{; newPhoneImage = getResources().getDrawable(R.drawable.i_dens); } public void onClick(View arg0) { // TODO Auto-generated method stub }; ) }; }; </code></pre> <p>};</p>
java android
[1, 4]
3,007,081
3,007,082
How do I unbind "hover" in jQuery?
<p>How do I unbind "hover" in jQuery?</p> <p>This does not work:</p> <pre><code>$(this).unbind('hover'); </code></pre>
javascript jquery
[3, 5]
4,984,279
4,984,280
Add .live or .on to jquery function
<p>I have some JavaScript that pulls how many items I have in my cart and places it in span.cartTotal for better styling. I need the code to work so it pulls the information instantly and I don't have to refresh my page to see the update. I assume the code would require either jquery .live or .on to be added. Any help is much appreciated. Thank you</p> <pre><code>$(function(){ if ($('#catCartSummary .cartSummaryItem').html() != 'Shopping cart is empty.') { var summary = $('#catCartSummary .cartSummaryItem').text().split(" "); var total = summary[0]; $('span.cartTotal').html(total); }else{ $('span.cartTotal').html("0"); } }); </code></pre> <p>More info: My add to cart class is .productSubmitInput </p> <p>I pull the info from this code below which is dynamically created. This cart total updates automatically in cartSummaryItem. I just need my new styled total to update from it when someone adds to cart. I tried the below suggestions but they didn't seem to work. I could be just adding something wrong.</p> <pre><code>&lt;td class="cartSummaryItem"&gt; 1 item(s), Total: $10.95 &lt;/td&gt; </code></pre>
javascript jquery
[3, 5]
3,177,661
3,177,662
Select JQuery elements that have some value set by data()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2891452/jquery-data-selector">jquery data selector</a> </p> </blockquote> <p>I have several elements with class 'connection_name'. Each one of these elements has a unique id bound to it using the data() JQuery function. I'm trying to query to find the element with a given id, but I can't seem to get it to work.</p> <p>For the sake of this test, I created a page with only 1 element, and set the id of the element.</p> <p>I can verify that the id is being set, as when I query the element in the console, it shows the id returned:</p> <pre><code>$('.connection_name').data() Object id: "4fea76bd99ea080d19000002" __proto__: Object </code></pre> <p>I've read on other questsions/posts that the element should be selected by $('selector[data-attribute=value]'), but that doesn't seem to work:</p> <pre><code>$('.connection_name[data-id="4fea76bd99ea080d19000002"]') [] </code></pre> <p>Worse than that, even when I try to select it without any value (just by the attribute), I still return nothing:</p> <pre><code>$('.connection_name[data-id]') [] </code></pre> <p>I'm not sure what the issue is, or how to go about doing this.</p>
javascript jquery
[3, 5]
2,769,735
2,769,736
is there a way to get the execution order of JavaScript for Debug purposes
<p>I am having alot of issues with Asynchronous functions and I was wondering if there are any tools which would show me the execution order of my script after it has run (without stopping it). I have Firebug but I do not see an option to do this.</p> <p>The Reason I am looking for this is I have a callback being called in a <code>.done()</code> for my <code>.get()</code> but It for some reason fails sometimes so I am trying to track down where exactly this is happening.</p> <p>This is not me asking how to solve the Asynchronous issue (although suggestions are welcome) but more I would like to learn how to track it down myself. Any advice or links to tools/tutorial a greatly Welcome</p>
javascript jquery
[3, 5]
5,800,788
5,800,789
How To "Endless Document" Script (like Skittles.com)
<p>How did they accomplish this? Have you guys seen: <a href="http://www.skittles.com" rel="nofollow">http://www.skittles.com</a>? The site never ends!</p>
javascript jquery
[3, 5]
85,025
85,026
android, how to get directory listing?
<p>Just a quick question, how to I get a list of directories inside a specified directory.</p> <p>for example,</p> <pre><code>String path = Environment.getExternalStorageDirectory().toString()+"/myApp/"; </code></pre> <p>now I'd need to get the list of directories that are inside the "path" directory.</p> <p>Thanks!</p>
java android
[1, 4]
1,837,290
1,837,291
How to receive the mobile sms to a server using php
<p>Can any one explain how to achieve the below requirement.</p> <ol> <li>Say user sends a message like eg: TDFEED Nice work ! to some common no like 5858.</li> <li>I need to receive this text message to my server.</li> <li>Manipulate the text and in reply i need to send an acknowledgement.</li> </ol> <p>I need how to achieve this using php or any other language.</p> <p>Thanks, Lokesh.</p>
c# php
[0, 2]
2,459,852
2,459,853
notice in Jquery Autocomplete
<p>what is the problem if i got this notice saying:</p> <p><b>Notice</b>: Undefined index: 8 in <b>C:\xampp\htdocs\projects\wesm\intranet\plugins\survey_manager\index.php</b> on line <b>80</b><br /></p> <p>i'm using the jquery autocomplete..</p> <p>here is some of my code for javascript in which the error occurred:</p> <pre><code>&lt;script type='text/javascript'&gt; var intranetUsers = ["&lt;?php echo $content[0].' ", "'; $num = 1; while($num != $getInranetUserCount['num']){ echo $content[$num].'" , "'; $num = $num + 1; } echo $content[$getInranetUserCount['num']]; ?&gt;"]; &lt;/script&gt; </code></pre> <p>I've already use that code in some module and it works I don't know why it doesn't work this time.</p>
php javascript jquery
[2, 3, 5]
866,002
866,003
Jquery Asp.net button disable
<p>html code:</p> <pre><code>&lt;asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" /&gt; </code></pre> <p>Jquery Code:</p> <pre><code>$('[id$=btnTest]').click(function(){ $('[id$=btnTest]').attr('disabled', 'true'); }); </code></pre> <p>CodeBehind:</p> <pre><code>protected void btnTest_Click(object sender, EventArgs e) { //here not come. } </code></pre> <p>Code Behind btnTest event not work ?</p>
asp.net javascript jquery
[9, 3, 5]
3,640,085
3,640,086
pdf download functionality asp.net
<p>I am making a web site in asp.net with c sharp. I need to place a download file functionality(pdf, doc, xls) on one of my web page.</p> <p>How can I do that?</p>
c# asp.net
[0, 9]
1,774,620
1,774,621
Can we redirect to totally new page in httpurlmodule without using response.redirect or server.transfer
<p>I tried some work using http handler and found that we can not execute .asp files and took the httpmodule route.</p> <p>I have http module on the virtual directory which is a dotnet application.Once the request comes to dotnet http module , i want to redirect to asp file which is the root folder based on some logic in .net.</p> <p>I don't want to use response.redirect here, that is the main thing</p> <p>root/dotnetapplication.</p> <p>dotnet application has the following code.</p> <pre><code> application.Context.RewritePath("http://localwww.test.com/main.asp", false); </code></pre> <p>This is throwing the following exception</p> <pre><code>' http://locwww.test.com/main.asp' is not a valid virtual path. [HttpException (0x80004005): 'http://locwww.allposters.com/main.asp' is not a valid virtual path.] System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8855691 System.Web.HttpContext.RewritePath(String path, Boolean rebaseClientPath) +116 ADC.Web.Code.ApcUrlRewriteModule.UrlRewriteModule_BeginRequest(Object sender, EventArgs e) System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75 </code></pre> <p>Really appreciate your help.</p>
c# asp.net
[0, 9]
982,225
982,226
How to Compare Time in Java?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4927856/how-to-calculate-time-difference-in-java">How to calculate time difference in java?</a> </p> </blockquote> <p>I have two Strings "10:00:00" and "14:00:00". I have converted them to Date Format. Now i want two compare the both time.Can anyone suggest me what to do....</p>
java android
[1, 4]
70,090
70,091
Select2 custom read custom data attributes
<p>I am using the jquery select2 plugin for suggestive form fields. I am trying to access the data stored in my original hidden input fields data attribute. I need the data from these attributes so I can send them to a php script via Ajax. Does anyone have any suggestions on how this would be done? I cannot seem to find a answer on google or the official website.</p> <p>Thanks </p>
javascript jquery
[3, 5]
665,733
665,734
Creating activity to open YouTube and search automaticlly
<p>so I wasn't sure how to put this in the title, but what I have been trying to do is making my application open, lets say YouTube and then enter a search automaticlly (given previously). Here is my code which makes it easier to explain.</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the URL and search from the intent Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); // Open browser and auto search in searchbar if (!message.startsWith("http://") &amp;&amp; !message.startsWith("https://")) message = "http://" + message + ".com"; Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(message)); startActivity(browserIntent); } </code></pre> <p>So What I wanted to do was open up YouTube (this works fine), however I want to use the next words put into the search (split with a space) to be typed into the searchbar in YouTube.</p> <ol> <li><p>What you enter: Youtube funny videos</p></li> <li><p>Delivers message into the second activity: opens the URL "Youtube" (works fine so far)</p></li> <li><p>The activity recognizes the other parts of message after "Youtube" (split with space) and puts these into the search bar in YouTube.</p></li> </ol> <p>How can I do this?</p>
java android
[1, 4]
175,544
175,545
jQuery: dealing with multiple keypress listeners?
<p>I have a page that needs to do two things at once:</p> <ul> <li>Listen all the time for input from a scanner (which presents as keyboard input), and notice when a string is entered in the right format.</li> <li>Listen for a user focussing on a particular dropdown, and typing a set of initials - when a set of initials is entered that matches the <code>title</code> attribute of an item in the dropdown, focus on that dropdown.</li> </ul> <p>I can do either of these things separately, but not together. Code:</p> <pre><code>// Listen for input when userlist is in focus. $("#userlist").keypress(function (e) { initials += String.fromCharCode(e.which).toUpperCase(); $(this).find("option").filter(function () { return $(this).attr("title").toUpperCase().indexOf(initials) === 0; }).first().attr("selected", true); // uses timer to check for time between keypresses return false; }); // Listen for scanner input all the time. var input = '', r1 = /^~{1}$/, r2 = /^~{1}\d+$/, r3 = /^~{1}\d+\.$/, r4 = /^~{1}\d+\.\d+$/, r5 = /^~{1}\d+\.\d+~{1}$/; $(window).keypress(function(e) { // when input matches final regex, do something } </code></pre> <p>If I have both, then while the user is focussed on the dropdown, the page does not 'hear' the input from the scanner.</p> <p>How can I combine the two together to make sure the page reacts to scanner input, even while the user is focussed on the dropdown?</p>
javascript jquery
[3, 5]
3,603,411
3,603,412
Append li after current li
<p>I would like to append a li in a ul after my current selection.</p> <p>I bound a click event to the li, and when it's clicked, another li has to be added after the current.</p> <p>What I have now is:</p> <pre><code>$(this).parent().append('&lt;li&gt;test&lt;/li&gt;'); </code></pre> <p>But this just adds the li to the ul, not after the current li.</p> <p>Is there a way to do that?</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
2,419,558
2,419,559
Javascript - Getting data from XML for later use... put in array or object?
<p>I am extracting a bunch of data from an XML file using jQuery. I need to use the data to fill in image paths, names, etc.</p> <p>What is the best way to gather all of this data for use? For instance, I get everything like so:</p> <pre><code> $(document).ready(function() { $.ajax({ type: "GET", url: "stuff.xml", dataType: "xml", success: function(xml) { $(xml).find('speaker').each(function(){ var img_path = $(this).find('speaker_image').text(); var name_text = $(this).find('speaker_name').text(); // should I build an array or object here? }); } }); }); </code></pre> <p>Should I stick everything into an array in the success method? Maybe in an object? What I will do is take the collected data and use it to build a list of names and images. There will be quite a few elements in this and it will look something like (with <code>img_path</code> being used in the image url and <code>name_text</code> being used for the label:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;img src="images/bobsmith.jpg" /&gt;&lt;br /&gt;&lt;lable&gt;Bob S. Smith&lt;/label&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="images/crystalforehead.jpg" /&gt;&lt;br /&gt;&lt;lable&gt;Crystal X. Forehead&lt;/label&gt;&lt;/li&gt; ... &lt;/ul&gt; </code></pre> <p>What is the best way to handle the collected data so I can go through and build the html I need using it?</p>
javascript jquery
[3, 5]
1,023,086
1,023,087
android getRuntime().exec() with cat command
<p>I am using the process class to run this command</p> <pre><code>/sdcard/file1.mpg /sdcar/file2.mpg &gt; /sdcard/out.mpg </code></pre> <p>Here is how I am trying to do it:</p> <pre><code>Process processx = Runtime.getRuntime().exec(new String[] {"cat","/sdcard/file1.mpg /sdcard/file2.mpg &gt; /sdcard/out.mpg" }); BufferedReader in = new BufferedReader(new InputStreamReader(processx.getInputStream())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } // Waits for the command to finish. processx.waitFor(); </code></pre> <p>The command works from terminal but not when I try the above, can anyone see why?</p>
java android
[1, 4]
5,289,192
5,289,193
Detect a click on video
<p>I embeded a video from <code>youtube</code> . My code is :</p> <pre><code> &lt;div id="video"&gt;&lt;iframe width="100%" height="100%" src="http://www.youtube.com/embed/Vv2RRaC9dC8?wmode=transparent" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt; </code></pre> <p>There is an <code>onclick</code> event attached with <code>div#video</code>. But i can`t able to fire it because of this video. When i click over it, the video starts playing.How can i detect the click event?</p>
javascript jquery
[3, 5]
3,587,394
3,587,395
Wha is the meaning of this js.js?version=1364903356 in a webpage?
<p>Every time i refresh a site and view its page source, the javascript src i.e <code>js.js?version=1364903356</code>; the version number always changes.</p> <p>My question is: What is the meaning of this number; and if i put <code>js.js</code> in every page, the site is not working. </p>
javascript jquery
[3, 5]
3,633,864
3,633,865
Learning java as a C++ programmer
<p>Long story short:</p> <p>I'm looking for either a book or documentation/reference explaining basic java syntax and functionality from a C++ perspective. I don't need to know about design patterns, encapsulation, keywords such as 'static', etc.</p> <p>What I do want is to know what packages are, know about the import/extends keywords, mostly syntax related stuff (ex: inheriting), basic structuring of a java program, etc.</p> <p>If it matters at all: I'm planning getting into Android development - but have no Java background.</p>
java c++ android
[1, 6, 4]
14,016
14,017
scrollTop doesn't work
<p>My code - </p> <pre><code>($("div[id$='fixedDataDiv']")[0]).scrollTop(0); </code></pre> <p>This is called when I change tabs in IE8.</p> <p>The error message I get is - </p> <pre><code>Microsoft JScript runtime error: Object doesn't support this action </code></pre> <p>Is my syntax incorrect?</p>
javascript jquery
[3, 5]
2,883,433
2,883,434
Removing everything before dash from each H4 tag
<p>this sounds really simple and stupid..but I'm having a hard time removing the content before each dash from each H4 element on my page....i've been trying to do this with Jquery/Javascript.. Any insight? </p> <p>Here's a sample of my HTML code:</p> <pre><code>&lt;h4&gt;California-Medical Research&lt;/h4&gt; &lt;h4&gt;Florida-Industrial&lt;/h4&gt; &lt;h4&gt;Atlanta-Computers&lt;/h4&gt; </code></pre> <p>I'm trying to have my code cycle through each occurance of <code>&lt;h4&gt;</code> and remove everything before the dash...so the desired result will look like this:</p> <p>Medical Research<br /> Industrial<br /> Computers</p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,065,639
1,065,640
how can i do this codes work only in a specific div tags
<pre><code>$(document).ready(function() { $(":input").focusout(function () { var a= $(this).closest("tr").attr('id'); var b= $(this).closest("td").attr('id'); var c = $(this).attr("value"); $.post("database.php", { trAdress:a , tdAdress:b, value:c}); }); }); </code></pre> <p>could this code work only between <code>&lt;div i="bab"&gt; &lt;/div&gt;</code> tags... can you help me!</p>
javascript jquery
[3, 5]
3,463,138
3,463,139
How to format this date + time got from JavaScript? (+jsFiddle)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1536516/how-to-display-a-date-as-2-25-2007-format-in-javascript-if-i-have-date-object">how to display a date as 2/25/2007 format in javascript, if i have date object</a> </p> </blockquote> <p>How can I format the following date+time to this one <strong>2012-07-24 17:00</strong> ?</p> <p><a href="http://jsfiddle.net/28Tgz/1/" rel="nofollow">http://jsfiddle.net/28Tgz/1/</a></p> <p>I am trying to make use of </p> <pre><code>formatDate('yy-mm-dd HH:ii', now)); </code></pre> <p>without luck.</p> <pre><code>jQuery(document).ready(function() { var foo = jQuery('#foo'); function updateTime() { var now = new Date(); foo.val(now.toString()); } updateTime(); setInterval(updateTime, 5000); // 5 * 1000 miliseconds }); </code></pre> <p>this return me <strong>Wed Jul 25 2012 17:14:02 GMT+0300 (GTB Daylight Time)</strong></p>
javascript jquery
[3, 5]
2,018,027
2,018,028
Jquery change .text(something) then bring back
<p>If i have the following code:</p> <p>html</p> <pre><code>&lt;div class ="lg"&gt; &lt;img src="/images/images.gif"&gt; &lt;/div&gt; </code></pre> <p>javascript</p> <pre><code>$('.lg').text("Correct"); </code></pre> <p>The jquery will remove image and replace it with "Correct". This is only intended to be a delay before I need the image to reappear. so it will flash correct then bring back the original image.</p>
javascript jquery
[3, 5]
3,933,600
3,933,601
Calling a .php file in the onclick() event
<p>I want to call a .php file from the OnClick event.</p> <pre><code>&lt;input id="Edit" name="Edit" value="Edit Record" type="button" onclick="---call to php file----;" /&gt; </code></pre> <p>The code is show above. I want to call a .php file through Javascript and pass a cookie value in the query string.</p>
php javascript
[2, 3]
2,749,318
2,749,319
Can you get the user’s scroll position every time they scroll with JavaScript/jQuery?
<p>Is it possible to grab the current position of the users scroll bar when they scroll?</p> <p>Say, if they were scrolled to the very top it would be 0, if they scrolled down it'd change.</p> <p>Can I assign a variable to contain the current scroll position whenever I access it, or is there a function in JavaScript for this already?</p>
javascript jquery
[3, 5]
1,427,900
1,427,901
Javascript object retrival
<p>Using Javascript objects, when I execute the code below, the second alert doesn't work. It returns <code>undefined</code>.</p> <pre><code> &lt;script&gt; var operations = {"Create" : "POST", "Read" : "GET", "Delete" : "DELETE" }; //result POST alert(operations.Create); var method="Create"; alert(operations.method); &lt;script&gt; </code></pre> <p>How do I get it to return the value of the "Create" property I created at the beginning of the script?</p>
javascript jquery
[3, 5]
3,039,880
3,039,881
Jquery resizeable issue
<p>I am trying to use the alsoResize option. It works when I write this: </p> <pre><code>$(obj).resizable({ minHeight: 150, minWidth: 280, alsoResize: '.tab_content'}); </code></pre> <p>but the problem is that it's resizing all 'tab_content' elements in the page. I want it to be relative to 'obj' which also contains a 'tab_content', I tried: <code>alsoResize: $('.tab_content',obj)</code> but it didn't work, any suggestions, Thanks</p>
javascript jquery
[3, 5]
5,884,174
5,884,175
Add papameters to AJAX response and then apply actions based on return parameter
<p>I have a page (<code>page1</code>)that calls another page (<code>page2</code>) via AJAX. How do I include parameters to page2 response and parse them in <code>success : function(data)</code>? is there any way to add parameters to http response object and then access those parameters?</p> <p>Reason:</p> <p>page2 generates some HTML. It could be <code>good</code> or <code>bad</code> html message. If it is a good message, I need to add parameters (hidden) and then add that good message to <code>Success div</code>. if message is an error, I need to add this message to 'Error div'.</p> <p>I can do it <code>bad way</code>: In Page2 I can add <code>hidden</code> element; then in page1 I can create some temp hidden div and add response to that div. Then access hidden element in hidden div and get it's value. Then get message from that div and paste it to designated div. But this seems to be too unprofessional. </p> <p><strong>PAGE1:</strong></p> <pre><code> function registeruser(){ jQuery(function($) { $.ajax( { url : "page2.php", type : "POST", data: { registerFname : document.getElementById('registerFname').value, registerLname : document.getElementById('registerLname').value, registerLEmail : document.getElementById('registerEmail').value, registerPassword : document.getElementById('registerPassword').value, ts : (new Date().getTime()) }, success : function(data) { //need to apply logic here based on the return parameters //if (SOME_PARAMETER === 'success'){ // document.getElementById('registerPresentation').innerHTML = data; //} //else { // document.getElementById('registerPresentationErrorDIV').innerHTML = data; //} //need to get rid of item below document.getElementById('registerPresentation').innerHTML = data; } }); }); } </code></pre>
php javascript jquery
[2, 3, 5]
1,470,225
1,470,226
Development tools
<p>What programming language are windows applications begin built with these days? from what I can see when looking at job descriptions, Java and C# are mostly used for web applications. I found a couple of companies looking for a c# winforms developer but the job also includes some web development as well. I think that is right since.net is web orientated.</p> <p>Any comments please </p>
c# java
[0, 1]
351,507
351,508
how to determine the exact element type/code segment, in real world scenarios of radio buttons
<p>I have a scenario where I want to parse through all the values displayed on screen for a radio button.</p> <p>Now the radio button can be any one of the following, in coding style--</p> <pre><code>&lt;input type="radio" name="lunch" value="pasta1" /&gt;&lt;span&gt;Pasta&lt;/span&gt; </code></pre> <p>OR</p> <pre><code>&lt;input type="radio" name="lunch" value="pasta1" /&gt;&lt;p&gt;Pasta&lt;/p&gt; </code></pre> <p>OR </p> <pre><code>&lt;input type="radio" name="lunch" value="pasta1" /&gt;&lt;ul&gt;Pasta&lt;/ul&gt; </code></pre> <p>OR <code>&lt;input type="radio" name="lunch" value="pasta1" /&gt;Pasta</code></p> <p>Basically I have to deal with any type of real world HTML... While I can get the factual value (="pasta1" for this example) using val(), I want to obtain the text "Pasta" also as shown above, irrespective of whatever tags may be used, in any combination... Is it possible to get such data? At the very least, is it possible to get (for our examples above) the element pointing to <code>&lt;p&gt;Pasta&lt;/p&gt;</code> or <code>&lt;ul&gt;Pasta&lt;/ul&gt;</code> and so on? Then I can try and extract the exact text from that element/node...I can use pure javascript or jquery...</p>
javascript jquery
[3, 5]
4,970,206
4,970,207
textview.setText(Html.fromhtml()) not working
<p>I'm trying to put some html code into a <code>TextView</code>. I'm using :</p> <pre><code>super.onCreate(savedInstanceState); try{ setContentView(R.layout.activity_main); TextView view = (TextView) findViewById(R.id.textView1); view.setText(Html.fromhtml(readfile())); }catch(IOException e){ System.out.println(e.printStackTrace) } public String readFile() throws IOException { FileInputStream stream = new FileInputStream(new File("c:\\test3.html")); try { FileChannel fc = stream.getChannel(); MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); String a = "&lt;html&gt;&lt;body&gt;Isso eh html&lt;/body&gt;&lt;/html&gt;"; return a; //return Charset.defaultCharset().decode(bb).toString(); } finally { stream.close(); } } </code></pre> <p>The <code>readFile()</code> method works, I already tested it.</p> <p>If I set : <code>textView.setText("&lt;html&gt;&lt;body&gt; test &lt;/body&gt;&lt;/html&gt;")</code>, it works perfectly, </p> <p>but If I set <code>textView.setText(anyStringMethod()));</code> it doesn't work.</p> <p>Why would this be?</p>
java android
[1, 4]
3,518,961
3,518,962
Android Java Object/Class Syntax Use In This Example
<p>I am new to Android, but I know <code>Javascript</code> so I have some familiarity in Object Oriented programming. </p> <p>In this line:</p> <pre><code>Resources myResources = getResources(); AnimationDrawable androidAnimation; androidAnimation = (AnimationDrawable)myResources.getDrawable(R.drawable.frame_by_frame); </code></pre> <ol> <li>is androidAnimation a new object initialized by the AnimationDrawable class?</li> <li>In (AnimationDrawable)myResources what is this syntax where the class is in parentheses proceeding a object?</li> </ol>
java android
[1, 4]
5,583,955
5,583,956
set the width dynamically of element which create dynamically
<p>I create one div#sresult_container dynamically and append no of div to that div. and all appended div have different text. so i can retrieve the width of div#sresult_container but i try to that increase the width of div#sresult_container 10px before it display on the view port. how can i do this plese help me? my code is below:</p> <pre><code>var $sresult_container = $('&lt;div id="sresult_container"&gt;&lt;/div&gt;'); </code></pre> <p>AND after that i append the some divs as children of div#sresult_container.</p> <p>and append to body.</p> <pre><code>$('body').append($sresult_container); var Setwidth = $('#sresult_container').outerWidth() + 10; $('#sresult_container').css('width',Setwidth + 'px'); </code></pre> <p>so here first load original width after that load the modified width. so how can do directly load the modified width. </p>
javascript jquery
[3, 5]
3,748,002
3,748,003
how to capture image from Camera in Android?
<p>I have made an application to capture photos from the camera.</p> <p>I have created two Activities: In Activity1 there is one Button which starts the camera wehen it is clicked. When the image is captured, it is passed to Activity2.</p> <p>However, when I run the application and start the Activity1 (with the one Button) and I click on the button to start the camera it displays a pop up window showing the message "Unfortunately, camera has stopped". There are no errors in the log-cat or on the console.</p> <p>Can anyone help me. Please. Thanks a lot.</p>
java android
[1, 4]
3,332,513
3,332,514
Java or Python to use for my application?
<p>I can't decide which one to use since I have limited experience in Java but none in Python.</p> <p>I'm going to create an application that involves creating a GUI. Without going into the details of the application, I will say, the application will be running on Windows, it will be doing a bunch of calculations and displaying a graph.</p> <p>It will have daily/weekly inputs via the GUI and will display the results and additional information in a graph form and will also display some meaningful numbers after crunching the data. I currently have this in excel, so I'm hoping for the graphing features similar to excel. Would java or python be my choice?</p>
java python
[1, 7]
1,712,021
1,712,022
what would be a good approach for multithreading recursive traversal over directory tree?
<p>I'm thinking of a good approach for multithreaded recursive traversal over a directory tree.</p> <p>What I'm doing right now is taking a the folders under a root directory and running a recursive traversal on each folder in a separate thread.</p> <p>This improved the performance quite a bit, but I still have a "long tail" problem - large folders take a lot of time.</p> <p>What approach would be better than this?</p> <p>I'm using python and java for this.</p> <p>thanks.</p> <p>EDIT: I don't need to load the files into memrory. just handle the file paths and maybe take some metadata info like file size.</p>
java python
[1, 7]
3,275,823
3,275,824
Jquery textinput change function is not working
<p>I just get the parameters from PHP GET method and use them using jQuery. There is no output when run the page.</p> <pre><code>&lt;?php if (isset($_GET['url'])){ $url = $_GET['url']; $url = explode(" " , $url); echo end($url); exit; } ?&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $('input[type=text]').change(function (){ if ($(this).val() !== ''){ var url = $(this).val(): $.post('grab.php?url='+url+'', function (data){ window.open(data, 'Download', 'width=10,height=10'); $(this).html(''); }); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" style="width:100%;height:20px;"/&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I'm new to designs and hope mistake is there.</p>
php javascript jquery
[2, 3, 5]
3,236,849
3,236,850
Can you use Routes and Query String Values Together?
<p>Is it possible to use routing and query strings together?</p> <p>An example would be the following as a route in my <em>Global.asax</em> file:</p> <pre><code> void RegisterRoutes(System.Web.Routing.RouteCollection routes) { routes.MapPageRoute("My Route Name", "users/{UserName}", "~/users/UserInfo.aspx"); } </code></pre> <p>Could I somehow use <a href="http://www.mywebsite.com/users/usernamehere?info=bla" rel="nofollow">http://www.mywebsite.com/users/usernamehere?info=bla</a> and pass info=bla to the page? I would rather not try to encode this in the route schema.</p>
c# asp.net
[0, 9]
448,094
448,095
How to use an array value as field in Java? a1.section[2] = 1;
<p>New to Java, and can't figure out what I hope to be a simple thing.</p> <p>I keep "sections" in an array:</p> <pre><code>//Section.java public static final String[] TOP = { "Top News", "http://www.mysite.com/RSS/myfeed.csp", "top" }; </code></pre> <p>I'd like to do something like this:</p> <pre><code>Article a1 = new Article(); a1.["s_" + section[2]] = 1; //should resolve to a1.s_top = 1; </code></pre> <p>But it won't let me, as it doesn't know what "section" is. (I'm sure seasoned Java people will cringe at this attempt... but my searches have come up empty on how to do this)</p> <p><strong>Clarification:</strong></p> <p>My article mysqlite table has fields for the "section" of the article:</p> <pre><code>s_top s_sports ...etc </code></pre> <p>When doing my import from an XML file, I'd like to set that field to a <code>1</code> if it's in that category. I could have switch statement:</p> <pre><code>//whatever the Java version of this is switch(section[2]) { case "top": a1.s_top = 1; break; case "sports": a1.s_sports = 1; break; //... } </code></pre> <p>But I thought it'd be a lot easier to just write it as a single line:</p> <pre><code>a1["s_"+section[2]] = 1; </code></pre>
java android
[1, 4]
3,018,518
3,018,519
Convert input string to a clean, readable and browser acceptable route data
<p>Scenario: </p> <p>There is a title called "AJAX, JSON &amp; HTML5! The future of web?"<br> Would like to convert this into this "ajax-json-html5-the-future-of-web"</p> <p>Basically what I need is a function that strips out all the non alphabets and then replace them with a single hyphen and lowercase that.</p> <p>Problem:</p> <p>With some effort I could do that with <code>String.Replace</code> or <code>String.CharAt</code> but I think thats all too messy. Am I correct? I believe Regex is the way to go. As my Regex is very rusty I am unable to get something that shows the desired output.:)<br> Disclaimer: This is basically a Give me the Codez. But I have pretty much covered my options I guess.</p>
c# asp.net
[0, 9]
948,320
948,321
disable textbox by jquery
<p>I'm trying to disable textbox using jquery:</p> <pre><code>$('#&lt;%=txtFrom.ClientID %&gt;').attr('disabled', true); </code></pre> <p>It looks as disabled: <img src="http://i.stack.imgur.com/oSvIX.png" alt="image">, but actually it's not, I can write there. Why?</p> <p><strong>UPDATE:</strong> Fixed by adding input in the code:</p> <pre><code>$('#&lt;%=txtFrom.ClientID %&gt; input').attr('disabled', true); </code></pre>
jquery asp.net
[5, 9]
4,197,396
4,197,397
Why isn't drop down changing based on other value?
<p>I'm not sure why this isn't working. Anyone care to take a stab?</p> <p>I have a form with the below. When the user selects the "disabled" option in #frmcomments, I'd like #frmstatus to change to the option value of private. </p> <pre><code>&lt;label for="type"&gt;Comments:&lt;/label&gt; &lt;select class="sort-select" id="frmcomments" name="frmcomments"&gt; &lt;option value="enabled"&gt;Allow Comments&lt;/option&gt; &lt;option value="disabled"&gt;No Comments&lt;/option&gt; &lt;/select&gt; &lt;label for="type"&gt;Status:&lt;/label&gt; &lt;select class="sort-select" id="frmstatus" name="frmstatus"&gt; &lt;option value="public"&gt;Anyone can see&lt;/option&gt; &lt;option value="private"&gt;Only I can see&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I'm using the following jquery, but it's failing?</p> <pre><code>$('#frmcomments').change(function() { var thistype = $(this).find(":selected").val(); if(thistype=="disabled") { $("#frmstatus").val("private"); } return false; }); </code></pre>
javascript jquery
[3, 5]
3,857,991
3,857,992
Android: IF statement with radio buttons not working
<p>I am trying to make a quiz app, so there are 5 radio buttons with possible answers, and only 1 is correct. Then there's a submit button, which has an onClick="clickMethod" to process the submission. </p> <p>My clickMethod looks like this:</p> <pre><code>public void clickMethod(View v){ RadioGroup group1 = (RadioGroup) findViewById(R.id.radioGroup1); int selected = group1.getCheckedRadioButtonId(); RadioButton button1 = (RadioButton) findViewById(selected); if (button1.getText()=="Right Answer") Toast.makeText(this,"Correct!",Toast.LENGTH_SHORT).show(); else Toast.makeText(this,"Incorrect.",Toast.LENGTH_SHORT).show(); } </code></pre> <p>However I can't get the IF statement to work no matter what. If I try to make the toast with "button1.getText()" as parameter it does print the "Right Answer" string, but for some reason inside the IF statement it's not working, and the ELSE is always executed even when I check the right answer.</p> <p>Does anyone know what might be happening or a better way to do this?</p>
java android
[1, 4]
4,383,893
4,383,894
Login control with jqueryui
<p>I'm using the default login control for asp.net, I would like to replace that with a button that will bring up the jquery dialog and display the login panel within that dialog box.</p>
asp.net jquery
[9, 5]
3,220,166
3,220,167
Check anchor tags color
<p>If I have anchor tags as follows:</p> <pre><code>&lt;a href="link1.html" class="none_standard_links"&gt;link one&lt;/a&gt;&lt;br /&gt; &lt;a href="link2.html" class="none_standard_links"&gt;link two&lt;/a&gt;&lt;br /&gt; &lt;a href="link3.html" class="none_standard_links"&gt;link three&lt;/a&gt;&lt;br /&gt; &lt;a href="link4.html" class="none_standard_links"&gt;link four&lt;/a&gt;&lt;br /&gt; &lt;a href="link5.html" class="none_standard_links"&gt;link five&lt;/a&gt;&lt;br /&gt; &lt;a href="link6.html" class="none_standard_links"&gt;link six&lt;/a&gt;&lt;br /&gt; &lt;a href="link7.html" class="none_standard_links"&gt;link seven&lt;/a&gt;&lt;br /&gt; &lt;a href="link8.html" class="none_standard_links"&gt;link eight&lt;/a&gt;&lt;br /&gt; &lt;a href="link9.html" class="none_standard_links"&gt;link nine&lt;/a&gt;&lt;br /&gt; &lt;a href="link10.html" class="none_standard_links"&gt;link ten&lt;/a&gt;&lt;br /&gt; </code></pre> <p>How do I loop through the entire set and alert the url of the link if it has a style sheet color of red?</p> <p>I have tried making a start with the script, but don't know how to finish off:</p> <pre><code>$(document).ready(function(){ $('#button1').click(function() { $(".none_standard_links").each(function (i) { if (this.style.color = "red") { alert("not sure what to do here?"); } }); }); }); </code></pre> <p>If the approach I am attempting is not the best way to go about doing this, please feel free to make changes.</p>
javascript jquery
[3, 5]
5,236,118
5,236,119
what tools do you use for writing jquery code and debugging your code?
<p>what tools do you use for writing jquery code and testing/debugging your code?</p>
javascript jquery
[3, 5]
2,479,460
2,479,461
How not to abort http response c#
<p>I need to run several methods after sending file to a user for a download. What happens is that after I send a file to a user, response is aborted and I can no longer do anything after <code>response.end()</code>.</p> <p>for example, this is my sample code:</p> <pre><code> Response.Clear(); Response.AddHeader("content-disposition", "attachment; filename=test.pdf"); Response.ContentType = "application/pdf"; byte[] a = System.Text.Encoding.UTF8.GetBytes("test"); Response.BinaryWrite(a); Response.End(); StartNextMethod(); Response.Redirect(URL); </code></pre> <p>So, in this example StartNextMethod and Response.Redirect are not executing. </p> <p>What I tried is I created a separate handler(ashx) with the following code:</p> <pre><code>public void ProcessRequest(HttpContext context) { context.Response.Clear(); context.Response.AddHeader("content-disposition", "attachment; filename=test.pdf"); context.Response.ContentType = "application/pdf"; byte[] a = System.Text.Encoding.UTF8.GetBytes("test"); context.Response.BinaryWrite(a); context.Response.End(); } </code></pre> <p>and call it like this:</p> <pre><code>Download d = new Download(); d.ProcessRequest(HttpContext.Current); StartNextMethod(); Response.Redirect(URL); </code></pre> <p>but the same error happen. I've tryied to replace Response.End with CompleteRequest but it doesn't help.</p> <p>I guess the problem is that I'm using HttpContext.Current but should use a separate response stream. Is that correct? how do I do that in a separate method generically (Assume that I want my handler to accept byte array of data and content type and be downloadable from a separate response. I really do not want to use a separate page for a response.</p> <p><strong>UPDATE</strong><br> I still didn't find a good solution. I'd like to do some actions after user has downloaded a file, but without using a separate page for a response\request thing.</p>
c# asp.net
[0, 9]
1,792,742
1,792,743
Send a xml file with POST and receive in php
<p>I'm working on an application using Android SO and Java. I would like to send an xml file as POST to a php server, that inserts the information from the xml into a database.</p> <p>how can i do that? </p> <p>regards :D</p>
java php android
[1, 2, 4]
4,859,357
4,859,358
Android Development using c#
<p>Is there a free way to develop apps for my Galaxy Tab (Androind 2.2) using c#? Or are there only paid solutions?</p>
c# android
[0, 4]
2,612,226
2,612,227
Conflict occurs while adding a jquery for sticky div in joomla
<p>I need a header that sticks to the top while scrolling down the page. Am using the following jquery function </p> <pre><code>&lt;script type="text/javascript"&gt; google.load("jquery", "1"); function sticky_relocate() { var window_top = $(window).scrollTop(); var div_top = $('#sticky-anchor').offset().top; if (window_top &gt; div_top) $('#sticky').addClass('stick') else $('#sticky').removeClass('stick'); } // If you have jQuery directly, use the following line, instead // $(function() { // If you have jQuery via Google AJAX Libraries google.setOnLoadCallback(function() { $(window).scroll(sticky_relocate); sticky_relocate(); }); &lt;/script&gt; </code></pre> <p>but the sliders already present in the page not functioning! Please help me to solve this issue. I have added <code>$.noConflict();</code>above the function the slider works properly and sticky div is not working!</p> <p>And have made following changes to the code // Start closure to prevent namespace conflicts</p> <pre><code>;(function($) { // Whatever code you want that relies on $ as the jQuery object // End closure })(jQuery); </code></pre> <p>both the slider and sticky div not working!</p>
php javascript jquery
[2, 3, 5]
1,894,117
1,894,118
Whats the codeURI value for ¶?
<p>Could someone please tell me what the CodeURI value of a line break is? (¶)</p> <p><strong>If you look below at the comment test you will see what i'm trying to achieve.</strong></p> <pre><code>public static string unescapeForEncodeUriCompatability(string str) { return str.Replace("%21", "!").Replace("%7e", "~") .Replace("%27", "'").Replace("%28", "(").Replace("%29", ")") .Replace("%3b", ";").Replace("%2f", "/").Replace("%3f", "?") .Replace("%3a", ":").Replace("%40", "@").Replace("%26", "&amp;") .Replace("%3d", "=").Replace("%2b", "+").Replace("%24", "$") .Replace("%2c", ",").Replace("%23", "#"); //test .Replace("¶"," ") } </code></pre>
c# javascript
[0, 3]
4,402,918
4,402,919
Unable to get value of the property 'length': object is null or undefined - Javascript Error
<p>In my user control, there is a GridView. When I check checkbox in the header of the GridView, I want to select all checkboxs. <strong>My user control can be use more than once in a page.</strong> So I try like this. </p> <p>My GridView</p> <pre><code>&lt;asp:GridView ID="GridView" runat="server"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;HeaderTemplate&gt; &lt;asp:CheckBox ID="chkHeader" runat="server" /&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox ID="chkEach" runat="server" /&gt; &lt;/ItemTemplate&gt; . . </code></pre> <p>This is my C# codes</p> <pre><code>CheckBox chkAll = gvAttachment.Controls[0].Controls[0].FindControl("chkHeader") as CheckBox; if (chkAll != null) { chkAll.Attributes.Add("onclick", "SelectAllChkBox('" + chkAll.ClientID + "','" + GridView.ClientID + "');"); } </code></pre> <p>This is my javascript</p> <pre><code>function SelectAllChkBox(value , grid) { for (var i = 1; i &lt; grid.all.length; i++) { grid.all[i].checked = value.checked; } } </code></pre> <p>But I got this error.</p> <pre><code>Unable to get value of the property 'length': object is null or undefined </code></pre> <p>What is wrong with my Code ?</p>
c# javascript
[0, 3]
5,101,803
5,101,804
How to add caption and sum a column?
<p>i want give caption DATE,PRICE1, PRICE2 and i also show sum of price1, price2 in the footer. how can i do this? </p> <pre><code>&lt;asp:Repeater ID="rptCari" runat="server"&gt; &lt;ItemTemplate&gt; &lt;div&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label runat="server" ID="lblBelgeTarihi"&gt;&lt;%#(Eval("DATE","{0:d}"))%&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/td&gt; &lt;td&gt; &lt;asp:Label runat="server" ID="lblAlacakTutar"&gt;&lt;%#ValidationHelper.FormatPrice(ValidationHelper.GetDecimal(Eval("PRICE1"), 0))%&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/td&gt; &lt;td&gt; &lt;asp:Label runat="server" ID="lblBorcTutar"&gt;&lt;%#ValidationHelper.FormatPrice(ValidationHelper.GetDecimal(Eval("PRICE2"), 0))%&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre>
c# asp.net
[0, 9]
2,116,619
2,116,620
clickable grid view row asp.net
<p>i want asp.net gridview with its rows clickable.</p> <p>i want to call a function when that row is clicked based on row index.</p> <p>i tried to use RowDataBound event but it did not worked or me</p> <p>i used the following code</p> <pre><code>protected void PeopleGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';"; e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';"; e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.PeopleGridView, "Select$" + e.Row.RowIndex); } } </code></pre> <p>where am i going wrong?</p> <p>i dont want to redirect to any other page. i want to fill the values in text box on the same page</p>
c# asp.net
[0, 9]
1,191,718
1,191,719
Android cocos2d
<p>i am new to android cocos2d,i have created a game using player1 and player2 CCSprites n later in order to move player1 and player2 to sprite positions,its become complicated.please provide me required docment or solution.</p>
java android
[1, 4]
982,520
982,521
JQuery vars outside JS file
<p>In a header file i have which is populated by PHP: </p> <pre><code>&lt;script type="text/javascript"&gt; var packages = {}; packages[1] = {title:'Pack 1',price:7.50,setup:0.00,template:0}; packages[2] = {title:'Pack 2',price:12.00,setup:0.00,template:0}; packages[3] = {title:'Pack 3',price:25.00,setup:75.00,template:1}; var templates = {}; templates[4] = {title:'Template 1'}; templates[5] = {title:'Template 2'}; templates[6] = {title:'Template 3'}; &lt;/script&gt; &lt;script type="text/javascript" src="/include/jscript/form.inc.js"&gt;&lt;/script&gt; </code></pre> <p>Now in the form.inc.js i want the content of the vars packages. So like:</p> <pre><code>function updatePrices(){ var package_price = 0; var setup_price = 0; var package = $_2('#package_select').val(); package_price += packages[package].price; setup_price += packages[package].setup; $_2(".package_price").html("&amp;pound;"+package_price); $_2(".setup_price").html("&amp;pound;"+setup_price); $_2(".total_price").html("&amp;pound;"+(package_price+setup_price)); } </code></pre> <p>You see here: packages[package].price that packages[1].price and should show 7.50, but i dont think the var packages is being passed though!</p> <p>Any help would be awesome thanks</p>
php jquery
[2, 5]
1,306,891
1,306,892
How do I get a class reference from a String in Java?
<p>If I need to return a Class instanced based on a String (e.g., creating logic from JSON), how should that be written?</p> <p>My initial thought was a switch, but in the Android framework's version of Java, it looks like switch statements don't allow Strings.</p> <p>Next thought was a HashMap:</p> <pre><code>private HashMap&lt;String, Class&gt; classMap = new HashMap&lt;String, Class&gt;(); classMap.put("someClass", SomeClass.class)? // ... etc String someString = jsonObject.getString("someProperty"); Class classRef = classMap.get(someString); SomeSuperClass classInstance = new classRef(); </code></pre> <p>This doesn't work. I'd rather not <code>if/else</code> down a lengthy list of possibilities.</p>
java android
[1, 4]
2,807,271
2,807,272
Is programming for Android completely different fron programming for iPhone?
<p>I have made apps for the iPhone, but want to also code for the Android but want to know if it is first worth my time, second worth my having to learn another language, and third worth the effort in the sense that am I going to make a profit from this. Also if in any way Android code is similar, then will it be hard to bring the iPhone (Xcode) files, or copy and paste my iPhone code into the Android code.</p>
iphone android
[8, 4]
2,487,509
2,487,510
Dynamically create elements from unrendered code using jquery and/or php
<p>I want to store html that isn't to be rendered until needed either within a tag that can hold raw html code without rendering it on page load or store it within a php or jquery variable for later use. I then want to be able to insert the html into the DOM on button click and have it render.</p> <p>I've tried storing it within an xmp tag as that can store html code with the &lt; and > characters without using character codes for them, but when trying to insert it into the DOM, the updated source shows it had been copied but it wouldn't render on screen. Also tried storing it within a code tag, which worked on a desktop browser but not in mobile safari. Since this is a webapp mobile browser compatibility is important.</p> <p>Anyone know of a good method of doing this?</p>
php jquery
[2, 5]
79,456
79,457
Accessing email inbox through content provider
<p>I'm trying to access the core application email using a content provider. Is this possible?</p>
java android
[1, 4]
4,190,679
4,190,680
How Get relative path
<p>Get picture file relative path from diffrent location. my Address pic file like ~/Uploads/Picture/Commodities/1390/11/TumbDesert.jpg</p>
c# asp.net
[0, 9]