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 |
---|---|---|---|---|---|
808,699 | 808,700 | Using Google Map View on iOS versus on Android | <p>on iOS you don't need to specify the Google Map API key. But In android, you do have to specify, so the question why such difference?</p>
| iphone android | [8, 4] |
5,250,661 | 5,250,662 | Discard null value in string[] java | <p>I am taking some value by parsing the api and now i want to chek whether if through parsing the value comes null then the value should not be added to the string array and if there is some value then only should be added to the string[]. please help
This is my code:</p>
<pre><code> String[] title_array=null;
myparseobj=new XMLParser();
if(myparseobj.xmlParsing(url,"item","title") != null){
title_array=myparseobj.xmlParsing(url,"item","title");
}
</code></pre>
<p>But this is not working please help</p>
| java android | [1, 4] |
3,714,216 | 3,714,217 | How to generate sequence of numbers/chars in javascript? | <p>Is there a way to generate sequence of characters or numbers in javascript?</p>
<p>For example, I want to create array that contains eight 1s. I can do it with for loop, but wondering whether there is a jQuery library or javascript function that can do it for me?</p>
<p>Thank you</p>
| javascript jquery | [3, 5] |
5,783,993 | 5,783,994 | JavaScript synchronous custom prompt | <p>I need to use a custom prompt, just like the one shown in this <a href="http://abeautifulsite.net/notebook_files/87/demo">jQuery plugin demo</a>.
The problem is, all custom prompts depend on a callback, they are asynchronized, i need them to be synchronous.</p>
<p>I need to do something like:</p>
<pre><code>alert("Your name is " + myPrompt("What's your name?"));
</code></pre>
<p>Where myPrompt is a modal custom synchronous prompt.</p>
<p>Is it possible?</p>
<p>Thanks,
Naimi</p>
| javascript jquery | [3, 5] |
2,184,172 | 2,184,173 | Access database using Android App | <p>Im creating android application which sends data to remote database and receive data from that database. I tested my application from the mysql database hosted in my laptop and it worked fine. But now i need to host the database in order to test with my mobile phone.
I created database in <a href="http://www.freesqldatabase.com/" rel="nofollow">http://www.freesqldatabase.com/</a> and accessed it from php script in laptop. but i need to access database from my phone.
Please help me, i am completely lost.
Thanks in advance</p>
| php android | [2, 4] |
1,421,435 | 1,421,436 | Download a file from C# after posting valid data | <p>I want users of my c# application to be able to download a file from my website if they provide certain details.</p>
<p>I can download the file using in c# using:</p>
<pre><code>WebClient webClient = new WebClient();
webClient.DownloadFile("http://www.example.com/download.php", "file.txt");
</code></pre>
<p>And I can upload values using webClient.UploadValues method, but I don't know how to combine them. That is, to download the file and posting data at the same time.</p>
<p>The download.php file contains the following:
<pre><code>$file = 'file.png';
if ((file_exists($file)) and ($_POST["ID"] == 'abc') ) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
else
header('HTTP/1.0 404 Not Found');
}
?>
</code></pre>
<p>How should I post the data from C# and then download the file?</p>
| c# php | [0, 2] |
2,814,140 | 2,814,141 | Instant notifications like Facebook | <p>I am building a social application and was wondering how facebook achieve their notifications.
As you know, facebooks notifications are instant. As soon as someone takes an action, people are notified. </p>
<p>I assume they don't have a query running on the database all the time.</p>
<p>Can someone point me in the right direction. Thanks</p>
| c# asp.net | [0, 9] |
5,592,217 | 5,592,218 | Need help with jQuery to clone form dropdown (dynamic dropdown) | <p>I am using PHP to generate dynamic dropdown, the dropdown list items are fetched from database.</p>
<p>Here's the php code for that and it works.</p>
<pre><code><select name="title[]" id="title">
<?php $categories = Category::find_by_cid(5); foreach($categories as $category): ?>
<option value="<?php echo $category->name; ?>"><?php echo $category->name; ?></option>
<?php endforeach; ?>
</select>
</code></pre>
<p>What i want to do is, Using jQuery whenever a link with id AddNew is clicked, a new dropdown should appear below that, containing same values.</p>
<p>Also, is there any way to execute php code inside javascript??</p>
<p>ex :</p>
<pre><code><script>
var name = "<?php echo $user->name; ?>";
</script
</code></pre>
| php jquery | [2, 5] |
3,708,363 | 3,708,364 | split values in arraylist and store in different array list | <p>I am doing a project in android ,and i have a problem My array list values like this</p>
<p>[name1, addr1, place1, name2, addr2, place2]</p>
<p>How can i split this values and want to store name, address, places in different array list?</p>
| java android | [1, 4] |
5,284,399 | 5,284,400 | Div Click on Image / Slide to new div possible with JQuery? | <p>I am looking for some way to click on an image or link on a Div and it will slide to another div without changing to height...so something like the below</p>
<pre><code><div id="div1">
<img src="image.jpg" onclick="slide_to_other_div" />
</div>
<div id="div2" style="display:none">
<p>Another Div Here</p>
</div>
</code></pre>
<p>But I don't want an accordion effect... I want to slide to Div2 without affecting the height?</p>
<p>Explained further ... </p>
<p>Suppose you have a table></p>
<pre><code><table>
<tr>
<td id="div1"><a href="#div2">Slide to Div2 Direction --> </a></td>
<td> id="div2" style="display:none">This is Div 2</td>
</tr>
</table>
</code></pre>
<p>So, Div1 scrolls sideways to Div2 when I click on the link to Div2</p>
| javascript jquery | [3, 5] |
4,724,778 | 4,724,779 | Pausing on a line of code for a few seconds(delay) before moving to next code in C#? | <p>I would like to display a message for a few seconds before moving on to executing code that follows.
How can I do this in C#?</p>
<pre><code>page load ()....
{
label1.text="Thank you for your input";
Delay by 3 seconds??? before entering codeX
codeX....
code....
}
</code></pre>
<p>Is it as simple as using a <code>wait(3000)</code>?</p>
<p>Clarifying my Question:
I am creating a survey web part in sharepoint and would like to display the message "Thanks for your vote" for 3 seconds before rendering the results of the survey. I am assuming I could use the timer inside of an AJAX update panel, that way It wouldnt affect the rest of the page? I hope this clarifies my Question. Please let me know, the best way I can implement this. Thanks</p>
| c# asp.net | [0, 9] |
3,516,117 | 3,516,118 | Jquery: How to prevent further animating to the left when style: left == 0 or 0px? | <p>How would I prevent a div from scrolling further left when the style 'left' of that div reached '0' or '0px'? Right now I am using the animate custom effect to scroll a div left and right to display hidden overflows but when the div reaches '0' or '0px' on style: left, I want the user to be prevented from scrolling further left where there is no content, just empty space. I currently have the following code which doesn't seem to be working the way I want:</p>
<pre><code>$(document).ready(function(){
if ($("#ajax-matched-results").css('left') == '0' || '0px') {
$("#scrollLeft-results").click(function() {
$(".matched-results-items").animate({"left": "0px"}, "slow");
});
$("#scrollRight-results").click(function() {
$(".matched-results-items").animate({"left": "-=547px"}, "slow");
});
} else {
$("#scrollLeft-results").click(function() {
$(".matched-results-items").animate({"left": "+=547px"}, "slow");
});
$("#scrollRight-results").click(function() {
$(".matched-results-items").animate({"left": "-=547px"}, "slow");
});
}
});
</code></pre>
<p>Thanks for any help!</p>
| javascript jquery | [3, 5] |
3,354,112 | 3,354,113 | how dynamically Delete or reset an element from a javascript object | <p>I am trying to delete an object from its parent object without success... When i use 'delete' directly it works, but when i am in a loop over multile objects, i can't get it to work? What am i doing wrong in that $.each loop below:</p>
<pre><code><script>
rc = { oc: { 'Amt': 30, 'mpA': 3000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 },
tb: { 'Amt': 2000, 'mpA': 100000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 },
bl: { 'Amt': 300, 'mpA': 100000, 'ipP': 1, 'ppP': 12, 'mpP': 12000 } }
var carObj = {}
carObj['name'] = 'carObj';
console.log ( ' when created: carObj: ', carObj);
carObj['rc'] = rc;
console.log ( 'when rc Loaded: carObj: ', carObj);
delete carObj['rc'];
console.log ( 'when rc deleted: carObj: ', carObj);
// up till here delete works as expected.
// create two objects
var carObj1 = {}
var carObj2 = {}
// load objects with the 'rc' object
carObj1['name'] = 'carObj1';
carObj1['rc'] = rc;
console.log ( 'when rc Loaded: carObj1: ', carObj1);
carObj2['name'] = 'carObj2';
carObj2['rc'] = rc;
console.log ( 'when rc Loaded: carObj2: ', carObj2);
// !!! Here is where delete doe not work. i don;t get any errors, only rc not deleted from c
$.each([carObj1, carObj2], function (index, c){
console.log('before deleting rc', c);
delete c[rc];
console.log('After deleting rc', c);
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
257,914 | 257,915 | iPhone coords and onclick with JavaScript | <p>I have a couple of js queries.</p>
<p>Onclick isn't working on iPhones although its fine elsewhere.</p>
<p>JavaScript:</p>
<pre><code>document.onclick = function(){newTarg(speedS)};
</code></pre>
<p>Any ideas on way round this, thinking maybe onchange but not sure how best to implement?</p>
<p>Also I am trying to get coordinates of the touch please help, so far code below.</p>
<p>JavaScript :</p>
<pre><code>event = window.event;
xTarg = event.clientX;
yTarg = event.clientY;
</code></pre>
| javascript iphone | [3, 8] |
1,132,133 | 1,132,134 | Changing page width and height using RegisterStartupScript method in asp.net | <p>I want to change page width and height using RegisterStartupScpript method:</p>
<p>I tried</p>
<pre><code>ScriptManager.RegisterStartupScript(this, this.GetType(), "default2", "<script height:350; width:200 type=text/javascript> </script>", true);
</code></pre>
<p>but it doesn't work. Can you help me? How can I do?</p>
<p>I find solution thanks for everone</p>
<pre><code> ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open( 'Default2.aspx?adi=" + adi + "&soyadi=" + soyadi + "&ogrenci_no="+ogrenci_no+"&tel_no="+tel_no+"&sinifi="+sinifi+"', 'height=650,width=850,status=no,toolbar=no,menubar=no,location=no, scrollbars=yes' );", true);
</code></pre>
| c# asp.net | [0, 9] |
4,702,028 | 4,702,029 | aspx javascript enabling button and checkbox on scroll down | <p>This is the html i'm using. I'm trying to figure out why my button and checkbox never get set to enabled.</p>
<pre><code><form id="form1" runat="server">
<script src="js/mootools-core-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function checkScrollHeight() {
var textElement = document.getElementsByName("tosgareementdiv")[0].addEventListener("scroll", checkScrollHeight, false);
if ((textElement.scrollTop + textElement.offsetHeight) >= textElement.scrollHeight) {
document.getElementsByName("AcceptTOSButton")[0].disabled = false;
}
});
</script>
<div class="tosgareementdiv">
<p>hi my stuff</p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><br><br>
<br>
<br>
<br>
<br>
<asp:CheckBox ID="AcceptTOSCheckBox" Text="I Agree." runat="server" Enabled="false" />
<asp:Button ID="AcceptTOSButton" Text="I Agree" runat="server" OnClick="AcceptTOSButton_Click"
Enabled="false" />
</div>
</form>
</code></pre>
<p>I was following the example here but i'm not able to figure out how to get it to fire..</p>
<p>I know there is no code for the checkbox but why wont the button enable?</p>
| javascript asp.net | [3, 9] |
5,384,273 | 5,384,274 | Window.print() fails to print | <p>For printing my Aspx web page I use following code but in IE I encounter "Stack over flow at line:0" error message and in fire fox any thing doesn't happen.
what's wrong?</p>
<pre><code><head>
<script language="javascript" type="text/javascript">
function print() {
window.print();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="toolbar" style="width:400px">
<ul>
<li>
<img alt="" src="../../../CssImages/printer_128.png" id="ImgPrint" width="20px" style="cursor:pointer" onclick="print()"/>
</li>
</ul>
</code></pre>
| javascript asp.net | [3, 9] |
1,574,370 | 1,574,371 | writing a jquery message-box and join it to server-side handler | <p>I need some jquery code in my application I have a button on the page and I want to handle it by jquery when the user click on it to show a confirmation dialog for example Are you sure? yes|no buttons but this is an asp.net button inside the updatepanel and in the other side I have some server side code to delete a record from database but my question is how I can handle both of them? server side and jquery inorder to when "yes" button clicked it runs server side and delete recorde from database and if the button is no it stop running ?</p>
| c# asp.net jquery | [0, 9, 5] |
394,792 | 394,793 | jquery-1.6.4.min.js automatically redirect to google home page | <p>i have downloaded a website using HTtrack wepsite copier. All files are downloaded to my local system . But if i run the file in my local system it automatically redirect to the come page. This action is done by using the <a href="http://static.livedemo00.template-help.com/wt_37010/js/jquery-1.6.4.min.js" rel="nofollow">http://static.livedemo00.template-help.com/wt_37010/js/jquery-1.6.4.min.js</a> . I tried to remove that automatic redirection script but no use.please help me how to remove that script.</p>
| javascript jquery | [3, 5] |
4,559,405 | 4,559,406 | jquery to get/set href protocol | <p>I have some relative links on my site that need to enforce https even if the current page is http (so I can't just use //links).</p>
<p>I'm guessing there is a pretty easy way for jQuery to retrieve the href upon click, and then set the page location to match the link that was clicked prepended with the HTTPS protocol?</p>
<p>Thanks in advance!</p>
| javascript jquery | [3, 5] |
4,140,968 | 4,140,969 | how to put video inside apk? | <p>I want to add video in my app . But i have a problem . i read android developers and found the example of java code . but i dont understand . how to put video inside apk . and what path should be? I realized that the video should be on SD card , isnt it?. I'm confused .
Android developes VideoView.java :</p>
<pre><code>/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.apis.media;
import com.example.android.apis.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
public class VideoViewDemo extends Activity {
/**
* TODO: Set the path variable to a streaming video URL or a local media
* file path.
*/
private String path = "";
private VideoView mVideoView;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
if (path == "") {
// Tell the user to provide a media file URL/path.
Toast.makeText(
VideoViewDemo.this,
"Please edit VideoViewDemo Activity, and set path"
+ " variable to your media file URL/path",
Toast.LENGTH_LONG).show();
} else {
/*
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
*/
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
}
}
}
</code></pre>
| java android | [1, 4] |
3,605,352 | 3,605,353 | Selecting elements in a usercontrol using JavaScript | <p>I have a web form that contains a usercontrol and I would like to be able to access the html elements within the usercontrol from the form page using javascript.</p>
<p>I tried the following:</p>
<pre><code>document.getElementById('<%= usercontrol.clientid %>')
</code></pre>
<p>but this returned <code>null</code>. </p>
<p>I had a look around with firebug and found that the tags in the usercontrol render with clientids like usercontrolid_myelement. I'm guessing that something like this might work:</p>
<pre><code>document.getElementById('<%= usercontrol.clientid %>'+'_myelement')
</code></pre>
<p>Is there a better/nicer way of doing this? </p>
| javascript asp.net | [3, 9] |
488,735 | 488,736 | processing returned json array in jquery | <p>I have a PHP page that returns a piece of HTML to set the values of a menu.</p>
<pre><code>while($employee = mysql_fetch_array($query))
{
$employee_menu = $employee_menu . '<option value="'.$employee['id'].'">'.$employee['first'].' '.$employee['last'].'</option>';
}
echo json_encode ($employee_menu);
</code></pre>
<p>Then update it with jquery like this:</p>
<pre><code>$.get('http://www.sharingizcaring.com/schedule/menutest.php', { job: $('#job').val() },
function(data)
{
$("#employee").html( data );
});
</code></pre>
<p>For some reason the closing tags are being turned into <\/option> and thus displaying as either:</p>
<p>First Last <\/option>
First Last >\/option> </p>
<p>In the menu (Chrome) or as one line: First Last <\/option> First Last <\/option> (Firefox)</p>
<p>Is there something I need to do to the html besides json_encode before I pass it back or should I be returning an array and then creating the with jquery?</p>
| php jquery | [2, 5] |
1,167,692 | 1,167,693 | Using Jquery to check if a URL is valid | <p>A long running background process creates a text file to indicate the completion of the process. From the frontend, I'd need to check every few seconds if the text file has been created or not.</p>
<p>I am doing this check from <code>http://DomainA.com</code> However the file is created in <code>http://DomainB.com/Mytext.txt</code></p>
<p>Can someone help me write a jquery script that checks for a file across domain? </p>
<p>PS: Currently, I am doing a ajax postback that executes a <code>WebMethod</code> in ASP.NET that creates <code>HttpWebRequest</code>. This works functionally, but I have major performance problems. So, I need a light weight way of finding if a URL is valid or not.</p>
<p>Thanks</p>
| asp.net javascript jquery | [9, 3, 5] |
2,921,614 | 2,921,615 | Added text before an anchor tag | <p>I would like to add some text just before the anchor tag I click on. The following adds the text to the actual anchor tag itself:</p>
<pre><code>$(document).ready(function(){
$(".none_standard_links").live('click', function(event)
{
event.preventDefault();
$(this).prepend("test");
});
});
</code></pre>
<p>the above gives me html as shown below:</p>
<p>Before the link is clicked</p>
<pre><code><a href="#" class="none_standard_links">link one</a>
</code></pre>
<p>After the link is clicked</p>
<pre><code><a href="#" class="none_standard_links">testlink one</a>
</code></pre>
<p>What I want is this:</p>
<pre><code>test<a href="#" class="none_standard_links">link one</a>
</code></pre>
| javascript jquery | [3, 5] |
4,946,778 | 4,946,779 | Setting id to a panel control in gridview | <p>I have a panel control in gridview's template.<br>
I need to hide/unhide panel in javascript function, for that i need to pass panel's id to the javascript. </p>
<p>The problem is that all panels have the same id in gridview, so I need to set unique id to each panel.<br>
I tried to do:</p>
<pre><code><asp:Panel id= "Panel_<%# Eval("ID")%>"
</code></pre>
<p>and some other variations but always get an error.</p>
<p>The panel contains some other controls, I need it to be server side because I need to set at code-behind (after checking if user is authenticated) </p>
<p>What can I do?</p>
<p>p.s.<br>
It doesn't have to be Panel, any other control that I can find with Findcontrol and can hold other controls.</p>
<p><strong>Update:</strong> </p>
<pre><code>I set the the js event in code behind:
protected void gvw_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (UserIsAuthenticated)
{
HyperLink title = e.Row.FindControl("lnkTitle") as HyperLink;
Panel panel = e.Row.FindControl("panel") as Panel;
title.Attributes.Add("onmouseover", "ShowHidePanel(" + panel.ClientID +")");
//All get the same id!!!
}
}
}
</code></pre>
| asp.net javascript | [9, 3] |
2,119,390 | 2,119,391 | Let user review a file before uploading it | <p>I am programming a control to allow the users of our intranet to upload multiple files into our system, but with some added functionality.</p>
<p>Imagine you as a user are uploading N files, when you add N files the intranet presents you a list like this:</p>
<p>File_name_1 ..... [View] [Remove] [Upload]<br>
File_name_2 ..... [View] [Remove] [Upload]<br>
.<br>
.<br>
.<br>
File_name_n ..... [View] [Remove] [Upload]<br><br>
[Remove all file] [Upload all files]</p>
<p>If you clic on the View button the file named "file_name_X" will be opened so you can review it and be sure it really is the file you want to upload.</p>
<p>Is this possible?, I am new on the Web programming world and all I found suggest the browsers do not allow you to access local file system from inside a web, but I am not sure.</p>
| asp.net javascript | [9, 3] |
2,149,322 | 2,149,323 | Finding elements in an object that started as a string | <p>I've got a textarea:</p>
<pre><code><p>
Input:<br>
<textarea name="text_input" id="text_input"></textarea>
</p>
</code></pre>
<p>I'm trying to treat the textarea value as a jQuery object to be able to find each hypertext link.</p>
<p>That textarea has some related script code:</p>
<pre><code><script>
$('#text_input').change(process).keyup(process);
function process(){
var html = $('#text_input').val();
$(html).find("a").each(function(i,elem){
alert('got here');
});
}
</script>
</code></pre>
<p>In that textarea, I paste, for example, the text:</p>
<pre><code><html>
<body>
<a href="http://www.google.com/">hello</a>
</body>
</html>
</code></pre>
<p>Problem is, the <code>alert()</code> never fires. What am I missing? I guess the <code>$(html)</code> line has issues.</p>
| javascript jquery | [3, 5] |
5,702,956 | 5,702,957 | Input Boxes validation with JQuery | <p>Hello this is my second attempt to solve this problem with JQuery<br>
I need Check that a row of input must be minor than other one in the same row for a dinamic table of "n" rows, before send my form...I need check row by row using the input "ID" property...</p>
<p>Here my Code: <a href="http://jsfiddle.net/cespinoza/bQcu2/36/" rel="nofollow">http://jsfiddle.net/cespinoza/bQcu2/36/</a></p>
<pre><code> <form >
Line 1 Get <input type="val1" name="text1" id="desp" /> from <input type="val1" name="text1" id="cantidad" /><br>
Line 2 Get <input type="val2" name="text2" id="desp" /> from <input type="val2" name="text2" id="cantidad" /><br>
Line 3 Get <input type="val3" name="text3" id="desp" /> from <input type="val3" name="text3" id="cantidad" /><br>
<button type="submit">Submit</button>
</form>
</code></pre>
<p>Edited: Added the Original JS code</p>
<pre><code>$('#desp').change(function(){
if($('#desp').val() == $('#cantidad').val())
{
alert("First value is greater than second, sorry")
return False;
}
else
{
alert("All ok, push to database")
return True,
}
});
</code></pre>
<p>Thanks in Advance.<br>
Christian.</p>
| javascript jquery | [3, 5] |
5,763,900 | 5,763,901 | Is is safe to pass an Android Button object outside of an OnClick() handler? | <p>OK I really need to know if I can pass the button out to a method like this or not. Am I going about this right? I am a major Java newbie same with the TextView as well I guess I would assume they would act the same, I have tried searching but can't seem to find anything. Eclipse isn't throwing any wobblies and the app runs fine until I press a button then it crashes with a resource exception. Thanks in adavance :)</p>
<pre><code>b1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
gameTurnLogic(player, 0, b1, myTv);
}
});
</code></pre>
<p>}</p>
<pre><code>public void gameTurnLogic(boolean p, int buttonNumb, Button button, TextView textview){
if(player == true && board[buttonNumb] == 0){
board[buttonNumb] = 1;
player = false;
btnText(button, 'O');
textview.setText("Player 2's Turn");
checkWin(textview);
}
else if(player == false && board[buttonNumb] == 0){
board[buttonNumb] = 2;
player = true;
btnText(button, 'X');
textview.setText("Player 1's Turn");
checkWin(textview);
}
else if(player == true && board[buttonNumb] != 0){
textview.setText("location already used!");
}
else if(player == false && board[buttonNumb] != 0){
textview.setText("location already used!");
}
}
</code></pre>
| java android | [1, 4] |
1,462,580 | 1,462,581 | jquery div height run time issue | <p>Please see the below code </p>
<pre><code>panelHeight = $('.panel:eq(' + x + ')', slider).height();
</code></pre>
<p>it returns the height correctly. If the height varies run time it is not returnts the current value.</p>
<p>ie By normal condition i have 2 paragraph of text inside the div. SO the height is 100px.
Under onclick, the text will be varied from 2 paragraph to 5 paragraph. At that time the height is 500px. But it shows the height as 100px. </p>
<p>How to get this height. </p>
<p>Please refer this url <a href="http://vsoftdemos.com/coda/err.html" rel="nofollow">http://vsoftdemos.com/coda/err.html</a>
We used coda slider.
Here if you change the Teams: dropdown from 16 to 22 then 'Invite or Remove Owners' section have more data than they previously appear. At that time some of the 'Division Alignment' section content will disappear. We know this is due to height proble. But i dont know how to fix this. Please help. </p>
| php javascript jquery | [2, 3, 5] |
612,846 | 612,847 | Uncheck checkbox with jquery? | <p>Is it possible upon page entry to modify this code to uncheck check box id LOTL even if the page is cached?</p>
<pre><code><script type="text/javascript">
function formReset()
{
document.getElementById("LOTL").reset();
}
</script>
</code></pre>
| javascript jquery | [3, 5] |
2,177,308 | 2,177,309 | How to place image inside the edittext? | <p>I want to place implement search in my app for that I need to make a search bar like we see in the google bar image at the end of the text field. I have tried using FrameLayout and I place EditText and image, but it doesn' work ..How do I make it.</p>
| java android | [1, 4] |
2,250,819 | 2,250,820 | Using remove as opposite of append not working | <p>Here's how I append the value:</p>
<pre><code>$('<div>someText</div>').appendTo(self);
</code></pre>
<p>And here's how I want to remove it:</p>
<pre><code>$(self).remove('<div>someText</div>');
</code></pre>
<p>The appending works, the removing doesnt. What am I doing wrong?</p>
| javascript jquery | [3, 5] |
4,945,279 | 4,945,280 | How to highlight the first 10 characters of text using Javascript or jQuery? | <p>I want to highlight the first 10 characters of text and also color occurrences of the word "paragraph".</p>
<pre><code><html>
<body>
This is a heading
This is a paragraph.This is another paragraph.
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
3,107,873 | 3,107,874 | how do i select the previous li using jquery? | <p>I have an unordered list, but there are headers within it for different categories.</p>
<pre><code><ul>
<h2>header1</h2>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<h2>header2</h2>
<li>...</li>
</ul>
</code></pre>
<p>I'm trying to loop through them and order them by the date, but the headers are throwing it off.</p>
<p>I'm looping through using:</p>
<pre><code>var list = $('#articleList');
list.children("li").each(function () {
...
}
</code></pre>
<p>and I'm using this within the loop to select the one before it:</p>
<pre><code>var prev = $(this).prev("li");
</code></pre>
<p>For some reason, prev selects the headers if you are on the list item after the header instead of the list item before them. So my sorting ends up being correct within the headers, but I need the whole thing to be ordered, not just in sections.</p>
| javascript jquery | [3, 5] |
5,400,698 | 5,400,699 | Resizing of page when jquery dialog opens causes scrollbars on the page | <p>I am using JQuery dialog to display dialog box on my page. When i click on button JQuery Dialog pops up but it enables browsers scrollbars too. My default page does not show scrollbars it shows only when JQuery dialog opens. Do i need to set any dialog property to disable web page resizing when showing dialog in order to avoid showing scrollbars when JQuery Dialog opens? </p>
| javascript jquery | [3, 5] |
4,628,031 | 4,628,032 | how to set data from sql query into the gridview template field | <p>In my SQL query I retrieve 3 strings and the 3rd string has an URL. I created 2 templatefield contain labels and another template with an image. Now I want to set the values to the two labels and view the image by setting ImageUrl and display all the rows coming out from SQL query. </p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
//if (IsPostBack == false)
//{
// grdMaterial.DataBind();
//}
try
{
matType = int.Parse(Session["mattype"].ToString());
colorId = int.Parse(Session["color"].ToString());
matStyleId = int.Parse(Session["matstyle"].ToString());
try
{
matContent = Session["matContent"].ToString();
}
catch
{
panAval.Visible = true;
panNew.Visible = false;
dtab = new DBHELPER().getdataTable("SELECT [item_Id],[mat_Content],[mat_Image] FROM [item] WHERE [mat_Content]='" + matContent + "'");
//grdMaterial.DataSource = dtab;
//grdMaterial.DataBind();
}
catch (Exception ee)
{
}
}
protected void grdMaterial_Load(object sender, EventArgs e)
{
try
{
for (int i = 0; i < dtab.Rows.Count; i++)
{
//TextBox x = (TextBox)GridViewCarrinho.Rows[row.RowIndex].Cells[2].FindControl("txtQuantidade");
Label itemId = (Label)grdMaterial.FindControl("lblItemId");
itemId.Text = dtab.Rows[i]["item_Id"].ToString();
Label matContent = (Label)grdMaterial.FindControl("lblItemName");
matContent.Text = dtab.Rows[i]["mat_Content"].ToString();
Image itemImage = (Image)grdMaterial.FindControl("imgItemImage");
itemImage.ImageUrl = dtab.Rows[i]["mat_Image"].ToString();
}
}
catch (Exception ee)
{
}
}
</code></pre>
| c# asp.net | [0, 9] |
306,191 | 306,192 | onclientclick validation not working | <p>The submit button should validate all the txtboxes, so i have written this code,<br>
but it is not working
and <strong>I also want that if textboxes aren't empty, then it should postback and onclick should call, otherwise not</strong> </p>
<pre><code> function submit() {
for( var i = 0, t = document.getElementsByName( "txt" ), l = t.length; i < l; i++ )
if( t[i].value)
return true;
return false;
}
</code></pre>
<p><strong>.aspx</strong></p>
<pre><code><asp:TextBox name="txt" runat="server" ID="email" CausesValidation="True"
ClientIDMode="Static" ValidationGroup="email" ></asp:TextBox>
<b>Password:</b><br />
<asp:TextBox ClientIDMode="Static" ID="pwd" runat="server" name="txt" TextMode="Password" CausesValidation="True"></asp:TextBox>
<asp:LinkButton ID="Submit" runat="server" CssClass="button" Text="Login"
onclick="Submit_Click" OnClientClick="submit()" CausesValidation="False" />
</code></pre>
| javascript asp.net | [3, 9] |
968,420 | 968,421 | Inline code in head tag asp.net | <p>Is it possible to do something like this in a head tag, of master page, which has runatserver</p>
<pre><code> <link rel="Stylesheet" type="text/css" href='<%=Config.ResourcesDomain %>/images/style.css' />
</code></pre>
<p>This is not working, as it produces this kind of html :</p>
<pre><code><link rel="Stylesheet" type="text/css" href="&lt;%=Config.ResourcesDomain %>/images/style.css" />
</code></pre>
<p>Thank's</p>
| c# asp.net | [0, 9] |
917,678 | 917,679 | How to highlight specific row in a DetailsView? | <p>I am a new ASP.NET developer. I am using a DetailsView now to dispaly some data from the database. I have the need to highlight certain two rows from the DetailsView. Both rows are VARCHAR data type.
<strong>SO HOW TO DO THAT?</strong></p>
| c# asp.net | [0, 9] |
5,758,535 | 5,758,536 | Trying to check if a file exists in internal storage | <p>The following code is how I am trying to identify if a file exists in the internal storage, <code>MODE_PRIVATE</code>.</p>
<pre><code>public boolean isset(String filename){
FileInputStream fos = null;
try {
fos = openFileInput(filename);
//fos = openFileInput(getFilesDir()+"/"+filename);
if (fos != null) {
return true;
}else{
return false;
}
} catch (FileNotFoundException e) {
return false;
}
//File file=new File(mContext.getFilesDir(),filename);
//boolean exists = fos.exists();
}
</code></pre>
<p>However, it goes into the exception and doesn't continue with the code. It doesn't do the return. Why?</p>
| java android | [1, 4] |
2,696,259 | 2,696,260 | Ad-Gallery Loader.gif not showing? | <p>I found this image gallery <a href="http://coffeescripter.com/code/ad-gallery/" rel="nofollow">http://coffeescripter.com/code/ad-gallery/</a> but I am having trouble.
the loader.gif image is not showing up at all in IE9 just a red x. I am a newbie to javascript, this is at the top of the javascript file</p>
<pre><code>(function($) {
$.fn.adGallery = function(options) {
var defaults = { loader_image: 'loader.gif',
</code></pre>
<p>the image is in the same directory as this javascript file so the path is ok.. also there is no mention of this loader.gif in the css file at all. </p>
<p>this is the my site, www.kayleighwhite.org/black_white.html</p>
| javascript jquery | [3, 5] |
26,918 | 26,919 | Change value of JQuery appended elements | <p>So I have newly appended elements on my page that are being appended with Jquery.live(), I now want to change the value of those after those elements have been appended. </p>
<p>So something like </p>
<pre><code> $("#questionForm").empty();
$.get("questionCreator.html", function(data){
$("#questionForm").append(data);
});
var index=$(this).parent().index();
id = index;
var associatedQuestion = idQuestionAssociation[index];
var associatedResponses = idResponsesAssociation[index];
if(associatedQuestion != null){
$(".questionInput").val(associatedQuestion);
}
</code></pre>
<p>So the .val() call, I think is not working because there is no .questionInput element initially, and this is appended. I feel like I should be using .live, or .delegate, or .on, but I'm not sure what event I should be using. </p>
<p>Can anyone help? </p>
| javascript jquery | [3, 5] |
2,164,611 | 2,164,612 | about broadcast receiver | <p>Hi all I want to create an application in which there is an activity say My activity. Now I want to start it with incoming call, if it is not answered within 20 seconds.Please Help me. </p>
| java android | [1, 4] |
636,272 | 636,273 | jQuery .remove() doesn't fire in IE8 | <p>Who can explain this, please?</p>
<p>In my function, I use <code>.remove()</code> to remove one row of a <code><select></code> box (I mean to remove an <code><option></code>) but why doesn't it work?</p>
<p>In FF it looks good, but in IE8 ... fail. </p>
<p>Let's see an example:</p>
<pre><code><form name="test">
</code></pre>
<p>I have two <code><select></code> boxes, the first is:</p>
<pre><code><select id='car1' name='car1' onchange='car_remove();'>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</code></pre>
<p>and the second is:</p>
<pre><code><select id='car2' name='car2'>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</form>
</code></pre>
<p>including this tiny JavaScript function (with <code>jquery.js</code> include script in header):</p>
<pre><code>function car_remove()
{
car1_selected = document.test.car1.value;
$("#car2 option[value="+ car1_selected +"]").remove();
}
</code></pre>
| javascript jquery | [3, 5] |
2,952,376 | 2,952,377 | calculation inside the grid | <p>I want to calculate inside the grid,multiple of 2 textBox values, key-press or keyup event.
can u provide me some javascript for this. I use the following code it does not work for me
javascript</p>
<pre><code>var a = document.getElementById(txtlabchrgsNooflab);
var b = document.getElementById(txtlabchrgsTotalCost);
txtlabchrgsTotalCost=a*b;</code></pre>
| javascript asp.net | [3, 9] |
3,489,022 | 3,489,023 | php page redirect after operation | <p>I have a page (index.php) which has a php grid with subpages(<<1,2,3,4>>). An operation on any page takes you back to index.php. Using $_GET['prd_p'] or $_REQUEST['prd_p'] gives you the page number. I want users to stay on a page after an operation, that means i have to use redirects. </p>
<pre><code><form name="frmSearchMe" action="<?php echo $page_name; ?>" method="POST">
<tr>
<input class='form_button' type='submit' name='btnSubmit' value=' Save ' onclick='return checkerrors();' /></td>
</tr>
//php codes here
</form>
</code></pre>
| php javascript | [2, 3] |
3,174,557 | 3,174,558 | Check if DOM Element exists automatically before appending in JQuery | <p>Basically, I want a check to run every time I append or prepend to the DOM that the element I am putting in does not exist. I am making sophisticated applications and on occasion have made duplicate elements causing events to not trigger properly.</p>
<p>I don't want to have to run this check manually each time I change the DOM, I would like it to be ran automatically when the prepend, or append functions are called. Is there an event I could listen for when a function is called?</p>
<p>I wouldn't use this check when the application is released because I realize that it could severely hamper performance, but during development it would be very valuable. </p>
| javascript jquery | [3, 5] |
3,042,072 | 3,042,073 | sort gridview with dynamic linq | <p>I have a gridview with several columns, 3 of which I'd like to sort.
The source for the data is held in the session.</p>
<pre><code>protected void MyGridHistorySort(object sender, GridViewSortEventArgs e)
{
var TheColumn = (e.SortExpression).ToString();
TheDataHistory = (List<ViewDataHistoryModel>)Session["SessionDataHistory"];
var test = "data.DataDate";
var NewDataSource = from data in TheDataHistory
orderby test
select data;
MyGridHistory.DataSource = NewDataSource;
MyGridHistory.DataBind();
</code></pre>
<p>DataDate is a valid column in the list but the orderby statement doesn't work. Ideally, I'd like it to sort with the variable TheColumn by writing something like test = "data."+TheColum; and then add a sort direction based on a boolean. I looked at the OrderBy extension method NewDataSource.OrderBy(test); but that doesn't work either.</p>
<p>What am I missing to make my code work?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
3,998,230 | 3,998,231 | Jquery remove and $(this) | <p>I have problem with <code>remove()</code> method. I can't remove <code>$(this)</code> object. My code is:</p>
<pre><code>$(".submit_add_type").live("click", function() {
var parent = $(this).parent();
var type_value = parent.children('.type_value').val();
var type_name = parent.children('.type_name').val();
var parent2 = parent.parent();
var permission = parent2.attr('id').replace('perm_types_', '');
$.ajax({
url: "/admin/ajax/permission_type_add", type: "POST", cache: false,
data: {
permission: permission,
type_value: type_value,
type_name: type_name,
},
success: function(text) {
if(text.substr(0,2) == "ok") {
var id = text.replace('ok|', '');
$(this).remove();
parent.append('<input class="submit" type="submit" name="" value="edytuj" id="edit_type_'+ id +'" /> <input class="submit delete_type" type="submit" name="" value="usuń" id="delete_type_'+ id +'" />')
} else {
alert(text);
}
}
});
});
</code></pre>
<p>When I change <code>$(this).remove();</code> on <code>$(".submit_add_type").remove();</code> it works perfectly. What could be wrong?</p>
<p>The thing is, there can be other objects with this <code>submit_add_type</code> class and I want to remove only a particular one.</p>
| php jquery | [2, 5] |
4,101,611 | 4,101,612 | scroll to just below my div? | <p>I got a div that expands on a click, sometimes its at the bottom of the page and its close to the bottom. What i want is that when its close to the bottom that it should scroll down just below it. </p>
<p>My solution so far is below. I get how to calculate the values and animate an all but i just dont get why my script wants to scroll to the bottom of the page, it just slams it to the bottom. Any ideas?</p>
<p><strong>EDIT</strong><br />
Doh ofcause its gone scroll to the bottom. Question is how do i scroll so its just below my div by 10px? Im not suppose to say <code>scrollTop: total</code></p>
<p>jquery</p>
<pre><code> var $ediv = $this.parent('div').find('.order-expand-row');
var hDiv = $ediv.outerHeight();
var oDiv = $ediv.offset().top;
var wHeight = $(window).height();
var total = hDiv + oDiv + 10;
if (total >= wHeight) {
$('html, body').animate({ scrollTop: total }, 600);
}
</code></pre>
| javascript jquery | [3, 5] |
4,938,488 | 4,938,489 | Call function inside iframe | <p>im trying to do something here. I have a document which I set an array. Then, jquery takes this array and appends an iframe for each value:</p>
<pre><code><script>
var containers = new Array("test1", "test2");
</script>
</code></pre>
<p>This results is 2 iframes, identified by id with his name. Ok. perfect, working. Then, inside of each iframe, it calls a document. Inside this document, I have a function called <code>play()</code>. </p>
<p>I am testing <code>play()</code> by returning an alert. Whenever I click on a button, it works:</p>
<pre><code>$("#viewport .next").click(function(){
document.getElementById(containers[current]).contentWindow.play();
});
</code></pre>
<p>This works. Perfectly. But I it put this function to trigger on document ready, it doesnt works.</p>
<pre><code>$(function() {
document.getElementById(containers[current]).contentWindow.play();
});
</code></pre>
<p>It returns to me:</p>
<p><code>Uncaught TypeError: Object [object Window] has no method 'play'</code></p>
<p>Whats am I doing wrong guys?
Thanks!</p>
<p><strong>EDIT</strong></p>
<p>Tried to apply onload on iframe. Didnt work.</p>
<pre><code>var initialFrame = containers[qual];
initialFrame.onload = function() {
document.getElementById(initialFrame).contentWindow.play();
};
</code></pre>
<p><strong>EDIT2</strong></p>
<p>For some reason, it started working. Thanks!</p>
| javascript jquery | [3, 5] |
636,011 | 636,012 | PHP code fails in main server | <p>I have integrated a Pop up window(new browser window) control on click of a link. It works
really well on local server(PHP 5.3) but not in the main server(PHP 5.1)</p>
<p>Here's the Javascript code to pop up window</p>
<pre><code>window.open ('http://www.xyzsite.com/edo/hints.php?Para1='+hin, '', 'width=250,height=100');
</code></pre>
<p>Is it because of difference in PHP version or any other configuration difference I should look for?
Please give me ur inputs.</p>
| php javascript | [2, 3] |
899,576 | 899,577 | How to set the function to make user click the table header to change sorting order | <p>I want to let user click the table header to sort the table, but can just set the ascending order, can not set the descending order in the same table header. following is the function I used, </p>
<pre><code>function sortBy(sKey)
{
document.sortResultsForm.sSortBy.value=sKey;
document.sortResultsForm.submit();
}
function sortDistrictNamedescend($a, $b)
{
if ($a->DistrictName == $b->DistrictName)
{
return 0;
}
return ($a->DistrictName < $b->DistrictName) ? 1 : -1;
}
function sortDistrictNameascend($a, $b)
{
if ($a->DistrictName == $b->DistrictName)
{
return 0;
}
return ($a->DistrictName < $b->DistrictName) ? -1 : 1;
}
if($sSortBy=="District")
{
usort($tempArr, 'sortDistrictNameascend');
}
</code></pre>
| php javascript | [2, 3] |
2,798,312 | 2,798,313 | jquery create a unique id | <pre><code>$(document).ready(function() {
$('a.menuitem').click(function() {
var arr = 0;
var link = $( this ), url = link.attr( "href" );
var newDiv = $( document.createElement( 'div' ) )
$( "#content_pane" ).append( newDiv );
newDiv.load( url );
return false;
});
});
</code></pre>
<p>As you can see I am creating a <code>div</code> and adding some content to it, how would I give each <code>div</code> that is created a unique id, something like section1, section2, section3, etc?</p>
| javascript jquery | [3, 5] |
5,250,883 | 5,250,884 | For Android, should I use the float datatype more often for my game, or just cast to float when drawing? | <p>Android uses the RectF structure for drawing bitmaps. I am working on my game structure, so for example, a Sprite will have and x/y coordinate, width, height, speed, and so on. This means every time in my render loop I have to cast those integers to floats when figuring out the source/target RectF's to use... alternatively, I can be far more universal and use floats everywhere so that when it comes time to simulate the physics and render, all of the types are already of the same type... even if it is unnecessary for what the property is (I don't need a float for "x position", but will have to cast it when rendering if not).</p>
<p>if floats generally are 2-10x's more ineffient (per <a href="http://developer.android.com/guide/practices/performance.html">http://developer.android.com/guide/practices/performance.html</a>), what is the proper course to take? </p>
<p>TLDL: Should I cast int's to float on render, or just have all of the contributing variables be floats to begin with, even if floats are inefficient? How inefficient is a typecast?</p>
| java android | [1, 4] |
827,912 | 827,913 | jQuery audio buffered function throws DOM error | <p>I've got this little function to show the amount the audio has buffered. Its a pretty simple little thing and I am not sure why it is throwing the error <code>Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1</code>.</p>
<pre><code>$(song).on('progress', function() {
$("*[data-url='" + url +"'].body_container .player .load_progress").show();
var loaded = parseInt(((song.buffered.end(0) / song.duration) * 100), 10);
$("*[data-url='" + url +"'].body_container .player .load_progress").css({width: loaded + '%'});
});
</code></pre>
<p>I know this is a duplicate of things like <a href="http://stackoverflow.com/questions/2923564/uncaught-error-index-size-err">this</a> but i cannot get this to work properly. It seems to behave reasonably normally apart from the error of course. Only at times width is not drawn with the buffering as the seeker overtakes the buffering. Im on localhost so the audio does buffer instantly.</p>
<p>Thanks in advance!</p>
| javascript jquery | [3, 5] |
3,775,575 | 3,775,576 | How do I format a timestamp in Javascript to display it in graphs? UTC is fine | <p>Basically, I receive raw timestamps and I need to format them into HH:MM:SS format.</p>
| javascript jquery | [3, 5] |
5,442,499 | 5,442,500 | Selecting readOnly textboxes with JQuery | <p>In my ASP.NET MVC project i need to select all text boxes that have attributed "readOnly" in current page and show modal Jquery dialog in keypress on the disabled text box.Any help appreciated.</p>
| javascript jquery | [3, 5] |
5,718,816 | 5,718,817 | How do I save an Image from an url? | <p>How do I take an image from an url and save it locally?</p>
<p><a href="http://someurl.com/imagename.jpg" rel="nofollow">http://someurl.com/imagename.jpg</a>
-> c:\apppath\imgfolder</p>
<p>ASP.NET C#</p>
<p>I am not very good with IO stuff, hope someone can help me out :)</p>
| c# asp.net | [0, 9] |
1,811,762 | 1,811,763 | Is there an href alternative for no-javascript? | <p>I'm currently using javscript and classes to handle my click events like so:</p>
<pre><code><a class="forgotten" href="#">Forgot your password?</a>
$('.forgotten').click(function(){
location.href = "forgotten.php";
return false;
});
</code></pre>
<p>Is there a way to evaluate that function first and if javascript is disabled simply go to forgotten.php?</p>
<p>I know I could easily remove the class and add forgotten.php to href but I'm making heavy use of jquery address so it would break some of my site.</p>
| javascript jquery | [3, 5] |
505,024 | 505,025 | Parse html list with javascript then output drop down | <p>I am trying to write some javascript that will automatically take text in a html ul list and then output it as a drop down. Here is what I have so far: <a href="http://jsfiddle.net/KRWHP/" rel="nofollow">http://jsfiddle.net/KRWHP/</a></p>
<p>The problem of course is that the code doesnt go through each list item and output it in its own option tag. </p>
| javascript jquery | [3, 5] |
584,833 | 584,834 | How to set the button unmovable? | <p>In android app, I have display the number of buttons in number of rows in GridView using adapter, If i click the button in first row right corner automatically the second row buttons are moved to first row and hide the first row buttons by second row buttons. i need to fix the solution for, the button is not move.</p>
<p>Anyone can give idea to fix the solution for this?</p>
| java android | [1, 4] |
3,342,898 | 3,342,899 | select specify row using Jquery | <p>I have a HTML table like below:</p>
<pre><code>ColA ColB ColC ColD ColE ColF
Checked AAAA BBBB CCCC DDDD EEEE
Unchecked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Unchecked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
</code></pre>
<p>ColA is a Check box. I want to get the ColD value of all rows whose ColA is Checked. I want to use the jquery to do it. Does anyone meet it before?</p>
<p>Best Regards,</p>
| javascript jquery | [3, 5] |
3,673,297 | 3,673,298 | Javascript str.search("?") returns Unexpected Quantifier error | <p>I am able to search a string using <code>str.search("me");</code> and <code>str.search("=");</code></p>
<p>But when i serach for <code>str.search("?");</code></p>
<p>I get the error <code>Unexpected Quantifier.</code></p>
<p>Why is that?
How can i search for <code>"?"</code> using something other than a regular expression?</p>
| javascript jquery | [3, 5] |
2,683,803 | 2,683,804 | increment php variable in javascript function | <p>Can anyone tell me how to increment a php variable inside a javascript function.I have a javascript function which is called for every 3 seconds inside this function i need to increment the php variable.</p>
<pre><code><? php $k =0?>
function slide()
{
//increment $k
var j =<? php echo $k++; ?>//when I do this k is not incremented
}
</code></pre>
<p>Can anyone tell me where I went wrong?Is their any other alternative to do this?</p>
<p>Thanks,</p>
<p>Shruti</p>
| php javascript | [2, 3] |
1,742,816 | 1,742,817 | How to release or clear the value of variable or object? | <p>I have an application in which I have used some variables and I want to release or free the memory space used by them after using them or on application close. Is there any process of doing this?</p>
<p>I have used:</p>
<pre><code>int x = Integer.parseInt(edt.getText().toString()) * Integer.parseInt(edt1.getText().toString());
String z = String.valueOf(x);
</code></pre>
<p>edt - Stands For EditText which I have been used for entering the value. </p>
<p>After entering the value into the EditText, whenever I'll switch to my next activity page and then get back on my previous page the value of EditText is still available on it. But I want to clear the value of the variable.</p>
<p>How can I achieve this?</p>
| java android | [1, 4] |
4,163,612 | 4,163,613 | Eval with complex business child object | <p>I have a class Employee with fields Name and OfficeAddress.OfficeAddress again is an object of type Address.
Address is a class with fields Building,City and Country.
I have list of employee called empList.Now I want to bind this empList to a gridview so that it should display Name,Building,City and Country.
The problem is gridview cannot find properties Building,City and Country in empList when I bind gridview using Eval("Building") or Eval("City") or Eval("Country").Please provide me the syntax to bind these columns.</p>
| c# asp.net | [0, 9] |
150,972 | 150,973 | Javascript Relative Path Not Working? | <p>I know that there's a million posts on this, but I've tested everything and can't seem to get it to work. I'm testing a weather slider and everything looks good, except the images aren't showing up. In one of the .js files, you need to define an imgPath. I've tried doing it in every way possible, and can't seem to get it to go as well as a direct URL. I've tried the following and none seem to work in the file (.js file).</p>
<pre><code> imgPath : 'http://localhost/mysite/wp-content/themes/MyTheme/weatherslider/img/',
imgPath : '/mysite/wp-content/themes/MyTheme/weatherslider/img/',
imgPath : '../mysite/wp-content/themes/MyTheme/weatherslider/img/',
imgPath : 'mysite/wp-content/themes/MyTheme/weatherslider/img/',
imgPath : '/wp-content/themes/MyTheme/weatherslider/img/',
imgPath : '../wp-content/themes/MyTheme/weatherslider/img/',
imgPath : 'wp-content/themes/MyTheme/weatherslider/img/',
</code></pre>
<p>Any ideas on how I can get this to read the images or a way that I can test to see if it's something else in the script? </p>
| javascript jquery | [3, 5] |
389,030 | 389,031 | Ringtone saving but have to set manually | <p>I have a soundboard app and i am wanting to get the sounds to save as ringtone or notification when the button is long clicked which works fine but then the user would have to go and set the ringtone in the sound tab.</p>
<p>I would like if its possible for the ringtone to save and be set as defualt so it overrides the current ringtone that is being used is this possible.</p>
<p>Thanks in advance.</p>
<pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "Benton");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
</code></pre>
| java android | [1, 4] |
1,834,734 | 1,834,735 | Method Swizzling in Android using java | <p>Is it possible to do method swizzling in android using java? i would like to intercept a system method and log its parameters then process it normally </p>
| java android | [1, 4] |
1,576,766 | 1,576,767 | Problem in selecting multiple items in Listbox.SelectionMode | <p>I have a webpart and I want to select mulitple items in a listbox,pretty easy.I am using webcontrols namespace.So I am declaring listbox as
ListBox lBox = new ListBox();
lBox.ID="lbox";
lBox.SelectionMode="Multiple";</p>
<p>But it is not accepting that . The error I m getting is cannot convert string type to listbox selection sth..</p>
<p>If anyone is having any idea where I m getting wrong?</p>
<p>Thanks,</p>
| c# asp.net | [0, 9] |
2,998,566 | 2,998,567 | RenderControl error | <p>HI,
I have a grid with which I'm templating columns with and one column is a user control. Since I'm adding these in the code behind ( using ITemplate), I get an error when I try to render the UserControl. This particular user control does require a scriptmanager since it includes a ajax control (radcombobox).
The error I get is :
Script control 'LookupComboBox' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().</p>
<p>I'm not sure even if my approach is correct using user control and using RenderControl.</p>
| c# asp.net | [0, 9] |
3,969,541 | 3,969,542 | Access Unordered list control id's in codebehind | <p>I have ul elements in usercontrol like below</p>
<pre><code><u><ul>
<li id="liMiddle" class="off">
<a href="#">One
</a>
<ul id="One" runat="server">
</ul>
</li>
<li id="liMiddle" class="off">
<a href="#">Two
</a>
<ul id="Two" runat="server">
</ul>
</li>
<li id="liMiddle" class="off">
<a href="#">Three
</a>
<ul id="Three" runat="server">
</ul>
</code></pre>
<p></p>
<p>foreach (SPWeb supersubsite in subsites)
{
int i = 0;
HtmlGenericControl li = new HtmlGenericControl("li");</p>
<pre><code> CurrentTab.Controls.Add(li);
HtmlGenericControl anchor = new HtmlGenericControl("a");
anchor.Attributes.Add("href", supersubsite.Url);
anchor.InnerText = supersubsite.Title;
li.Controls.Add(anchor);
} </u>
</code></pre>
<p>Here in each loop Current tab should be changed to corresponding next ul id. How to access it?</p>
<p>I have to generate 'li' elements dynamically under above ul's. So I need to access all the 'ul' id's one by one in the codebehind.</p>
<p>Can anybody tell me the solution?</p>
| c# asp.net | [0, 9] |
5,096,026 | 5,096,027 | Convert first letter to uppercase on input box | <p><a href="http://atiweb.org/others/input/" rel="nofollow">http://atiweb.org/others/input/</a></p>
<p>check the link, and in chrome press F12 and click console tab, i logging there the value of input box, it seems to be working, but i have no idea how to repalce the selected characters in the current input field. Basicly I do want the user to see that the first letter he/she pressed is converted to uppercase.</p>
<pre><code>$(document).ready(function() {
//alert('ready');
$('input').on('keypress', function(event) {
var $this = $(this),
val = $this.val();
val = val.toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
});
console.log(val);
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,194,882 | 4,194,883 | How to put loading image when something is processing? | <p>I am having page in that when we click on create button its sends web request to get the all links but mean while it takes some time to get all links working or not so at that time I want to put image load</p>
<pre><code> Button ID="btnRender" runat="server" Text="Page Render" OnClick="btnRender_Click" />
<asp:Button ID="btn_submit" runat="server" Text="Submit" OnClientClick="javascript:finda();" />
<asp:Button ID="btn_createlink" runat="server" Text="Create link" OnClick="btn_createlink_Click" />
</code></pre>
<p>i want to call on btn_createlink_Click" button when user clicks the image or text should appear</p>
| c# asp.net | [0, 9] |
1,976,820 | 1,976,821 | How can I make PHP output from SQL have unique names for each element I can access with jQuery? | <p>I'm trying to make simple cms; the code below is index.php.<p></p>
<p>Now I can't find the way to make jquery select each item, because they have the same name.<br>
For example i want to do is: select (on $(.subject)).hover then (a $(.subjectpic)).show<p>
How to make them have their own names? </p>
<pre><code><?php
if(!$query){
print "submit error";
}
else {
while($list=mysql_fetch_array($query)){
print"
<div class=\"subjectwrap\">
<div class=\"subject\">$list[subject]</div>
<div class=\"subjectpic\">$list[subjectpic]</div>
</div>
";
}
}
?>
</code></pre>
| php jquery | [2, 5] |
1,079,428 | 1,079,429 | Uploading a file with javascript, and php | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5587973/javascript-upload-file">JavaScript: Upload file</a><br>
<a href="http://stackoverflow.com/questions/7475567/uploading-a-file-with-html-javascript-and-php">Uploading a file with html, javascript, and php</a> </p>
</blockquote>
<p>So I am trying to get my upload file code to work better. If someone could show me a simple way to upload a file, that could help me simplify my code, where it only uses javascript and PHP. </p>
<p>EDIT: If I could get a simple block of code in javascript and php then i could figure out the rest. I just cant find any good simple code snippets that shows the form, input, validate input, post to server, etc.</p>
<pre><code>var myPatentOtherBrowseContainer = document.createElement('input');
myPatentOtherBrowseContainer.name = 'myPatentOtherBrowseContainer';
myPatentOtherBrowseContainer.id = 'myPatentOtherBrowseContainer';
myPatentOtherBrowseContainer.type = 'file';
myPatentOtherBrowseContainer.multiple = 'multiple';
myPatentOtherBrowseContainer.size = '60';
</code></pre>
<p>this is just part of the code.</p>
<p>BTW, javascript is part of the code so it should be a tag!</p>
| php javascript | [2, 3] |
72,115 | 72,116 | How do I implement a synchronous wrapper in JavsScript? | <p>I am using Googles Analytics api in Javascript.</p>
<p>They provide a method that gets the result of a list, once the execution is done it calls a callback method with the result.</p>
<p>Looks something like this: </p>
<pre><code>gapi.client.analytics.management.accounts.list().execute(handleAccounts);
</code></pre>
<p>...</p>
<pre><code>function handleAccounts(results) {
if (!results.code) {
if (results && results.items && results.items.length) {
// See this code below.
} else {
console.log('No accounts found for this user.')
}
} else {
console.log('There was an error querying accounts: ' + results.message);
}
}
</code></pre>
<p>Generally this is fantastic, however... I need a flattened list of all child items so I keep calling like this:</p>
<pre><code> $.each(results.items, function (index, value) {
gapi.client.analytics.management.webproperties.list({ 'accountId': value.Id}).execute(handleWebproperties);
// and so on..
})
</code></pre>
<p>The problem being if at any level you have more than one item you end up with multiple asynchronous calls shooting off, and I won't know when they have all finished to get the final list.</p>
<p>Other than writing something to keep track of how many calls have been made then waiting for that total to come back.</p>
<p>How can I easily know when they have all completed?</p>
<p>Thanks.</p>
<p>In summary:</p>
<p>A user can have multiple accounts, accounts can have multiple properties and properties can have multiple profiles.</p>
<p>I need all the profiles for all the accounts of a user.</p>
| javascript jquery | [3, 5] |
2,855,324 | 2,855,325 | Is beginner knowledge of Java enough to develop for Android? | <p>I just finished the book "Tech Yourself Java in 24 Hours, 6th Edition" I have an understanding of the language (by understanding I mean, the basics and everything covered in the book) and I have been experimenting and building little things with my knowledge. I want to learn about Android and was wondering if I need to increase my knowledge in Java before moving on to Android or can I just go straight to Android?</p>
| java android | [1, 4] |
5,791,821 | 5,791,822 | javascript iframe trouble | <p>After adding iframe tag in html of dashcode(web application IDE for iphone), i am getting an error which says "For Security reasons framing is not allowed"</p>
| javascript iphone | [3, 8] |
4,474,097 | 4,474,098 | Capture all events (click, change, onmouseover, e.t.c) for a given element using jquery | <p>Is there anyway that I can check if an existing element has event handlers attached to it? Suppose a simple javascript method adds a click event to some div.example (sans jquery), so there are not attribute tags, is it possible to then, using jquery, to capture the event that was attached? I tried to accomplish this using the code below to no avail:</p>
<pre><code>$( '.example' ).each( function() {
var newObj = $(this);
$.each($(newObj).data("events"), function(i, event) {
alert(i);
$.each(event, function(j, h) {
alert(h.handler);
});
});
</code></pre>
<p>});</p>
| javascript jquery | [3, 5] |
1,932,844 | 1,932,845 | click gets detected when function is called | <p>I have a function that looks like this:</p>
<pre><code>function reset_all_lightbox_assets()
{
$(document).one("click", function () {
$("#lightbox-asset-wrapdiv .category-asset-div-tileview").css({"background-color": "#f9f9f9"});
$("#lightbox-asset-wrapdiv .category-asset-table-td-category,#lightbox-asset-wrapdiv .category-asset-table-td-id").css("color", "#777777");
$("#lightbox-asset-wrapdiv .category-asset-table-td-name").css("color", "#999999");
});
}
</code></pre>
<p>When this function is called I want to be able to click the document once and execute the code.</p>
<p>The problem is that when the function is called, it also immediately detects the click. So how can I call the function so the click becomes enabled but only gets executed when I actually click again?</p>
| javascript jquery | [3, 5] |
5,870,433 | 5,870,434 | jQuery replace text on submit | <p>I have a file upload form on a site and i'd like to replace the form with the text "uploading..." whilst the file uploads. so far i have:</p>
<pre><code>$( document ).ready(function(){
$(form).submit(function(){
$('#key').html("Uploading...");
});
});
</code></pre>
<p>the submit part works because i got it to alert on submit and the .html part works because it will change the html when it's not in the submit function. The form is in a div with the id of "key". </p>
| javascript jquery | [3, 5] |
913,396 | 913,397 | Cropping an Image In The Browser Automatically | <p>How can I crop an image automatically through the upload process? Is there php function to do that? </p>
<p>I want my webpage to display the images with the same dimension from various dimension of the original images by cropping it. </p>
<p>Or any idea?</p>
| php javascript jquery | [2, 3, 5] |
4,149,892 | 4,149,893 | password data not appear in edit mode | <p>i have a problem </p>
<p>in edit mode i bring user data and all data come normally </p>
<p>then i add that data to text fields on the page and that also work well </p>
<p>I'm sure from that as i see it in debug mode </p>
<p>but when the page come to the browser the password field is empty although i put the data on it </p>
<p>can any one tell me where is the problem ??? </p>
<p>that is the code </p>
<p>method get data from data base </p>
<pre><code>public AdminsContianer getContainer(int adminId)
{
using (Naqqab context = new Naqqab())
{
IQueryable<user> admin = getContainer_compiledQuery2.Invoke(context, adminId);
if (admin.Count() > 0)
{
var add = admin.FirstOrDefault();
if (add != null)
{
var rc = new AdminsContianer();
rc.FirstName = add.user_firstname;
rc.adminCreationdate = (DateTime)add.user_creationdate;
rc.LastName = add.user_lastname;
rc.Username = add.user_username;
rc.Password = add.user_password;
rc.adminLuState = add.user_lu_status.ToString();
rc.adminLuType = add.user_lu_type.ToString();
rc.adminLevel = add.admin_level.ToString();
rc.adminId = add.user_id;
return rc;
}
else
{
return null;
}
}
else
{
return null;
}
}
}
</code></pre>
<p>method put data in text fields </p>
<pre><code>public void FillFormFields(AdminsContianer ad)
{
HiddenAdminID.Value = AdminIdToEdit;
registerAdminUsername.Text = ad.Username;
registerAdminLastname.Text = ad.LastName;
registerAdminFirstname.Text = ad.FirstName;
registerAdminPassword.Text = ad.Password;
registerAdminCPassword.Text = ad.Password;
adminLevelDropDownList.SelectedValue = ad.adminLevel.ToString();
//userTypeDropDownList.SelectedValue = ad.adminLuType.ToString();
registerAdminState.SelectedValue = ad.adminLuState.ToString();
}
</code></pre>
<p>thanks in advance </p>
| c# asp.net | [0, 9] |
5,733,020 | 5,733,021 | How to validate a form in ASP.NET using an image button, before raising the onClick event? | <p>This may be a silly question but i'm a beginer here..</p>
<p>I created a form in asp.net and it's all fields are validated using validation controls on clicking an image button.It is working properly.After that i add an event to the button.This is the code of that button.</p>
<pre><code><asp:ImageButton ID="Submit" runat="server" OnClick="submit_Clicked" ValidationGroup="AddSchoolValidationGroup" CausesValidation="true" ImageUrl="~/Styles/images/submit-btn.png" OnClientClick="submitClicked" />
</code></pre>
<p>The purpose of that event is for submitting all the values in the form to database.Here my problem is,After adding the onClick event to button, validation has not taken place.And i want these onClick event to raise only when the form is validated successfully.Can any one guide me ..Thanks in Advance.</p>
| c# asp.net | [0, 9] |
1,725,295 | 1,725,296 | If one page executes a Response.Redirect() to a different web page, can the new page access values in asp.net controls from the original page? | <p>I have a text string value that I'd like to persist from one web page to another without using query strings or the session/view states. I've been trying to get the ASP HiddenField control to pass information from one web form to a <i>different</i> form.<br><br>
All the hiddenfield control examples that I've seen is to preserve round trips from the client to the server for the same form.<br><br>
Is there way for a form to access the ASP controls (and their values) from the previously-rendered form? Or is the initial form simply disposed of in memory by the time the second form executes it's <i>OnLoad</i> method?</p>
| c# asp.net | [0, 9] |
474,197 | 474,198 | Does anyone know where I can find the "Orto" Javascript JVM? | <p>I've read about "Orto", a Java virtual machine that runs on Javascript, but I can't find the actual code, only a few articles about it - like this one: <a href="http://ejohn.org/blog/running-java-in-javascript/" rel="nofollow">http://ejohn.org/blog/running-java-in-javascript/</a></p>
<p>Does anyone know where I can find Orto itself, or something else that can run Java bytecode on Javascript?</p>
<p>Note that the GWT doesn't meet my needs since it is a Java source code to Javascript compiler, not a Java bytecode to Javascript compiler. My source language is Scala, so GWT won't work.</p>
| java javascript | [1, 3] |
2,646,316 | 2,646,317 | I want to refresh dom if new element (clone object) appended in inner html | <p>I want to auto bind events of element(s) if i append element into <code>DOM</code> and the element is clone object. Here is code snippet:</p>
<p>HTML:</p>
<pre><code><input type="button" class="clickme" value="Click Me" />
</code></pre>
<p>Javascript:</p>
<pre><code>$(document).ready(function(){
$(".clickme").click(function(){
alert("Clicked");
var cloneElem = $(this).clone();
//cloneElem.bind("click");
cloneElem.attr("value", "Click Me" + $("input").length.toString());
$(this).parent().append(cloneElem);
});
});
</code></pre>
<p>Result:</p>
<p><img src="http://i.stack.imgur.com/f5kS7.png" alt="enter image description here"></p>
<p>If I click on <code>Click Me1</code> then it should also trigger a event which is similar to <code>Click Me</code> </p>
<p>Note:
I don't want to use <code>Live function</code> of JQuery to trigger event.</p>
| javascript jquery | [3, 5] |
1,398,644 | 1,398,645 | How do I pass a PHP array to a jQuery function? | <p>I have a jQuery function that opens a modal popup and I have in the same file a variable in PHP like <code>$url="iteminfo.php?ID=".$i['itmid'];</code>(<code>$i['itmid']</code> is the id of some products from MySQL). The jQuery function looks like this:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(Surl) {
var source="iteminfo.php?ID=<?echo $i['itmid']?>";
var width = 920;
var align = "center";
var top = 100;
var padding = 10;
var backgroundColor = "#FFFFFF";
var borderColor = "#000000";
var borderWeight = 4;
var borderRadius = 5;
var fadeOutTime = 300;
var disableColor = "#666666";
var disableOpacity = 40;
var loadingImage = "js/popup/loading.gif";
$(".modal").click(function() {
modalPopup( align,
top,
width,
padding,
disableColor,
disableOpacity,
backgroundColor,
borderColor,
borderWeight,
borderRadius,
fadeOutTime,
source,
loadingImage );
});
$(document).keyup(function(e) {
if (e.keyCode == 27) {
closePopup(fadeOutTime);
}
});
});
</script>
</code></pre>
<p>It opens the respective links but the function open all of them like in a loop. How can I pass the <code>$url</code> into the jQuery function to open the respective link for the respective product?</p>
| php javascript jquery | [2, 3, 5] |
680,146 | 680,147 | Access <script> tag from codebehind | <p>I was trying to access < script type='text/javascript' ....>< / script > existing within Head tag.</p>
<p>What I was doing to achieve that,</p>
<pre><code> foreach (Control ctrl in Header.Controls)
{
Response.Write(ctrl.GetType() + "<br/>");
}
</code></pre>
<p>It gives me the reference of "title", "meta" and "literal" control. How can I get the control and get the "src" attribute of that tag.</p>
| c# asp.net | [0, 9] |
838,874 | 838,875 | Are there in jQuery some methods for handling period of time data type? | <p>I'm new in jQuery and all of my search requests bring me to methods for handling Date/Time data types. But I need to handle some period of time, given in number of minutes. I want to convert, for example, <code>1708</code> minutes to <code>"1 day and 4 hours"</code> expression, ignoring minutes. There is <code>TimeSpan</code> data type in C#, for example, and I can do following:</p>
<pre><code>public string ConvertMinutes()
{
//Number of minutes I have and want to convert
int n = 1708;
TimeSpan t = new TimeSpan(0, n, 0);
string dayshelper = t.Days == 1 ? "day" : "days";
string hoursHelper = t.Hours == 1 ? "hour" : "hours";
//The result I want to get
//For example "4 days and 2 hours"
string result = string.Empty;
result += t.Days == 0 ? string.Empty : string.Format("{0} {1}", t.Days, dayshelper);
result += t.Hours == 0 ? "." : string.Format(" and {0} {1}.", t.Hours, hoursHelper);
return result;
}
</code></pre>
<p>Is there something similar in jQuery? Or do I have to get number of days and hours from number of minutes by myself?</p>
| c# javascript jquery | [0, 3, 5] |
5,309,785 | 5,309,786 | jQuery keyup value of input | <p>i need to display value of <code><input></code> into the <code><span></code> and when label become empty, change value of span to "Video title". But always i type something into the <code><input></code> and then delete it, the <code><input></code> still have "" value so <code><span></code> display nothing. Thanks for help. (And sorry for my bad english) </p>
<p>Here is my code:</p>
<pre><code>$("#newVideoName").keyup(function(){
var newVideoName = $("#newVideoName").val();
if(newVideoName == ""){
$("#newVideoNameLabel").html("Video title");
}
});
<input type="text" id="newVideoName">
<span id="newVideoNameLabel"></span>
</code></pre>
| javascript jquery | [3, 5] |
797,675 | 797,676 | c# how to retrieve post data | <p>If I have a textbox <code>txtInfo</code> in a form that I submit via post, if I post back to the page I can read the value entered in the textbox using <code>txtInfo.Text</code>. What if I am posting to a different page? Do I have to parse <code>Request.Form</code> for the control name mutilations (which is what I am doing now) or can I get it from that mess .net passes around as state?</p>
<p>Thanks</p>
<p><hr /></p>
<p>Thank you for the answers so far... Sorry I should have been a little more clear. This control is a <code>runat="server"</code> control. This is what I am relegated to now - not very pretty.</p>
<pre><code> foreach (String key in page.Request.Form.AllKeys)
{
String[] controlName = key.Split('$');//remove that horrrible .net naming - thanks Bill.
keyName = controlName[controlName.Length - 1];//get the last value so we always have the name
keyValue = page.Request.Form[key];
if (keyValue != "")
{
switch (keyName)...
</code></pre>
| c# asp.net | [0, 9] |
32,901 | 32,902 | Good way to output javascript selectively depending on Application settings | <p>I am developing a site which includes several different javascript files and libraries. For optimization purposes I have implemented <a href="http://yuicompressor.codeplex.com" rel="nofollow">YUI Compressor for .Net</a></p>
<p>This will minimize and combine my javascript files into one single file.</p>
<p>Now I have put this up in a MSBuild script that automatically does the compression and minimization and outputs it to a file of my choosing. However, I still wish to keep the original javascript files in my development environment. My question is simply:</p>
<p>Is there a good way to depending on the Debug setting for example choose which javascript to use? This to not have to change the MasterPage by hand each time I release the build.</p>
<p>Allow me to illustrate.</p>
<p>If I am running in Debug="true" I wish my MasterPage to include the following javascripts:</p>
<pre><code><script type="text/javascript" src="first.js"></script>
<script type="text/javascript" src="second.js"></script>
<script type="text/javascript" src="third.js"></script>
<script type="text/javascript" src="fourth.js"></script>
</code></pre>
<p>If I am running in Debug="false" I wish this to be outputted in the MasterPage:</p>
<pre><code><script type="text/javascript" src="compressedAndMinimized.js"></script>
</code></pre>
<p>Is there an elegant solution to this that I am missing here?</p>
| c# asp.net javascript | [0, 9, 3] |
2,006,548 | 2,006,549 | How can I cut the last char from a string in jquery? | <p>suppose that i have </p>
<blockquote>
<p>var name = "kanishka";</p>
</blockquote>
<p>How can I cut only the last char so that the output will be 'a' instead?</p>
<p>i read the question</p>
<blockquote>
<p>How can I cut the 1st char from a
string in jquery?</p>
</blockquote>
<p>by jin Yong ,</p>
<blockquote>
<p>in this problem i know the length of
the string . can u tell me how i can
do this with out knowing the string
length .</p>
</blockquote>
<p>couldn't get help from the answers , please help</p>
| javascript jquery | [3, 5] |
5,338,767 | 5,338,768 | How can I show a dialog box like stackoverflow? | <p>I have the following code on my page:</p>
<pre><code>$('#Report').click(Report);
function Report() {
var e = encodeURIComponent,
arr = [
"dataSource=" + e($('#DataSource').val()),
"statusID=" + e($('#StatusID').val())
];
window.location.href = '/Administration/Tests/Report?' + arr.join("&");
return false;
}
</code></pre>
<p>When a user clicks on the button with Id=Report then the function is called and it shows a page with report information. </p>
<p>However if the dataSource and statusID are not set then my code ends in an exception. </p>
<p>Is there some way I can check for the value of DataSource not being equal to "00" and StatusID not being equal to "0" and then show a dialog box telling the user these fields should be selected. </p>
<p>Ideally I would like to have something like the dialog box that Stackoverflow uses.</p>
| javascript jquery | [3, 5] |
2,254,775 | 2,254,776 | How to differentiate the request from Web View or normal browser | <p>We have developed a HTML5 application. We have to show the application in both the normal browser and in the iphone web view. We have done the implementation for the webview. Now we just want to differentiate whether the request is coming from the normal browser or webview. Any solution in c# .net or javascript</p>
<p>Thanks in advance </p>
| c# iphone asp.net | [0, 8, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.