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
1,668,120
1,668,121
ServerSide(PHP) vs. ClientSide(JS) running trade off
<p>I have a collection of rows, I can generate Table(HTML) out of it using PHP (server side) or I can send the raw data to the client side and generate the Table there using JavaScript</p> <p>Which one is better and way?</p>
php javascript
[2, 3]
3,631,620
3,631,621
jquery zoom in and zoom out on clicking an image
<p>I have an image which has to behave the following way: When a user clicks on it the first time it the image should zoom-in and when clicked on the image again it should zoom-out. </p> <p>Please help in figuring out how the two actions be performed by clicking on the image using jquery? Below is the code I have written for zooming in the image.</p> <pre><code>$('.tab1').click(function() { $(".GraphHolder").hide("slow"); $("#top-button-container").hide("slow"); $(".print").append('&lt;button type="button"&gt;PRINT&lt;/button&gt;'); $(this).animate({width: "70%"}, 'slow'); }); </code></pre>
javascript jquery
[3, 5]
2,299,920
2,299,921
Calendar for booking date
<p>Can someone tell me how to make calendar in order user to choose booking date? I'm sorry I didn't provide any code because I really don't know how to do it. Any comments and guidances are welcome :) Thanks</p>
c# asp.net
[0, 9]
2,527,398
2,527,399
Javascript write underneath another element (on a new line)
<p>I need to create a function in JavaScript, that will write some text (which was retrieved with XMLHttpRequest) to a new element underneath the previous one. To give you an example, imagine a chat room. When someone writes something new, a new line is created.</p> <p>Also if possible how this would be in jQuery? I want to see if in jQuery would be much easier.</p> <p>If you need anymore information please let me know! Thanks in advance.</p>
javascript jquery
[3, 5]
2,926,604
2,926,605
Return dynamic CheckBoxList span ID on button click
<p>I have a dynamic <code>CheckBoxList</code> that creates an HTML table. I've listed one row to keep it simple.</p> <pre><code>&lt;table id="checkBoxList1" border="0"&gt; &lt;tr&gt; &lt;td&gt;&lt;span someValue="neededValue"&gt;&lt;input id="checkBoxList1_0" type="checkbox" name="checkBoxList1$0" checked="checked" /&gt;&lt;label for="checkBoxList1_0"&gt;TestTopic1&lt;/label&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I also have an ASP button that will run javascript when clicked. I need the function to return the <code>"neededValue"</code>. Here is the ASP button and the javascript function:</p> <pre><code>&lt;asp:Button ID="btnSubscribe" runat="server" Text="Update Subscriptions" OnClientClick="return GetSelectedItem()"/&gt; &lt;script type="text/javascript"&gt; function GetSelectedItem() { var CHK = document.getElementById("&lt;%=checkBoxList1.ClientID%&gt;"); var checkbox = CHK.getElementsByTagName("input"); var spans = CHK.getElementsByTagName("span"); for (var i = 0; i &lt; checkbox.length; i++) { if (checkbox[i].checked) { alert("Selected = " + spans[i]); } } return false; } &lt;/script&gt; </code></pre> <p>Right now it returns a null value.</p>
javascript asp.net
[3, 9]
1,208,290
1,208,291
Jquery.height() returns different results usign F5 or CTRL+F5
<p>So I am trying to find the height of my images then add a top margin this enables me to impose a a vertical center.</p> <p>I'm running this code, and on an <strong>F5 refresh</strong> I get correct height but on <strong>CTRL+F5 refresh</strong> it gives me a much smaller height. I kind of assume this is a loading/delay thing, but I am using document ready so not really sure whats going on. I tried using a php function but it slows the site down amazingly so have to stick with jquery. </p> <p>you can see it working here. <a href="http://www.mzillustration.com" rel="nofollow">www.mzillustration.com</a></p> <pre><code> jQuery(document).ready(function() { if (jQuery('.imagedisplay').length != 0) { jQuery('.imagedisplay').each(function(){ var imgheight = jQuery(this).find('img').height(); var topmarg = ((240 - imgheight) / 2) ; jQuery(this).find('img').css({'margin-top':topmarg+'px'}); }); }); </code></pre> <p>any ideas/help/explanation much appreciated. thanks</p>
javascript jquery
[3, 5]
737,059
737,060
How to compare two dates in c#
<p>I have a textbox where i will enter date in mm/dd/yyyy format,i want to compare this textbox date with current date(sysdate) in javascript code in c#.How to do that??Example i enter 11/11/2011 which is future date and it must be checked with sysdate and print an message </p>
c# javascript
[0, 3]
1,232,639
1,232,640
How do I select a span containing an exact text value, using jquery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2338439/select-element-based-on-exact-text-contents">Select element based on EXACT text contents</a> </p> </blockquote> <p>How do I select a span containing an exact text value, using jquery?</p> <pre><code>&lt;div&gt; &lt;span&gt;find me&lt;/span&gt; &lt;span&gt;dont find me&lt;/span&gt; &lt;span&gt;xfind mex&lt;/span&gt; &lt;span&gt;_find me_&lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,382,069
3,382,070
using jquery with vb.net
<p>is some one try to use jquery with vb.net, like </p> <pre><code>if InvalidUser() then show ModalDialog or if CreateNewUserForm.Confirm()=true then do some thing... </code></pre> <p>Thanx</p>
jquery asp.net
[5, 9]
4,914,765
4,914,766
How to pass the dynamic text box value to another php page
<p>i make a dynamic textbox through javascript now i want to post the data of all dynamically generated textboxes to php script and then insert into a table. how can i do this... </p> <pre><code>&gt; var intTextBox=0; &gt; &gt; //FUNCTION TO ADD TEXT BOX ELEMENT &gt; function addElement() { &gt; intTextBox = intTextBox+1; &gt; &gt; var contentID = document.getElementById('content'); &gt; var newTBDiv =document.createElement('div'); &gt; newTBDiv.setAttribute('id','strText'+intTextBox); &gt; newTBDiv.innerHTML="Author : &lt;input type='text' id='citingfield' name='"intTextBox"'/&gt;"; &gt; contentID.appendChild(newTBDiv); &gt; } &gt; &gt; //FUNCTION TO REMOVE TEXT BOX ELEMENT &gt; function removeElement() { &gt; if(intTextBox != 0) &gt; { &gt; var contentID = document.getElementById('content'); &gt; contentID.removeChild(document.getElementById('strText'+intTextBox)); &gt; intTextBox = intTextBox-1; } } &gt; &gt; &lt;body&gt; &gt; &gt; &lt;form action="add_save.php" method="post" &gt; &gt; &gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;p&gt;&lt;a href="javascript:addElement();" &gt; &gt;Add&lt;/a&gt; &lt;a href="javascript:removeElement();" &gt;Remove&lt;/a&gt;&lt;/p&gt; &gt; &gt; &lt;input name="submit" type="submit" id=" " value="Submit"&gt; &gt; &lt;/from&gt; </code></pre>
php javascript
[2, 3]
2,066,714
2,066,715
How can I run PHP code within a Java application?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/614995/calling-php-from-java">Calling PHP from Java</a> </p> </blockquote> <p>I was wondering how I could run PHP code within Java. Using the ScriptEngine, I am able to run JavaScript:</p> <pre><code>String code="print(5+5);"; //sample bit of code ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByExtension("js"); try { engine.eval(code); } catch (ScriptException ex) { //catch statement } </code></pre> <p>To run this, I imported the library <code>javax.script.*</code>. I believe to run PHP I would have to import a similar library, and change the third line of the code above to the extension <code>php</code>. Unfortunately, I don't know which library this is. I have Googled to try and find the answer, and came across the PHP/Java Bridge library but I don't think this is exactly what I'm looking for, as it is focussed on running Java through PHP (as far as I know).</p> <p>I hope I haven't missed anything out, and any help would be greatly appreciated!</p>
java php
[1, 2]
473,174
473,175
jquery forward compatibility issue with checking all checkboxes
<p>I've got a js function using jquery that works fine with 1.8.3.js, but when I update to 1.9.1.js it quits. I really don't know anything about jquery at this point (it's on the list of things to study, coming up soon), so I really can't tell from looking at it where the problem might come in. Here is the code:</p> <pre><code>&lt;script type="text/javascript"&gt; var allCheckBoxSelector = '#&lt;%=GridView1.ClientID%&gt; input[id*="chkAll"]:checkbox'; var checkBoxSelector = '#&lt;%=GridView1.ClientID%&gt; input[id*="chkSelected"]:checkbox'; function ToggleCheckUncheckAllOptionAsNeeded() { var totalCheckboxes = $(checkBoxSelector), checkedCheckboxes = totalCheckboxes.filter(":checked"), noCheckboxesAreChecked = (checkedCheckboxes.length === 0), allCheckboxesAreChecked = (totalCheckboxes.length === checkedCheckboxes.length); $(allCheckBoxSelector).prop('checked', allCheckboxesAreChecked); } $(document).ready(function () { $(allCheckBoxSelector).live('click', function () { $(checkBoxSelector).prop('checked', $(this).is(':checked')); ToggleCheckUncheckAllOptionAsNeeded(); }); $(checkBoxSelector).live('click', ToggleCheckUncheckAllOptionAsNeeded); ToggleCheckUncheckAllOptionAsNeeded(); }); &lt;/script&gt; </code></pre> <p>Any suggestions on what the problem is here? Again, when referencing 1.8.3.js, it works perfectly, but when using 1.9.1.js checking the "check all" box doesn't have any effect.</p>
jquery asp.net
[5, 9]
3,910,994
3,910,995
javascript confirm value not working
<p>i have a confirm and alert message box. both are getting displayed at the right time.</p> <p>but in confirm box when i press cancel the applyaction_button_click is getting executed, which should not happen as i return false.</p> <p>Similar is the case with alert box which returns false still applyaction_button_click is getting executed.</p> <p>here is my code:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { ApplyAction_Button.Attributes.Add("onclick", "ShowConfirm();"); } protected void ApplyAction_Button_Click(object sender, EventArgs e) { // Action to be applied } </code></pre> <p>JS function:</p> <pre><code> function ShowConfirm() { //check if checkbox is checked if is checked then display confirm message else display alert message var frm = document.forms['aspnetForm']; var flag = false; for (var i = 0; i &lt; document.forms[0].length; i++) { if (document.forms[0].elements[i].id.indexOf('Select_CheckBox') != -1) { if (document.forms[0].elements[i].checked) { flag = true } } } if (flag == true) { if (confirm("Are you sure you want to proceed?") == true) { return true; } else { return false; } } else { alert('Please select at least Checkbox.') return false; } } </code></pre> <p>thanks</p>
c# javascript asp.net
[0, 3, 9]
142,825
142,826
JQuery - Set Attribute value
<p>I have following HTML with two elements having the same name</p> <pre><code>&lt;input type="hidden" name= "chk0" value=""&gt; &lt;input type="checkbox" name="chk0" value="true" disabled&gt; </code></pre> <p>Through JQuery, I want to set the enable the checkbox. So, I am using something like this:</p> <pre><code>$('#chk0').attr("disabled",false); </code></pre> <p>But this doesn't work. I assume JQuery is getting confused with two elements having the same identical name. Unfortunatel, I cannot avoid using two different names because, when the form is posted, I want all the checkboxes to get posted (not just the ones that are checked). Hence I have to use hidden element with the same name.. So, back to the question, how can I enable the checkbox through JQuery in the above scenario? Is there a "type" parameter for attr which distingues hidden from checkbox?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,556,264
1,556,265
How to include jQuery in an external .js file?
<p>I want to provide my clients a simple code to insert and get my plugin. </p> <p>The code:</p> <pre><code>&lt;div id='banner-lujanventas'&gt;&lt;/div&gt; &lt;script src="http://lujanventas.com/plugins/banners/script.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>The problem is that my plugin only works with jQuery. How do I check if a version of jQuery is installed on my script.js file and if not include it? (I can only modify my /script.js file)</p>
javascript jquery
[3, 5]
3,500,711
3,500,712
Single page website with login control
<p>I have a single page website (asp.net using c#) that displays some grid data when no user is logged in. When a user presses login a popup control opens and they can login. when logged in extra functionality is available on that page. Then after a period of inactivity (i.e no postback) i want the funtionality to be disabled automatically on that page and a message stating you have been logged off.</p> <p>Typical pages use a seperate login page but thats not what i want. is the above possible and how?</p> <p>thanks damo</p>
c# asp.net
[0, 9]
2,949,893
2,949,894
Reset a view in an asp.net MultiView
<p>I'm using an asp.net MultiView control with 2 Views inside. First view has a "create" button to create new customer. Clicking the "create" button will display the 2nd View of the MultiView which allows to enter customer information. Second view has a "return" button to return back to the 1st view.</p> <p>The problem is: after creating the first customer, clicking the "create" button again will render the 2nd view with first customer's information already entered.</p> <p>Is there a way to reset 2nd view to its default state whenever the "create" button is clicked? Perhaps, clearing out the viewstate?</p> <p>Currently I'm using a recursive method to clear out all the inputs (textbox, radiobutton, dropdownlist, etc.). I just want to know if there's a cleaner/better way.</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,619,058
4,619,059
Android java accessing URL from a string rather than hard coded
<p>I am trying to access an image via URl using the below code:</p> <pre><code>public class SingleListItem extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.details_list); TextView txtProduct = (TextView) findViewById(R.id.name); TextView txtLdesc = (TextView) findViewById(R.id.longdesc); SmartImageView imgPreview = (SmartImageView) findViewById(R.id.preview); imgPreview.setImageUrl(lpreview); Intent i = getIntent(); // getting attached intent data String product = i.getStringExtra("title"); String ldesc = i.getStringExtra("longdesc"); String lpreview = i.getStringExtra("preview"); // displaying selected product name txtProduct.setText(product); txtLdesc.setText(ldesc); </code></pre> <p>I am passing the "preview" value from another activity. This contains the URL from which I want to grab the image, but it varies from user selection in the previous activity. In <code>imgPreview.setImageUrl</code>, I would like to set that to the string <code>lpreview</code>, rather than hard coding it. </p>
java android
[1, 4]
4,542,575
4,542,576
hide div if container div has less charecter
<p>I am doing this to develop a read more. How do I hide the read more if the <code>#pdpTab4</code> has less than <code>540</code> charecters to begin with. </p> <pre><code>&lt;script&gt; $(function(){ var myDiv = $('#pdpTab4'); myDiv.html(myDiv.html().substring(0,540)); $('#pdpTab4').append('&lt;div id="readOne"&gt;Read More&gt;&lt;/div&gt;'); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,860,579
3,860,580
Print PDF or Image using PrintDocument
<p>I wrote code to print GIF image using print document and it works fine but facing problem for its height and width related.</p> <p>My code:</p> <pre><code>PrintDocument pd = new PrintDocument(); pd.PrintPage += new PrintPageEventHandler(this.PrintPage); pd.Print(); private void PrintPage(object sender, PrintPageEventArgs ev) { FileStream fs = File.Open(@"D:\\Test2.gif", FileMode.Open, FileAccess.Read); var image = System.Drawing.Image.FromStream(fs); try { ev.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; ev.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; ev.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; ev.Graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; ev.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; double WidthRatio = ev.MarginBounds.Width / (double)image.Width; double HeightRatio = ev.MarginBounds.Height / (double)image.Height; if (WidthRatio &gt; HeightRatio) { ev.Graphics.DrawImage(image, 0, 0, Convert.ToInt32(HeightRatio * ev.MarginBounds.Width), ev.MarginBounds.Height); } else { ev.Graphics.DrawImage(image, 0, 0, ev.MarginBounds.Width, Convert.ToInt32(WidthRatio * ev.MarginBounds.Height)); } } catch (Exception ex) { throw ex; } finally { fs.Close(); image.Dispose(); } } </code></pre> <p>Image properly opened But facing problem in height width and not properly displayed. Also want to print pdf using print document.</p> <p>Please help.</p>
c# asp.net
[0, 9]
2,745,331
2,745,332
Response is not come in a right way in jquery load method
<p>I uses j query Load Method to load a data in asp.net grid view , My Code for that is</p> <pre><code> $("#SelectedTestPart").load("PackageForm2.aspx?category=" + currentId2 + " #&lt;%= grdAllSelectedTest1.ClientID %&gt;", function (response) { rows = $("tr:gt(0)",response); rows.children("td:nth-child(7)").each(function() { ages += parseInt($(this).html()) } ); </code></pre> <p>But in the respone Whole html page(including script,both body and head section completely) is come back,i want that only a Html table will be came. How i Can do this</p>
jquery asp.net
[5, 9]
5,670,562
5,670,563
Getting width of a child div with width 100% gives windows width
<p>HTML:</p> <pre><code>&lt;div id="parent"&gt; &lt;div id="child"&gt; &lt;div id="child1"&gt;&lt;/div&gt; &lt;!-- UPDATE --&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>#parent{ float:left; width:90%; } /* UPDATE*/ #parent #child{ float:left; width:100%; } /* UPDATE*/ /* In a different file*/ #child1{ float:left; width:100%; } </code></pre> <p>jQuery:</p> <p>Say the width of the window is 1000px. So the width of #parent should be 900px. If I try to get the width of the #child1 it should also be 900px. But the below jQuery code returns 1000px.</p> <pre><code>jQuery("#child").width(); //UPDATE: returns 900px as width jQuery("#child1").width(); //UPDATE: returns 1000px as width </code></pre> <p>I need 900px as result of the above statement. </p>
javascript jquery
[3, 5]
2,663,868
2,663,869
Possible to sort rendered images based on class of parent div?
<p>I have some images that are wrapped within containers like this:</p> <pre><code>&lt;div id="swatchcontainer"&gt; &lt;div class="swatchimgouter"&gt; &lt;div class="swatchimginner"&gt; &lt;img src="whatever1.jpg" alt="some text" title="some text too"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="swatchimgouter"&gt; &lt;div class="swatchimginner swatchdisabled"&gt; &lt;img src="whatever2.jpg" alt="some text" title="some text too"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="swatchimgouter"&gt; &lt;div class="swatchimginner"&gt; &lt;img src="whatever3.jpg" alt="some text" title="some text too"/&gt; &lt;/div&gt; &lt;/div&gt; etc., etc. &lt;/div&gt; </code></pre> <p>It's not mission critical, but I got to thinking that it's probably possible to sort these images fairly easy using JQuery. I would like to place all images that are wrapped in the "swatchdisabled" class at the end.</p> <p>There could be a couple of dozen of these images. They're all styled with <code>float:left</code> and so they display horizontally in rows. Even if there are a couple of dozen, there are only 2 rows. Each of these images is 30 pixels by 30 pixels.</p> <p>It's just a UI consideration. Makes it a lot easier to keep track of which items are disabled and which are enabled by placing all disabled images at the end.</p> <p>If it's fairly simple to do this, I'll also need to keep their inner div classes with them.</p>
javascript jquery
[3, 5]
3,592,422
3,592,423
Pass data to anonymous Javascript function
<p>I'm trying to query a webservice with jQuery and insert the reply into my html page using jquery templates. My code currently looks like this:</p> <pre><code>$(function () { $('.media-releases h3 div').click(function () { var button = $(this); if ($(this).hasClass("expand")) { $(this).addClass("spinner"); var params = '{ "year": "' + 2012 + '", "month": "' + 02 + '" }'; $.ajax({ type: "POST", url: "NewsReleases.asmx/GetNewsReleases", data: params, contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var result = jQuery.parseJSON(response.d); $.get('NewsRelease.htm', function (data) { // The problem is here, button is null. // I assume I have to create a closure // but I'm not sure how to do it. var ul = button.parentNode.nextSibling; $.tmpl(data, result).appendTo(ul); }); button.removeClass("spinner"); button.parents('h3').next().slideDown(); button.removeClass('expand').addClass('minimise'); }, error: function (error) { /*Error handling code removed*/ } }); } else { button.parents('h3').next().slideUp(); button.removeClass('minimise').addClass('expand'); } }); </code></pre> <p>});</p> <p>How can I make the button variable accessible in the above function so I can append the template to it?</p>
javascript jquery
[3, 5]
688,222
688,223
Accessing data from iframe
<p>Suppose we have the following structure :</p> <pre><code> &lt;div id='main'&gt; &lt;div id="1"&gt; .. &lt;/div&gt; &lt;div id="2"&gt; &lt;iframe id="ifr" src="some"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>How can we access div#1 contents from inside the iframe#ifr?</p>
javascript jquery
[3, 5]
2,835,604
2,835,605
Asp.net Binding data without headers names
<p>I've got problem with automatic showing table with data from Database. I'm trying to do this in repeater control, but tables has got different count of columns, and different names of headers. I don't know how to do it more automatic and do not have to write i aspx file </p> <pre><code>&lt;%# Eval("UserId") %&gt; </code></pre> <p>To get data :</p> <pre><code>ds.SelectCommand = "EXEC procedure"; repExportedSendOuts.DataSource = ds.Select(new DataSourceSelectArguments()); repExportedSendOuts.DataBind(); </code></pre>
c# asp.net
[0, 9]
3,771,703
3,771,704
how to format number the using jquery
<p>I am trying to remove the number which are coming after "." then i want to format the number <strong>(16810900.211233)</strong> to like this <strong>(16,810,900)</strong> but i dont know how to do that here is my html is this:</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="http://cdn.webrupee.com/font" /&gt; &lt;div class="main"&gt; &lt;p class="active"&gt;10200.00&lt;/p&gt; &lt;p class="in_active"&gt;16810900.211233&lt;/p&gt; &lt;p class="active"&gt;0&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;1278200.543554&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;-&lt;/p&gt; &lt;p class="in_active"&gt;9,890.656&lt;/p&gt; &lt;p class="active"&gt;10,200&lt;/p&gt; &lt;p class="in_active"&gt;16810900&lt;/p&gt; &lt;p class="active"&gt;0&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;1278200.09&lt;/p&gt; &lt;p class="in_active"&gt;-&lt;/p&gt; &lt;p class="active"&gt;-&lt;/p&gt; &lt;p class="in_active"&gt;9890.00&lt;/p&gt; &lt;/div&gt;​ </code></pre> <p>i tried here <a href="http://jsfiddle.net/sureshpattu/Hrac3/2/" rel="nofollow">jsfiddle</a></p>
javascript jquery
[3, 5]
3,228,079
3,228,080
jQuery: Define multiple variables with a single chain?
<p>Is it possible to define multiple variables with a single jQuery chain?</p> <pre><code>var sectionTable = jQuery("#sectionsTable") var sectionTableRows = sectionTable.find("tr"); var sectionTableColumns = sectionTableRows.find("td"); </code></pre> <p>I don't know what the syntax would be if it is possible but if you took the 3 variables above how could you chain them and would it be considered good practice?</p> <p>Many thanks</p> <p>Chris</p> <p>EDIT:: Wow - thanks for all the comments. Sorry for being vague, what I was after was a better way if one exists of defining child variables from a parent. Thats why I thought of using the chain and wondered if a away existed. Thanks for the great advice.</p>
javascript jquery
[3, 5]
5,626,400
5,626,401
displaying a texarea value into another textarea value
<p>I've two input fields, both type textareas. </p> <pre><code>&lt;input id="display" type="text" disabled="disabled" style="border: none; background: none" /&gt; &lt;input id="name" type="text" /&gt; </code></pre> <p>And I'm using jQuery to display the value of <code>#name</code> into <code>#display</code>. The textarea <code>#display</code> is used only for displaying. (It can be changed to any other suitable HTML element)</p> <p>I use the jQuery code to do that:</p> <pre><code>$('#name').keyup( function() { $('#display').val($('#name').val()); }); </code></pre> <p>The problem is, as I type, I want the value inside <code>#display</code> to wrap within its width. When I type long strings in <code>#name</code>, the string wraps and falls down as the next line but in <code>#display</code> it doesn't do so.</p> <p>Again, when I type return, I want the same format to be followed up in the <code>#display</code> text field.</p> <p>Can anyone tell me how do I do that??</p>
javascript jquery
[3, 5]
1,484,682
1,484,683
javascript to disable /enable a checkbox
<p>I have the below syntax which unchecks a checkbox.</p> <pre><code>$('#h12_1').attr('checked','checked'); </code></pre> <p><code>h12_1</code> is the name of my checkbox.</p> <p>How do I disable the checkbox so it cannot be checked? similarly how do I enable the checkbox again?</p> <p>Something like this:</p> <pre><code> $.post('get_as_12', {data:selectedObj.value},function(result) { alert(result[0]) ; if(result[0] &gt; 0) { $('#h12_1').attr('checked','enabled'); $('#h12_1').attr('checked','checked'); } else { $('#h15_1').attr('disabled'); $('#h15_1').removeAttr('checked'); } }); </code></pre>
javascript jquery
[3, 5]
5,549,637
5,549,638
How to use aloha editor on the website
<p>I want to use aloha editor on my website and i downloaded it from [http://aloha-editor.org/].Now i am totally confused because the downloaded bundle contain lots of files.</p> <p>I pick up aloha.js and aloha.css and added the following script</p> <pre><code>$(document).ready(function () { Aloha.ready(function () { var $ = Aloha.jQuery; $('.editable').aloha(); }); }); </code></pre> <p>but its not working.Then i tried</p> <pre><code> &lt;script src="http://cdn.aloha-editor.org/current/lib/aloha.js" data-aloha-plugins="common/format, common/list, common/link, common/highlighteditables"&gt; &lt;/script&gt; &lt;!-- load the Aloha Editor CSS styles --&gt; &lt;link href="http://cdn.aloha-editor.org/current/css/aloha.css" type="text/css" /&gt; &lt;!-- make all elements with class="editable" editable with Aloha Editor --&gt; &lt;script type="text/javascript"&gt; Aloha.ready( function() { var $ = Aloha.jQuery; $('.editable').aloha(); }); &lt;/script&gt; </code></pre> <p>It works fine. But i want to use my downloaded bundle, Can anyone tell me how can i manage all the files &amp; folders (for ex- where i have to put image folder and other folder..) so it starts working?</p>
javascript jquery
[3, 5]
4,699,739
4,699,740
$.inArray issues with passing string from php script
<p>I'm having a problem with the inArray function not sure why. I'm passing a string back to the Javascript from my PHP it looks something like this 22,24 ect. I've tried using the split command to convert it to a Javascript array and I've tried it just as is. Either way the inArray function isn't finding 22, I've tried 22 with and without speak marks in the inArray function. </p> <pre><code>$.ajax({ url: "&lt;?=base_url(); ?&gt;/products/update_dropdown/"+&lt;?=$product['product_id']?&gt;+"/"+strUser, type: 'GET', success: function(msg) { var test; test = $.inArray(22, msg); alert(test); } }); </code></pre> <p>Thank you for any help this is really driving me nuts!</p>
php jquery
[2, 5]
409,240
409,241
javascript event.target throwing errors(but it works)
<p>Long story short, im making a small website using ajax but its more for mobiles.</p> <p>ive hijacked a few links and while testing on firebug, i get this error when clicking links</p> <pre><code>TypeError: e.target is undefined [Break On This Error] var myurl = e.target.href; </code></pre> <p>Now the thing is that although i get this error, it does work when i test it on a regular desktop and when i put on a mobile(ios) it also works and loads the AJAX content.</p> <p>Reason i want to fix it is because...well aside from having an error, im having another small issue and im not sure if its because of this so, trying to fix one by one.</p> <p>Heere are the two functions ive created to hijack the mobile sites links.</p> <p>javascript:</p> <pre><code>//~~~~~~~~~~~~~~~~~~~~~~~~~~~functions for mobile index load AND hijacking app function loadPage(url){ if( url == undefined){ $('#contentHere').load('index.html #content', hijackLinks); window.location.hash = mainHash; } else { $('#contentHere').load(url + '#content', hijackLinks ); } } function hijackLinks(e){ var myurl = e.target.href; e.preventDefault(); loadPage(myurl); mainHash = window.location.hash = $(this).attr("href"); console.log(mainHash); } </code></pre> <p>Anyone can help me with this? how would i fix this?</p> <p>Thanks in advanced.</p>
javascript jquery
[3, 5]
1,064,524
1,064,525
jQuery: return string as html
<p>I have a "Label" control on my form which is being populated via jquery. My problem however, is I need to return my string with html tags, but my label doesn't seem to recognize html. Here's my control:</p> <pre><code>&lt;label id="comment"&gt;&lt;/label&gt; </code></pre> <p>And here's how I'm working with it in javascript:</p> <pre><code>var comment; comment = $("#comment"); comment.text("&lt;b&gt;Please scan an &lt;br/&gt;item!&lt;/b&gt;"); </code></pre> <p>In the above code, the html in my string is ignored. Is there any way I can get my form to recognize the returned html tags?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,273,927
5,273,928
how to call getResouces() in a class that is not extended Activity?
<p>I would like to call getResouces in some classes, however, these classes are not extended to Activity. How to do it in a right way?</p> <p>regards penny</p>
java android
[1, 4]
2,643,076
2,643,077
implement jquery Plugin add method Validation
<p>I have a problem to use jquery Plugin/Validation.</p> <p>I want to add a method and follow the documentation but I think I still missing some thing.</p> <p>First I add the method but I think I have a problem to implement it.</p> <p>please check my code and advice me.</p> <pre><code> &lt;script src="js/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/jquery.validate.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { jQuery.validator.addMethod("domain", function(value, element) { return this.optional(element) || /^http:\/\/yahoo.com/.test(value); }, "Please specify the correct domain for your documents"); $("#aspForm").validate(); }); &lt;asp:TextBox ID="TextBox1" runat="server" CssClass="domain" &gt;&lt;/asp:TextBox&gt; &lt;/script&gt; </code></pre>
asp.net jquery
[9, 5]
2,528,138
2,528,139
How to use HTML Table as gridview
<p>How to fetch data from database in HTML TABLE rather than Gridview?</p>
c# asp.net
[0, 9]
5,137,044
5,137,045
How can I add and remove elements inside an array in Java?
<pre><code>String varname[] = {"red", "yellow", "green"}; </code></pre> <p>I have an array declared like this. I wanted to know how can I add or remove elements to and from this array?</p> <p><strong>NOTE : -</strong> Edited the question after seeing one of the OP's comments, saying what he wants.</p>
java android
[1, 4]
4,023,989
4,023,990
Is there a way to turn off auto-complete on an input-field using jQuery?
<p>Is there a way to turn off auto-complete on an input-field using jQuery?</p> <p>Like this:</p> <pre><code>&lt;input type="text" autocomplete="off" /&gt; </code></pre>
javascript jquery
[3, 5]
5,475,595
5,475,596
Subscribing to AJAX events in Facebook
<p>I'm developing a browser extension. I want it to be able to act on all DOM elements in Facebook. Now Facebook only loads the beginning of the page on page load and then makes repeated AJAX requests to get the rest of the page. I'd like to know when these loads happen so I can examine the added DOM elements. Is there any way to do this? I tried jQuery's <a href="http://api.jquery.com/ajaxSend/" rel="nofollow">ajaxSend</a> but it doesn't fire. BTW, since this is a browser extension I have full access to the DOM.</p>
javascript jquery
[3, 5]
5,101,462
5,101,463
What is the best approach for a Java developer to learn C++
<p>I consider myself an experienced Java developer and am planning to get started with learning C++. </p> <p>If you had same experience, i.e learn C++ after Java, I would like to hear your thoughts on what is the best approach at doing this. </p> <p>[Update] "the best approach" was not well quantified. What I am looking for is to leverage my existing java knowledge and programming experience so that I can quickly ramp up on C++.</p>
java c++
[1, 6]
3,100,981
3,100,982
How to stop function reload(window.reload) on jquery or javascript?
<p>Source</p> <pre><code>$(function reload(){ $.ajax({ . . . window.setTimeout(reload, 3000); }); }); </code></pre> <p>This function reload ajax page on every 3 sec.</p> <p>I want to make stop button(#stop).</p> <pre><code>$('#stop').click(function){ //STOP FUNCTION }); </code></pre> <p>Please let me know how to make it?</p>
javascript jquery
[3, 5]
2,708,847
2,708,848
How randomly to choose buttons
<p>I have a UI, like this</p> <p><img src="http://i.stack.imgur.com/5i6LC.png" alt="UI"></p> <p>What I want is to choose randomly 3 of them and change their texts. Thank you.</p> <p>UPD1: What ive tried:</p> <pre><code>ArrayList&lt;Button&gt; _btnList = new ArrayList&lt;Button&gt;(); for (int i = 1; i &lt;= 16; ++i) { _btnList.add(btn1); } </code></pre> <p>here I stucked, how to add all that buttons inside.</p> <p>upd2: done, really not to answer and put minuses make the mind to work</p>
java android
[1, 4]
1,013,562
1,013,563
How do you get the pageYOffset of from the bottom of the window and not the top ( Javascript )?
<p>I need to get the pageYOffset of the bottom of the viewable area, whether the user is zoomed in on the webpage or not, on Mobile Safari ( iPhone ). However pageYOffset returns the offset from the <em>upper left corner of the window</em>. </p> <p>Spec:</p> <p>"pageYOffset properties returns the pixels the current document has been scrolled from the <em>upper left corner of the window</em>"</p> <p>How do you get the page y offset from the bottom of the viewable area, (zoomed in or not) on the iPhone via Javascript?</p>
javascript iphone
[3, 8]
3,404,457
3,404,458
Session object doesn't store value
<p>I'm currently creating a webpage, and I want to transfer one object that is related to the current visitor of the site, to another page. I chose to do this with the Session item. But there seems to be a problem, I declare it's value on one page like this:</p> <pre><code>Session["CurrentAccount"] = new Account(tb_username.text, tb_password.text); </code></pre> <p>And want to retreive this data on another page like this:</p> <pre><code>Account currAccount = (Account)Session["CurrentAccount"]; </code></pre> <p>Whenever I try to do this, a nullreferenceexception occurs. The Account class isn't marked as serializable. And both pages are running under the same application.</p> <p>Edit: I've tried to do the same thing but instead binding a regular string to a session, this didn't work either.</p>
c# asp.net
[0, 9]
2,736,052
2,736,053
JQuery Pagination for multiple components of same type on a single webpage doesnt work
<p>On a single wepage i need to apply pagination for three similar type of components(c1,c2,c3) and end up getting all data being displayed only under first component with pagination(includes links to pages 123456- 1,2 includes c1 data, 3,4- c2 data, 5,6- c3 data). Even tried creating different set of pagination options. Would like to know if i am missing anything here.</p> <pre><code>var pagination_options = { callback: pageselectCallback, items_per_page:1 } function pageselectCallback(page_index, jq){ var items_per_page = pagination_options.items_per_page; var offset = (page_index) * items_per_page; var new_content = jQuery('#hiddenresult div.result').slice(offset, offset + $(items_per_page)).clone(); $('#Searchresult').empty().append(new_content); return false; } function initPagination() { var num_entries = jQuery('#hiddenresult div.result').length; $("#Pagination").pagination(num_entries, pagination_options); } $(document).ready(function(){ initPagination(); }); </code></pre> <p>Tried even adding another set of code for "#Pagination2" providing </p> <p>With this there is another pagination set getting displayed but still under same first component.</p> <p>I need pagination in all three similar type components separately on same webpage.</p> <p>Appreciate all your help &amp; Thanks!!</p>
javascript jquery
[3, 5]
93,512
93,513
add and remove classes in order with jQuery
<p>Im trying to say that, if my div doesnt have the class active add it. And if it does have the class active, remove it. </p> <p>Ive the following, only my code adds the class, then continues the query and removes it at the end, what would the best solution be, 2 seperat click funcitons?</p> <pre><code>$('.work-showcase').click(function(){ if ( !$(this).hasClass('active') ){ $(this).addClass('active'); } else { $(this).removeClass('active'); }; }); </code></pre>
javascript jquery
[3, 5]
3,589,533
3,589,534
How do I get values of input element with the same name as an javascript array?
<p>I want to get values of the input element that those elements are under the same name, name="items[]"<br/> for example:<br/></p> <pre><code>&lt;div&gt;...&lt;input type="text" name="items[]" value="1" /&gt;&lt;/div&gt; &lt;div&gt;...&lt;input type="text" name="items[]" value="2" /&gt;&lt;/div&gt; &lt;div&gt;...&lt;input type="text" name="items[]" value="3" /&gt;&lt;/div&gt; </code></pre> <p>And I wish to get the result something like:</p> <pre><code>[1, 2, 3] //that store in an javascript variable. </code></pre> <p>Do I need to do a loop to access all the elements to get its value? Please give me a good solution either javascript or JQuery.<br/> Thanks</p>
javascript jquery
[3, 5]
1,894,754
1,894,755
How to copy table structure from defaultview.table?
<p>I have created a datatable with three columns. I am sorting the data </p> <pre><code>DataTable dt= new DataTable(); DataColumn auto = new DataColumn("ID",typeof(System.Int32)); dt.Columns.Add(auto); auto.AutoIncrement = true; auto.AutoIncrementSeed = 1; auto.ReadOnly = true; dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] }; dt.Columns.Add(new DataColumn("Name")); dt.Columns.Add(new DataColumn("Precedence",typeof(System.Int32))); DataView dv = dt.DefaultView; dv.Sort = "Precedence ASC"; dt=dv.table </code></pre> <p>dv.table doesnot return me table structure of original table.I want the sorted data and the table schema(primary key) as well.</p>
c# asp.net
[0, 9]
5,344,557
5,344,558
jquery php embedding DOM element same problem
<p>When i embed or use php loops to create multiple div's with some id. I want each of them to use with jquery. Say anything like simple hide/show interface.</p> <p>But as the id is the same it wont work. I assign a variable lets say $i to php loop for the reference of uniqueness. I can assign id to a DOM element with like</p> <pre><code> &lt;div id="element-&lt;php echo $i ?&gt;"&gt;Bla Bla &lt;/div&gt; </code></pre> <p>Php echoes out here perfectly but how do i use it with jquery something like this:</p> <pre><code> $("#element"+&lt;?php echo $i ?&gt;).toggle(); </code></pre> <p>Here it doesnt works.</p> <p>How do i do it correctly and where am i going wrong ?</p> <p>Sorry for bad english.</p> <p>Thanks</p>
php jquery
[2, 5]
6,014,739
6,014,740
Find Control Text (ASP.NET/C#)
<p>Trying to pull the text value of the label that is dynamically populated by a SQL database. Any help would be greatly appreciated!</p> <p><em><strong>ASP.NET</em></strong></p> <pre><code>&lt;asp:Label ID="PlatformName" Text='&lt;%# DataBinder.Eval(Container.DataItem, "PlatformName") %&gt;' runat="server" /&gt; </code></pre> <p><em><strong>C# Code Behind (Which gives me the object, not the string value in the label)</em></strong></p> <pre><code>string strPlatform = GameGrid.Rows[counter].FindControl("PlatformName").ToString() </code></pre>
c# asp.net
[0, 9]
3,902,628
3,902,629
simple form validation with jquery serialize() function
<pre><code>$(document).ready(function(){ $('#send').click(function() { var names = $('#appontment_form').serialize(); //this is how my names variable look like //doctor=Dr.Fathmath+Shahuda&amp;date=2013-02-27&amp;time=1900+-+1700&amp;phone= var doc = $(names).filter('doctor'); if(doc !='') { $.ajax({ type: "post", url: "../../includes/jqueryRequireFiles/appointmentSave.php", data:names, success: function(data) { $('#confir').text('Your Appointment Received..'); } }); return false; } }); }); </code></pre> <p>I have a appontment form. when i click send link it will grab all the values in the textboxs and put it in the names variable through serialize() function. i want to filter the names variable and find out if any of the field is left not filled.. if only if then i will make the ajax part.. but its not working...any help</p>
javascript jquery
[3, 5]
4,901,301
4,901,302
Change the text of corresponding node with attribute's value using jquery
<p>How to change the text of corresponding node with attribute's value using jquery</p> <pre><code>&lt;div class="rating"&gt; &lt;h2 typename="First"&gt;One is First&lt;/h2&gt; &lt;h2 typename="Second"&gt;Two is Second&lt;/h2&gt; &lt;h2 typename="Third"&gt;Three is Third&lt;/h2&gt; &lt;/div&gt; </code></pre> <p>to </p> <pre><code>&lt;div class="rating"&gt; &lt;h2 typename="First"&gt;First&lt;/h2&gt; &lt;h2 typename="Second"&gt;Second&lt;/h2&gt; &lt;h2 typename="Third"&gt;Third&lt;/h2&gt; &lt;/div&gt; </code></pre> <p>Here I want to change the <code>h2</code> text with its corresponding attribute value <code>typename</code>. How to do so ?</p>
javascript jquery
[3, 5]
4,366,944
4,366,945
how to get a variable over to a function?
<p>i want to get a variable (which is set when a link is clicked) over to a function and show it as a pop out.</p> <p>the code as shown below:</p> <pre><code>$('a#link1').click(function(e){ e.preventDefault(); var value = 'true'; }); function exe(){ alert(value); } </code></pre> <p>when the function is executed , all i get is value is undentified.</p> <p>So anyone knows a way around it? </p>
javascript jquery
[3, 5]
2,447,246
2,447,247
Select the first field from jQuery autocomplete function automatically
<p>When I mouseover a field in my autocomplete list it adds a class named selected. I want it to do that by default on the first line as soon as you start typing. How would i select the first element in that list and change it's class? </p> <p>I'm using this now but it flickers a lot. </p> <pre><code>$('.name').eq(0).addClass('selected'); </code></pre>
javascript jquery
[3, 5]
3,261,704
3,261,705
how can l get the image size, before it loads into html?
<p>At first image height is coming as zero, after that by refreshing the page i am getting its actual height. I need to get its height at first time? could any body helps me?</p> <pre><code>$j(document).ready(function(){ var imgV = new Image(); imgV.src="http://www.kerrvilletexascvb.com/Riverside%20Nature%20Center3.JPG"; $j("#imgD").html(imgV.height); alert(imgV.height); }); &lt;div id="imgD"&gt;&lt;/div&gt; &lt;img src="http://www.kerrvilletexascvb.com/Riverside%20Nature%20Center3.JPG" /&gt; </code></pre>
javascript jquery
[3, 5]
4,069,161
4,069,162
Creating IPHONE application with PHP,Possible?
<p>I want to try to create an iPhone app using PHP and I do not know where to start. Please, give me example, guides or any information. Thank you very much! Niv</p>
php iphone
[2, 8]
412,463
412,464
login using open id authentication
<p>I would like to know as in StackOverflow website user can login with open id authentication how it has been done.Can I get any sample example of doing this.</p>
c# asp.net
[0, 9]
2,765,860
2,765,861
How to send Image and text messages to iphone using push notification in php
<p>I know the code for sending push text messages to iPhone but I want to send text and image to push notification. Please guide me.</p>
php iphone
[2, 8]
5,900,933
5,900,934
Jquery tabs, how to redirect?
<p>Hello all you programmers, well I have one problem with jQuery tabs. I am using jQuery for navigation between tabs, and jQuery code looks like this:</p> <pre><code>$(document).ready(function() { //Default Action $(".tab-content").hide(); //Hide all content $("ul.vertical-tab li:first").addClass("active").show(); //Activate first tab $(".tab-content:first").show(); //Show first tab content //On Click Event $("ul.vertical-tab li").click(function() { $("ul.vertical-tab li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab-content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); }); </code></pre> <p>First tab is always default, so when I work on second tab, and submit data to external php script, redirection always returns me on the first(default tab). My redirection looks like this:<strong><em>header('Location:<a href="http://www.administrator.php" rel="nofollow">http://www.administrator.php</a>');</em></strong></p> <pre><code>$con=mysqli_connect("localhost","root","","database"); $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $sql="INSERT INTO student (firstname,lastname) VALUES('$firstname','$lastname')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error()); } header('Location:http://www.administrator.php'); mysqli_close($con); </code></pre> <p>So because I use jQuery I can't redirect myself to desired tab using address. Help :/</p>
php jquery
[2, 5]
2,551,977
2,551,978
segregating data from database in datastructure
<p>i have a table which has cloumn :</p> <pre><code>vaccine_date text ,vaccine_name text ,mother_id text , child_id text ,address text </code></pre> <p>on the same date for the same child this table can have mutiple vaccine so the column repeats for same date with different vaccine name .</p> <p>I have to create a datastructure(HashMap) such the it should have date as key and all the vaccine name as Arraylist as a value to date. </p> <p>I am not getting way out.Wrote some piece of code :</p> <pre><code>HashMap&lt;String ,ArrayList&gt; hmap = new HashMap&lt;String,ArrayList&gt;(); String [] vaclist =new String [10]; String [] disdatelist = new String[20]; //ArrayList&lt;String&gt; ashu =new ArrayList&lt;String&gt;(); Cursor curdate=database.query(true,"calendar_updation", new String []{"vaccine_date"}, "child_id"+"="+ "?", new String []{childnme},null, null, null, null); while (curdate.moveToNext()){ String distinctvacdate = curdate.getString(curdate.getColumnIndex("vaccine_date")); ArrayList&lt;String&gt; ashu_distinctvacdate =new ArrayList&lt;String&gt;(); hmap.put(distinctvacdate, ashu_distinctvacdate); } // Addition of this part ends here Cursor cur=database.query(true,"calendar_updation", new String []{"vaccine_date","vaccine_name","address"}, "child_id"+"="+ "?", new String []{childnme},null, null, null, null); while(cur.moveToNext()){ // Addition for arraylist starts here while (hmap.isEmpty()){ if (hmap.equals(cur.getString(cur.getColumnIndex("vaccine_date")))){ String vaccinename = cur.getString(cur.getColumnIndex("vaccine_name")); ashu.add(vaccinename); } hmap.put(key, ashu); } </code></pre>
java android
[1, 4]
547,744
547,745
Jquery Animated Tab - revert on mouseout
<p>I'm trying to adapt Gaya Design's Animated Tabbed Content <a href="http://www.gayadesign.com/diy/animated-tabbed-content-with-jquery/" rel="nofollow">http://www.gayadesign.com/diy/animated-tabbed-content-with-jquery/</a> for a navigation menu. I want to have the background verting back to the first tab on mouseout but can't seem to get that working. Below is the Javascript for moving background function:</p> <pre> var TabbedContent = { init: function() { $(".tab_item").mouseover(function() { var background = $(this).parent().find(".moving_bg"); $(background).stop().animate({ left: $(this).position()['left'] }, { duration: 300 }); TabbedContent.slideContent($(this)); }); }, } $(document).ready(function() { TabbedContent.init(); }); </pre> <p>And here is a link to what I'm trying to achieve. <a href="http://www.stimulatingminds.co.uk/test/slider/slide.html" rel="nofollow">Link</a></p> <p>Any help on how to get the background to revert to tab one on mouseout will be very much appreciated!</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,386,454
5,386,455
Why app crashes when Timer is used to remove view?
<p>I'm very new to Andriod development. I'm trying to use Timer (from java.util) to remove a view 1sec after <code>onCreate</code>, this is what I've wrote.</p> <pre><code>Timer timer; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { ImageView startup = (ImageView) findViewById(R.id.startup); startup.setVisibility(View.GONE); } }, 1000); } </code></pre> <p>Not exactly sure why but my app crashes every time.</p> <p>It appears that there is something wrong with the timer. I've tried removing the timer and having <code>startup.setVisibility(View.GONE);</code> in <code>OnCreatee</code> and it works fine.</p> <pre><code> protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView startup = (ImageView) findViewById(R.id.startup); startup.setVisibility(View.GONE); //Didn't crash at all!!! } </code></pre> <p>It would be great if someone can explain to me why my app crashes when <code>timer</code> is used.</p>
java android
[1, 4]
2,149,312
2,149,313
String to integer convertion
<p>For one of my project I have to convert String to integer. How to convert <code>"16:45:20"</code> string to integer in java. I am using</p> <pre><code>int time = Integer.parseInt(string) </code></pre> <p>It's giving me <code>NumberFormatException</code> error. How to solve this</p> <p>Thanks</p>
java android
[1, 4]
1,179,815
1,179,816
hide div that contains <p> that contains "text" - how to
<pre><code>&lt;div id="example"&gt; &lt;ul&gt; &lt;p&gt;text&lt;/p&gt; &lt;/ul&gt; &lt;div&gt; </code></pre> <p>i need to hide div itself</p>
javascript jquery
[3, 5]
631,382
631,383
upload image and save file stream in View State
<pre><code> protected void upload_Click(object sender, EventArgs e) { if (Upload.Value !="") { System.IO.Stream fs = Upload.PostedFile.InputStream; img_uploadStream = Upload.PostedFile.InputStream; System.IO.BinaryReader br = new System.IO.BinaryReader(fs); Byte[] bytes = CreateThumbnail(br.ReadBytes((Int32)fs.Length),150); string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); imageField.Src = String.Format("data:{0};base64,{1}", "image/jpeg", base64String); } } </code></pre> <p>After upload the image , Upload.PostedFile.InputStream has set to null value . I want to save this Input Stream to asp.net View State to reuse .</p>
c# asp.net
[0, 9]
3,408,728
3,408,729
copy .aspx webform error
<p>I wanted to copy my .aspx file and paste it with all its content, but I run into an error.</p> <p>this is what I did : 1. Copy - Paste. 2. rename the new aspx file in the solution explorer. 3. rename the Inherits in the aspx file (the "code behind" there was already changed automatically for some reason..)</p> <p>I run into an error : "Type WebApplication21.Home" already defines a member called Page_Load with the same parameter types</p> <p>Thanks.</p>
c# asp.net
[0, 9]
3,398,429
3,398,430
Is there a way to clone elements using JQuery?
<p>Is there a way to clone HTML elements using JQuery?</p> <p>However, I want to be able to assign the cloned elements new attributes "id, name". So if I had a textfield element, I want to clone it <strong>without</strong> its value and <strong>change</strong> its id and name attribute to "exmple2" if it was named "example" previously.</p> <p>I would appreciate any help on this and any other implementation I can use to add more elements to my html form that already exists on the page.</p> <p>Thanks all</p>
javascript jquery
[3, 5]
683,795
683,796
HttpContext Cookie
<pre><code>if (HttpContext.Current.Request.Cookies.AllKeys.Contains("myCookie") &amp;&amp; !String.IsNullOrEmpty(HttpContext.Current.Request.Cookies["myCookie"].Value)) { HttpCookie myCookie = HttpContext.Current.Request.Cookies["myCookie"]; } </code></pre> <p>Is there something wrong with this code? Every once in a while, our production website will get a null reference exception on line 4. I can't reproduce this in test.</p>
c# asp.net
[0, 9]
4,226,994
4,226,995
C# - match many cases in a single run
<p>So the case is this:</p> <p>The user can provide a group of strings for a propert. ex: </p> <pre><code>DaysNeeded ="Sunday,Tuesday,Friday,Saturday"; </code></pre> <p>In the actual UI, the days of the week are available as check boxes. I'm trying to provide a way so that the user can also set the days needed in the code behind through a property.</p> <p>Now my query is, which strategy is the best way to execute certain pieces of code that are respective to the days that the user have provided. Meaning, the DaysNeeded property has sunday,Tuesday, Friday and Saturday. Each day has certain piece of code to be executed. If i have to have a forloop with a switch case for each day of the week, i feel it would cost more as i have to run the for loop, the number of days the user has given. </p> <p>Is there a way that i can run a single code that matches all the set of days the user has given and run the respective code pieces?</p> <p>Please let me know if I'm not clear with my query.</p>
c# asp.net
[0, 9]
2,458,520
2,458,521
How to disable browser back button in asp.net?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/961188/disable-browsers-back-button">Disable browser&#39;s back button</a> </p> </blockquote> <p>now i am trying to disable browser back option in All browser but is not working in chrome browser i am using this code </p> <pre><code>&lt;body onunload="javascript:history.go(1)"&gt; </code></pre>
javascript asp.net
[3, 9]
2,408,632
2,408,633
setting the selected option of a select tag with jquery
<p>If my jquery function is as below:</p> <pre><code>$('#shifts').change (function () { $.get('ajax/time_menus.php', { shift: $('#shifts').val() }, function(data) { $("#test").html( data ); }); </code></pre> <p>And returns a array with two time values contained in an array of six values: [hours][minutes][ampm][hours][minutes][ampm]</p> <p>How would I set the values of 6 correlated menus as to display the two times I just loaded.</p> <p>Is there a way to set the value via jquery or is it better to build the entire menu's in php and then pass them back and set the html.</p>
php jquery
[2, 5]
4,027,960
4,027,961
convert string to dynamic array with variables in javascript
<p>How would I take a string (that I got from a page using jQuery's text()) such as:</p> <pre><code>var myData = "[{name:'xxx',data:[1,2,3,4,5]},{name:'yyy',data:[5,4,3,2,1]}]"; //this is a string :( </code></pre> <p>And turn it into the actual javascript object that I need, so for example:</p> <pre><code>var myObject = [{name:'xxx',data:[1,2,3,4,5]},{name:'yyy',data:[5,4,3,2,1]}]; </code></pre> <p>So 'name' and 'data' will be non-dynamic variables, however names value, the data array and the length of myObject will be dynamic.</p> <p>Not really sure where to start with this one. I am guessing that I will have to do a whole lot of spliting and looping, but I am open to suggestions.</p>
javascript jquery
[3, 5]
4,058,088
4,058,089
How to add variable + databinding to ASP.NET link navigateurl?
<p>Let's say I have a repeater with the code:</p> <pre><code>&lt;ItemTemplate&gt; &lt;asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='&lt;%#DataBinder.Eval(Container.DataItem, "FileLeafRef")%&gt;'&gt; &lt;h2&gt;&lt;%# DataBinder.Eval(Container.DataItem, "Title")%&gt;&lt;/h2&gt; &lt;/asp:HyperLink&gt; &lt;/ItemTemplate&gt; </code></pre> <p>The FileLeadRef variable only contains the page name though (like test.aspx and not the full URL which I need). I can get the first part of the URL in a variable in page_load so I need to do something like:</p> <p><code>NavigateUrl='&lt;%myVariable + "/"%&gt;&lt;%#DataBinder.Eval(Container.DataItem, "FileLeafRef")%&gt;'</code> but it obviously doesn't work and a have tried a few varieties without success.</p> <p>Any suggestions?</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
1,775,392
1,775,393
Switch between two divs in JQuery
<p>I am tring to switch between two divs (a small text area and a bigger form field..sort of like twitter). The divs belong to two different classes like</p> <pre><code>&lt;div class = first onClick = "show();" &gt; </code></pre> <p> </p> <pre><code>&lt;div class = second style = "display:none;"&gt; contains a form that is supposed to redirect to some other .php page via the "action" field &lt;/div&gt; </code></pre> <p>I have the following javascript</p> <pre><code>function show() { $(".second").fadeIn('5'); $(".first").fadeOut('5'); } </code></pre> <p>When the form in the class = "second" is clicked however the page simply refreshes and div = "first" is displayed (instead of redirecting to the page that the form points to) What am I doing wrong?</p>
php javascript jquery
[2, 3, 5]
5,517,702
5,517,703
Why do I get a double console message for this function?
<p>I have the following function:</p> <pre><code>var checkNameLenght = function(name,nameLenght,allowedLenght,defaultName) { var result; if(!(nameLenght &lt;= allowedLenght) || !(/[^a-z]/i.test(name))) { result = name; } else { if(opts.debug == true) { console.log(name+' is to long or contains special characters / numbers | Please choose a name shorter than '+allowedLenght+' characters or remove any character / number'); } result = defaultName; } return result; } </code></pre> <p>I use it to check the length of a string ( in my case the value of an input ) and if it contains any special characters or numbers.</p> <p>I use it like so:</p> <pre><code>var input = 'Somevalue'; checkNameLenght(input ,input.length,16,'Username'); </code></pre> <p>The only thing is that if the <code>input</code> string contains some of the above conditions than the console will output the message twice. </p> <p>Why is that happening ?</p>
javascript jquery
[3, 5]
427,202
427,203
Populating a dropdownlist with a specific value plus an array of values from an sql query
<p>I am new to the wonderful world of dropdownlists and I know this is going to be difficult for me to explain but I will try the best I can. </p> <p>Here is my data:</p> <pre class="lang-none prettyprint-override"><code> **Type** **ID** **Status** Letter 1 A Letter 2 B Letter 3 C Letter 4 D Letter 5 E </code></pre> <p>From my query result I return the ID of "3" and my Drop Down List displays a "C". I have accomplished this piece already :). My question is, how can I populate the dropdownlist with the Statuses? My DDL will display a "C" and when it the arrow is clicked, the rest of the Status values will be displayed.</p> <p>Is this something that can be done with the sql query? Do I have to create a separate method? If someone could point me in the right direction or provide some helpful code that would be awesome! Here is my code:</p> <pre><code>SqlDataAdapter adapter = new SqlDataAdapter("SELECT Status FROM dbo.database WHERE ID = @ID AND Type = 'Letter'", mySqlConnection1); adapter.SelectCommand.Parameters.Add("@ID", SqlDbType.Char).Value = lblID.Text; adapter.Fill(test); ddlStatus.DataSource = test; ddlStatus.DataTextField = "Status"; ddlStatus.DataValueField = Status"; ddlStatus.DataBind(); </code></pre>
c# asp.net
[0, 9]
4,225,877
4,225,878
How can I add a client-side (JavaScript) confirmation message box using ASP.NET?
<p>How might I add a JavaScript message box with a confirmation option in ASP.NET?</p>
asp.net javascript
[9, 3]
1,414,081
1,414,082
pass multidimentional array from javascript to php
<p>Im running a javascript code which reads values from different XML files and it generates a multidimentional array based on those values. Now I need to pass this array to a PHP page. I tried different but it always pass the arrray as string not as an array. Anyone has an idea :( ... and thank you very much</p>
php javascript
[2, 3]
1,505,127
1,505,128
Clickable DIV with children links
<p>I have created a clickable <code>div</code> element that has a few links inside it. When I click anywhere on the <code>div</code> the page will go to the mail link but I want to be able to go to all the other links inside that <code>div</code>. I have managed to do this by calling the <code>e.stopPropagation();</code> method. This works very good. You can see it in action here: <a href="http://jsfiddle.net/nfZ3y/1/" rel="nofollow">http://jsfiddle.net/nfZ3y/1/</a></p> <p>The problem is, when hold the <code>ctrl</code> key and click on the link (to open it on a new tab), the link will not work and the page will go to the default link (instead of the one that I just clicked on). How can I achive all of the functionalities of the child links and add a default link for my <code>div</code>?</p>
javascript jquery
[3, 5]
354,473
354,474
Setting value to textarea doesn't work
<pre><code>var myText = $('#myTextBox').val() + '&lt;span id="caret_pos_holder"&gt;&lt;/span&gt;'; $('#myTextBox').val(myText); console.log($('#myTextBox').val()); </code></pre> <p>In the console log, there is no <code>&lt; span &gt;</code> tag. Why isn't the value of the textbox set to it?</p>
javascript jquery
[3, 5]
5,300,676
5,300,677
PHP + Redirect of Page Using Meta Tag HTML
<p>Here, In php code I am facing problem to redirect a page after valid login. Sample Code::</p> <pre><code> $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo "&lt;meta http-equiv='refresh' content='3;url=&lt;?php echo "home.php"; ?&gt;'&gt;"; } else{ ?&gt; &lt;META HTTP-EQUIV="refresh" content="5;URL=&lt;?php print "index.php"; ?&gt;"&gt; &lt;?php echo "Wrong Username or Password"; } ?&gt; </code></pre> <blockquote> <p>Here I wanna redirect the page to home.php.</p> </blockquote> <p>Please modify the following line ::</p> <pre><code>&lt;meta http-equiv='refresh' content='3;url=&lt;?php echo "home.php"; ?&gt;'&gt; </code></pre> <p>Thanks In Advance !!!</p>
php javascript
[2, 3]
827,843
827,844
php can't receive request from C# webrequest when post data length more than 8K
<p>I am trying to send base64 encoded data through C# <code>WebRequest</code> to php script. Then I receive sent data by <code>file_get_contents("php://input")</code>, when data length is lower than 8 KBs the php code is executed, otherwise it can't be executed. In the other hand php didn't receive the request.</p> <p>the code C#:</p> <pre><code> WebRequest request = WebRequest.Create(url); request.Method = "POST"; // postData is Base64_encoded byte[] byteArray = Encoding.UTF8.GetBytes(postData); request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse(); dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string responseData = reader.ReadToEnd(); responseData = SecurityUtils.DecryptUrlData(responseData); reader.Close(); dataStream.Close(); response.Close(); return responseData; </code></pre> <p>Could any one help?</p>
c# php
[0, 2]
946,960
946,961
Use a Javascript variable in C#
<p>I want to use a Javascript variable in C#, is it possible, how do I go about it? Thanks</p>
c# javascript
[0, 3]
2,561,162
2,561,163
Best way to learn how to write latency-critical, fast C++/Java/C# code?
<p>Could anyone give me some pointers as to the best way in which to learn how to do very low latency programming? I have many programming books but I've never seen one which focused (or helped) on writing extremely fast code. Or are books not the best way forward?</p> <p>Some advice from an expert would be really appreciated!</p> <p>EDIT: I think I'm referring more to CPU/Memory bound.</p>
c# java c++
[0, 1, 6]
5,237,316
5,237,317
Select value of a RadioButton
<p>I want to select a particular RadioButton based on its value</p> <pre><code>&lt;input id="RadioJ" type="radio" name="grp1" value="AAA" /&gt; &lt;input id="FaroK" type="radio" name="grp1" value="BBB" /&gt; &lt;input id="MartreLK" type="radio" name="grp1" value="CCC" /&gt; </code></pre> <p>Something like this:</p> <p>var radio = radio button whose value is BBB</p> <p>Another thing i am looking is that if a button is clicked, all the radiobuttons which are hidden should be visible.</p>
javascript jquery
[3, 5]
4,030,534
4,030,535
Adding target _blank to links after a page has been generated
<p>I have a tool that I wrote that takes Word documents (articles) from users, puts them in our website template, then uploads them to our testing web server. </p> <p>When they are copy and pasting their articles from Word, they would like all links to open in a new window. </p> <p>Is there a way to accomplish this? I can add a function to the website template from which the articles are being created from.</p> <p>edit: Your suggestions are great, however, one thing I overlooked was that adding a target blank attribute to ALL a tags will make clicks go to a new window. Here is one of my pages:</p> <p><a href="http://www.pachamber.org/newsroom/articles/2012/PA%20Chamber%20unveils%20results%20of%2022nd%20Pennsylvania%20Economic%20Survey.php" rel="nofollow">http://www.pachamber.org/newsroom/articles/2012/PA%20Chamber%20unveils%20results%20of%2022nd%20Pennsylvania%20Economic%20Survey.php</a></p> <p>Could I limit this to a div?</p>
javascript jquery
[3, 5]
1,884,232
1,884,233
DotNetOpenAuth in Asp.Net 3.5
<p>I implemented DotNetOpenAuth in my application. Its bulding dine but raising error saying unexpected response from the server. Error log is showing exceprtion while processing the login request. Let me know how to solve this.</p>
c# asp.net
[0, 9]
3,315,126
3,315,127
Cloning javascript library into iFrame
<p>I'm creating a popup dialog using jQueryUI. I have run into problems because I'm using exactly the same blocks of HTML and JavaScript code as on the page. (The application was not designed for that and I'm not going to recode it deeply). So I have two tags with same <code>ID</code> attributes in the document - on the page and in popup.</p> <p>To avoid this I decided to open the dialog in an iFrame. Everything works, of course, but the popup opens too slowly (it has a long list of JS and CSS files to load). They are in cache of course, but the browser seems to send requests to check them.</p> <p><strong>The question</strong>: can anything be done as a quick help? I can connect the parent window using Javascript, so can I somehow import, or clone (deep copy), for example, jQuery library? What do you think of it?</p> <p>(Please don't blame me if the question is crazy)</p>
javascript jquery
[3, 5]
5,095,036
5,095,037
Excel Report Setting page setup options in C#
<p>I am using the following approach to create a dynamic Excel Report from HTML in my ASP.NET Application. </p> <p>While creating the excel report, I want to set the Page Setup options such that the report fits into one page. </p> <p>This is the approach I'm using to create the excel report... Please tell me how to fit this report to one page or to zoom in the report?</p> <pre><code> string sContentType = "application/vnd.excel"; string sFileName = "Detail Qutation.xls"; Hashtable oData = new Hashtable(); oData.Add("Content-Disposition", "attachment;filename=" + sFileName); oData.Add("Charset", ""); oData.Add("ContentType", sContentType); oData.Add("Content", sTable.ToString()); oData.Add("IsBinaryContent", false); this.StoreObject("Document", oData); </code></pre>
c# asp.net
[0, 9]
3,313,276
3,313,277
Can I wrap a javascript event in a jQuery event?
<p>I have this code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ $('a.one').click(function(event){ event.preventDefault(); }); }); function test(event){ event.preventDefault(); } &lt;/script&gt; &lt;style type="text/css"&gt; a.test { font-weight: bold; } body { font-family:sans-serif; background-color:#AAAAAA;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;a class="one" href="http://jquery.com/"&gt;jQuery&lt;/a&gt; &lt;br/&gt; &lt;a class="two" href="http://stackoverflow.com/" onclick='test(event)'&gt;stack overflow&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The test-function does not work as it stands now, since a regular javascript event doesn't support the jQuery event preventDefault-function. Is there some way to wrap a regular javascript event in a jQuery event so that I can use e.g. preventDefault?</p>
javascript jquery
[3, 5]
1,907,951
1,907,952
Check if the requested user has admin privileges
<p>In a web application, is there any way to check the requested user has got admin privileges. Is it possible? Can you suggest one method?</p> <p>For example: a front-end user requests a page in my application. I want to know whether the user that made the request has admin privileges in his client machine. I have to check whether he is logged in with an admin privileged account in the system.</p> <p>I need the privileges of logged in user to the system not to my application , my application doesn't have a login. One user just request my home page or any other page and i just want to know that user is logged into his PC with an admin account or not?</p>
c# asp.net
[0, 9]
5,735,959
5,735,960
can we call a java method by js?
<p>In my Java Script , I want to call a java method . Is it possible to call a java method by js w/o using ajax?</p>
java javascript
[1, 3]
5,031,830
5,031,831
jquery change color using css one working but another is not working
<p>Why only name is changing the color but age is not changing ?</p> <pre><code>&lt;div id="user"&gt; &lt;?php echo $user_name; ?&gt; &lt;span class="age"&gt;&lt;?php echo $user_age; ?&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p>user name color chang is working but age inside span is not working.</p> <pre><code>$(document).ready(function(){ $('#user').css('color','red'); $('#user#age').css('color','gray'); }); </code></pre>
php jquery
[2, 5]
158,954
158,955
The importance of knowing c++ for web application development
<p>I'm a php developer and I want to broaden my knowledge base by learning a higher language (java, c#, c++). My specialty is in building web applications (ria etc). I'm trying to think of the appropriate path to take (hedging my bets so to speak) in terms of which language I should be focusing on. I love open source technology but at the same time C# seems to be getting a lot of notoriety. Despite the newer technologies available there still remains c++ which is the staple for many popular vendors including google and facebook (hip hop) in building scalable and robust cross platform apps.</p> <p>Can anyone offer suggestions as to how I should be looking at this. Should I go Java, C# or C++). They all take time to master and I just want to choose a specialty.</p> <p>Thanks</p>
c# java c++
[0, 1, 6]
666,867
666,868
Why does this jQuery return an index of 3?
<p>HTML:</p> <pre><code>&lt;ul&gt; &lt;li class="selected"&gt;First Item&lt;/li&gt; &lt;li class="disabled"&gt;Second Item&lt;/li&gt; &lt;li class="separator"&gt;Third Item&lt;/li&gt; &lt;li&gt;Fourth Item&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>jQuery:</p> <pre><code>alert($("li:not(.disabled,.separator)").index()); </code></pre> <p>According to <a href="http://api.jquery.com/index/">the documentation</a> for index:</p> <blockquote> <p>the return value is an integer indicating the position of the first element within the jQuery object relative to its sibling elements.</p> </blockquote> <p>Emphasis on <code>first element</code>. But the above code returns <code>3</code>. Based on the documentation shouldn't this code return <code>0</code>?</p> <p>You can see it in action here: <a href="http://jsfiddle.net/Zf9Vv/">http://jsfiddle.net/Zf9Vv/</a></p> <p><strong>NOTE:</strong></p> <p>My selector matches two elements: the first and last <code>LI</code>.</p>
javascript jquery
[3, 5]
2,789,745
2,789,746
jQuery / javascript wrapped code query
<p>I have inherited some javascript code that is wrapped in the following way:</p> <pre><code>(function ($) { //some javascript using jQuery here... } (jQuery)); </code></pre> <p>What does it do?</p>
javascript jquery
[3, 5]
2,440,660
2,440,661
ASP.NET Publishing with Entity Framework
<p>How to publish an ASP.NET C# Website with Entity Framework?</p>
c# asp.net
[0, 9]
4,377,997
4,377,998
How to send an value from .aspx page to JavaScript file?
<p>I have these functions:</p> <pre><code>function clear(txtvalue) { } function EnableValue (txtvalue, rfvValue) { } &lt;asp:Button ID="btn1" runat="server" OnClick="btn1_Click" onclientClick =" return clear('"+txtValue.ClientID+'"); Text="Button" /&gt; &lt;asp:Button ID="btn2" runat="server" OnClick="Button1_Click" onclientClick ="return EnableValue ('"+txtValue.ClientID+'",'"+rfvValue.ClientID+'")"; Text="Button" /&gt; </code></pre> <p>I have two functions where I am trying to send an value from my .aspx page (button) to a JavaScript file.</p> <p>I get an error telling server tag is not well formed.</p> <p>What is the issue here?</p>
asp.net javascript
[9, 3]
792,057
792,058
How to get POSTED data in php script?
<p>I am working on an android application in which I POST data using following code segments.</p> <pre><code> public void postData() { try { // Create a new HttpClient and Post Header HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://10.0.2.2/check/justprint.php"); // Add your data List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(); nameValuePairs.add(new BasicNameValuePair("id", "jaydeepsinh jadeja")); nameValuePairs.add(new BasicNameValuePair("password", "00000000000000")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); String text = EntityUtils.toString(response.getEntity()); Log.i("","response = "+text); } catch (ClientProtocolException e) { Log.e("Error:",e+""); e.printStackTrace(); } catch (IOException e) { Log.e("Error:",e+""); e.printStackTrace(); } } </code></pre> <p>My main requirement is that get this values in php script and display on web page. Is there any way to do the same?</p>
php android
[2, 4]