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
3,912,916
3,912,917
How to detect selection outside textarea and input
<p>jQuery select event is limited to <code>textarea</code> and <code>input:text</code> only. Is there a way to handle a selection in ordinary elements such as <code>&lt;div&gt;</code>?</p>
javascript jquery
[3, 5]
839,346
839,347
Why does asp.net still have to use js?
<p>I'm a beginner of <code>asp.net</code>, and I learned yesterday that we can use <code>.cs</code> file to handle control event, so do we still need to use <code>js</code>? Can we just use c# to deal with the web controls?</p>
c# javascript asp.net
[0, 3, 9]
564,005
564,006
When to use jQuery wrapper methods instead of built-in javascript methods
<p>Which jQuery methods should be avoided in favour of built-in methods / properties?</p> <p>Example:</p> <pre><code>$('#el').each(function(){ // this.id vs $(this).attr('id'); // this.checked vs $(this).is(':checked'); });; </code></pre>
javascript jquery
[3, 5]
1,910,939
1,910,940
How would you store Highcharts chart objects?
<p>I have started using Highcharts creating some very basic visualisations with some data. I used C#/MVC3 with a basic class called GraphOptions consisting of two properties, an array of string categories and an array of Graph Series (which has a name and data property). </p> <p>I then stored a js graph configuration in a js file and populated its properties from the GraphOptions class returned as a JSON object. The configuration would look like this:</p> <pre><code>var options = { chart: { renderTo: 'chartContainer', type: 'column' }, title: { text: 'Strategic Cluster Average', x: -20 //center }, subtitle: { text: '', x: -20 }, xAxis: { categories: [] }, yAxis: { title: { text: 'Score (%)' }, min: 0 }, tooltip: { formatter: function () { return '&lt;b&gt;' + this.series.name + '&lt;/b&gt;&lt;br/&gt;' + this.x + ': ' + this.y; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, legend: { layout: 'vertical', backgroundColor: '#FFFFFF', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, shadow: true }, series: [] } </code></pre> <p>The configuration above only renders a column chart at this stage. I was just wondering what the best way would be to accommodate all the chart types. Do I add a property to my Graph Options class called "GraphType" or do I rather store the whole chart configuration object and return it as part of a JSON object?</p>
c# javascript
[0, 3]
624,011
624,012
Run javascript/jquery after text change but before submit
<p>I have an input element on a form along with a submit button.</p> <p>I want to run the change event on the input element all whenever a change occurs. The problem is if end user changes text and clicks submit button the code in the change event doesn't run.</p> <p>Immediately after user clicks the submit button, the form submits (like the change is not getting time to run, the same occurs with blur or focus out).</p> <p>My controls can be placed on any form, and I do not control the click event of the button.</p> <p>Help please</p>
javascript jquery
[3, 5]
70,955
70,956
Error when add row in php and jquery?
<pre><code>&lt;a class="checkModelButton" href="addrow.php"&gt;ADD ROW&lt;/a&gt; &lt;table&gt; &lt;thead&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/thead&gt; &lt;tboby id="model_row"&gt; &lt;tr&gt;Nokia N70&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>And jQuery:</p> <pre><code>jQuery('.checkModelButton').click(function(){ var url = jQuery(this).attr('href'); jQuery.ajax({ type:'get', cache: false, url: url, success: function(html){ jQuery('#model_row').html(html); } }); }); </code></pre> <p>in file addrow.php</p> <pre><code>&lt;tr&gt;Nokia N71&lt;/tr&gt; </code></pre> <p>When I click on a tag is result is:</p> <pre><code> &lt;table&gt; &lt;thead&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/thead&gt; &lt;tboby id="model_row"&gt; &lt;tr&gt;Nokia N71&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>How to fix it to result is:</p> <pre><code> &lt;table&gt; &lt;thead&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/thead&gt; &lt;tboby id="model_row"&gt; &lt;tr&gt;Nokia N70&lt;/tr&gt; &lt;tr&gt;Nokia N71&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre>
php jquery
[2, 5]
3,356,775
3,356,776
get value of div class in jquery drop event
<p>Using jQuery, I am trying to capture and display the value of a div class when it is 'dropped'. For example, I want to display '01:20' when this particular element is dropped. div class='routineTime'>01:20 /div></p> <p>Additionaly, I want to sum and display a running total of these dropped elements.</p> <p>I have an example in jsfiddle, but it's only displaying the 'routineTime' of the first element that is dropped. I need to sum and display 'routineTime' for each element that is dropped.</p> <p><a href="http://jsfiddle.net/n2learning/QfFQ9/9/" rel="nofollow">http://jsfiddle.net/n2learning/QfFQ9/9/</a></p> <p>Appreciate any help!</p> <p>DK</p>
javascript jquery
[3, 5]
4,280,640
4,280,641
what is the best practice of binding jQuery click event to each anchor tag on every row of a table
<p>There is a grid (just html table) that lists users and you can delete a specific user by clicking on delete link. The usual way I do is </p> <pre><code>&lt;% foreach (var user in Model.Users) {%&gt; &lt;tr &gt; &lt;td align="right"&gt;&lt;%= user.Name %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= user.Level %&gt;&lt;/td&gt; &lt;td align="center"&gt; &lt;a href="#" onclick="return deleteUser('&lt;%= user.Name %&gt;');"&gt; &lt;%= Html.Image("trash.gif") %&gt; &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% )%&gt; </code></pre> <p>but I want to attach click event to the link in a non-obtrusive way. I mean, I do not want to specify javascript method inside the tag. I am not sure what is the best way to achieve it with jQuery, binding multiple multiple anchor tags with parameter passing.</p>
javascript jquery
[3, 5]
4,986,230
4,986,231
JQuery click function not getting called
<p>I have a simple page for testing with only a button, I am linking to an external js file. It is displaying the jquery version in a alert box, but when the button is clicked nothing happens. What is wrong with this? </p> <p>Here is my simple test html page</p> <pre><code>&lt;title&gt;Insert title here&lt;/title&gt; &lt;!-- scripts --&gt; &lt;script language="JavaScript" type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script language="JavaScript" type="text/javascript" src="myscript.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; &lt;input type="button" tabindex="5" value="jscript" id="testbutton" /&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>and here is my myscript file content</p> <pre><code>alert($.fn.jquery); $('#testbutton').click(function(){ alert("test successful"); }); </code></pre> <p>I am using JQuery version 1.6</p>
javascript jquery
[3, 5]
437,200
437,201
Android Expandable ListView Icon (Group Indicator)
<p>I have been able to successfully swap in my own image for the expandable listview arrows. I have two issues at the moment.</p> <p>One is that the icons i substitue in with the code below are each strechted to the height of the row and too wide as well. The second is, that this code is only changing the initial state of the Group Indicator. How do I change it from one image to another when a particular row is open?</p> <pre><code>Drawable plus = (Drawable) getResources().getDrawable(R.drawable.plus); getExpandableListView().setGroupIndicator(plus); </code></pre>
java android
[1, 4]
977,369
977,370
checkbox list -javascript
<p>In my aspx page i am having a checkbox list ..It has binded values from a table.. I need to validate the checkbox list ..I tried the following script </p> <pre><code> var checkBoxCount = 0; var elements = document.getElementById('&lt;%=ChkBoxList.ClientID%&gt;'); for(i=0; i&lt;elements.length;i++) { if(elements[i].checked) checkBoxCount++; } if (checkBoxCount == 0) { alert("Please choose atleast one"); return false; } </code></pre> <p>But I can't get the required output, it requires to select all the values in the checkbox list ..My need is atleast only one item must be selected from the checkbox list.. Using javascript</p> <p>Thanks in advance...</p>
c# javascript asp.net
[0, 3, 9]
1,649,928
1,649,929
logging javascript module names
<p>I want to be able to log my module initializations to see what happens. Is there a way to get the module namespace and log it to the console.</p> <pre><code>(function($, bis, window, document, undefined) { "use strict"; //other app code bis.library = bis.library || function(module) { $(function() { if (module.init) { module.init(); //how can I make it log the module namespace console.log('module' + module.toString() + 'initialized'); } }); return module; }; //other app code })(jQuery, window._bis = window._bis || {}, window, document); </code></pre> <p>example of my module definition</p> <pre><code>(function($, bis, window, document, undefined) { "use strict"; var common = bis.common, urls = bis.urls, defaults = bis.defaults, createWorklist = bis.createWorklist, editWorklist = bis.editWorklist, editMoveBoxesWorklist = bis.editMoveBoxesWorklist; bis.worklist = bis.worklist || bis.library((function() { // module variables var init = function() { //module init code }; //other module code return { init: init }; })()); })(jQuery, window._bis = window._bis || {}, window, document);​ </code></pre> <p>So I want the line console.log to log the following text "module bis.worklist initialized" for example.</p>
javascript jquery
[3, 5]
4,836,853
4,836,854
In jquery, trigger a click on the link with the highest 'rel' attribute value
<p>I have:</p> <pre><code>&lt;a rel="9"&gt;Link 1&lt;/a&gt; &lt;a rel="6"&gt;Link 2&lt;/a&gt; &lt;a rel="3"&gt;Link 3&lt;/a&gt; &lt;a rel="21"&gt;Link 4&lt;/a&gt; </code></pre> <p>I want to trigger a click on the link with the highest 'rel' value. What is the most efficient way to write this?</p>
javascript jquery
[3, 5]
4,586,504
4,586,505
c# & ASP.NET Gridview- Textbox data update in DB
<p>I have a grid view with about six columns in which one of those columns is a text box.</p> <p>User may enter a value in the texbox and when he clicks on Submit button(this button is not within the gridview) that single value has to be updated into the database. All other columns in the gridview will be retrieved from the DB. But this one column has to updated into DB. User may enter data for one row or all the rows (records) for this editable column.</p> <p>Whenever there is some text change event for that textbox in gridview, I need to update the data for that particular record.</p> <p>Please suggest as to how to get the value of that particualar column when many rows are edited.</p> <p>Thanks in advance. </p>
c# asp.net
[0, 9]
1,847,789
1,847,790
Why does a JavaScript function fail with certain parameter names?
<p>The following JavaScript function is supposed to make a simple JQuery call to load a page and set a class:</p> <pre><code>function Lp(page,class) { $("#result").load(page); $('#nav').attr('class',class); } </code></pre> <p>However it failed to work until, on a hunch, I changed the name of the second parameter:</p> <pre><code>function Lp(page,hilite) { $("#result").load(page); $('#nav').attr('class',hilite); } </code></pre> <p>Surely the parameter names are arbitrary, or am I missing something?</p>
javascript jquery
[3, 5]
1,752,498
1,752,499
Variable different on php echo and javascript alert
<p>I have a dynamic multilanguage website. My php echos the current language right, but javascript doesn't even if loading after body.</p> <p>My php:</p> <pre><code>&lt;?php echo $language ?&gt; </code></pre> <p>This gives me english, portuguese, german or french accordingly to the one is being used.</p> <p>when i try with javascript this way:</p> <pre><code> &lt;script type="text/javascript"&gt; function language() { var ci = { language : "&lt;?php echo $language; ?&gt;" }; if(ci.language = 'portuguese') { alert(ci.language); return false; fb_language = "pt_PT"; } else if (ci.language = 'english') { alert(ci.language); return false; fb_language = "en_US"; } else if (ci.language = 'german') { alert(ci.language); return false; fb_language = "de_DE"; } else if (ci.language = 'french') { alert(ci.language); return false; fb_language = "fr_FR"; } else { fb_language = "en_US"; } }; &lt;/script&gt; &lt;body onload="language();"&gt; </code></pre> <p>It always gives me portuguese in javascript, can't make it alert the right language, but in php it gives me the right language im using.</p>
php javascript
[2, 3]
1,763,119
1,763,120
Android equivalent function of VC++ sleep function
<p>Is any equivalent function in android(Java) of sleep(VC++) function. If no please provide a method to do it.</p> <p>eg. <code>Sleep(5000);</code> // a delay of 5000 milliseconds</p> <p>thanks</p>
java android
[1, 4]
5,206,266
5,206,267
objectdatasource cast gridview datasource back to generic list
<p>environment: asp.net fx3.5</p> <p>i'm using the objectdatasource for my gridview. at first, i load up my gridview with records from a generic <code>List&lt;Attachments&gt;</code> for my customer. Next I'd like to add/remove items from the gridview without hitting database until after all the add/removes are done. Then the user will hit Save button and then I will persist the items in the gridview.</p> <p>my question is how do I add/remove items in the gridview while the objectdatasource is wired up to gridview? my guess is somehow cast the gridview rows back to generic list, and add/remove items, and rebind? is that even possible?</p>
c# asp.net
[0, 9]
2,564,653
2,564,654
Jquery DateTime Unix timestamp vs http://www.epochconverter.com/
<p>I am referring to <a href="http://docs.jquery.com/UI/Datepicker/%24.datepicker.formatDate" rel="nofollow">datepicker</a> where I noted that:</p> <blockquote> <p>@ - Unix timestamp (also known as epoch seconds or POSIX time) in milliseconds since 01/01/1970</p> </blockquote> <p>Also site <a href="http://www.epochconverter.com/" rel="nofollow">http://www.epochconverter.com/</a> shows time in readable format based upon seconds / milliseconds entered since epoch</p> <p>But I am getting a difference from both the values:</p> <p>Example:</p> <pre><code>var startDt = $.datepicker.formatDate('@', $('#starttime').datetimepicker('getDate')) For startDt as entered: 05/01/2012 12:00 AM = 1335810600000 04/18/2012 06:40 PM = 1334754640000 The URL shows me a different values: 05/01/2012 12:00 AM = 1335810600000 Assuming that this timestamp is in milliseconds: GMT: Mon, 30 Apr 2012 18:30:00 GMT 04/18/2012 06:40 PM = 1334754640000 Assuming that this timestamp is in milliseconds: GMT: Wed, 18 Apr 2012 13:10:40 GMT </code></pre> <p>How can I match both the outputs [assuming the URL shows correct - am I wrong?]</p>
javascript jquery
[3, 5]
1,986,811
1,986,812
How to show popup message box in ASP.NET?
<p>Work on C# VS 2005 AJAX enabled web. I want to show a pop up message on my web page. In my desktop application I write the following code to show a message:</p> <pre><code>MessageBox.Show("Data Saved Successfully.", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); </code></pre> <p>I want this kind of message. Where i can set message icon, Message Header, Message text....I write a code for web :</p> <pre><code>s = "&lt;script type=\"text/javascript\"&gt;alert('InCorrect DateFormat. Check Required.');&lt;/script&gt;"; ClientScript.RegisterStartupScript(GetType(), "Alert", s); </code></pre> <p>Why it's not work ....And how to get message like desktop application.</p> <p>my button under the ajax update panel.After click data save but message is not show....if i put button out the update panel it's work show pop up message ....but i want button must stay on update panel</p>
asp.net javascript
[9, 3]
1,509,135
1,509,136
check filename before posting using jquery/ php
<p>I need jquery to check if my posted filename (up_image) is empty or not.</p> <p>if it's empty i need a div tag to be shown and come with some kind of alert message. </p> <p>if not, just do the </p> <blockquote> <pre><code>$("#submit").submit(); </code></pre> </blockquote> <pre><code> &lt;form action="/profile/" method="post" enctype="multipart/form-data" id="submit"&gt; &lt;p&gt; &lt;label for="up_image"&gt;image:&lt;/label&gt; &lt;input type="file" name="up_image" id="up_image" /&gt; &lt;/p&gt; &lt;a href="javascript:;" id="post_submit" class="submit_btn"&gt;Upload&lt;/a&gt; &lt;/form&gt; </code></pre>
php jquery
[2, 5]
4,579,428
4,579,429
how to get data from string in javascript
<p>I have such string <code>test1/test2/test3/test4/test5</code> How can I get those tests in separate variables or in array or smth using javascript or jquery ?</p>
javascript jquery
[3, 5]
4,826,079
4,826,080
file browser/uploader with CKEditor?
<p><a href="http://stackoverflow.com/questions/1498628/how-can-you-integrate-a-custom-file-browser-uploader-with-ckeditor">How can you integrate a custom file browser/uploader with CKEditor?</a></p> <p>after read the answer, i still don't know which file in ckeditor package should put the code in ? expect someone can explian it. thank you.</p>
php javascript
[2, 3]
5,989,660
5,989,661
How to populate a DropDownList using a List<ListItem>
<p>I have a DropDownList.</p> <p>I need populate it with item collected in a <code>List&lt;ListItem&gt;</code>.</p> <p>In my script, collector has been populated properly.</p> <p>But I cannot populate the DropDownList. I receive an error:</p> <pre><code>DataBinding: 'System.Web.UI.WebControls.ListItem' does not contain a property with the name 'UserName'."} </code></pre> <hr> <pre><code>&lt;asp:DropDownList ID="uxListUsers" runat="server" DataTextField="UserName" DataValueField="UserId"&gt; </code></pre> <hr> <pre><code> List&lt;ListItem&gt; myListUsersInRoles = new List&lt;ListItem&gt;(); foreach (aspnet_Users myUser in context.aspnet_Users) { // Use of navigation Property EntitySet if (myUser.aspnet_Roles.Any(r =&gt; r.RoleName == "CMS-AUTHOR" || r.RoleName == "CMS-EDITOR")) myListUsersInRoles.Add(new ListItem(myUser.UserName.ToString(), myUser.UserId.ToString())); } uxListUsers.DataSource = myListUsersInRoles; // MAYBE PROBLEM HERE???? uxListUsers.DataBind(); </code></pre> <p>Any ideas? Thanks</p>
c# asp.net
[0, 9]
4,459,475
4,459,476
Reading all values from an ASP.NET datagrid using javascript
<p>I have an ASP.NET Datagrid with serveral text boxes and drop down boxes inside it. I want to read all the values in the grid using a javascript function. How do i go about it?</p>
asp.net javascript
[9, 3]
2,910,655
2,910,656
Reducing the need for JavaScript libraries
<p>I'm writing several small things in JavaScript, notably a <code>mousemove</code> event, and a AJAX call. I don't believe that two things should necessitate loading the ~25KB that is jQuery. Add in the fact that I want as <em>few</em> external dependencies as possible and necessitating jQuery isn't something I want to do.</p> <p>Is there a primer / tutorials on rewriting calls between a JavaScript library and pure JavaScript?</p> <ul> <li><code>$('element')</code></li> <li><code>$.get()</code></li> </ul>
javascript jquery
[3, 5]
2,367,073
2,367,074
Jquery Change event for input and select elements
<p>I am trying to alert something when ever a drop down box changes and when ever something is typed into an input. I don't think I can use change for input fields? What would you use for input fields? Also, what about input fields of type file? Same thing. Here is what I have so far and its not working:</p> <pre><code> $('input#wrapper, select#wrapper').change(function(){ alert('You changed.'); }); </code></pre> <p>Thanks all</p>
javascript jquery
[3, 5]
5,437,012
5,437,013
How to hide div that is referenced by an anchor href on click with javascript (jQuery)
<p>I have several blocks of text separated into their own divs. I also have several links in a navigation bar that reference these divs with an anchor link. On click, I'd like to hide all other divs except the one referenced by the clicked link. I have:</p> <pre><code>&lt;div id="navbar"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#section1"&gt;Link 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#section2"&gt;Link 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#section3"&gt;Link 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#section4"&gt;Link 4&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>So, when I click 'Link 3'. I'd like to hide all divs except #section3.</p> <p>I'm fine actually hiding/showing each section of text using CSS, but I can't figure out how to use the link's href attribute to reference the div name. </p> <p>Thanks for your help, and let me know if you need clarification of what I'm asking.</p>
javascript jquery
[3, 5]
3,210,066
3,210,067
Problem on how to update the DOM but do a check on the data with the code-behind
<p>This is with ASP.NET Web Forms .NET 2.0 - </p> <p>I have a situation that I am not sure how to fulfill all the requirements. I need to update an img source on the page if selections are made from a drop down on the same page. </p> <p>Basically, the drop downs are 'options' for the item. If a selection is made (i.e. color: red) then I would update the img for the product to something like (productID_red.jpeg) IF one exists. </p> <p>The problem is I don't want to do post backs and refresh the page every time a selection is made - especially if I do a check to see if the image exists before I swap out the img src for that product and the file doesn't exist so I just refreshed the entire page for nothing.</p> <p><strong>QUESTION:</strong></p> <p>So I have easily thrown some javascript together that formulates a string of the image file name based on the options selected. My question is, what options do I have to do the following:</p> <ul> <li><p>submit the constructed image name (i.e. productID_red_large.jpg) to some where that will verify the file exists either in C# or if it is even possible in the javascript. I also have to check for different possible file types (i.e. .png, .jpg...etc.).</p></li> <li><p>not do a post back and refresh the entire page</p></li> </ul> <p>Any suggestions?</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,558,043
1,558,044
Getting outerWidth of element where text is changed
<p>I have the following element.</p> <pre><code>var e=$('&lt;span/&gt;', {"class":'someClass',text:'Hello'}); </code></pre> <p>I wish to get its outer width. It appears that I cannot just use <code>e.outerWidth()</code> as it needs to be written to the screen first. Correct?</p> <p>So, now the real question. Instead of using text "Hello", I wish to know the outer width if the text had been "Goodby" How would this be accomplished?</p> <p>Thank you</p>
javascript jquery
[3, 5]
1,911,424
1,911,425
"com.android.exchange.ExchangeService has leaked ..." error when running emulator
<p>I'm seeing many of these errors when using my emulator with IntelliJ. I'm not sure what to do about it. It doesn't appear to have been affecting anything, so I haven't paid much attention to it. But I'm concerned it may cause an issue before long.</p> <pre><code>01-01 15:16:22.805: ERROR/StrictMode(607): null android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cf0270 that was originally bound here at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969) at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863) at android.app.ContextImpl.bindService(ContextImpl.java:1418) at android.app.ContextImpl.bindService(ContextImpl.java:1407) at android.content.ContextWrapper.bindService(ContextWrapper.java:473) at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157) at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145) at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116) </code></pre>
java android
[1, 4]
4,298,943
4,298,944
ASP.NET save files from dynamically added FileUpload controls
<p>I'm building an ASP.NET UserControl where users of the website can upload several pictures at once. I'm doing it the old fashioned way by letting the user enter the amount of FileUpload controls wanted and then add them dynamically from C# to a asp:Panel control. </p> <p>While this works, the values/files from the FileUpload isn't stored for when the user clicks the "Save" button. How exactly do I go about this problem?</p> <p>My code for specifying the amount of FileUpload controls wanted:</p> <pre><code>protected void btnSubmitImageAmount_Click(object sender, EventArgs e) { int amountOfControls = Convert.ToInt32(txtImageAmount.Text); for (int i = 0; i &lt; amountOfControls; i++) { FileUpload fUl = new FileUpload(); Label lblLineBreak = new Label(); lblLineBreak.Text = "&lt;br /&gt;"; fUl.ID = i.ToString(); fUl.Visible = true; pnlUploadControls.Controls.Add(fUl); pnlUploadControls.Controls.Add(lblLineBreak); } } </code></pre> <p>Code for the Save button:</p> <pre><code>protected void btnCreateStory_Click(object sender, EventArgs e) { List&lt;Media&gt; images = new List&lt;Media&gt;(); foreach (Control ctrl in pnlUploadControls.Controls) { if (ctrl is FileUpload) { FileUpload fUl = (FileUpload)ctrl; Media media = UmbracoSave(fUl, storydDoc.Id); if (media != null) { images.Add(media); } } } } </code></pre> <p>Anyone got any hints of how to solve this problem? :)</p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
4,411,563
4,411,564
Check if cookie exist in general, not a specific cookie
<p>How would I detect if the website has set a cookie in general without checking lots of individual cookies. </p> <p>I looked at this similar question: <a href="http://stackoverflow.com/questions/2824021/check-if-cookie-exists-if-not-create-it">Check if cookie exists if not create it</a>. But the solutions provided there check if a specific cookie exist, not just cookies in general.</p> <p>I have tried:</p> <pre><code>if($.cookie) { //code } </code></pre>
javascript jquery
[3, 5]
4,984,406
4,984,407
If you select an element in jQuery by ID is there still a speed improvement by giving it a context?
<p>Imagine this simplified markup:</p> <pre><code>&lt;div id="header"&gt; &lt;!-- Other things.... --&gt; &lt;div id="detail"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>and assume you already have this code:</p> <pre><code>var $hdr = $("#header"); </code></pre> <p>Is there any speed difference for jQuery to lookup "detail" this way:</p> <pre><code>var $detail = $("#detail", $hdr); </code></pre> <p>vs</p> <pre><code>var $detail = $("#detail"); </code></pre> <p>Since detail is being looked up by ID?</p>
javascript jquery
[3, 5]
2,922,940
2,922,941
How to properly use the each() in jQuery?
<p>I have the following:</p> <pre><code> &lt;div class="io-section-header"&gt; &lt;ul&gt; &lt;li class="advanced"&gt;Eat&lt;/li&gt; &lt;li class="advanced"&gt;Sleep&lt;/li&gt; &lt;li class="advanced"&gt;Be merry&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>I have the jQuery (which is tied to a click() handler:</p> <pre><code>$('io-section-header').each(function() { $("li").siblings(".advanced").toggle('fast',function(){}); }); </code></pre> <p>Why aren't the list items toggling?</p>
javascript jquery
[3, 5]
2,030,110
2,030,111
Resolve URLs for ASP.NET in jQuery?
<p>I would like to use "<code>~/</code>" and resolve on the client site.</p> <p>For example, I would want to do this:</p> <pre><code>&lt;a href="~/page.aspx"&gt;website link&lt;/a&gt; &lt;img src="~/page.aspx" /&gt; </code></pre> <p>I would have my base URLs in ASP.NET like this:</p> <pre><code>&lt;script type="text/javascript"&gt; var baseUrl = "&lt;%= ResolveUrl("~/") %&gt;"; &lt;/script&gt; </code></pre> <p>Would I need a jQuery plugin for this or can this be a achieved with a chained command?</p>
asp.net javascript jquery
[9, 3, 5]
4,272,908
4,272,909
How to create a dynamic array in Javacript?
<p>I need to create the following array dynamically, for example:</p> <pre><code>var data = { point: [ { x:5, y:8 }, { x:8, y:10}, ]}; console.log(data.point[0].x); // 5 n=0 console.log(data.point[1].y); // 10 n=1 </code></pre> <p>At some point my application needs to expand the array to more than 2 items (n=0, n=1). Please let me know how to do that (i.e. n = 9 ). Thank you.</p>
javascript jquery
[3, 5]
3,375,334
3,375,335
What is the best practice to pass many server side information to JavaScript?
<p>Let say that I have many Javascript inside pages. At this moment is pretty easy to initialize variable by simply using some Print/Echo statement to initialize JavaScript value.</p> <pre><code>Example: var x = &lt;?php echo('This is a value');?&gt; </code></pre> <p>I first thought that I could pass all variables value by parameter of function BUT it's impossible because we have a lot of values (we have a multilanguage website and all text are from the server (BD)).</p> <pre><code>Example : initializeValues(&lt;?php echo('Value1,Value2,Value3,Value...');?&gt;);//JS Method that can be external of the page </code></pre> <p>More problem come when we want to take off all JavaScript from pages to move everything on <strong>external</strong> JavaScript file. What would be the good way to initialize all those variables? If I bind the JavaScript methods by using OnLoad of the document I won't be able to use Print/Echo method to populate all values.</p> <p>Any good pattern to resolve this task?</p>
php javascript
[2, 3]
3,654,337
3,654,338
What is the best way to validate that a specific option has been selected in an asp:ListBox?
<p>I have an asp:ListBox that contains multiple values. A user is required to always select one specific item in this box as well as optionally selecting others.</p> <p>What is the best way to do this?</p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
1,781,404
1,781,405
Should we user anonymous classes for Button click listener or Inner named class
<p>I have lots of buttons in my activity, the question comes here, </p> <p>1) should i create multiple inner anonymous classes for clickListener for each button, like below</p> <pre><code> private View.OnClickListener mShuffleListener = new View.OnClickListener() { public void onClick(View v) { /// task to do } }; </code></pre> <p>2) or should i go for named inner class and add if condition to check for which button listener called.</p> <p>Which one is cool to save mem resources??</p>
java android
[1, 4]
5,758,835
5,758,836
Slide up div and then append a new div to slide up in its place
<p>Im trying to animate two div boxes when a user has successfully filled out a registration form. The first div that is animated is the registration form itself which will slide up from the bottom into the centre and the slide up and off the screen when a user has filled the form properly. </p> <p>I have that first bit working fine but I then need a second div to slide up from the bottom of the screen into the center that contains a message telling a user to check their emails to activate the account they just made. How can I get this bit working and animating?</p> <p>The code im using is this:</p> <pre><code> $("#registerForm").validate({ rules: { name: { required: true, minlength: 3 }, eMail:{ required: true}, passWord: { required: true, minlength: 5 }, rePassWord: { equalTo: ".passWord" } }, submitHandler: function(form) { // do other stuff for a valid form $.post('../inc/register.php', $("#registerForm").serialize(), function(data) { if(data == "true") { $('#loaderWrap').remove(); $('#reg_dialog').animate({ marginTop : -2000, opacity : 0 }, 400); $.append('&lt;div id="reg_success"&gt;Please check your emails to active your account&lt;/div&gt;'); //Slide Up Success Message $('#reg_success').css({ top : winH / 2 - $this.height() / 2, left : winW / 2 - $this.width() / 2, display : 'block' }).animate({ marginTop : 0, opacity : 1 }, 400); } }); } }); </code></pre>
javascript jquery
[3, 5]
2,382,489
2,382,490
JQuery DatePicker not showing in textbox when textbox is enabled
<p>I have a set of controls, which sit inside an ajax update panel, and these controls are enabled via the user ticking a checkbox. One of these controls is a textbox, which uses the JQuery Datepicker to populate the textbox with a date. The problem I am seeing is when the textbox is enabled, and you click on the textbox the datepicker is not showing. The only way I can get the datepicker to show up is after the validator is fixed to show that no date has been set.</p> <p>There is no magic code. If the checkbox is ticked then txtDate.enabled = true.</p> <p>Has anyone come across this problem before? If so, how was it solved?</p> <p>Thanks</p>
jquery asp.net
[5, 9]
3,029,498
3,029,499
scope of variables in JavaScript callback functions
<p>I expected the code below to alert "0" and "1", but it alert "2" twice. I don't the reason. Don't know if it is a problem of jQuery. Also, please help me to edit title and tags of this post if they are inaccurate.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { for (var i=0; i&lt;2; i++) { $.get('http://www.google.com/', function() { alert(i); }); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
2,614,200
2,614,201
How to assign dynamic css class to HyperLink located inside ListView
<p>Kinda of confusing title.</p> <p>This is my old navigation</p> <pre><code>&lt;li&gt;&lt;a href="General.aspx" runat="server" id="currentGeneral"&gt;&lt;i class="home"&gt;&lt;/i&gt; Overview&lt;/a&gt;&lt;/li&gt; </code></pre> <p>The i class sets an icon next to the navigation tab. </p> <p>On the Site.Master.CS I checked what the current page was and would set it to active with the code below.</p> <pre><code>currentGeneral.Attributes["class"] = "active"; </code></pre> <p>So I changed the navigation to a listview populated by a database.</p> <pre><code>&lt;asp:ListView ID="ListViewMenu" runat="server" ItemPlaceholderID="menuContainer"&gt; &lt;LayoutTemplate&gt; &lt;ul class="menu" id="responsive" runat="server"&gt; &lt;asp:PlaceHolder ID="menuContainer" runat="server" /&gt; &lt;/ul&gt; &lt;/LayoutTemplate&gt; &lt;ItemTemplate&gt; &lt;li&gt;&lt;a href='&lt;%#Eval ("href") %&gt;' class='&lt;%#Eval ("id") %&gt;'&gt; &lt;i class='&lt;%#Eval ("class") %&gt;'&gt;&lt;/i&gt;&lt;%#Eval ("text") %&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; </code></pre> <p>But now that I am using listview, the currentGeneral id does not exist and I cant set it to active.</p> <p>I was trying to think what the best way to get this to work is. Anyone have a suggestion?</p> <p>Thank you.</p>
c# asp.net
[0, 9]
68,634
68,635
Javascript Jquery code just works the first time, next time it doesnt
<p>I am a beginner in all Javascript stuff and the code is making me crazy. I'm using Jquery</p> <p>I have a div:</p> <pre><code>&lt;div id="dicesDiv"&gt;&lt;/div&gt; </code></pre> <p>This div is load at the beginning directly with this code:</p> <pre><code>$("#dicesDiv").load("dices.php?dice1=&lt;?php print ($lastDices[1])?&gt;&amp;dice2=&lt;?php print ($lastDices[2])?&gt;"); </code></pre> <p>I have a link to reload this div when clicking it:</p> <pre><code>&lt;a href = "javascript:void(0);" onclick = "javascript:rollDice();"&gt;&lt;img src="../images /tirar_dados.png"/&gt;&lt;/a&gt; </code></pre> <p>This is all my javascript stuff:</p> <pre><code>&lt;script&gt; ...... function rollDice() { &lt;?php $lastDices[1] = rand(1,6);?&gt; &lt;?php $lastDices[2] = rand(1,6);?&gt; $("#dicesDiv").load("dices.php?dice1=&lt;?php print ($lastDices[1])?&gt;&amp;dice2=&lt;?php print ($lastDices[2])?&gt;"); } &lt;/script&gt; </code></pre> <p>When I click the first time, it works, but when I click later it doesn't work. It doesn't make sense to me.</p> <p>Do you know what is happening??</p> <p>Thanks ^^</p>
php javascript jquery
[2, 3, 5]
950,104
950,105
How to assign the text to the label using Jquery for the web controls
<p>i am having and by using jquery ineed to assign another text "hello" to the label "lbl" through the jquery. and if we access the label "lbl" the text "hello" should come because the value "hai" is replaced with "hello" and if we write the below line i should get the new modified lable in aspx.cs file</p> <p>my aspx.cs file code is</p> <pre><code>switch(lbl.Text) { case "hello": code... break; } </code></pre>
asp.net jquery
[9, 5]
114,033
114,034
How can I use a variable to define MailAddress toAddress in c#?
<p>I have an ASP.NET 4.0 aspx page from which I wish to send an email to the recipient specified in a text box named "supervisoremailTextBox". Is there any way that I can specify a variable as the recipient email address. The code I have used which doesn't work is shown below:</p> <pre><code>MailAddress fromAddress = new MailAddress("address@domain.co.uk", "Sender Name"); MailAddress toAddress = new MailAddress("supervisoremailTextBox.Value"); message.From = fromAddress; message.To.Add(toAddress); </code></pre> <p>Sorry if this a really dumb question and thanks in advance for your help.</p>
c# asp.net
[0, 9]
4,431,204
4,431,205
Jquery Masonry Isotope gap issue
<p>Maybe I am being dumb or maybe its just not possible to do.</p> <p>I am trying to get my divs to reorder when the page is smaller than the container div.</p> <p>You can see what I mean by clicking here <a href="http://maffo.co.uk/masonry-isotope-issue" rel="nofollow">example</a></p> <p>If the page is narrow, I get a huge gap next to Div 1 when it could easily accommodate Div 3</p> <p>I have tried many, many settings and cant get it to work, I cant seem to find the answer on here either.</p> <p>For the purposes of this question I have stripped a lot of the code out that I was using.</p> <p>If anybody can advise, you would be my hero.</p>
javascript jquery
[3, 5]
5,031,984
5,031,985
PHP array to jQuery options
<p>I'm creating a Wordpress Plugin which uses a jQuery script. I've created a PHP array which contains its options like:</p> <p><code>$settings = array('setting1' =&gt; 'value1', 'setting2' =&gt; 'value2', 'setting3' =&gt; 10)</code></p> <p>I was now going to use foreach to loop over the items and print them like this:</p> <pre><code>foreach($settings as $setting =&gt; $value) { if (is_string($value)) { $value = "'" . $value . "'"; } $output .= $setting . ':' . $value .','; </code></pre> <p>}</p> <p>which should make me end up with:</p> <pre><code>(window).load(function() { $('#widget').myWidget({ setting1:'value1', setting2:'value2', setting3:10}) </code></pre> <p>With the current setup I end up with the last entry having a ',' at the end (one too many) which means I get a Javascript error, so I need to remove it.</p> <p>All with all, I have the feeling I'm doing something very dirty (including the is_string check) and I was wondering if there is a neat way to deal with this?</p>
php jquery
[2, 5]
4,114,363
4,114,364
Is there an #ifdef ANDROID equivalent to #ifdef WIN32
<p>I have some c++ code that has a bunch of #ifdef WIN32 else we assume its IOS code. However I am now trying to use this same c++ code for an android port.</p> <p>Is there some sort of equivalent for #ifdef WIN32 || ANDROID?</p>
android c++
[4, 6]
3,038,375
3,038,376
Check if the jQuery page load events fired already
<p>Is there a way to check if jQuery fired the page load events yet, or do you have to roll your own? I need to alter the behavior of links, but I don't want to wait until the page finishes loading because the user could conceivably click on a link on, say, the top half of the page before the page finishes loading. Right now I'm doing it like this:</p> <pre><code>var pageLoaded = false; $(function() { pageLoaded = true; }); function changeLinks() { $("a[data-set-already!='true']").each(function() { $(this).attr("data-set-already", "true").click(...); }); // Is there something along the lines of jQuery.pageWasLoaded that I can // use instead? if (!pageLoaded) { window.setTimeout(changeLinks, 100); } } changeLinks(); // Added per @jondavidjohn's question </code></pre>
javascript jquery
[3, 5]
1,323,522
1,323,523
Changing Background of an app
<p>Here is sample code:</p> <pre><code> WallpaperManager wallpaperManager1 = WallpaperManager .getInstance(getApplicationContext()); final Drawable wallpaperDrawable1 = wallpaperManager1.getDrawable(); getWindow().setBackgroundDrawable(wallpaperDrawable1); if (wallpaperDrawable1==null) { Resources res = getResources(); Drawable drawable1=res.getDrawable(R.drawable.bg1); getWindow().setBackgroundDrawable(drawable1); } </code></pre> <p>I wanted to get the system background in my app, If its not there or if user removes it, then I wanted to set a default image from my app to set as app background. Hope Its all clear.... </p>
java android
[1, 4]
2,991,451
2,991,452
Android CookieManager
<p>I have an application that makes several web calls in order to get authenticated after which a JSON is returned. My web calls are to an https server and I am using HTTPURlConnection.</p> <p>I need to store the session in a cookie, after researching around, I found this</p> <p><a href="http://developer.android.com/reference/java/net/HttpURLConnection.html" rel="nofollow">http://developer.android.com/reference/java/net/HttpURLConnection.html</a></p> <p>Under the sessions with cookies header, it tells you to use this code here</p> <pre><code> CookieManager cookieManager = new CookieManager(); CookieHandler.setDefault(cookieManager); </code></pre> <p>However when I try using this code, the new CookieManager(); part highlights in red and says </p> <blockquote> <p>The constructor CookieManager is not visible</p> </blockquote> <p>and the Cookiehandler.setDefault also highlights in red and says</p> <blockquote> <p>The method setDefault(CookieHandler) in the type CookieHandler is not applicable for the arguments (CookieManager)</p> </blockquote> <p>Does anyone know why this is? </p> <p>Thanks in advance!</p>
java android
[1, 4]
3,659,713
3,659,714
checking session with jquery from php script then saving the item clicked to mysql database and updating the label which has been clicked
<p>hi I am trying to saving to save item into my sql database I have 3 functions </p> <pre><code>/* the function below checks if a session is pressent using jquery ajax call to php script */ function checkSess(){ $.ajax({ url: "check_s.php", cache: false, success: function(data){ processDetails1(data) } }); } &lt;?php session_start(); if(isset($_SESSION['flipmode'])) { echo "u"; } else { echo "n"; } ?&gt; /* the function below checks if value from checkSess() is true or false */ function processDetails1(info){ if(info==='u'){ return true; } else{ return false; } } /* the function below checks if value from checks all data then saves to database and changes label if the result from processDetails1 and if true is returned then changes label details and if it returns false should open dialog*/ $('.savepropertycon').live('click', function() { var chekH = checkSess(); if(chekH===true){ $.get("saveprop.php", { pid: saveId }, function(data){ $('#dialog-message').dialog('open'); $('#pro').html(data); return false; }); var saveCurrentId = $(this).attr('id'); jQuery("label", this).html('saved'); $(this).removeClass(); $(this).removeAttr('href'); $(this).addClass("savedone"); jQuery("img", this).remove(); } else { $('.dialogsign').dialog('open'); } return false; }); </code></pre> <p>The problem I have is the above keeps and returning false I have tried to debug with firebug and var chekH is coming back as undifined. Please could somebody help thank you.</p>
php jquery
[2, 5]
3,972,027
3,972,028
Get access to a view so it can be replaced
<p>So, I am using the sliding menu library from <a href="https://github.com/jfeinstein10/SlidingMenu" rel="nofollow">JFeinstein</a>.</p> <p>I have successfully integrated into my project but I am having trouble changing the view of the front/main view/activity.</p> <p>I currently have many activities that I would like to be be able to interchange.</p> <p>I have seen the question here.. <a href="https://github.com/jfeinstein10/SlidingMenu/issues/79" rel="nofollow">https://github.com/jfeinstein10/SlidingMenu/issues/79</a>.</p> <p>I would like to know how to use the snippet from above question to change from one activity to another. I think the issue is with fragments, which my views are not. Do I need to convert them?</p> <p>i.e.</p> <pre><code> SettingsActivity parent = (SettingsActivity) getActivity(); parent.getSupportFragmentManager() .beginTransaction() .replace(R.id.settings_frame, new Fragment()) .commit(); parent.toggle(); </code></pre> <p>Any advice greatly appreciated.</p>
java android
[1, 4]
6,007,778
6,007,779
Android Autocomplete TextView drop down width
<p>I want the dropdown of my auto complete TextView to cover the entire screen width. Currently the normal behaviour of the autocomplete textview is such that it covers only the width of the EditText (screenshot below). </p> <p>How do I do it ? It should look somewhat like the default maps app in android. </p> <p><img src="http://i.stack.imgur.com/XXF0p.png" alt="enter image description here"></p>
java android
[1, 4]
4,986,873
4,986,874
What does jQuery(function) or $(function) do?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7642442/what-does-function-do">What does $(function() {} ); do?</a> </p> </blockquote> <p>what exactly does the following syntax mean?</p> <pre><code>$(function() {..} </code></pre> <p>as in </p> <pre><code>$(function () { $(".add_folder").click(function () { </code></pre> <p>Does it means only defining anonymos function? or also executing it?</p> <p>TIA</p>
javascript jquery
[3, 5]
5,513,981
5,513,982
Remove duplicate cells of a column
<p>I want to remove duplicate cells of a column.</p> <pre><code>&lt;table id="test" border="1"&gt; &lt;tr&gt; &lt;td&gt;test1&lt;td&gt; &lt;td&gt;test2&lt;td&gt; &lt;td&gt;test3&lt;td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;test4&lt;td&gt; &lt;td&gt;test2&lt;td&gt; &lt;td&gt;test5&lt;td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;test6&lt;td&gt; &lt;td&gt;test2&lt;td&gt; &lt;td&gt;test5&lt;td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;test6&lt;td&gt; &lt;td&gt;test8&lt;td&gt; &lt;td&gt;test9&lt;td&gt; &lt;/tr&gt; &lt;/table&gt;​​​ output ------ test1 test2 test3 test4 test2 test5 test6 test2 test9 test6 test8 test9 I want in this format --------------------- test1 test2 test3 test4 test5 test6 test9 test8 </code></pre> <p>​</p>
javascript jquery
[3, 5]
643,956
643,957
Getting sensors from separate package
<p>I'm working on a small project where I'm making a compass that is going to be used on top of a MapView. Everything works just fine when running the program (compass part) within its own activity (not on the MapView), but because the compass has to be integrated into another package containing the Activity that holds the MapView, I want my compass code to be accessed from that package.</p> <p>The problem is that I don't know to initialize the sensors from the other package or if I have to do it from the Activity itself and then somehow pass the instance of the SensorManager to the compass package.</p> <p>I hope that my question is specific enough, but if not, I'll gladly post some of my code :)</p>
java android
[1, 4]
4,846,548
4,846,549
Calling a javascript function after a server call in asp.net web forms
<p>Is there a way in web forms to call a javasctipt function after making a server call for example </p> <pre><code>function showAlert(){ alert("hello"); } &lt;asp:Button ID="callJavasctips" runat="server" Text="callJavasctipt" OnClick="callJavaSctipt_click" /&gt; </code></pre> <p>In MVC I can say OnSuccess = "showAlert()" is there a way to do this in webforms?</p> <p><strong>UPDATE</strong></p> <p>I ended up using ScriptManager instead of Page.ClientScript because it didn't work with update panels.</p>
javascript asp.net
[3, 9]
4,987,881
4,987,882
Check how far window can scroll?
<p>This seems like it should be pretty easy, so I just don't get what I'm overlooking. I've tried jQuery's <code>$(document).width()</code> and that is not returning the correct value. I just need to check how far a window can scroll (horizontally).</p>
javascript jquery
[3, 5]
5,812,491
5,812,492
siutable tool and technology for electronic health system?
<p>hello i am going to develop an EHR (Electronic Health Record System) i am new to this field and want to discuss and get the suggestion about what tool technology i have to use for this purpose: </p> <p>here is my research about EHR and available tools for it</p> <p>1) i am going to discuss about java as an EHR is a web based system so J2EE will be the solution for java at core level and as i am going to globalize my system so i need some standard protocol for it the most useful and appreciated one is <code>HL7 CDA 2.0</code> one thing about java i like is it provides <code>JAVA CAPS</code> with full implementation of HL7 protocol. it make my work bit easy the second thing about java is it is very efficient for <code>DATA CENTERED</code> application as mine one is but the problem is with the scalability of system that is much expensive and time taking. and java is bit slower on client side that can effect downtime that should me very less approaching to zero for my system. and at last i need a attractive user interface. and the most wanted thing is privacy and security.</p> <p>2) the other option is <code>PHP</code> for doing all as above described it is less expensive and less time taking for scalability,may contribute to achieve a good interface and a faster client side but question mark on data centric environment and security.</p> <p>3) the last one is the MS's <code>ASP.NET</code> no doubt about security and privacy but very much expensive to develop and maintain and no platform independence and what about speed that is response and down times?</p> <p>i have discussed the possibilities upto my best knowledge hope u people advise me which one will be the best to attain privacy, security, speed and scalability on best cost.</p> <p>thanx in advance. </p>
java php asp.net
[1, 2, 9]
3,045,475
3,045,476
Listening in Javascript to back button in Android
<p>I have a HTML5 app in Android. I would like to override this</p> <pre><code>@Override public void onBackPressed() { } </code></pre> <p>so the js file, which has a method called back(), can "listen" when the user taps the back button in Android, in order to replicate the navigation behaviour that is currently in my app inside HTML5 from the WebView in Android.</p> <p>I thought about creating a JavaScriptInterface, but I really don't see which could be the communication process to solve this. Probably it's not my day. Thanks.</p>
javascript android
[3, 4]
1,940,823
1,940,824
ASP.NET Content page dynamic content comes out at the top of the HTML output
<p>I'm very new to ASP.net. I have a c# content page, in which I want to inset this code half way down within the HTML:</p> <pre><code>&lt;% HttpResponse r = Response; r.Write(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]); %&gt; </code></pre> <p>But when I view the page, this content comes out first, before even the tag.</p> <p>Any ideas on how to get this code inline instead?</p> <p>Thanks!</p> <p><strong>EDIT</strong> I'd just like to add a note to all who answered this question to explain what you've done. You spared your valuable time to help me, a stranger to you, solve a difficult problem at work, which allowed me to get out of the office on Friday night, just in time to catch the last bus to my home 50 miles away, and see my wife who was sick in bed. You didn't just answer my question, you made my day SO much better. THANK YOU so much!</p> <p>Steven</p>
c# asp.net
[0, 9]
495,655
495,656
how do you add a new view at a specific layout?
<p>I want to add an ImageView on a absolute layout thats on a specific place. the x y coordinates may change dramatically,so I want java code instead of xml code.</p>
java android
[1, 4]
5,167,309
5,167,310
Cannot load ClassDiagram.cd URI formats are not supported
<p>When I create a new Class Diagram in my ASP.NET Application C# it gives me an error message that says:</p> <pre><code>(Cannot load 'C:\Users\...\...\App_Code\ClassDiagram.cd': URI formats are not supported) </code></pre> <p>I don't have any classes in my ASP.NET project.</p>
c# asp.net
[0, 9]
3,249,140
3,249,141
Get function name from inside itself
<p>let's say I have a function:</p> <pre><code> function test1() { } </code></pre> <p>I want to return "test1" from within itself. I found out that you can do <code>arguments.callee</code> which is going to return the whole function and then do some ugly regex. Any better way?</p> <p>what about namespaced functions? </p> <p>is it possible to get their name as well: e.g.:</p> <pre><code>var test2 = { foo: function() { } }; </code></pre> <p>I want to return foo for this example from within itself.</p> <p><strong>update:</strong> for arguments.callee.name Chrome returns blank, IE9 returns undefined. and it does not work with scoped functions.</p>
javascript jquery
[3, 5]
3,095,846
3,095,847
How can I get the element visible in the viewport? jquery
<p>I have a list of images on a page. As I scroll through the page I would like to show some options in a naviationbar of the image currently in the viewport. Therefore I need to get the image element currently in the viewport, is this possible ? </p> <p>Jakob</p>
javascript jquery
[3, 5]
1,298,418
1,298,419
Android development without SDK
<p>To get a better understanding of what I'm actually asking let me outline my situation (I think the wording of my question is off, but couldn't think of how to word it better).</p> <p>I'm currently working in a team of 4 people to develop a basic OCR app. I'm focused on the algorithm side, developing the pre-processing and implementing the OCR. I want as little to do with the app side as possible; as from what I've read so far, it is quite a steep hill to climb and I have enough to do without learning to develop the app from scratch.</p> <p>So my questions are: </p> <ul> <li>Is it possible to develop my code in a <em>black-box</em> style that I can hand to the app developer and say "Here's a list of functions, go for your life"</li> <li>Is it possible to do the aforementioned in a way that I can test without the Android emulators?</li> <li>Is it possible I can do all that without even needing the Android SDK? (given that I can develop my code to deal with specific formats of information. e.g. <code>int[][]</code> for pixel data)</li> </ul>
java android
[1, 4]
5,819,036
5,819,037
apk download issue
<p>Hi I am trying to download apk file from https and http ,I am not able to proceed. What wrong i may be doing.When trying on https I have added .htaccess file on apache server containing the AddType for android. When tried on http it didnt worked.</p> <p>Any help is appreciated. Thanks in advance.</p>
java android
[1, 4]
3,912,054
3,912,055
Strange behaviour from System.IO.DirectoryInfo. Exists function
<p>I am developing an application using c# and asp. It need to access some places in the local network . There is a text box in the form which accept the path to be accessed from the user and will store it to a string variable named location.</p> <p>The if loop always return false if the application run in windows 7. and it occurs only when I run from the installed application, otherwise it will return true if the path is true. Here is the code:</p> <p>The input to textbox BackupLocation is like this </p> <pre><code> \\192.168.0.33\Others (F) </code></pre> <p>. It work fine if the application is hosted on a system which have windows XP </p> <pre><code> System.IO.DirectoryInfo locationInfo = new System.IO.DirectoryInfo(BackupLocationTxt.Text); if (locationInfo.Exists) // always return false if the application run in windows 7 { } </code></pre> <p>Why this happens ?</p>
c# asp.net
[0, 9]
2,737,969
2,737,970
Pass PHP Array to Javascript
<p>Am trying to pass an array of values from PHP function to Javascript. Not sure if I am doing it correctly.</p> <p>PHP:</p> <pre><code>function toggleLayers(){ for($i=0;$i&lt;$group_layer_row;$i++){ $toggleArray=mb_convert_encoding(mssql_result ($rs_group_layer, $i, 0),"UTF-8","SJIS")."_".mb_convert_encoding(mssql_result ($rs_group_layer, $i, 1),"UTF-8","SJIS"); return $toggleArray; } } </code></pre> <p>JS:</p> <pre><code>var myArray = [JSON.parse("&lt;?php echo json_encode($toggleArray); ?&gt;")]; for(var i=0;i &lt; myArray.length; i++){ if($myArray.getVisibility()==true){ $myArray.getVisibility(false); } else{ $myArray.getVisibility(true); } } </code></pre> <p>SQL (for reference):</p> <pre><code>$con = mssql_connect("myServer", "myUsername", myPassword"); $sql = "SELECT * FROM m_group_layer WHERE group_id=\"".$_SESSION["group_id"]."\" ORDER BY display_order"; $rs_group_layer = mssql_query ($sql, $con); $group_layer_row = mssql_num_rows($rs_group_layer); </code></pre> <p>I have been looking at some other similar questions, and the answers are either vague and/or there are a few thousand of them.</p> <p>Would appreciate any help, also please try to explain as if you were writing a book called "Idiot's Guide to Passing PHP Arrays to JS"</p> <p>Thanks for your help.</p> <p><b>Edit:</b></p> <p>Sorry, my question was very vague. Here's what I'm trying to do:</p> <p>1.PHP Function gets all records from table into array(in this case they are map layers)</p> <p>2.Javascript receives PHP array and loops through adding if clause to toggle layers.</p> <p>Hope this makes it clearer.</p>
php javascript
[2, 3]
200,173
200,174
Reference in ASPX file is not working as in ASPX.CS file
<p>I am using <a href="http://code.google.com/p/google-api-for-dotnet/" rel="nofollow">http://code.google.com/p/google-api-for-dotnet/</a> Google API for .NET.</p> <p>I added DLL file reference to project and address it using <code>using Google.API.Search;</code> <code>Search.aspx.cs</code> file and it works completely fine.</p> <pre><code>using Google.API.Search; namespace ASP._8 { public partial class Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public static IList&lt;IWebResult&gt; Search() { GwebSearchClient client = new GwebSearchClient(@"http://www.google.com/"); IList&lt;IWebResult&gt; results = client.Search("Google API for .NET", 32); return results; } } } </code></pre> <p>Trouble is when I try to access same code in <code>Search.aspx</code> file. I've got this errors</p> <pre><code>Error 4 The name 'Google' does not exist in the current context c:\Users\Martinek\Documents\My\Learning.Dot.Net\ASP.8\ASP.8\Search.aspx 12 15 ASP.8 Error 5 The type or namespace name 'IWebResult' could not be found (are you missing a using directive or an assembly reference?) c:\Users\Martinek\Documents\My\Learning.Dot.Net\ASP.8\ASP.8\Search.aspx 13 18 ASP.8 </code></pre> <p>Any ideas? Attaching <code>Search.aspx</code></p> <pre><code>&lt;% using Google.API.Search; foreach (IWebResult a in ASP._8.Search.Search()){ %&gt; </code></pre>
c# asp.net
[0, 9]
4,576,741
4,576,742
jquery row selection from index
<p>I want, given a table id and a row index (0-based), to select the row at that index so that I can apply a background color to all of its td's. I'm familiar with basic selection, but am not sure how to do this using an index variable.</p>
javascript jquery
[3, 5]
3,018,631
3,018,632
How to learn Java, developing for Androind using Eclipse?
<p>I want to learn Java and to became an Android Developer. I studied Electronics &amp; Telecomunications, and I studied programming basis, operative systems, computer architecture, and I studied the languages: Basic, Visual Basic, Turbo Pascal, DIV, Assembler for PICs.</p> <p>I'm looking for the perfect docs and tutorials solution to learn Java for Android.</p> <p>I think that a good answer will be helpful to a lot of people and allow the Android developers Comunity to gain new people =)</p> <p>Carlo</p>
java android
[1, 4]
1,167,432
1,167,433
Serialise/Deserialise List<String>
<p>I was to save an arraylist of strings into 1 column in the local database. I am having some problems doing this. Can somebody tell me where I am going wrong...</p> <pre><code>private String serializeArray(List&lt;String&gt; array) { try { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bytesOut); oos.writeObject(array); oos.flush(); oos.close(); return Base64.encodeToString(bytesOut.toByteArray(), Base64.NO_WRAP); } catch (Exception e) { e.printStackTrace(); return null; } } private ArrayList&lt;String&gt; deserializeArray(String string) { Log.d("USERDAO", string); try { ByteArrayInputStream bytesIn = new ByteArrayInputStream(Base64.decode(string, Base64.NO_WRAP)); ObjectInputStream ois = new ObjectInputStream(bytesIn); return (ArrayList&lt;String&gt;) ois.readObject(); } catch (Exception e) { e.printStackTrace(); return null; } } </code></pre> <p>I am getting a null pointer exception when returning the Arraylist on deserialise array. The serialiseArray method does return a string however I am not sure if it is correct.</p>
java android
[1, 4]
4,794,194
4,794,195
jQuery methods, order of optional arguments
<p>I just played around a bit with the <a href="http://api.jquery.com/animate/" rel="nofollow">animate()</a> method.</p> <blockquote> <p>.animate( properties [, duration] [, easing] [, complete] )</p> </blockquote> <p>I know that I dont have to pass all the arguments to a function in javascript. But what I would like to know is how jquery figures out that <code>function(){ }</code> refers to the callback function, which is actually the 4:th parameter, instead of the easing string (which is the 3:rd)?</p> <pre><code>$('div').animate({ height: '10px' }, 100, function(){ }); </code></pre>
javascript jquery
[3, 5]
1,914,018
1,914,019
Asp.net radio button, how to change the rendered label server side?
<p>I'm having to modify some existing code for a radio button that has a bunch of logic based around the value and Id for a radio button. All I really need to do is change the label and I don't really want to modify the generated input tag since it breaks the messy logic. Does anyone know how to do this server side? Many thanks!</p>
c# asp.net
[0, 9]
1,372,859
1,372,860
No suitable HttpMessageConverter found when trying to execute restclient request
<p>I'm trying to use <code>Spring for Android rest client</code> to send data with an <code>http post</code> , to avoid creating and parsing the json data.</p> <p>From their <a href="http://static.springsource.org/spring-android/docs/1.0.x/reference/htmlsingle/#d4e426" rel="nofollow">manual</a> they have the following method:</p> <pre><code>restTemplate.postForObject(url, m, String.class) </code></pre> <p>After the method is called I get the following exception:</p> <pre><code>No suitable HttpMessageConverter found when trying to execute restclient request </code></pre> <p>My activity code snippet is :</p> <pre><code> RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter()); restTemplate.getMessageConverters().add(new StringHttpMessageConverter()); Message m = new Message(); m.setLibrary("1"); m.setPassword("1395"); m.setUserName("1395"); String result = restTemplate.postForObject(url, m, String.class); </code></pre> <p>And the Message object is :</p> <pre><code>public class Message { private String UserName, Password, Library; public String getUserName() { return UserName; } public void setUserName(String userName) { UserName = userName; } public String getPassword() { return Password; } public void setPassword(String password) { Password = password; } public String getLibrary() { return Library; } public void setLibrary(String library) { Library = library; } } </code></pre> <p>Why can't it <code>convert the Message object to JSON</code> ?</p>
java android
[1, 4]
560,073
560,074
Jquery on new Window objects?
<p>Is it possible to use jQuery on a new Window javascript object?</p> <p>Example:</p> <pre><code>win = new Window('mywindow','width= 400', 'height=400'); win.getContent().innerHTML = xmlFindNodeContent(XmlHttp.responseXML, "windowHtml"); jQuery(win).ready(function(){ do jQuery stuff on the new window here?? }); </code></pre> <p>Is something like this possible?</p> <p>NB: new Window() function takes some parameters before it works properly. Something like this:</p> <p>window.open('mywindow','width=400,height=200')</p>
javascript jquery
[3, 5]
5,013,225
5,013,226
Passing data between a parent window and a child popup window with jQuery
<p>I have the following HTML</p> <pre><code>&lt;tr&gt; &lt;td class="label" valign="top"&gt; Affiliate Party &lt;/td&gt; &lt;td class="field"&gt; &lt;input type="hidden" name="ctl00$MainContent$ExternalAccountAttributes$AffiliatePartyId" id="AffiliatePartyId" /&gt; &lt;input name="ctl00$MainContent$ExternalAccountAttributes$AffiliatePartyName" type="text" id="AffiliatePartyName" class="PartyLookup" /&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>and the following Javascript/jQuery</p> <pre><code>$(".PartyLookup").after("&lt;img src='Images/book_open.png' class='PartyLookupToggle' style='padding-left:4px;' /&gt;"); $(".PartyLookupToggle").click(function () { window.open("PartySearch.aspx", "PartySearch", "width=400,height=50"); return false; }); </code></pre> <p>I need to be able to flag ANY PartyId input field with class="PartyLookup" so that it will modify the DOM and include the image next to the input field. The popup window returns data to populate both the hidden and text fields, but since the click() is generic I need to pass it the ID of the input field. I have no idea how to do this. Any suggestions?</p>
javascript asp.net jquery
[3, 9, 5]
1,535,308
1,535,309
set watermark on an image with high quality
<p>I have a handler wich set watermark on images. The problem is the quality is not so good. Here is the code:</p> <pre><code> byte[] imageBytes = null; using (Graphics G = Graphics.FromImage(ImageToWatermark)) { using (ImageAttributes IA = new ImageAttributes()) { ColorMatrix CM = new ColorMatrix(); CM.Matrix33 = Opacity; IA.SetColorMatrix(CM); G.DrawImage(Watermark, new Rectangle(WatermarkPosition, Watermark.Size), 0, 0, Watermark.Width, Watermark.Height, GraphicsUnit.Pixel, IA); } } using (MemoryStream memoryStream = new MemoryStream()) { ImageToWatermark.Save(memoryStream, GetImageFormat(context.Request.PhysicalPath)); imageBytes = memoryStream.ToArray(); } </code></pre> <p>How can I set the quality for the result?</p> <p>Thank you, Alina</p>
c# asp.net
[0, 9]
2,309,297
2,309,298
Is there a better way to get ClientID's into external JS files?
<p>I know this has been asked before, but I've found a different way to get references to controls in external JS files but I'm not sure how this would go down in terms of overall speed.</p> <p>My code is</p> <pre><code>public static void GenerateClientIDs(Page page, params WebControl[] controls) { StringBuilder script = new StringBuilder(); script.AppendLine("&lt;script type=\"text/javascript\"&gt;"); foreach (WebControl c in controls) { script.AppendLine(String.Format("var {0} = '#{1}';", c.ID, c.ClientID)); } script.AppendLine("&lt;/script&gt;"); if (!page.ClientScript.IsClientScriptBlockRegistered("Vars")) { page.ClientScript.RegisterClientScriptBlock(page.GetType(), "Vars", script.ToString()); } } </code></pre> <p>This was I can reference the id of the aspx page in my JS files.</p> <p>Can anyone see any drawbacks to doing things this way? I've only started using external JS files. Before everything was written into the UserControl itself.</p>
asp.net javascript
[9, 3]
2,523,951
2,523,952
Apply widget to current and future page elements
<p>Update : I had to change the text to explain my exact problem.</p> <p>I have a 3th party library for tooltips. It works like this</p> <p>jQuery("a").tooltip();</p> <p>How can I attach this to all future "a" elements added using ajax on this page ?</p>
javascript jquery
[3, 5]
4,232,726
4,232,727
How to remove data- attribute from the div element?
<p>I have an html <code>div</code> element, which contains lot of HTML-5 <code>data-</code> attributes to store extra </p> <p>data with element. I know that we can use <code>removeAttr</code> of jquery to remove specific attribute, </p> <p>but i want to know that is there any way to remove <code>data-</code> all atonce?</p>
javascript jquery
[3, 5]
1,249,913
1,249,914
High Score Board for Android
<p>I am trying to implement a high score system inside of my game, I don't know any sql, so I can't write it that way. So I was wandering what would be the best and simplest way to use a tab layout to display a global high score on one and local high score on the other. The scores would be taken from the game activity which uses a surfaceview and be displayed on the high score screen activity. If I need sql to make a global high score I will not use it, if I can at least do the local high score that would be fine. </p>
java android
[1, 4]
2,731,710
2,731,711
autoscrolling textview in android
<p>I'm building a chat-like application that displays text the user inputs to the screen using a scrollview. What I'd like to do is making the scrollview autoscroll as more text is appended to the screen. I'm using a textview to display the input. The xml portion of the scrollview is as follows:</p> <pre><code> &lt;ScrollView android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@id/buttons" &gt; &lt;LinearLayout android:id="@+id/start_chat" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>How do I go about doing that? I tried setting the layout's gravity to "bottom", but that doesn't work correctly (text inputed that moves up as the scrollview is scrolled down can't be viewed again). </p> <p>Any help is greatly appreciated.</p>
java android
[1, 4]
2,512,021
2,512,022
Can I make the force open select in save/download dialog box?
<p>I use ASP.NET and C# to create file content from binary value</p> <pre><code>FileStruct currentFile = null; File file = new File(); currentFile = file.GetFile(FileID, strTableCode); Response.ContentType = currentFile.ContentType; Response.OutputStream.Write(currentFile.FileContent, 0, currentFile.FileContent.Length); Response.AddHeader("content-disposition", string.Format(@"attachment;filename=""{0}""", currentFile.FileName)); Response.Flush(); </code></pre> <p>I put this content in an <code>iframe</code> with jquery. After this an open/save dialog is shown. How can I force to open the file directly without open/save dialog?</p>
c# asp.net
[0, 9]
4,884,634
4,884,635
PHP/JS : Preventing doubleinserting with function
<p>Yes im having a issue i thought i didn't have.</p> <p>When you submit it runs a javascript function, that runs an ajax call. This function have this right under it´s name(first line in the function):</p> <pre><code> $('#submitWall').attr('disabled', true); </code></pre> <p>This works very well, but not so well for the faster humans...I tried to click/pressing enter really fast, and it inserted to the database 2-3 times.</p> <p>And I want to prevent this. As i said i have the above, which didn't solve it 100%.</p> <p>Is there a solution for this in JS/jquery or maybe in PHP, so there's like a 1 second timelimit somehow..?</p> <p>Here's my function:</p> <pre><code> function DoWallInsert(BuID, uID){ $('#submitWall').attr('disabled', true); var wrapperId = '#wall_insert'; $.ajax({ type: "POST", url: "misc/insertWall.php", data: { value: 'y', BuID : BuID, uID : uID, message : $('#message').val() }, success: function(msg){ $('#submitWall').attr('disabled', false); $(wrapperId).prepend(msg); $(wrapperId).children().first().slideDown('slow'); $('#message').val(""); } }); } </code></pre>
php javascript jquery
[2, 3, 5]
423,942
423,943
How to use JQuery InsertAtCaret Function
<p>I have found JQuery InsertAtCaret Function <a href="https://gist.github.com/mathiasbynens/326491" rel="nofollow">Here</a> But there is no detail given how to use it. I have tried a lot to understand that how it can be used, but could not find any way. Here is the function.</p> <pre><code>$.fn.insertAtCaret = function(myValue) { return this.each(function() { var me = this; if (document.selection) { // IE me.focus(); sel = document.selection.createRange(); sel.text = myValue; me.focus(); } else if (me.selectionStart || me.selectionStart == '0') { // Real browsers var startPos = me.selectionStart, endPos = me.selectionEnd, scrollTop = me.scrollTop; me.value = me.value.substring(0, startPos) + myValue + me.value.substring(endPos, me.value.length); me.focus(); me.selectionStart = startPos + myValue.length; me.selectionEnd = startPos + myValue.length; me.scrollTop = scrollTop; } else { me.value += myValue; me.focus(); } }); }; </code></pre> <p>I have a textbox input field and a textarea below it. Where Should I call this function and what value should I give it. And Where I have to give the reference of my textarea.</p>
javascript jquery
[3, 5]
4,436,240
4,436,241
How to make a custom Dialog which will display once a day
<p>I am doing an application in which a I want to implement a custom dialogn in the main activity. The thing is a want this dialog to be displayed once a day. How can I accomplished that ? </p>
java android
[1, 4]
2,189,135
2,189,136
Remove part of string between two indexOf in javascript
<p>How can i remove from a string between two <code>indexOf</code> </p> <p>i have this <a href="http://jsfiddle.net/minagabriel/ertcp/" rel="nofollow">jsFiddle</a></p> <p>here is my code : </p> <pre><code> var x = "M 178.6491699876038 23.419570090792845 C 183.6491699876038 23.419570090792845 186.47776067057902 30.902823043098138 190.3670728596699 41.19229585251793 L 194.25638504876076 51.48176866193772" ; var c = x.indexOf('C') ; var L = x.indexOf('L') ; var final = x.slice (c,L) ; console.log(final) ; </code></pre> <p>this code will result in returning the removed part of the string </p> <p><strong>QUESTION</strong> how can i return the original string after removing the part between <code>C</code> and <code>L</code> </p> <p>​</p>
javascript jquery
[3, 5]
5,953,269
5,953,270
How to use Session List<T> in asp.net to store value
<p>i made one property like this :</p> <pre><code>public static List&lt;Message&gt; _SessionStore; public static List&lt;Message&gt; SessionStore { get { if(HttpContext.Current.Session["MyData"]==null) { _SessionStore = new List&lt;Message&gt;(); } return _SessionStore; } set { HttpContext.Current.Session["MyData"] = _SessionStore; } } </code></pre> <p>I want to add value <code>SessionStore.Add() and get SessionStore.Where()</code> but i got error while doing this Add And Get</p> <p>first i did <strong>SessionStore.Add(comment);</strong> somewhere then i got this error</p> <pre><code> List&lt;Message&gt; msglist = HttpContext.Current.Session["MyData"] as List&lt;Message&gt;; if(msglist.Count&gt;0) </code></pre> <p>i am not able access <code>msglist</code></p> <p>can anybody fix my property in way that i can use this List from anypage to add and get values</p>
c# asp.net
[0, 9]
5,701,273
5,701,274
jQuery - Building object arrays with html5 data attribute selection
<p>I'm using HTML 5 data attributes to key rows of data in a table. I need to iterate the rows and gather the data into an object collection. I created a class to represent my row data:</p> <pre><code>function SomeItem(description, finalPrice, percentDiscount) { this.Description = description; this.FinalPrice = finalPrice; this.PercentDiscount = percentDiscount; } </code></pre> <p>An event fires which triggers the collection of this data.</p> <pre><code>$.each($('.ItemPriceBox'), function () { var uniqueid = $(this).data('uniqueid'); var finalPrice = $(this).val(); }); </code></pre> <p>The final piece of data, percentDiscount should be retrieved using the <code>data-uniqueid</code> attribute. I'm not sure how to do this.</p> <p>I want...</p> <pre><code>SomeItem[] items; $.each($('.ItemPriceBox'), function () { var uniqueid = $(this).data('uniqueid'); var finalPrice = $(this).val(); var percentDiscount = $('.ItemDiscountBox').where("uniqueid = " + uniqueid); items[i] = new SomeItem(uniqueid,finalPrice,percentDiscount); }); </code></pre> <p>How can I solve this?</p>
javascript jquery
[3, 5]
3,522,762
3,522,763
How to pass variable using javascript/jquery from one PHP file to another PHP file
<p>I have two PHP files a.php and b.php. I have some links in a.php like this:</p> <pre><code>echo "&lt;ul&gt;"; foreach($x-&gt;channel-&gt;item as $entry) { echo "&lt;li&gt;&lt;a href='NEED SOME CODE HERE TO OPEN b.php' title='$entry-&gt;title'&gt;" . $entry-&gt;link . "&lt;/a&gt;&lt;/li&gt;"; } echo "&lt;/ul&gt;"; </code></pre> <p>When the user clicks on that link, the second page b.php should open and ALSO b.php should know the contents of the variable <code>$entry-&gt;link</code> so that based on the<code>$entry-&gt;link</code> I can do some conditional checks like this:</p> <p>in b.php, I want to do this check:</p> <pre><code>if($entry-&gt;link=="http://www.google.com") { //Some code here } </code></pre> <p>How can I do this?</p>
php javascript
[2, 3]
4,686,729
4,686,730
how do i store a path to an image in my drawable folder to my database in android?
<p>i have a database and need to store an image from drawable folder's paht into it.</p>
java android
[1, 4]
2,666,902
2,666,903
How to close dialog box which is opened by jQuery?
<p>I have a webpage in which I open a dialog box, which shows another webpage. When I click on the submit button on this child webpage, it is loaded in the browser window.</p> <p>Here is the whole synopsis:</p> <p>On the parent page, I have a div which loads the child.</p> <pre><code>&lt;div id="divMyDialog" title="Child Dialog Title"&gt; &lt;/div&gt; </code></pre> <p>In a jQuery file, I have the following:</p> <pre><code>$("#divMyDialog").dialog({ autoOpen: false, bgiframe: true, width: 800, height: 400, modal: true, draggable: false, resizable: false }); function OpenDialog(FirstID, SecondID) { $("#divMyDialog").dialog("open").load("ChildPage.aspx?FirstID=" + FirstID+ "&amp;SecondID=" + SecondID); } </code></pre> <p>Now, once I click on an asp:button in ChildPage.aspx (after a database action), I want ChildPage.aspx to show an alert and then close. Instead, what is happening is that it shows the alert correctly, and then loads ChildPage.aspx in the browser.</p> <p>For the alert, I have this in the OnClick event for that asp:button:</p> <pre><code>Page.ClientScript.RegisterStartupScript(this.GetType(), "showalert", "&lt;script&gt;CloseMyDialog();&lt;/script&gt;"); </code></pre> <p>To close ChildPage.aspx dialog, I have this:</p> <pre><code>&lt;script type="text/javascript"&gt; function CloseMyDialog() { parent.$.fn.colorbox.close(); return false; } &lt;/script&gt; </code></pre> <p>Please let me know if you need any more clarification. I have already tried many things, but so far none worked correctly.</p> <p>Thanks.</p>
jquery asp.net
[5, 9]
2,700,167
2,700,168
How to add items to a dropdown list provided from textbox?
<p>I want to take values from a textbox,</p> <p>and add those to a dropdown list on another page.</p>
php javascript jquery
[2, 3, 5]
5,274,796
5,274,797
How to show modal popup on page index changed event?
<p>I have one user control having gridview in it.In my aspx page i have modal popup to show this user control.So,when i click on page index modal popup get disappears.</p> <p>So,how can i avoid disappearance of modal popup on page index change in asp.net.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
2,631,738
2,631,739
Using jQuery in a Blackboard Building Block
<p>Shot in the dark here, but I'm trying to use jQuery in a custom building block of type module for Blackboard: <a href="http://www.blackboard.com/" rel="nofollow">http://www.blackboard.com/</a>, and would love to know the tag structure I'm suppose to use to get this accomplished.</p> <p>I have tried several combinations of the tags in the library to get this done. Here is my latest attempt:</p> <pre><code>&lt;%@page language="java" pageEncoding="UTF-8"%&gt; &lt;%@page import="blackboard.data.user.*" %&gt; &lt;%@page import="blackboard.platform.session.*" %&gt; &lt;%@page import="blackboard.persist.*" %&gt; &lt;%@page import="java.sql.*" %&gt; &lt;%@page import="java.util.*" %&gt; &lt;%@taglib uri="/bbData" prefix="bbData" %&gt; &lt;%@taglib uri="/bbUI" prefix="bbUI" %&gt; &lt;%@taglib uri="/bbNG" prefix="bbNG" %&gt; &lt;bbUI:docTemplateHead&gt; &lt;script type="text/javascript" src="jquery-ui-1.8.2.custom/js/jquery-1.4.2.min.js&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-ui-1.8.2.custom/js/jquery-ui-1.8.2.custom.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="jquery-ui-1.8.2.custom/css/custom-theme/jquery-ui-1.8.2.custom.css" /&gt; &lt;script type="text/javascript"&gt; $(function(){ $('#tabs').tabs(); }); &lt;/script&gt; &lt;/bbUI:docTemplateHead&gt; html here... </code></pre>
java jquery
[1, 5]